From db7de6b9e8de048a656559ae63ba69b56e64d609 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 9 Feb 2023 23:57:12 +0100 Subject: [PATCH] Bug 31056: Restore closeandprint function on basketgroups page Bug 13614 removed the basketgroup.js asset from the basket group page. This file includes the closeandprint function used for closing and printing the PDF from the open basket groups tab. The patch restores just this function directly in the file where it's needed as this is the only spot and it's only a few lines. The rest of basketgroup.js appears unused. To test: * Create a basket with one or more oder lines * Close the basket and check the checkbox to add it to a basket group * Reopen the basket group from the basket groups page * Verify the close and print only leads to a JS error and nothing happens * Apply patch * Repeat and verify you can now 'Close and print' from the open basket group tab * Verify all other buttons work as expected as well Signed-off-by: Caroline Cyr La Rose JD Amended patch: fix indentation and spacing Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a2314dc0ce6d0202451162cf11708ac73d4ba95e) Signed-off-by: Matt Blenkinsop --- .../intranet-tmpl/prog/en/modules/acqui/basketgroup.tt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt index 3bb45083d8..afca3199fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt @@ -24,6 +24,14 @@ } } + function closeandprint(bg){ + if(document.location = '/cgi-bin/koha/acqui/basketgroup.pl?op=closeandprint&basketgroupid=' + bg ){ + setTimeout("window.location.reload();", 3000); + } else { + alert(MSG_FILE_DOWNLOAD_ERROR); + } + } + $(document).ready(function() { [% IF ( listclosed) %] $("#basket_groups a[href='#closed']").tab("show"); -- 2.39.5