Lines 248-265
Link Here
|
248 |
[% MACRO jsinclude BLOCK %] |
248 |
[% MACRO jsinclude BLOCK %] |
249 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script> |
249 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script> |
250 |
[% INCLUDE 'datatables.inc' %] |
250 |
[% INCLUDE 'datatables.inc' %] |
251 |
<script type="text/javascript"> |
|
|
252 |
var errMESSAGES = [ |
253 |
"Error 0: Not in use", |
254 |
_("This file already exists (in this category)."), |
255 |
_("File could not be created. Check permissions."), |
256 |
_("Your koha-conf.xml does not contain a valid upload_path."), |
257 |
_("No temporary directory found."), |
258 |
_("File could not be read."), |
259 |
_("File has been deleted."), |
260 |
_("File or upload record could not be deleted."), |
261 |
]; |
262 |
</script> |
263 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/file-upload_[% KOHA_VERSION %].js"></script> |
251 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/file-upload_[% KOHA_VERSION %].js"></script> |
264 |
<script type="text/javascript"> |
252 |
<script type="text/javascript"> |
265 |
function StartUpload() { |
253 |
function StartUpload() { |
Lines 317-329
Link Here
|
317 |
var str = ''; |
305 |
var str = ''; |
318 |
for( var file in err ) { |
306 |
for( var file in err ) { |
319 |
str= str + '<p>' + file + ': ' + |
307 |
str= str + '<p>' + file + ': ' + |
320 |
errMESSAGES[ err[file].code ] + '</p>'; |
308 |
errMESSAGES( err[file].code ) + '</p>'; |
321 |
} |
309 |
} |
322 |
if( str ) { |
310 |
if( str ) { |
323 |
$('#myalerts').html(str); |
311 |
$('#myalerts').html(str); |
324 |
$('#myalerts').show(); |
312 |
$('#myalerts').show(); |
325 |
} |
313 |
} |
326 |
} |
314 |
} |
|
|
315 |
function errMESSAGES(code) { |
316 |
var rv; |
317 |
switch(code) { |
318 |
case 'UPLERR_ALREADY_EXISTS': |
319 |
rv = _("This file already exists (in this category)."); |
320 |
break; |
321 |
case 'UPLERR_CANNOT_WRITE': |
322 |
rv = _("File could not be created. Check permissions."); |
323 |
break; |
324 |
case 'UPLERR_NO_ROOT_DIR': |
325 |
rv = _("Your koha-conf.xml does not contain a valid upload_path."); |
326 |
break; |
327 |
case 'UPLERR_NO_TEMP_DIR': |
328 |
rv = _("No temporary directory found."); |
329 |
break; |
330 |
case 'UPLERR_FILE_NOT_READ': |
331 |
rv = _("File could not be read."); |
332 |
break; |
333 |
case 'UPL_FILE_DELETED': // An alert, no error |
334 |
rv = _("File has been deleted."); |
335 |
break; |
336 |
case 'UPLERR_FILE_NOT_DELETED': |
337 |
rv = _("File or upload record could not be deleted."); |
338 |
break; |
339 |
default: |
340 |
rv = code; |
341 |
} |
342 |
return rv; |
343 |
} |
327 |
function CheckSearch() { |
344 |
function CheckSearch() { |
328 |
if( $("#term").val()=="" ) { |
345 |
if( $("#term").val()=="" ) { |
329 |
alert( _("Please enter a search term.") ); |
346 |
alert( _("Please enter a search term.") ); |