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

(-)a/C4/Letters.pm (+1 lines)
Lines 843-848 sub _parseletter_sth { Link Here
843
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
843
    ($table eq 'aqorders'     )    ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
844
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
844
    ($table eq 'opac_news'    )    ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
845
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
845
    ($table eq 'article_requests') ? "SELECT * FROM $table WHERE             id = ?"                                  :
846
    ($table eq 'recalls'      )    ? "SELECT * FROM $table WHERE      recall_id = ?"                                  :
846
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
847
    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE verification_token = ?" :
847
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
848
    ($table eq 'subscription') ? "SELECT * FROM $table WHERE subscriptionid = ?" :
848
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
849
    ($table eq 'serial') ? "SELECT * FROM $table WHERE serialid = ?" :
(-)a/circ/returns.pl (-2 / +26 lines)
Lines 46-51 use C4::Members; Link Here
46
use C4::Members::Messaging;
46
use C4::Members::Messaging;
47
use C4::Koha;   # FIXME : is it still useful ?
47
use C4::Koha;   # FIXME : is it still useful ?
48
use C4::RotatingCollections;
48
use C4::RotatingCollections;
49
use C4::Letters;
50
use C4::Message;
49
use Koha::AuthorisedValues;
51
use Koha::AuthorisedValues;
50
use Koha::DateUtils;
52
use Koha::DateUtils;
51
use Koha::Calendar;
53
use Koha::Calendar;
Lines 55-60 use Koha::Holds; Link Here
55
use Koha::Items;
57
use Koha::Items;
56
use Koha::Patrons;
58
use Koha::Patrons;
57
use Koha::Recalls;
59
use Koha::Recalls;
60
use Koha::IssuingRules;
61
use Koha::Biblios;
58
62
59
my $query = new CGI;
63
my $query = new CGI;
60
64
Lines 192-198 if ( $query->param('reserve_id') ) { Link Here
192
196
193
if ( $query->param('recall_id') ){
197
if ( $query->param('recall_id') ){
194
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
198
    my $recall = Koha::Recalls->find(scalar $query->param('recall_id'));
195
    $recall->update({ status => 'W', waitingdate => dt_from_string() });
199
    my $recall_borrower = $recall->borrower;
200
    my $item = Koha::Items->find($recall->itemnumber);
201
    my $biblio = Koha::Biblios->find($item->biblionumber);
202
203
    my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $recall_borrower->categorycode, itemtype => $item->itype, branchcode => $item->holdingbranch });
204
    my $shelf_time = $issuing_rule->recall_shelf_time || C4::Context->preference('RecallsMaxPickUpDelay');
205
    my $expirationdate = dt_from_string()->add( $issuing_rule->lengthunit => $shelf_time );
206
    $recall->update({ status => 'W', waitingdate => dt_from_string(), expirationdate => $expirationdate });
207
208
    # send notice to user who requested recall to pick up item
209
    my $letter = C4::Letters::GetPreparedLetter (
210
        module => 'circulation',
211
        letter_code => 'PICKUP_RECALLED_ITEM',
212
        branchcode => $recall->branchcode,
213
        tables => {
214
            'biblio', $biblio->biblionumber,
215
            'borrowers', $recall_borrower->borrowernumber,
216
            'items', $item->itemnumber,
217
            'recalls', $recall->recall_id,
218
        },
219
    );
220
    C4::Message->enqueue($letter, $recall_borrower->unblessed, 'email');
196
}
221
}
197
222
198
my $borrower;
223
my $borrower;
199
- 

Return to bug 19532