Bugzilla – Attachment 163723 Details for
Bug 35880
Use template wrapper for accordions: Patrons requesting modifications
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35880: Use template wrapper for accordions: Patrons requesting modifications
Bug-35880-Use-template-wrapper-for-accordions-Patr.patch (text/plain), 17.67 KB, created by
Owen Leonard
on 2024-03-22 16:48:32 UTC
(
hide
)
Description:
Bug 35880: Use template wrapper for accordions: Patrons requesting modifications
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2024-03-22 16:48:32 UTC
Size:
17.67 KB
patch
obsolete
>From da4f9e7348226a161b376df44a1bcee694b3f720 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <david@davidnind.com> >--- > .../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 5350ebf150..67155008d0 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 >@@ -116,95 +116,92 @@ > [% IF PendingModifications %] > <form method="post" action="members-update-do.pl"> > [% INCLUDE 'csrf-token.inc' %] >- <div id="pending_updates" class="panel-group" role="tablist" aria-multiselectable="true"> >+ [% WRAPPER accordion panelgroup_id="pending_updates" %] > [% FOREACH pm IN PendingModifications %] > [% SET borrowernumber = pm.borrowernumber %] >- <div class="panel panel-default"> >- <div class="panel-heading" role="tab" id="panel-header-[% pm.borrowernumber | html %]"> >- <h3 class="panel-title"> >- <a role="button" class="collapsed" data-toggle="collapse" data-parent="#pending_updates" aria-controls="panel_modify_[% pm.borrowernumber | html %]" href="#panel_modify_[% pm.borrowernumber | uri %]">[% 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 %]</a> >- </h3> >- </div> <!-- /.panel-heading --> >- <div id="panel_modify_[% pm.borrowernumber | html %]" class="panel-collapse collapse" role="tabpanel" aria-labelledby="panel-header-[% pm.borrowernumber | html %]"> >- <div class="panel-body"> >- <div class="btn-toolbar"> >+ [% 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}" %] > >- <label for="approve_modify_[% pm.borrowernumber | html %]"><input type="radio" id="approve_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="approve" /> Approve</label> >+ <div class="btn-toolbar"> > >+ <label for="approve_modify_[% pm.borrowernumber | html %]"><input type="radio" id="approve_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="approve" /> Approve</label> > >- <label for="deny_modify_[% pm.borrowernumber | html %]"><input type="radio" id="deny_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="deny" /> Deny</label> > >+ <label for="deny_modify_[% pm.borrowernumber | html %]"><input type="radio" id="deny_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="deny" /> Deny</label> > >- <label for="ignore_modify_[% pm.borrowernumber | html %]"><input type="radio" id="ignore_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="ignore" checked="checked"/> Ignore</label> >- | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber | html %]" >Patron details</a> >- </div> >- >- [% IF borrowers.$borrowernumber.gonenoaddress > 0 %] >- <div class="dialog message" style="margin-top:.8em"> >- <h4>Patron's address in doubt</h4> >- <p>The <strong>Gone no address</strong> flag is set for this patron. If this modification request resolves the issue, please unset the flag.</p> >- <input type="checkbox" id="unset_gna_[% pm.borrowernumber | html %]" name="unset_gna_[% pm.borrowernumber | html %]" value="unset_gna_[% pm.borrowernumber | html %]"/> >- <label for="unset_gna_[% pm.borrowernumber | html %]">Unset Gone no address for this patron</label> >- </div> >- [% END %] >- >- [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %] >- [%# timestamp+verification_token+borrowernumber=3 %] >- <div class="members-update-table"> >- <table> >- <tr> >- <th>Field</th> >- <th>Old value</th> >- <th>New value</th> >- </tr> > >+ <label for="ignore_modify_[% pm.borrowernumber | html %]"><input type="radio" id="ignore_modify_[% pm.borrowernumber | html %]" name="modify_[% pm.borrowernumber | html %]" value="ignore" checked="checked"/> Ignore</label> >+ | <a target="_blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% pm.borrowernumber | html %]" >Patron details</a> >+ </div> > >- [% FOREACH key IN pm.keys %] >- [% IF ( key != "timestamp" and key != "extended_attributes" ) %] >- [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %] >- <tr> >- <td>[% PROCESS display_names field = key %]</td> >- [% IF ( key == "dateofbirth" ) %] >- <td>[% borrowers.$borrowernumber.$key | $KohaDates %]</td> >- <td>[% pm.$key | $KohaDates %]</td> >- [% ELSIF key == 'branchcode' %] >- <td>[% Branches.GetName( borrowers.$borrowernumber.$key ) | html %]</td> >- <td>[% Branches.GetName( pm.$key ) | html %]</td> >- [% ELSE %] >- <td>[% borrowers.$borrowernumber.$key | html %]</td> >- <td>[% pm.$key | html %]</td> >- [% END %] >- </tr> >- [% END %] >+ [% IF borrowers.$borrowernumber.gonenoaddress > 0 %] >+ <div class="dialog message" style="margin-top:.8em"> >+ <h4>Patron's address in doubt</h4> >+ <p>The <strong>Gone no address</strong> flag is set for this patron. If this modification request resolves the issue, please unset the flag.</p> >+ <input type="checkbox" id="unset_gna_[% pm.borrowernumber | html %]" name="unset_gna_[% pm.borrowernumber | html %]" value="unset_gna_[% pm.borrowernumber | html %]"/> >+ <label for="unset_gna_[% pm.borrowernumber | html %]">Unset Gone no address for this patron</label> >+ </div> >+ [% END %] >+ >+ [% IF !pm.extended_attributes and pm.size > 3 or pm.extended_attributes and pm.size > 4 %] >+ [%# timestamp+verification_token+borrowernumber=3 %] >+ <div class="members-update-table"> >+ <table> >+ <tr> >+ <th>Field</th> >+ <th>Old value</th> >+ <th>New value</th> >+ </tr> >+ >+ >+ [% FOREACH key IN pm.keys %] >+ [% IF ( key != "timestamp" and key != "extended_attributes" ) %] >+ [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %] >+ <tr> >+ <td>[% PROCESS display_names field = key %]</td> >+ [% IF ( key == "dateofbirth" ) %] >+ <td>[% borrowers.$borrowernumber.$key | $KohaDates %]</td> >+ <td>[% pm.$key | $KohaDates %]</td> >+ [% ELSIF key == 'branchcode' %] >+ <td>[% Branches.GetName( borrowers.$borrowernumber.$key ) | html %]</td> >+ <td>[% Branches.GetName( pm.$key ) | html %]</td> >+ [% ELSE %] >+ <td>[% borrowers.$borrowernumber.$key | html %]</td> >+ <td>[% pm.$key | html %]</td> >+ [% END %] >+ </tr> > [% END %] > [% END %] >- </table> >- </div> <!-- /.members-update-table --> >- [% END # /!pm.extended_attributes %] >- [% IF borrowers.$borrowernumber.modified_attributes %] >- <div class="members-update-table"> >- <h4>[% PROCESS display_names field='extended_attributes' %]</h4> >- <table> >+ [% END %] >+ </table> >+ </div> <!-- /.members-update-table --> >+ [% END # /!pm.extended_attributes %] >+ [% IF borrowers.$borrowernumber.modified_attributes %] >+ <div class="members-update-table"> >+ <h4>[% PROCESS display_names field='extended_attributes' %]</h4> >+ <table> >+ <tr> >+ <th>Field</th> >+ <th>Old value</th> >+ <th>New value</th> >+ </tr> >+ [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %] > <tr> >- <th>Field</th> >- <th>Old value</th> >- <th>New value</th> >+ <td>[% attribute_group.type.description | html %]</td> >+ <td>[% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %]</td> >+ <td>[% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]</td> > </tr> >- [% FOREACH attribute_group IN borrowers.$borrowernumber.modified_attributes %] >- <tr> >- <td>[% attribute_group.type.description | html %]</td> >- <td>[% PROCESS display_extended_attributes attrs=attribute_group.before type=attribute_group.type %]</td> >- <td>[% PROCESS display_extended_attributes attrs=attribute_group.after type=attribute_group.type %]</td> >- </tr> >- [% END %] >- </table> >- </div> <!-- /.members-update-table --> >- [% END # / borrowers.$borrowernumber.modified_attributes %] >- </div> <!-- /.panel-body --> >- </div> <!-- /.panel-collapse.collapse --> >- </div> <!-- /panel.panel-default --> >+ [% END %] >+ </table> >+ </div> <!-- /.members-update-table --> >+ [% END # / borrowers.$borrowernumber.modified_attributes %] >+ [% END %] >+ [% END %] > [% END # /FOREACH pm %] >- </div> <!-- /#pending-updates --> >+ [% END # /collapse %] > <fieldset class="action"> > <input type="hidden" name="op" value="cud-update" /> > <input type="submit" class="btn btn-primary" value="Submit" /> >@@ -225,9 +222,9 @@ > <script> > $(document).ready(function(){ > [%- IF ( active ) -%] >- $("#pending_updates a[href='#panel_modify_" + [% active | html %] + "']").click(); >+ $("#pending_updates_group a[href='#panel-" + [% active | html %] + "_panel']").click(); > [%- ELSE -%] >- $("#pending_updates a.collapsed:eq(0)").click(); >+ $("#pending_updates_group a.collapsed:eq(0)").click(); > [%- END -%] > }); > </script> >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35880
:
161329
|
161737
|
163723
|
163888