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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt (-3 / +13 lines)
Lines 79-84 Link Here
79
              <p>The job has been enqueued! It will be processed as soon as possible.</p>
79
              <p>The job has been enqueued! It will be processed as soon as possible.</p>
80
               [% INCLUDE "job_progress.inc" job_id=job_id %]
80
               [% INCLUDE "job_progress.inc" job_id=job_id %]
81
              <p><a class="job_details" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
81
              <p><a class="job_details" href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a>
82
              <div id="job_callback"></div>
82
            </div>
83
            </div>
83
        [% ELSE %]
84
        [% ELSE %]
84
<h1>Stage MARC records for import</h1>
85
<h1>Stage MARC records for import</h1>
Lines 105-112 Link Here
105
106
106
    <div id="fileuploadpanel">
107
    <div id="fileuploadpanel">
107
        <div id="fileuploadstatus" class="progress_panel">Upload progress:
108
        <div id="fileuploadstatus" class="progress_panel">Upload progress:
108
            <progress id="fileuploadprogress" max="100" value="0">
109
            <progress id="fileuploadprogress" max="100" value="0"></progress>
109
            </progress>
110
            <span class="fileuploadpercent">0</span>%
110
            <span class="fileuploadpercent">0</span>%
111
        </div>
111
        </div>
112
        <div id="fileuploadfailed"></div>
112
        <div id="fileuploadfailed"></div>
Lines 428-434 Link Here
428
                })
428
                })
429
            });
429
            });
430
            [% IF job_enqueued %]
430
            [% IF job_enqueued %]
431
                updateProgress([% job_id | html %]);
431
                updateProgress([% job_id | html %], function(){
432
                    $.getJSON('/api/v1/jobs/[% job_id | html %]', function(job){
433
                        let import_batch_id = job.data.report.import_batch_id;
434
                        $('<p><a href="/cgi-bin/koha/tools/manage-marc-import.pl?import_batch_id=%s">%s</a></p>'.format(import_batch_id, _("View batch"))).appendTo("#job_callback");
435
                        let basket_id = job.data.report.basket_id;
436
                        let vendor_id = job.data.report.vendor_id;
437
                        if ( basket_id && vendor_id ) {
438
                            $('<p><a id="addtobasket" class="btn btn-default" href="/cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=%s&basketno=%s&booksellerid=%s">%s</a></p>'.format(import_batch_id, basket_id, vendor_id, _("Add staged files to basket"))).appendTo("#job_callback");
439
                        }
440
                    });
441
                });
432
            [% END %]
442
            [% END %]
433
        });
443
        });
434
444
(-)a/koha-tmpl/intranet-tmpl/prog/js/job_progess.js (-3 / +5 lines)
Lines 1-4 Link Here
1
function updateProgress(job_id) {
1
function updateProgress(job_id, callback) {
2
    $.getJSON('/api/v1/jobs/' + job_id, function(job){
2
    $.getJSON('/api/v1/jobs/' + job_id, function(job){
3
        let recheck = true;
3
        let recheck = true;
4
4
Lines 28-34 function updateProgress(job_id) { Link Here
28
        }
28
        }
29
29
30
        if ( recheck ) {
30
        if ( recheck ) {
31
            setTimeout(function(){updateProgress(job_id)}, 1 * 1000);
31
            setTimeout(function(){updateProgress(job_id, callback)}, 1 * 1000);
32
        }
33
        else {
34
            callback();
32
        }
35
        }
33
    });
36
    });
34
}
37
}
35
- 

Return to bug 31891