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 70b6901034..5daded0745 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/holds-table.inc
@@ -82,7 +82,16 @@
[% UNLESS( singleBranchMode) %]
Pick up location:
- [% HOLD.branch.branchname | html %]
+ [% IF Koha.Preference('OPACInTransitHoldPickupLocationChange') && HOLD.is_in_transit %]
+
+ [% ELSE %]
+ [% HOLD.branch.branchname | html %]
+ [% END %]
|
[% 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");