Bug 6874: Attach files to bibliographic records
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / cataloguing / value_builder / upload.tt
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5     <title>Upload plugin</title>
6     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7     <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
8     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
9
10 </head>
11 <body>
12 [% IF ( success ) %]
13
14     <script type="text/javascript">
15         function report() {
16             var doc   = opener.document;
17             var field = doc.getElementById("[% index %]");
18             field.value =  "[% return %]";
19         }
20         $(document).ready(function() {
21             report();
22         });
23     </script>
24
25
26     The file [% uploaded_file | html %] has been successfully uploaded.
27     <p><input type="button" value="close" onclick="window.close();" /></p>
28
29 [% ELSE %]
30
31     [% IF ( error ) %]
32         <p>Error: Failed to upload file. See logs for details.</p>
33         <input type="button" value="close" onclick="window.close();" />
34     [% ELSE %]
35         [%# This block display recursively a directory tree in variable 'dirs' %]
36         [% BLOCK list_dirs %]
37             [% IF dirs.size %]
38                 <ul>
39                     [% FOREACH dir IN dirs %]
40                         <li style="list-style-type:none">
41                             <input type="radio" name="dir" id="[% dir.value %]" value="[% dir.value %]">
42                                 <label for="[% dir.value %]">
43                                     [% IF (dir.name == '/') %]
44                                         <em>(root)</em>
45                                     [% ELSE %]
46                                         [% dir.name %]
47                                     [% END %]
48                                 </label>
49                             </input>
50                             [% INCLUDE list_dirs dirs=dir.dirs %]
51                         </li>
52                     [% END %]
53                 </ul>
54             [% END %]
55         [% END %]
56
57         <h2>Please select the file to upload : </h2>
58         <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl">
59             [% filefield %]
60             <h3>Choose where to upload file</h3>
61             [% INCLUDE list_dirs dirs = dirs_tree %]
62             <input type="hidden" name="plugin_name" value="upload.pl" />
63             <input type="hidden" name="index" value="[% index %]" />
64             <input type="submit">
65         </form>
66     [% END %]
67
68 [% END %]
69
70 </body>
71 </html>