View | Details | Raw Unified | Return to bug 6874
Collapse All | Expand All

(-)a/cataloguing/value_builder/upload.pl (-2 / +6 lines)
Lines 80-88 sub plugin { Link Here
80
    );
80
    );
81
81
82
    # Dealing with the uploaded file
82
    # Dealing with the uploaded file
83
    if ($uploaded_file) {
83
    my $dir = $input->param('dir');
84
    if ($uploaded_file and $dir) {
84
        my $fh = $input->upload('uploaded_file');
85
        my $fh = $input->upload('uploaded_file');
85
        my $dir = $input->param('dir');
86
86
87
        $id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle);
87
        $id = C4::UploadedFiles::UploadFile($uploaded_file, $dir, $fh->handle);
88
        if($id) {
88
        if($id) {
Lines 128-133 sub plugin { Link Here
128
        } else {
128
        } else {
129
            $template->param( error_upload_path_not_configured => 1 );
129
            $template->param( error_upload_path_not_configured => 1 );
130
        }
130
        }
131
132
        if ($uploaded_file and not $dir) {
133
            $template->param(error_no_dir_selected => 1);
134
        }
131
    }
135
    }
132
136
133
    $template->param(
137
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/upload.tt (-1 / +17 lines)
Lines 6-11 Link Here
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
7
    <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script>
8
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
8
    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
9
    <script type="text/javascript">
10
      function _(s) { return s; }
11
      $(document).ready(function() {
12
        $('form').each(function() {
13
          $(this).submit(function() {
14
            var value = $(this).find('input[type="radio"][name="dir"]:checked').val();
15
            if (!value) {
16
              alert(_("Please select the destination of file"));
17
              return false;
18
            }
19
          });
20
        })
21
      });
22
    </script>
9
23
10
</head>
24
</head>
11
<body>
25
<body>
Lines 59-64 Link Here
59
          <p>Configuration variable 'upload_path' is not configured.</p>
73
          <p>Configuration variable 'upload_path' is not configured.</p>
60
          <p>Please configure it in your koha-conf.xml</p>
74
          <p>Please configure it in your koha-conf.xml</p>
61
        [% ELSE %]
75
        [% ELSE %]
76
          [% IF (error_no_dir_selected) %]
77
              <p class="error">Error: You have to select the destination of uploaded file.<p>
78
          [% END %]
62
          <h2>Please select the file to upload : </h2>
79
          <h2>Please select the file to upload : </h2>
63
          <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl">
80
          <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl">
64
              [% filefield %]
81
              [% filefield %]
65
- 

Return to bug 6874