Lines 45-50
use C4::Members;
Link Here
|
45 |
use C4::Members::Messaging; |
45 |
use C4::Members::Messaging; |
46 |
use C4::Koha; # FIXME : is it still useful ? |
46 |
use C4::Koha; # FIXME : is it still useful ? |
47 |
use C4::RotatingCollections; |
47 |
use C4::RotatingCollections; |
|
|
48 |
use C4::Letters; |
49 |
use C4::Message; |
48 |
use Koha::AuthorisedValues; |
50 |
use Koha::AuthorisedValues; |
49 |
use Koha::DateUtils; |
51 |
use Koha::DateUtils; |
50 |
use Koha::Calendar; |
52 |
use Koha::Calendar; |
Lines 53-58
use Koha::Holds;
Link Here
|
53 |
use Koha::Items; |
55 |
use Koha::Items; |
54 |
use Koha::Patrons; |
56 |
use Koha::Patrons; |
55 |
use Koha::Recalls; |
57 |
use Koha::Recalls; |
|
|
58 |
use Koha::IssuingRules; |
59 |
use Koha::Biblios; |
56 |
|
60 |
|
57 |
my $query = new CGI; |
61 |
my $query = new CGI; |
58 |
|
62 |
|
Lines 187-193
if ( $query->param('reserve_id') ) {
Link Here
|
187 |
|
191 |
|
188 |
if ( $query->param('recall_id') ){ |
192 |
if ( $query->param('recall_id') ){ |
189 |
my $recall = Koha::Recalls->find(scalar $query->param('recall_id')); |
193 |
my $recall = Koha::Recalls->find(scalar $query->param('recall_id')); |
190 |
$recall->update({ status => 'W', waitingdate => dt_from_string() }); |
194 |
my $recall_borrower = $recall->borrower; |
|
|
195 |
my $item = Koha::Items->find($recall->itemnumber); |
196 |
my $biblio = Koha::Biblios->find($item->biblionumber); |
197 |
|
198 |
my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $recall_borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch }); |
199 |
my $shelf_time = $issuing_rule->recall_shelf_time || C4::Context->preference('RecallsMaxPickUpDelay'); |
200 |
my $expirationdate = dt_from_string()->add( $issuing_rule->lengthunit => $shelf_time ); |
201 |
$recall->update({ status => 'W', waitingdate => dt_from_string(), expirationdate => $expirationdate }); |
202 |
|
203 |
# send notice to user who requested recall to pick up item |
204 |
my $letter = C4::Letters::GetPreparedLetter ( |
205 |
module => 'circulation', |
206 |
letter_code => 'PICKUP_RECALLED_ITEM', |
207 |
branchcode => $recall->branchcode, |
208 |
tables => { |
209 |
'biblio', $biblio->biblionumber, |
210 |
'borrowers', $recall_borrower->borrowernumber, |
211 |
'items', $item->itemnumber, |
212 |
'recalls', $recall->recall_id, |
213 |
}, |
214 |
); |
215 |
C4::Message->enqueue($letter, $recall_borrower->unblessed, 'email'); |
191 |
} |
216 |
} |
192 |
|
217 |
|
193 |
my $borrower; |
218 |
my $borrower; |
194 |
- |
|
|