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

Return to bug 19532