View | Details | Raw Unified | Return to bug 19532
Collapse All | Expand All

(-)a/C4/Letters.pm (+1 lines)
Lines 846-851 sub _parseletter_sth { Link Here
846
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
846
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
847
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
847
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
848
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
848
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
849
    ($table eq 'recalls'      )    ? "SELECT * FROM $table WHERE      recall_id = ?"                                  :
849
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
850
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
850
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
851
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
851
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
852
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
(-)a/circ/returns.pl (-2 / +26 lines)
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 186-192 if ( $query->param('reserve_id') ) { Link Here
186
190
187
if ( $query->param('recall_id') ){
191
if ( $query->param('recall_id') ){
188
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
192
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
189
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
193
    my $recall_borrower = $recall->borrower;
194
    my $item = Koha::Items->find($recall->itemnumber);
195
    my $biblio = Koha::Biblios->find($item->biblionumber);
196
197
    my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $recall_borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch });
198
    my $shelf_time = $issuing_rule->recall_shelf_time || C4::Context->preference('RecallsMaxPickUpDelay');
199
    my $expirationdate = dt_from_string()->add( $issuing_rule->lengthunit => $shelf_time );
200
    $recall->update({ status => 'W', waitingdate => dt_from_string(), expirationdate => $expirationdate });
201
202
    # send notice to user who requested recall to pick up item
203
    my $letter = C4::Letters::GetPreparedLetter (
204
        module => 'circulation',
205
        letter_code => 'PICKUP_RECALLED_ITEM',
206
        branchcode => $recall->branchcode,
207
        tables => {
208
            'biblio', $biblio->biblionumber,
209
            'borrowers', $recall_borrower->borrowernumber,
210
            'items', $item->itemnumber,
211
            'recalls', $recall->recall_id,
212
        },
213
    );
214
    C4::Message->enqueue($letter, $recall_borrower->unblessed, 'email');
190
}
215
}
191
216
192
my $borrower;
217
my $borrower;
193
- 

Return to bug 19532