Bugzilla – Attachment 135835 Details for
Bug 30500
Add option to allow user to change the pickup location while a hold is in transit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30500: Allow patrons to change in transit holds pickup locations
Bug-30500-Allow-patrons-to-change-in-transit-holds.patch (text/plain), 4.12 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-06-08 20:40:58 UTC
(
hide
)
Description:
Bug 30500: Allow patrons to change in transit holds pickup locations
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-06-08 20:40:58 UTC
Size:
4.12 KB
patch
obsolete
>From 048002a46b8dca83fa855273eef52f1e8141688e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 8 Jun 2022 17:26:43 -0300 >Subject: [PATCH] Bug 30500: Allow patrons to change in transit holds pickup > locations > >This patch adds a way for patrons to change the pickup location for in >transit holds. > >This is done in the OPAC on the holds table. > >The feature is controlled by a new system preference: > >* OPACInTransitHoldPickupLocationChange > >To test: >1. Apply this patches >2. Run: > $ updatedatabase > $ restart_all >=> SUCCESS: system preference added >3. Have an in-transit hold for a known patron >4. Visit the holds table for the patron (OPAC) >=> SUCCESS: Hold in transit, cannot change pickup location >5. Enable the OPACInTransitHoldPickupLocationChange system preference >=> SUCCESS: Descriptive text makes sense and is idiomatic >6. Reload the OPAC page >=> SUCCESS: You can now choose a new pickup location >7. Choose one >=> SUCCESS: It works! Reloaded page pre-selects the new pickup location >8. Switch to the new pickup location library on the staff interface >9. Go to Circulation > Transfers to receive >=> SUCCESS: The hold is there! >10. Scan the hold >=> SUCCESS: Usual workflow follows >11. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../opac-tmpl/bootstrap/en/includes/holds-table.inc | 11 ++++++++++- > opac/opac-modrequest.pl | 13 +++++++++++++ > 2 files changed, 23 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >index 682478d82d..efce00246e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc >@@ -84,7 +84,16 @@ > [% UNLESS( singleBranchMode) %] > <td class="branch"> > <span class="tdlabel">Pick up location:</span> >- [% HOLD.branch.branchname | html %] >+ [% IF Koha.Preference('OPACInTransitHoldPickupLocationChange') && HOLD.is_in_transit %] >+ <form class="form-inline" action="/cgi-bin/koha/opac-modrequest.pl" method="post"> >+ <input type="hidden" name="reserve_id" value="[% HOLD.reserve_id | html %]" /> >+ <select name="new_pickup_location" class="new_pickup_location" onchange="this.form.submit()"> >+ [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { item => HOLD.itemnumber, patron => logged_in_user }, selected => HOLD.branchcode }) %] >+ </select> >+ </form> >+ [% ELSE %] >+ [% HOLD.branch.branchname | html %] >+ [% END %] > </td> > [% END %] > [% IF ( showpriority ) %] >diff --git a/opac/opac-modrequest.pl b/opac/opac-modrequest.pl >index 5d83ea3f97..c12ac95d24 100755 >--- a/opac/opac-modrequest.pl >+++ b/opac/opac-modrequest.pl >@@ -41,6 +41,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > > my $reserve_id = $query->param('reserve_id'); > my $cancellation_request = $query->param('cancellation_request'); >+my $new_pickup_location = $query->param('new_pickup_location'); > > if ( $reserve_id && $borrowernumber ) { > >@@ -61,6 +62,18 @@ if ( $reserve_id && $borrowernumber ) { > $hold->cancel > if $hold->is_cancelable_from_opac; > } >+ >+ if ( $new_pickup_location ) { >+ >+ if ( C4::Context->preference('OPACInTransitHoldPickupLocationChange') ) { >+ $hold->set_pickup_location({ library_id => $new_pickup_location }); >+ } >+ else { >+ # whatcha tryin to do? >+ print $query->redirect('/cgi-bin/koha/errors/403.pl'); >+ exit; >+ } >+ } > } > > print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds"); >-- >2.34.1
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 30500
:
135834
|
135835
|
135836
|
135837
|
135847
|
135848
|
138690