From f13108a32faac675f01621652cb20fac87cc8765 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Thu, 8 May 2025 17:10:14 +0100 Subject: [PATCH] Bug 33430: Enable datatables for suggestion tabs Test plan: 1) Either add loads of suggestions to your KTD or use the script in the data script patch uploaded to the bug 2) Navigate to Acquisitions > Suggestions 3) Depending on how many suggestions you have loaded (the script does 2000), the page will load very slowly 4) Apply patches 5) yarn build && restart_all 6) Hard refresh the page, the page should load much faster and the first tab should load a paginated datatable 7) Click into another tab, the tab should also load a paginated datatable 8) Click back into the first tab, the original table should persist and should not reload 9) Use the edit tools at the bottom of the page, they should work as expected 10) Click on the links in various table cells, they should redirect as expected 11) Use the actions buttons in the far right column, then should work as expected Signed-off-by: Emily Lamancusa --- .../prog/en/modules/suggestion/suggestion.tt | 375 +++++++++++------- 1 file changed, 223 insertions(+), 152 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 3484852206..7d96a366d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -3,6 +3,7 @@ [% USE Branches %] [% USE AuthorisedValues %] [% USE KohaDates %] +[% USE To %] [% USE Price %] [% USE TablesSettings %] [% PROCESS 'i18n.inc' %] @@ -759,7 +760,7 @@ No name [% END %] [% END %] - ([% suggestion.suggestions.size| html %]) + ([% suggestion.tab_count | html %]) [% END %] [% END # /FOREACH suggestion %] [% END # /WRAPPER tabs_nav %] @@ -776,7 +777,7 @@ [% INCLUDE 'csrf-token.inc' %] [%# filled by submit %] - [% IF suggestion.suggestions.size %] + [% IF suggestion.tab_count %]

Check all | Uncheck all

@@ -800,132 +801,6 @@ - - [% FOREACH s IN suggestion.suggestions %] - - - - - - - - - - - - - - - - - - - [% END # /FOREACH s %] -
 
- - - - [% s.title | html %][% IF ( s.author ) %], by [% s.author | html %][% END %] - -
- [% IF ( s.copyrightdate ) %] - © [% s.copyrightdate | html %] - [% END %] - [% IF ( s.volumedesc ) %] - ; Volume:[% s.volumedesc | html %] - [% END %] - [% IF ( s.isbn ) %] - ; ISBN: [% s.isbn | html %] - [% END %] - [% IF ( s.publishercode ) %] - ; Published by [% s.publishercode | html %] - [% END %] - [% IF ( s.publicationyear ) %] - in [% s.publicationyear | html %] - [% END %] - [% IF ( s.place ) %] - in [% s.place | html %] - [% END %] - [% IF ( s.collectiontitle ) %] - ; [% s.collectiontitle | html %] - [% END %] - [% IF ( s.itemtype ) %] - ; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', s.itemtype, 0 ) | html %] - [% END %] -
- [% IF ( s.note ) %] -
[% s.note | html %]
- [% END %] - [% IF s.archived %] -
Archived - [% END %] -
- [% SET suggester = s.suggester %] - [% suggester.surname | html %][% IF suggester.firstname %], [% suggester.firstname | html %][% END %] - [% IF suggester.cardnumber %]([% suggester.cardnumber | html %])[% END %] - [% suggester.category.description | html %] [% IF ( s.suggesteddate ) %][% s.suggesteddate | $KohaDates %][% END %] [% AuthorisedValues.GetByCode( 'OPAC_SUG', s.patronreason ) | html %] - [% SET manager = s.manager %] - [% manager.surname | html %][% IF manager.firstname %], [% manager.firstname | html %][% END %] - [% IF ( s.manageddate ) %][% s.manageddate | $KohaDates %][% END %] - [% SET last_modifier = s.last_modifier %] - [% last_modifier.surname | html %][% IF last_modifier.firstname %], [% last_modifier.firstname | html %][% END %] - [% IF ( s.lastmodificationdate ) %][% s.lastmodificationdate | $KohaDates %][% END %] [% s.lastmodificationdate | $KohaDates %] [% Branches.GetName( s.branchcode ) | html %] [% s.fund.budget_name | html %] [% s.staff_note | html %] - [% IF s.STATUS == 'ASKED' %] - Pending - [% ELSIF s.STATUS == 'ACCEPTED' %] - Accepted - [% ELSIF s.STATUS == 'ORDERED' %] - Ordered - [% ELSIF s.STATUS == 'REJECTED' %] - Rejected - [% ELSIF s.STATUS == 'CHECKED' %] - Checked - [% ELSIF s.STATUS == 'AVAILABLE' %] - Available - [% ELSIF AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_STATUS', s.STATUS ) | html %] - [% ELSE %] - Status unknown - [% END %] - - [% IF ( s.reason ) %] -
([% s.reason | html %]) - [% END %] -
- [% IF CAN_user_suggestions_suggestions_manage %] -
- Edit - -
- [% ELSIF CAN_user_suggestions_suggestions_delete %] - - [% END %] -
@@ -1447,22 +1322,231 @@ [% INCLUDE 'datatables.inc' %]