Bugzilla – Attachment 179540 Details for
Bug 38842
Refactor modal logic in returns.tt / returns.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38842: Use new reusable components for hold-found2 modal
Bug-38842-Use-new-reusable-components-for-hold-fou.patch (text/plain), 20.01 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-20 15:23:04 UTC
(
hide
)
Description:
Bug 38842: Use new reusable components for hold-found2 modal
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-20 15:23:04 UTC
Size:
20.01 KB
patch
obsolete
>From ba0c4223484b1989fa435862379c5cecfc62743c Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Fri, 7 Mar 2025 12:01:34 -0500 >Subject: [PATCH] Bug 38842: Use new reusable components for hold-found2 modal > >Refactor the code for hold-found2 to use the new modal_wrapper and >passthrough_data block as a proof of concept. > >The modal is also renamed hold-found-modal. > >To test: >Setup: >0. Set system preferences: > - HoldsAutoFill = Don't > - ShowAllCheckins = Show >1. Find a biblio record with multiple items >2. Set the homebranch on all of those items to the logged-in branch >3. Place two holds on that record: > - One for pickup at the logged-in branch (Hold A) > - One for pickup at a different branch (Hold B) >4. Keep the tab for the biblio record open, and open a new tab for > checkins >5. Check in an item from that bib >6. Take a screenshot of the modal on main for easy comparison >7. Ignore the hold >8. Apply patches > >Test a hold for pickup at the logged-in branch: >9. Check in the item again >--> Confirm that the new modal contains all the correct information for >Hold A. The only change in the modal should be that the title is now >in the modal body instead of the modal header. >10. Open all of the links in the modal body in new tabs. >--> Confirm the links all work as expected, then close those tabs >11. Click to ignore the hold >--> Confirm that the checkins table displays correctly >12. Reload the Holds tab of the biblio record >--> Confirm the holds are unchanged >13. Switch to the Normal tab of the biblio record >--> Confirm the item still shows as Available >14. Check in the item again and click the button to confirm the hold >--> Confirm that the checkins table displays correctly >15. Reload the Holds tab of the biblio record >--> Confirm Hold A is now set to Waiting >16. Revert the waiting status on Hold A >17. Check in the item again >18. Click the button to confirm and print slip >--> Confirm the print dialog appears and slip information is correct >19. Cancel the print dialog >--> Confirm that the checkins table displays correctly >20. Reload the Holds tab of the biblio record >--> Confirm Hold A is now set to Waiting > >Test a hold for pickup at a different branch: >21. Check in a different item from that bib >--> Confirm that the new modal contains all the correct information for >Hold B, and correctly states that the item needs to be transferred >22. Click to ignore the hold >--> Confirm that the checkins table displays correctly >23. Reload the Holds tab of the biblio record >--> Confirm the hold is unchanged >24. Switch to the Normal tab of the biblio record >--> Confirm the item still shows as Available >25. Check in the item again and click the button to confirm and transfer >--> Confirm that the checkins table displays correctly >26. Reload the Holds tab of the biblio record >--> Confirm Hold B is now set to in-transit >27. Revert the transit status on Hold B >28. Check in the item again >29. Click the button to print slip, transfer, and confirm >--> Confirm the print dialog appears and slip information is correct >30. Cancel the print dialog >--> Confirm that the checkins table displays correctly >31. Reload the Holds tab of the biblio record >--> Confirm Hold B is now set to in-transit >32. Change your logged-in branch to match Hold B's pickup location >33. Check in the item again >--> Confirm the modal still contains all the correct information for >Hold B and does not say it needs to be transferred >34. Click to print slip and confirm >--> Confirm that the print dialog appears and looks correct >35. Cancel the print dialog >36. Reload the Holds tab of the biblio record >--> Confirm that both holds are now Waiting >37. Sign off :D > >Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >--- > .../prog/en/modules/circ/returns.tt | 211 ++++++++---------- > 1 file changed, 92 insertions(+), 119 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 6552e8c4..dc9472c7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -8,6 +8,7 @@ > [% USE TablesSettings %] > [% PROCESS 'i18n.inc' %] > [% PROCESS 'member-display-address-style.inc' %] >+[% PROCESS 'html_helpers.inc' %] > [% SET footerjs = 1 %] > [% BLOCK display_bormessagepref %] > [% IF ( bormessagepref ) %] >@@ -841,132 +842,103 @@ > > <!-- case of simple return no issue or transfer but with a hold --> > [% IF ( reserved and !recalled and !waitingrecall ) %] >- <!-- reserved --> >- <div id="hold-found2" class="modal modal-lg block audio-alert-action" data-bs-backdrop="static" data-bs-keyboard="false"> >- <div class="modal-dialog"> >- <div class="modal-content"> >- <form method="post" action="returns.pl" class="confirm"> >- [% INCLUDE 'csrf-token.inc' %] > >- <input type="hidden" name="print_slip" value="0" /> >- >- <div class="modal-header"> >- <h1 class="modal-title"> >- Hold found: >- <br /> >- <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a> >- <div class="hold-found-barcode"> (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>) </div> >- </h1> >- </div> >- >- <div class="modal-body"> >- [% IF ( reservenotes ) %] >- <h4>Notes:</h4> >- <p>[% reservenotes | html %]</p> >- <hr /> >- [% END %] >- <h5>Hold for:</h5> >- <ul> >- <li> >- [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %] >- <span class="patron-category"> - [% patron.category.description | html %]</span> >- </li> >+ [% SET confirm_button_text = '' %] >+ [% SET print_button = '' %] > >- [% INCLUDE display_holdpatron_address %] >+ [% IF transfertodo %] >+ [% confirm_button_text = 'Confirm hold and transfer' %] >+ [% print_button = '<button type="button" class="btn btn-default print" accesskey="p"> <i class="fa fa-print"></i> Print slip, transfer, and confirm (P) </button>' %] >+ [% ELSE %] >+ [% confirm_button_text = 'Confirm hold' %] >+ [% print_button = '<button type="button" class="btn btn-default print" accesskey="p"> <i class="fa fa-print"></i> Print slip and confirm (P) </button>' %] >+ [% END %] > >- [% IF ( patron.phone ) %] >- <li>[% patron.phone | html %]</li> >- [% END %] >+ [% SET modal_print_url = reserve_id | uri %] >+ [% modal_print_url = "/cgi-bin/koha/circ/hold-transfer-slip.pl?reserve_id=" _ modal_print_url %] > >- [% IF ( patron.email ) %] >- <li> >- [% IF ( transfertodo ) %] >- [% patron.email | html %] >- [% ELSE %] >- <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a> >- [% END %] >- </li> >- [% END %] >+ [% WRAPPER modal_wrapper modal_id="hold-found-modal" modal_header_contents='<h1 class="modal-title">Hold found</h1>' modal_confirm_text=confirm_button_text modal_confirm_accesskey="Y" modal_custom_utility_button=print_button modal_deny_text="Ignore" modal_deny_accesskey="I" modal_deny_action="dismiss" %] >+ <h1> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a> >+ <div class="hold-found-barcode"> (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&itemnumber=[% itemnumber | uri %]">[% item.barcode | html %]</a>) </div> >+ </h1> >+ [% IF ( reservenotes ) %] >+ <h4>Notes:</h4> >+ <p>[% reservenotes | html %]</p> >+ <hr /> >+ [% END %] >+ <h4>Hold for:</h4> >+ <ul> >+ <li> >+ [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %] >+ <span class="patron-category"> - [% patron.category.description | html %]</span> >+ </li> > >- [% UNLESS ( transfertodo) %] >- [% INCLUDE display_bormessagepref %] >- [% IF patron.primary_contact_method %] >- <li id="main_contact_method" >- >Main contact method: >- [% SWITCH patron.primary_contact_method %] >- [% CASE 'phone' %] >- <span>Primary phone</span> >- [% CASE 'phonepro' %] >- <span>Secondary phone</span> >- [% CASE 'mobile' %] >- <span>Other phone</span> >- [% CASE 'email' %] >- <span>Primary email</span> >- [% CASE 'emailpro' %] >- <span>Secondary email</span> >- [% CASE 'fax' %] >- <span>Fax</span> >- [% END %] >- </li> >- [% END %] >- [% END %] >+ [% INCLUDE display_holdpatron_address %] > >- [% IF ( patron.is_debarred ) %] >- <li class="error">Patron is RESTRICTED</li> >- [% END %] >+ [% IF ( patron.phone ) %] >+ <li>[% patron.phone | html %]</li> >+ [% END %] > >- [% IF ( patron.gonenoaddress ) %] >- <li class="error">Patron's address is in doubt</li> >- [% END %] >- </ul> >- [% IF ( transfertodo ) %] >- <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4> >- [% ELSE %] >- <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4> >- [% END %] >+ [% IF ( patron.email ) %] >+ <li> >+ [% IF ( transfertodo ) %] >+ [% patron.email | html %] >+ [% ELSE %] >+ <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a> >+ [% END %] >+ </li> >+ [% END %] > >- [% FOREACH checkin IN checkins %] >- <input type="hidden" name="checkin_counter" value="[% loop.count | html %]" /> >- <input type="hidden" name="checkin_barcode_[% loop.count | html %]" value="[% checkin.barcode | html %]" /> >- <input type="hidden" name="checkin_duedate_[% loop.count | html %]" value="[% checkin.duedate | html %]" /> >- <input type="hidden" name="checkin_borrowernumber_[% loop.count | html %]" value="[% checkin.borrowernumber | html %]" /> >- <input type="hidden" name="checkin_not_returned_[% loop.count | html %]" value="[% checkin.not_returned | html %]" /> >+ [% UNLESS ( transfertodo) %] >+ [% INCLUDE display_bormessagepref %] >+ [% IF patron.primary_contact_method %] >+ <li id="main_contact_method" >+ >Main contact method: >+ [% SWITCH patron.primary_contact_method %] >+ [% CASE 'phone' %] >+ <span>Primary phone</span> >+ [% CASE 'phonepro' %] >+ <span>Secondary phone</span> >+ [% CASE 'mobile' %] >+ <span>Other phone</span> >+ [% CASE 'email' %] >+ <span>Primary email</span> >+ [% CASE 'emailpro' %] >+ <span>Secondary email</span> >+ [% CASE 'fax' %] >+ <span>Fax</span> > [% END %] >+ </li> >+ [% END %] >+ [% END %] > >- <input type="hidden" name="op" value="cud-affect_reserve" /> >- <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" /> >- <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >- <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" /> >- <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" /> >- <input type="hidden" name="diffBranch" value="[% destbranch | html %]" /> >- <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" /> >- <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" /> >- <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" /> >- <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" /> >- <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" /> >- [% INCLUDE all_checkin_messages %] >- </div> >+ [% IF ( patron.is_debarred ) %] >+ <li class="error">Patron is RESTRICTED</li> >+ [% END %] > >- <div class="modal-footer"> >- [% IF ( transfertodo ) %] >- <button type="submit" class="btn btn-default approve" accesskey="y"> <i class="fa fa-check"></i> Confirm hold and transfer (Y) </button> >- <button type="button" class="btn btn-default print" accesskey="p"> <i class="fa fa-print"></i> Print slip, transfer, and confirm (P) </button> >- [% ELSE %] >- <button type="submit" class="btn btn-default approve" accesskey="y"> <i class="fa fa-check"></i> Confirm hold (Y) </button> >- <button type="button" class="btn btn-default print" accesskey="p"> <i class="fa fa-print"></i> Print slip and confirm (P) </button> >- [% END %] >+ [% IF ( patron.gonenoaddress ) %] >+ <li class="error">Patron's address is in doubt</li> >+ [% END %] >+ </ul> >+ [% IF ( transfertodo ) %] >+ <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4> >+ [% ELSE %] >+ <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4> >+ [% END %] > >- <button type="button" data-bs-dismiss="modal" class="btn btn-default deny" accesskey="i"> <i class="fa fa-times"></i> Ignore (I) </button> >- </div> >- <!-- /.modal-footer --> >- </form> >- <!-- /.confirm --> >- </div> >- <!-- /.modal-content --> >- </div> >- <!-- /.modal-dialog --> >- </div> >- <!-- /#hold-found2 --> >+ [% PROCESS passthrough_data %] >+ >+ <input type="hidden" name="op" value="cud-affect_reserve" /> >+ <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" /> >+ <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> >+ <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" /> >+ <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" /> >+ <input type="hidden" name="diffBranch" value="[% destbranch | html %]" /> >+ <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" /> >+ <input type="hidden" name="print_slip" value="0" /> >+ [% INCLUDE all_checkin_messages %] >+ [% END #/hold-found-modal %] > [% END #/IF reserved %] > > [% IF ( recalled ) %] >@@ -1486,11 +1458,12 @@ > <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" /> > <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" /> > <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" /> >- [% FOREACH inputloo IN inputloop %] >- <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" /> >- <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" /> >- <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" /> >- <input type="hidden" name="nr-[% inputloo.counter | html %]" value="[% inputloo.not_returned | html %]" /> >+ [% FOREACH checkin IN checkins %] >+ <input type="hidden" name="checkin_counter" value="[% loop.count | html %]" /> >+ <input type="hidden" name="checkin_barcode_[% loop.count | html %]" value="[% checkin.barcode | html %]" /> >+ <input type="hidden" name="checkin_duedate_[% loop.count | html %]" value="[% checkin.duedate | html %]" /> >+ <input type="hidden" name="checkin_borrowernumber_[% loop.count | html %]" value="[% checkin.borrowernumber | html %]" /> >+ <input type="hidden" name="checkin_not_returned_[% loop.count | html %]" value="[% checkin.not_returned | html %]" /> > [% END %] > </fieldset> > [% END %] >-- >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 38842
:
178875
|
179084
|
179085
|
179086
|
179087
|
179127
|
179520
|
179521
|
179523
|
179524
|
179526
|
179538
|
179539
|
179540
|
179541
|
179542
|
180752
|
180753
|
180754
|
180755
|
180756