From 1c55f99340c10633662941df7776ae977258a95b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 23 Jan 2024 19:22:12 +0000 Subject: [PATCH] Bug 35880: Use template wrapper for accordions: Patrons requesting modifications This patch updates the patrons requesting modification page so that Bootstrap accordion markup is generated by WRAPPERs. To test, apply the patch and make sure you have the OPACPatronDetails system preference enabled. - Create at least two different patron modification requests: - Log in to the OPAC using two different patron accounts, each time following the sidebar link for "Personal details." - Make some changes to the patron records and submit them. - In the staff interface, from the home page, click the "Patrons requesting modifications" link. - You should see the list of updates in the same format as before: Collapsible panels where clicking the patron name heading expands the corresponding information. - View the detail or checkout page for one of your updated patrons. - Click the "Review pending modifications" link. - The modifications page should open with that patron's information exapanded. Signed-off-by: David Nind --- .../prog/en/modules/members/members-update.tt | 151 +++++++++--------- 1 file changed, 74 insertions(+), 77 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt index 9ea7874ba6..3475c3aafb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt @@ -115,95 +115,92 @@

Update patron records

[% IF PendingModifications %]
-
+ [% WRAPPER accordion panelgroup_id="pending_updates" %] [% FOREACH pm IN PendingModifications %] [% SET borrowernumber = pm.borrowernumber %] -
- -
-
-
+ [% WRAPPER accordion_item %] + [% WRAPPER accordion_heading panel_id="panel-${pm.borrowernumber}" %] + [% borrowers.$borrowernumber.surname | html %][% IF ( borrowers.$borrowernumber.firstname ) %], [% borrowers.$borrowernumber.firstname | html %][% END %] - [% Categories.GetName( borrowers.$borrowernumber.categorycode ) | html %] ([% Branches.GetName( borrowers.$borrowernumber.branchcode ) | html %]) ([% borrowers.$borrowernumber.cardnumber | html %]) - Requested on [% pm.timestamp | $KohaDates with_hours = 1 %] + [% END %] + [% WRAPPER accordion_panel panel_id="panel-${pm.borrowernumber}" %] - +
+ - + - -  |  Patron details -
- - [% IF borrowers.$borrowernumber.gonenoaddress > 0 %] -
-

Patron's address in doubt

-

The Gone no address flag is set for this patron. If this modification request resolves the issue, please unset the flag.

- - -
- [% END %] - - [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %] - [%# timestamp+verification_token+borrowernumber=3 %] -
- - - - - - + +  |  Patron details + - [% FOREACH key IN pm.keys %] - [% IF ( key != "timestamp" and key != "extended_attributes" ) %] - [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %] - - - [% IF ( key == "dateofbirth" ) %] - - - [% ELSIF key == 'branchcode' %] - - - [% ELSE %] - - - [% END %] - - [% END %] + [% IF borrowers.$borrowernumber.gonenoaddress > 0 %] +
+

Patron's address in doubt

+

The Gone no address flag is set for this patron. If this modification request resolves the issue, please unset the flag.

+ + +
+ [% END %] + + [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %] + [%# timestamp+verification_token+borrowernumber=3 %] +
+
FieldOld valueNew value
[% PROCESS display_names field = key %][% borrowers.$borrowernumber.$key | $KohaDates %][% pm.$key | $KohaDates %][% Branches.GetName( borrowers.$borrowernumber.$key ) | html %][% Branches.GetName( pm.$key ) | html %][% borrowers.$borrowernumber.$key | html %][% pm.$key | html %]
+ + + + + + + + [% FOREACH key IN pm.keys %] + [% IF ( key != "timestamp" and key != "extended_attributes" ) %] + [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %] + + + [% IF ( key == "dateofbirth" ) %] + + + [% ELSIF key == 'branchcode' %] + + + [% ELSE %] + + + [% END %] + [% END %] [% END %] -
FieldOld valueNew value
[% PROCESS display_names field = key %][% borrowers.$borrowernumber.$key | $KohaDates %][% pm.$key | $KohaDates %][% Branches.GetName( borrowers.$borrowernumber.$key ) | html %][% Branches.GetName( pm.$key ) | html %][% borrowers.$borrowernumber.$key | html %][% pm.$key | html %]
-
- [% END # /!pm.extended_attributes %] - [% IF borrowers.$borrowernumber.modified_attributes %] -
-

[% PROCESS display_names field='extended_attributes' %]

- + [% END %] +
+
+ [% END # /!pm.extended_attributes %] + [% IF borrowers.$borrowernumber.modified_attributes %] +
+

[% PROCESS display_names field='extended_attributes' %]

+ + + + + + + [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %] - - - + + + - [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %] - - - - - - [% END %] -
FieldOld valueNew value
FieldOld valueNew value[% attribute_group.type.description | html %][% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %][% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]
[% attribute_group.type.description | html %][% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %][% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]
-
- [% END # / borrowers.$borrowernumber.modified_attributes %] -
-
-
+ [% END %] + +
+ [% END # / borrowers.$borrowernumber.modified_attributes %] + [% END %] + [% END %] [% END # /FOREACH pm %] -
+ [% END # /collapse %]
[% ELSE %] @@ -221,9 +218,9 @@ -- 2.30.2