@@ -, +, @@
hold/reservation in Staff client
---
C4/Reserves.pm | 25 +++--
.../prog/en/modules/reserve/request.tt | 110 +++++++++++++++------
reserve/placerequest.pl | 79 +++++++++------
reserve/request.pl | 40 ++++++--
4 files changed, 180 insertions(+), 74 deletions(-)
--- a/C4/Reserves.pm
+++ a/C4/Reserves.pm
@@ -409,22 +409,33 @@ sub GetReservesFromBorrowernumber {
#-------------------------------------------------------------------------------------
=head2 CanBookBeReserved
- $error = &CanBookBeReserved($borrowernumber, $biblionumber)
+ $error = &CanBookBeReserved($borrowernumber, $biblionumber, $pickupLibrary)
+
+C<$pickupLibrary> OPTIONAL, undef OR the branchcode of the item transfer destination.
=cut
sub CanBookBeReserved{
- my ($borrowernumber, $biblionumber) = @_;
-
- my $items = GetItemnumbersForBiblio($biblionumber);
+ my ($borrowernumber, $biblionumber, $pickupLibrary) = @_;
+
+ my $itemNumbers = GetItemnumbersForBiblio($biblionumber);
#get items linked via host records
my @hostitems = get_hostitemnumbers_of($biblionumber);
if (@hostitems){
- push (@$items,@hostitems);
+ push (@$itemNumbers,@hostitems);
}
- foreach my $item (@$items){
- return 1 if CanItemBeReserved($borrowernumber, $item);
+ foreach my $itemNumber (@$itemNumbers){
+
+ if (defined $pickupLibrary) {
+ return 0 if (! CanItemBeReserved($borrowernumber, $itemNumber) );
+ my $item = GetItem($itemNumber);
+ my ($transferOk, $errorMsg) = C4::Circulation::CheckBranchTransferAllowed($pickupLibrary, $item->{holdingbranch}, $item, undef);
+ return 1 if ($transferOk);
+ }
+ else {
+ return 1 if ( CanItemBeReserved($borrowernumber, $itemNumber) );
+ }
}
return 0;
}
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
@@ -130,6 +130,19 @@ function checkMultiHold() {
});
$('#hold-request-form').preventDoubleFormSubmit();
+ $('#reloadPickupLocationForm').preventDoubleFormSubmit();
+
+ //Setting the trigger to reload branchTransferLimits
+ $('#pickup').change(function() {
+ var newSelection = $(this).val();
+
+ //Make sure the pickup location is changed to the first select as well.
+ // The branch selection uses only the first given pickuplocations branch value.
+ $('#reloadPickupLocationForm > input[name="pickup"]').val(newSelection);
+
+ $('#reloadPickupLocationForm').submit();
+ });
+
[% UNLESS ( borrowernumber || borrower_list ) %]
[% IF ( CircAutocompl ) %]
@@ -352,10 +365,15 @@ function checkMultiHold() {
[% END %]
- [% UNLESS ( multi_hold ) %]
+
+
+
+ [% UNLESS ( multi_hold ) %]