|
Lines 7-24
Link Here
|
| 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"> |
9 |
<script type="text/javascript"> |
| 10 |
function _(s) { return s; } |
10 |
function ValidateForm() { |
| 11 |
$(document).ready(function() { |
11 |
var filename = document.forms["UploadForm"]["uploaded_file"].value; |
|
|
12 |
var selected = 0; |
| 13 |
var value; |
| 12 |
$('form').each(function() { |
14 |
$('form').each(function() { |
| 13 |
$(this).submit(function() { |
15 |
value = $(this).find('input[type="radio"][name="dir"]:checked').val(); |
| 14 |
var value = $(this).find('input[type="radio"][name="dir"]:checked').val(); |
16 |
if (value) { |
| 15 |
if (!value) { |
17 |
selected = 1; |
| 16 |
alert(_("Please select the destination of file")); |
18 |
} |
| 17 |
return false; |
19 |
}); |
| 18 |
} |
20 |
if (!filename && !selected) { |
| 19 |
}); |
21 |
alert("Please select a file and its destination."); |
| 20 |
}) |
22 |
return false; |
| 21 |
}); |
23 |
} |
|
|
24 |
else if (!filename) { |
| 25 |
alert("Please select a file to upload."); |
| 26 |
return false; |
| 27 |
} |
| 28 |
else if (!selected) { |
| 29 |
alert("Please select a file destination."); |
| 30 |
return false; |
| 31 |
} |
| 32 |
else { |
| 33 |
return true; |
| 34 |
} |
| 35 |
} |
| 22 |
</script> |
36 |
</script> |
| 23 |
|
37 |
|
| 24 |
</head> |
38 |
</head> |
|
Lines 73-89
Link Here
|
| 73 |
<p>Configuration variable 'upload_path' is not configured.</p> |
87 |
<p>Configuration variable 'upload_path' is not configured.</p> |
| 74 |
<p>Please configure it in your koha-conf.xml</p> |
88 |
<p>Please configure it in your koha-conf.xml</p> |
| 75 |
[% ELSE %] |
89 |
[% ELSE %] |
|
|
90 |
[% IF (error_nothing_selected) %] |
| 91 |
<p class="error">Error: You have to choose the file to upload and select where to upload the file.<p> |
| 92 |
[% END %] |
| 93 |
[% IF (error_no_file_selected) %] |
| 94 |
<p class="error">Error: You have to choose the file to upload.<p> |
| 95 |
[% END %] |
| 76 |
[% IF (error_no_dir_selected) %] |
96 |
[% IF (error_no_dir_selected) %] |
| 77 |
<p class="error">Error: You have to select the destination of uploaded file.<p> |
97 |
<p class="error">Error: You have to select where to upload the file.<p> |
| 78 |
[% END %] |
98 |
[% END %] |
| 79 |
<h2>Please select the file to upload : </h2> |
99 |
<h2>Please select the file to upload : </h2> |
| 80 |
<form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl"> |
100 |
<form name="UploadForm" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl" onsubmit="return ValidateForm()"> |
| 81 |
[% filefield %] |
101 |
[% filefield %] |
| 82 |
<h3>Choose where to upload file</h3> |
102 |
<h3>Choose where to upload the file</h3> |
| 83 |
[% INCLUDE list_dirs dirs = dirs_tree %] |
103 |
[% INCLUDE list_dirs dirs = dirs_tree %] |
|
|
104 |
<input type="hidden" name="from_popup" value="1" /> |
| 84 |
<input type="hidden" name="plugin_name" value="upload.pl" /> |
105 |
<input type="hidden" name="plugin_name" value="upload.pl" /> |
| 85 |
<input type="hidden" name="index" value="[% index %]" /> |
106 |
<input type="hidden" name="index" value="[% index %]" /> |
| 86 |
<input type="submit"> |
107 |
<input type="submit" value="Upload file"> |
| 87 |
</form> |
108 |
</form> |
| 88 |
[% END %] |
109 |
[% END %] |
| 89 |
[% END %] |
110 |
[% END %] |