Bugzilla – Attachment 144427 Details for
Bug 30687
Unable to override hold policy if no pickup locations are available
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30687 (alternative patch): Always allow to force hold pickup location
Bug-30687-alternative-patch-Always-allow-to-force-.patch (text/plain), 4.52 KB, created by
Julian Maurice
on 2022-12-05 09:48:36 UTC
(
hide
)
Description:
Bug 30687 (alternative patch): Always allow to force hold pickup location
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2022-12-05 09:48:36 UTC
Size:
4.52 KB
patch
obsolete
>From 352bfd85adc3a0cadc823553449e212c88e163b6 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Wed, 7 Sep 2022 11:24:49 +0200 >Subject: [PATCH] Bug 30687 (alternative patch): Always allow to force hold > pickup location > >If AllowHoldPolicyOverride is enabled and only some pickup locations are >available, you still have the possibility to force one of the others >pickup locations. >But when there are zero pickup locations available, that is not >possible. > >This patch change that by always displaying the list of pickup locations >when AllowHoldPolicyOverride is enabled. > >Test plan: >1. Apply patch >2. Disable AllowHoldPolicyOverride >3. Create a biblio B with an item I at library A. >4. Configure this library A to not be a pickup location >5. Add a "Default holds policy by item type" for item I type where "Hold > pickup library match" is "item's home library" >6. Try to place a hold on biblio B > You should not be able to place a hold because there is no valid > pickup locations >7. Enable AllowHoldPolicyOverride >8. Try to place a hold on biblio B > You should now see all valid pickup locations in a dropdown list > (with an exclamation mark in front of each option) with none selected > by default >9. Verify you can place a title-level hold and an item-level hold >--- > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 4 ++-- > reserve/request.pl | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index c7033a8123..7d1f2b3592 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -799,7 +799,7 @@ > [% END # /IF force_hold_level %] > </td> > <td> >- [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %] >+ [% IF (itemloo.pickup_locations_count > 0) || itemloo.override || Koha.Preference('AllowHoldPolicyOverride') %] > <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;" > data-item-id="[% itemloo.itemnumber | html %]" > data-patron-id="[% patron.borrowernumber | html %]" >@@ -1518,7 +1518,7 @@ > msg = (_("- Please select an item to place a hold") + "\n"); > } > } else { >- if( $("#pickup").length < 1 || $("#pickup").val() == "" ){ >+ if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){ > msg = _("- Please select a pickup location for this hold" + "\n"); > } > } >diff --git a/reserve/request.pl b/reserve/request.pl >index c053e94b3f..89d9db8f1e 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -515,7 +515,7 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > # Send the pickup locations count to the UI, the pickup locations will be pulled using the API > my $pickup_locations = $item_object->pickup_locations({ patron => $patron }); > $item->{pickup_locations_count} = $pickup_locations->count; >- if ( $item->{pickup_locations_count} > 0 ) { >+ if ( $item->{pickup_locations_count} > 0 || C4::Context->preference('AllowHoldPolicyOverride') ) { > $num_items_available++; > $item->{available} = 1; > # pass the holding branch for use as default >@@ -537,7 +537,7 @@ if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) > my @pickup_locations = $item_object->pickup_locations({ patron => $patron })->as_list; > $item->{pickup_locations_count} = scalar @pickup_locations; > >- if ( @pickup_locations ) { >+ if ( @pickup_locations || C4::Context->preference('AllowHoldPolicyOverride') ) { > $num_items_available++; > $item->{override} = 1; > >-- >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 30687
:
134625
|
137643
|
140683
|
140712
|
140713
|
143457
|
144427
|
144825
|
144896
|
148502
|
150260