From 34bb215b3417c19206120a7103a001eb9c21744c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 13 Apr 2023 16:56:07 +0000 Subject: [PATCH] Bug 33310: Use template wrapper for tabs: Suggestions This patch updates the suggestions template so that it uses the new WRAPPER directive to build tabbed navigation. To test, apply the patch and go to the suggestions page in the staff interface. - By default you suggestions should be organized by status, with a separate tab for each status (pending, accepted, etc). - Use the "Organize by" form in the sidebar to change how suggestions are listed. In each case confirm that the tabs are redisplayed correctly. Works as advertised. 3/3 Signed-off-by: Paul Derscheid Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit e18e32744f4e76ef107cb305432be11c2beda062) Signed-off-by: Jacob O'Mara --- .../prog/en/modules/suggestion/suggestion.tt | 554 +++++++++--------- 1 file changed, 272 insertions(+), 282 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 f516c5f9a7..431e5d5f82 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -697,12 +697,10 @@ [% END # /FOR m %] - [% IF suggestions.size && !notabs %] -
- -
- [% END # IF suggestions.size && !notabs %] + [% WRAPPER tab_panels %] + [% FOREACH suggestion IN suggestions %] + [% WRAPPER tab_panel tabname= suggestion.suggestiontype %] +
- [% FOREACH suggestion IN suggestions %] - [% UNLESS ( notabs ) %] -
- [% ELSE %] -
- [% END %] - - - [% IF suggestion.suggestions.size %] -

- Check all | Uncheck all -

- - - - - - - - - - - - - - - - - - - - - - - - [% FOREACH s IN suggestion.suggestions %] - - - - - - - - - - - - - - - - - +
 SuggestionSuggested bySuggester categorySuggested onPatron reasonManaged byManaged onLast modification byLast modification onLast updatedLibraryFundNon-public noteStatus 
- - - - [% 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 suggestion.suggestions.size %] +

+ Check all | Uncheck all +

- [% IF ( s.reason ) %] -
([% s.reason | html %]) - [% END %] -
-
- Edit - -
-
+ + + + + + + + + + + + + + + + + + - [% END # /FOREACH s %] - -
 SuggestionSuggested bySuggester categorySuggested onPatron reasonManaged byManaged onLast modification byLast modification onLast updatedLibraryFundNon-public noteStatus 
+ + + [% FOREACH s IN suggestion.suggestions %] + + + + + + + [% 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 %] -
-
-

Change selected suggestions

+ [% IF ( s.reason ) %] +
([% s.reason | html %]) + [% END %] + + +
+ Edit + +
+ + + [% END # /FOREACH s %] + + + +
+
+

Change selected suggestions

+
-
-
-
-
-
- - + + + [% IF (statusselected_ASKED ) %] + + [% ELSE %] + + [% END %] - [% IF (statusselected_ASKED ) %] - - [% ELSE %] - - [% END %] + [% IF (statusselected_ACCEPTED ) %] + + [% ELSE %] + + [% END %] - [% IF (statusselected_ACCEPTED ) %] - - [% ELSE %] - - [% END %] + [% IF (statusselected_CHECKED ) %] + + [% ELSE %] + + [% END %] - [% IF (statusselected_CHECKED ) %] - - [% ELSE %] - - [% END %] + [% IF ( statusselected_REJECTED ) %] + + [% ELSE %] + + [% END %] - [% IF ( statusselected_REJECTED ) %] - - [% ELSE %] - - [% END %] + [% IF ( statusselected_ORDERED ) %] + + [% ELSE %] + + [% END %] - [% IF ( statusselected_ORDERED ) %] - - [% ELSE %] - - [% END %] + [% FOREACH s IN SuggestionStatuses %] + + [% END %] + - [% FOREACH s IN SuggestionStatuses %] - - [% END %] - + + - - + + + Cancel + +
+ + + +
+
+ +
+
+ +
+
+ + [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %] + + +
+
+ +
+
+ +
+
+ Update manager + Select manager + + + + +
+
+ +
+
- - - Cancel - -
- - - - -
- -
-
- -
-
- - [% PROCESS 'av-build-dropbox.inc' name="suggestion_itemtype", category="SUGGEST_FORMAT", size = 20 %] - - -
-
- -
-
- -
-
- Update manager - Select manager - - - - -
-
- -
-
- -
-
- Delete selected - - -
-
- -
-
-
-
- Archive selected - - +
+
+ Delete selected + + +
- + +
+
+
+
+ Archive selected + + +
+ +
-
-
-
+
+
- [% ELSE %] - No results. - [% END # /IF ( suggestion.suggestions_loop ) %] - -
- [% END # /FOREACH suggestion %] - [% IF suggestions.size && !notabs %] - - - [% END # /UNLESS notabs %] + [% ELSE %] + No results. + [% END # /IF ( suggestion.suggestions_loop ) %] + + [% END # /tab_panel# %] + [% END # /FOREACH suggestion %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] [% END # /IF op == 'else' %] [% UNLESS op == 'save' %] -- 2.39.5