@@ -, +, @@ pickup from being able to be checked out to patrons other than the recall requester. --- C4/Circulation.pm | 13 +++++++++++++ catalogue/detail.pl | 4 ++-- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 4 ++++ opac/opac-recall.pl | 11 ++++++----- 4 files changed, 25 insertions(+), 7 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -666,6 +666,10 @@ sticky due date is invalid or due date in the past if the borrower borrows to much things +=head3 WAITING_RECALL_FOR_A_DIFFERENT_PATRON + +if the item has been recalled by a different patron and the recall status is waiting 'W' + =cut sub CanBookBeIssued { @@ -1023,6 +1027,15 @@ sub CanBookBeIssued { } } + #CHECK IF ITEM HAS WAITING RECALL FOR ANOTHER PATRON + if ( C4::Context->preference('UseRecalls') ) { + my $recall = Koha::Recalls->find({ itemnumber => $item->{'itemnumber'} }); + if ((defined $recall) && ($recall->patron->borrowernumber != $patron->borrowernumber) && $recall->status eq 'W') { + #Item has been recalled by a different patron and is waiting for them + $issuingimpossible{WAITING_RECALL_FOR_A_DIFFERENT_PATRON} = 1; + } + } + ## CHECK AGE RESTRICTION my $agerestriction = $biblioitem->agerestriction; my ($restriction_age, $daysToAgeRestriction) = GetAgeRestriction( $agerestriction, $patron->unblessed ); --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -334,8 +334,8 @@ foreach my $item (@items) { } } - my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber}, old => undef }); - if (defined $recall){ + my $recall = Koha::Recalls->find({ itemnumber => $item->{itemnumber} }); + if (defined $recall && $recall->status ne 'F' && $recall->status ne 'C'){ $item->{recalled} = 1; $item->{recall} = $recall; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -79,6 +79,7 @@
Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.
[% END %] + [% IF ( NEEDSCONFIRMATION ) %]
@@ -313,6 +314,9 @@ [% IF ( INVALID_DATE ) %]
  • The due date "[% INVALID_DATE | html %]" is invalid
  • [% END %] + [% IF ( WAITING_RECALL_FOR_A_DIFFERENT_PATRON ) %] +
  • This item is awaiting pickup by another patron who recalled it.
  • + [% END %] [% IF ( UNKNOWN_BARCODE ) %]
  • The barcode was not found: [% barcode | html %] --- a/opac/opac-recall.pl +++ a/opac/opac-recall.pl @@ -87,13 +87,14 @@ if ($op eq 'request'){ my $recall = Koha::Recalls->find($recall_request->recall_id); # updating due date on checkout my $timestamp = dt_from_string($recall->timestamp); - if ($issuing_rule->recall_due_date_interval eq '') { - my $due_date = $timestamp->add( $issuing_rule->lengthunit => 0 ); + my $due_date; + if ( $issuing_rule->recall_due_date_interval eq '' ) { + $due_date = $timestamp->add( $issuing_rule->lengthunit => 0 ); } else { - my $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval); + $due_date = $timestamp->add( $issuing_rule->lengthunit => $issuing_rule->recall_due_date_interval ); } - my $checkout = Koha::Checkouts->find({ itemnumber = $itemnumber })->update({ date_due => $due_date }); - my $checkout_borrower = $checkout->patron; + my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber })->update({ date_due => $due_date }); + my $checkout_borrower = Koha::Patrons->find($checkout->borrowernumber->borrowernumber); # send notice to user with recalled item checked out my $letter = C4::Letters::GetPreparedLetter ( --