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

(-)a/C4/Letters.pm (+1 lines)
Lines 749-754 sub _parseletter_sth { Link Here
749
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
749
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
750
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
750
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
751
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
751
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
752
    ($table eq 'recalls'      )    ? "SELECT * FROM $table WHERE      recall_id = ?"                                  :
752
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
753
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
753
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
754
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
754
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
755
    ($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 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
- 

Return to bug 19532