From 43a095341f113e48d3af170ca5f06208ca4d18d5 Mon Sep 17 00:00:00 2001 From: Slava Shishkin Date: Wed, 21 Dec 2022 14:46:45 +0200 Subject: [PATCH] Bug 32504: Fix misalignment of visibility of basket orders table columns and missing export columns To reproduce: 1. Go to /cgi-bin/koha/admin/columns_settings.pl 2. In the section Acquisition > Basket > Orders uncheck all checkboxes in the table settings 3. Go to a separate browser window to /cgi-bin/koha/acqui/booksellers.pl and open/create a new basket and add one book to it so the basket table will have rows in the "Order" table which we will configure below: 4. Click on the ["Columns" settings] for the table. 5. In the dropdown menu, observe that all Columns are marked as visible and correspond to the current table display. 6. Also check the export table feature: Click on "Export" and choose print, you will see that Columns up to GST (goods_and_services_tax) are displayed, and Fund and Estimated delivery date are missing. 7. Go back to table settings (like it was in steps.1-2) 8. Make the estimated_delivery_date column 'invisible by default' by checking out the appropriate checkbox and saving the changes. 9. Refresh the basket window/page (like in step 3). 10. Observe that in the table the whole columns "Estimated delivery date" is visible but "Fund" is gone. 11. Click on the ["Columns" settings] for the table. 12. In the dropdown menu observe that the wrong column is disabled ("Fund" instead of "Estimated delivery date"). 13. Apply the patch. 14. Go through steps 3-12 and make sure that everything mentioned in those steps now works correctly: when you hide any columns in columns_settings.pl they are correctly hidden for the "Order" table, as well when exporting the table, the Fund, and Estimated delivery date columns are now exported. Note: this patch also respects Koha.Preference('EDIFACT') setting and when it's enabled it also correctly hides/shows and exports the 'supplier_report' column. Signed-off-by: Laura Escamilla Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 024cdf269ae8527d02c15e442af69a3ccda6e551) Signed-off-by: Jacob O'Mara --- koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt index edab292e55..99f92d2f5f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt @@ -1080,12 +1080,12 @@ $(document).ready(function() { var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'basket', 'orders', 'json' ) | $raw %]; [% IF !(Koha.Preference('EDIFACT') && ediaccount) %] - table_settings['columns'].splice(13, 1); + table_settings['columns'].splice(16, 1); [% END %] KohaTable("orders", { "sPaginationType": "full", "autoWidth": false, - "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13], + "exportColumns": [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15[% IF (Koha.Preference('EDIFACT') && ediaccount) %],16[% END %]], }, table_settings); var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, { -- 2.39.5