@@ -, +, @@
placing a hold/reservation in Staff client
---
C4/Circulation.pm | 6 +-
C4/Reserves.pm | 11 +--
.../prog/en/modules/reserve/request.tt | 79 +++++++++++++++++++---
.../opac-tmpl/prog/en/modules/opac-reserve.tt | 2 +-
opac/opac-reserve.pl | 2 +-
reserve/placerequest.pl | 79 ++++++++++++++--------
reserve/request.pl | 40 ++++++++---
7 files changed, 162 insertions(+), 57 deletions(-)
--- a/C4/Circulation.pm
+++ a/C4/Circulation.pm
@@ -3256,8 +3256,8 @@ sub IsBranchTransferAllowed {
A convenience function to easily check item transfer limits.
- $allowed = CheckBranchTransferAllowed( $toBranch, $fromBranch, $item, $biblioitem );
- $allowed = CheckBranchTransferAllowed( $toBranch, undef, $item, undef] );
+ ($allowed, $errorMessage) = CheckBranchTransferAllowed( $toBranch, $fromBranch, $item, $biblioitem );
+ ($allowed, $errorMessage) = CheckBranchTransferAllowed( $toBranch, undef, $item, undef] );
Checks if UseBranchTransferLimits global preference is in use.
Checks if the given item can be transferred from $fromBranch to $toBranch.
@@ -3333,7 +3333,7 @@ sub CheckBranchTransferAllowed {
## If a row is found, then that combination is not allowed, if no matching row is found, then the combination *is allowed*
if ( $limit->{'limitId'} ) {
- return 0, $toBranch . "::" . $code;
+ return 0, "$fromBranch -> $toBranch " . " :: " . $code;
} else {
return 1;
}
--- a/C4/Reserves.pm
+++ a/C4/Reserves.pm
@@ -418,22 +418,23 @@ C<$pickupLibrary> OPTIONAL, undef OR the branchcode of the item transfer destina
sub CanBookBeReserved{
my ($borrowernumber, $biblionumber, $pickupLibrary) = @_;
- my $items = GetItemnumbersForBiblio($biblionumber);
+ 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){
+ foreach my $itemNumber (@$itemNumbers){
if (defined $pickupLibrary) {
+ my $item = GetItem($itemNumber);
return 1 if ( CanItemBeReserved($borrowernumber, $item) and
- CheckBranchTransferLimits($pickupLibrary, $item->{holdingbranch}, $item, undef)
+ C4::Circulation::CheckBranchTransferAllowed($pickupLibrary, $item->{holdingbranch}, $item, undef)
);
}
else {
- return 1 if ( CanItemBeReserved($borrowernumber, $item) );
+ 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 ) %]