From fe02ca92bccd68d0e21e6fd74f69f46e9aa2e0db Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 3 Aug 2023 10:12:17 +0000 Subject: [PATCH] Bug 34468: Update how we call updateProgress in stage-marc-import.tt Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize --- .../en/modules/tools/stage-marc-import.tt | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt index be7669afff7..8c21fd8e0aa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stage-marc-import.tt @@ -417,16 +417,18 @@ }) }); [% IF job_enqueued %] - updateProgress([% job_id | html %], function(){ - $.getJSON('/api/v1/jobs/[% job_id | html %]', function(job){ - let import_batch_id = job.data.report.import_batch_id; - $('

%s

'.format(import_batch_id, _("View batch"))).appendTo("#job_callback"); - let basket_id = job.data.report.basket_id; - let vendor_id = job.data.report.vendor_id; - if ( basket_id && vendor_id ) { - $('

%s

'.format(import_batch_id, basket_id, vendor_id, _("Add staged files to basket"))).appendTo("#job_callback"); - } - }); + updateProgress([% job_id | html %], { + finish_callback : function(){ + $.getJSON('/api/v1/jobs/[% job_id | html %]', function(job){ + let import_batch_id = job.data.report.import_batch_id; + $('

%s

'.format(import_batch_id, _("View batch"))).appendTo("#job_callback"); + let basket_id = job.data.report.basket_id; + let vendor_id = job.data.report.vendor_id; + if ( basket_id && vendor_id ) { + $('

%s

'.format(import_batch_id, basket_id, vendor_id, _("Add staged files to basket"))).appendTo("#job_callback"); + } + }); + } }); [% END %] }); -- 2.41.0