From fb80c5bd5f1fbfba89da1f75d431c9b21024da2b 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 Signed-off-by: Tomas Cohen Arazi --- .../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 be7669afff..8c21fd8e0a 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.39.5