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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/offline_circ/process_koc.tt (-2 / +4 lines)
Lines 34-40 function StartUpload() { Link Here
34
    xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload );
34
    xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload );
35
}
35
}
36
36
37
function cbUpload( status, fileid ) {
37
function cbUpload( status, fileid, errors ) {
38
    if( status=='done' ) {
38
    if( status=='done' ) {
39
        $("form#processfile #uploadedfileid").val( fileid );
39
        $("form#processfile #uploadedfileid").val( fileid );
40
        $("form#enqueuefile #uploadedfileid").val( fileid );
40
        $("form#enqueuefile #uploadedfileid").val( fileid );
Lines 42-51 function cbUpload( status, fileid ) { Link Here
42
        $("#processfile").show();
42
        $("#processfile").show();
43
        $("#enqueuefile").show();
43
        $("#enqueuefile").show();
44
    } else {
44
    } else {
45
        var errMsgs = [ _("Error code 0 not used"), _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ];
46
        var errCode = errors[$('#fileToUpload').prop('files')[0].name].code;
45
        $("#fileuploadstatus").hide();
47
        $("#fileuploadstatus").hide();
46
        $("#fileuploadfailed").show();
48
        $("#fileuploadfailed").show();
47
        $("#fileuploadfailed").text( _("Upload status: ") +
49
        $("#fileuploadfailed").text( _("Upload status: ") +
48
            ( status=='failed'? _("Failed"):
50
            ( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]:
49
            ( status=='denied'? _("Denied"): status ))
51
            ( status=='denied'? _("Denied"): status ))
50
        );
52
        );
51
    }
53
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt (-1 / +1 lines)
Lines 72-78 function cbUpload( status, fileid, errors ) { Link Here
72
        }
72
        }
73
        $("#processfile").show();
73
        $("#processfile").show();
74
    } else {
74
    } else {
75
        var errMsgs = [ _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ];
75
        var errMsgs = [ _("Error code 0 not used"), _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ];
76
        var errCode = errors[$('#fileToUpload').prop('files')[0].name].code;
76
        var errCode = errors[$('#fileToUpload').prop('files')[0].name].code;
77
        $('#fileuploadbutton').show();
77
        $('#fileuploadbutton').show();
78
        $("#fileuploadcancel").hide();
78
        $("#fileuploadcancel").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt (-2 / +4 lines)
Lines 18-33 function StartUpload() { Link Here
18
    $("#uploadedfileid").val('');
18
    $("#uploadedfileid").val('');
19
    xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload );
19
    xhr= AjaxUpload( $('#fileToUpload'), $('#fileuploadprogress'), 'temp=1', cbUpload );
20
}
20
}
21
function cbUpload( status, fileid ) {
21
function cbUpload( status, fileid, errors ) {
22
    if( status=='done' ) {
22
    if( status=='done' ) {
23
        $("#uploadedfileid").val( fileid );
23
        $("#uploadedfileid").val( fileid );
24
        $('#fileToUpload').prop('disabled',true);
24
        $('#fileToUpload').prop('disabled',true);
25
        $("#processfile").show();
25
        $("#processfile").show();
26
    } else {
26
    } else {
27
        var errMsgs = [ _("Error code 0 not used"), _("File already exists"), _("Directory is not writeable"), _("Root directory for uploads not defined"), _("Temporary directory for uploads not defined") ];
28
        var errCode = errors[$('#fileToUpload').prop('files')[0].name].code;
27
        $("#fileuploadstatus").hide();
29
        $("#fileuploadstatus").hide();
28
        $("#fileuploadfailed").show();
30
        $("#fileuploadfailed").show();
29
        $("#fileuploadfailed").text( _("Upload status: ") +
31
        $("#fileuploadfailed").text( _("Upload status: ") +
30
            ( status=='failed'? _("Failed"):
32
            ( status=='failed'? _("Failed") + " - (" + errCode + ") " + errMsgs[errCode]:
31
            ( status=='denied'? _("Denied"): status ))
33
            ( status=='denied'? _("Denied"): status ))
32
        );
34
        );
33
        $("#processfile").hide();
35
        $("#processfile").hide();
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt (-3 / +2 lines)
Lines 196-202 Link Here
196
<script type="text/javascript">
196
<script type="text/javascript">
197
//<![CDATA[
197
//<![CDATA[
198
    var errMESSAGES = [
198
    var errMESSAGES = [
199
        "Error 0: Not in use",
199
        "Error 0: Not in use", //We only return 1 - 4
200
        _("This file already exists (in this category)."),
200
        _("This file already exists (in this category)."),
201
        _("File could not be created. Check permissions."),
201
        _("File could not be created. Check permissions."),
202
        _("Your koha-conf.xml does not contain a valid upload_path."),
202
        _("Your koha-conf.xml does not contain a valid upload_path."),
Lines 265-271 function ShowAlerts(err) { Link Here
265
    var str = '';
265
    var str = '';
266
    for( var file in err ) {
266
    for( var file in err ) {
267
        str= str + '<p>' + file + ': ' +
267
        str= str + '<p>' + file + ': ' +
268
            errMESSAGES[ err[file] ] + '</p>';
268
            errMESSAGES[ err[file].code ] + '</p>';
269
    }
269
    }
270
    if( str ) {
270
    if( str ) {
271
        $('#myalerts').html(str);
271
        $('#myalerts').html(str);
272
- 

Return to bug 19420