From f4f9edb59a03be69f3d943f3c793c5edc16194bb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 18 Jun 2024 15:52:10 +0000 Subject: [PATCH] Bug 36475: Enable table configurations on patrons print summary This patch fixes table configuration to the tables shown on the patron's print summary page, adding default display length and default sort as well. I removed the JS for moving around the DataTable controls to make them display better and instead swapped the s for

. It's not perfect but it's better than it was. Previously table configuration wasn't working because the window.print() function was firing before the DataTables code had time to run. I've added a use of onbeforeprint event to make sure we run the DataTables initiation before automatic printing. To test, apply the patch and restart services. - In the staff client, go to Administration -> Table settings -> Circulation -> print_summary. - Configure the print-summary-checkouts, print-summary-fines, and print-summary-holds tables with some custom options (e.g. hide columns, change default sort). - In the staff client, find a patron with checkouts, holds, and fines. - In the toolbar, click Print -> Print summary. A new tab should appear with the print summary view. A print dialog should appear immediately. - In the print preview you should see that the tables you configured are displayed correctly (sort is correct, columns correctly hidden, etc). - If you print the page or cancel the tab should close. - If you want to test the table configurations without having the tab automatically close you can go to Administration -> System preferences -> IntranetSlipPrinterJS and enter any dummy code, e.g. "console.log('Testing');" With that preference populated, the automatic closing isn't included. - Test other pages which use the slip-print include, e.g. other patron print options and quick spine labels in Cataloging. Sponsored-By: Athens County Public Libraries Signed-off-by: Thibaud Guillot Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- admin/columns_settings.yml | 3 + .../prog/en/includes/slip-print.inc | 2 + .../en/modules/members/moremember-print.tt | 80 +++++++++---------- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml index c71c744929..4dfb152a6c 100644 --- a/admin/columns_settings.yml +++ b/admin/columns_settings.yml @@ -1936,6 +1936,7 @@ modules: print_summary: print-summary-checkouts: + default_sort_order: 0 columns: - columnname: title @@ -1959,6 +1960,7 @@ modules: columnname: status print-summary-holds: + default_sort_order: 0 columns: - columnname: title @@ -1974,6 +1976,7 @@ modules: columnname: priority print-summary-fines: + default_sort_order: 0 columns: - columnname: date diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc index fba67cffcf..4321d95177 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/slip-print.inc @@ -2,8 +2,10 @@ [% END %] -- 2.39.5