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">
5 <title>Upload plugin</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
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" />
9 <script type="text/javascript">
10 function ValidateForm() {
11 var filename = document.forms["UploadForm"]["uploaded_file"].value;
14 $('form').each(function() {
15 value = $(this).find('input[type="radio"][name="dir"]:checked').val();
20 if (!filename && !selected) {
21 alert("Please select a file and its destination.");
25 alert("Please select a file to upload.");
29 alert("Please select a file destination.");
42 <script type="text/javascript">
44 var doc = opener.document;
45 var field = doc.getElementById("[% index %]");
46 field.value = "[% return %]";
48 $(document).ready(function() {
54 The file [% uploaded_file | html %] has been successfully uploaded.
55 <p><input type="button" value="close" onclick="window.close();" /></p>
59 [% IF ( MissingURL ) %]
60 <p>Error: The OPAC system preference OPACBaseURL is not configured.</p>
61 <p><input type="button" value="close" onclick="window.close();" /></p>
63 <p>Error: Failed to upload file. See logs for details.</p>
64 <p><input type="button" value="close" onclick="window.close();" /></p>
66 [%# This block display recursively a directory tree in variable 'dirs' %]
70 [% FOREACH dir IN dirs %]
71 <li style="list-style-type:none">
72 <input type="radio" name="dir" id="[% dir.value %]" value="[% dir.value %]">
73 <label for="[% dir.value %]">
74 [% IF (dir.name == '/') %]
81 [% INCLUDE list_dirs dirs=dir.dirs %]
88 [% IF (error_upload_path_not_configured) %]
89 <h2>Configuration error</h2>
90 <p>Configuration variable 'upload_path' is not configured.</p>
91 <p>Please configure it in your koha-conf.xml</p>
93 [% IF (error_nothing_selected) %]
94 <p class="error">Error: You have to choose the file to upload and select where to upload the file.</p>
96 [% IF (error_no_file_selected) %]
97 <p class="error">Error: You have to choose the file to upload.</p>
99 [% IF (error_no_dir_selected) %]
100 <p class="error">Error: You have to select where to upload the file.</p>
103 <p class="error">Error: The URL has no file to retrieve.</p>
105 <h2>Please select the file to upload : </h2>
106 <form name="UploadForm" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl" onsubmit="return ValidateForm()">
108 <h3>Choose where to upload the file</h3>
109 [% INCLUDE list_dirs dirs = dirs_tree %]
110 <input type="hidden" name="from_popup" value="1" />
111 <input type="hidden" name="plugin_name" value="upload.pl" />
112 <input type="hidden" name="index" value="[% index %]" />
113 <input type="submit" value="Upload file">
114 <input type="button" value="Cancel" onclick="window.close();" />