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 513-525
if ( $messages->{'RecallFound'} ){
Link Here
|
513 |
found => 1, |
519 |
found => 1, |
514 |
recalled => 1, |
520 |
recalled => 1, |
515 |
recall => $recall, |
521 |
recall => $recall, |
516 |
address => $patron->address, |
522 |
transfer_recall => ($userenv_branch eq $recall->branchcode ? 1 : 0 ) |
517 |
address2 => $patron->address2, |
523 |
# address => $patron->address, |
518 |
streetnumber => $patron->streetnumber, |
524 |
# address2 => $patron->address2, |
519 |
city => $patron->city, |
525 |
# streetnumber => $patron->streetnumber, |
520 |
zipcode => $patron->zipcode, |
526 |
# city => $patron->city, |
521 |
state => $patron->state, |
527 |
# zipcode => $patron->zipcode, |
522 |
country => $patron->country, |
528 |
# state => $patron->state, |
|
|
529 |
# country => $patron->country, |
523 |
); |
530 |
); |
524 |
} |
531 |
} |
525 |
|
532 |
|