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