Lines 190-218
if ( $query->param('reserve_id') ) {
Link Here
|
190 |
} |
190 |
} |
191 |
|
191 |
|
192 |
if ( $query->param('recall_id') ){ |
192 |
if ( $query->param('recall_id') ){ |
193 |
my $recall = Koha::Recalls->find(scalar $query->param('recall_id')); |
193 |
my $recall = Koha::Recalls->find( $query->param('recall_id') ); |
194 |
my $recall_borrower = $recall->patron; |
194 |
my $recall_borrower = $recall->patron; |
195 |
my $item = Koha::Items->find($recall->itemnumber); |
195 |
my $item = Koha::Items->find($recall->itemnumber); |
196 |
my $biblio = Koha::Biblios->find($item->biblionumber); |
196 |
my $biblio = Koha::Biblios->find($item->biblionumber); |
197 |
|
197 |
if( $query->param("transfer_recall") ){ |
198 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $recall_borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch }); |
198 |
$recall->update({ status => 'T', waitingdate => undef, expirationdate => undef }); |
199 |
my $shelf_time = $issuing_rule->recall_shelf_time || C4::Context->preference('RecallsMaxPickUpDelay'); |
199 |
} else { |
200 |
my $expirationdate = dt_from_string()->add( $issuing_rule->lengthunit => $shelf_time ); |
200 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $recall_borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch }); |
201 |
$recall->update({ status => 'W', waitingdate => dt_from_string(), expirationdate => $expirationdate }); |
201 |
my $shelf_time = $issuing_rule->recall_shelf_time || C4::Context->preference('RecallsMaxPickUpDelay'); |
202 |
|
202 |
my $expirationdate = dt_from_string()->add( $issuing_rule->lengthunit => $shelf_time ); |
203 |
# send notice to user who requested recall to pick up item |
203 |
$recall->update({ status => 'W', waitingdate => dt_from_string(), expirationdate => $expirationdate }); |
204 |
my $letter = C4::Letters::GetPreparedLetter ( |
204 |
|
205 |
module => 'circulation', |
205 |
# send notice to user who requested recall to pick up item |
206 |
letter_code => 'PICKUP_RECALLED_ITEM', |
206 |
my $letter = C4::Letters::GetPreparedLetter ( |
207 |
branchcode => $recall->branchcode, |
207 |
module => 'circulation', |
208 |
tables => { |
208 |
letter_code => 'PICKUP_RECALLED_ITEM', |
209 |
'biblio', $biblio->biblionumber, |
209 |
branchcode => $recall->branchcode, |
210 |
'borrowers', $recall_borrower->borrowernumber, |
210 |
tables => { |
211 |
'items', $item->itemnumber, |
211 |
'biblio', |
212 |
'recalls', $recall->recall_id, |
212 |
$biblio->biblionumber, |
213 |
}, |
213 |
'borrowers', |
214 |
); |
214 |
$recall_borrower->borrowernumber, |
215 |
C4::Message->enqueue($letter, $recall_borrower->unblessed, 'email'); |
215 |
'items', $item->itemnumber, |
|
|
216 |
'recalls', |
217 |
$recall->recall_id, |
218 |
}, |
219 |
); |
220 |
C4::Message->enqueue($letter, $recall_borrower->unblessed, 'email'); |
221 |
} |
216 |
} |
222 |
} |
217 |
|
223 |
|
218 |
my $borrower; |
224 |
my $borrower; |
Lines 484-496
if ( $messages->{'RecallFound'} ){
Link Here
|
484 |
found => 1, |
490 |
found => 1, |
485 |
recalled => 1, |
491 |
recalled => 1, |
486 |
recall => $recall, |
492 |
recall => $recall, |
487 |
address => $patron->address, |
493 |
transfer_recall => ($userenv_branch eq $recall->branchcode ? 1 : 0 ) |
488 |
address2 => $patron->address2, |
494 |
# address => $patron->address, |
489 |
streetnumber => $patron->streetnumber, |
495 |
# address2 => $patron->address2, |
490 |
city => $patron->city, |
496 |
# streetnumber => $patron->streetnumber, |
491 |
zipcode => $patron->zipcode, |
497 |
# city => $patron->city, |
492 |
state => $patron->state, |
498 |
# zipcode => $patron->zipcode, |
493 |
country => $patron->country, |
499 |
# state => $patron->state, |
|
|
500 |
# country => $patron->country, |
494 |
); |
501 |
); |
495 |
} |
502 |
} |
496 |
|
503 |
|