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

(-)a/C4/Acquisition.pm (+1 lines)
Lines 3028-3033 sub NotifyOrderUsers { Link Here
3028
            module      => 'acquisition',
3028
            module      => 'acquisition',
3029
            letter_code => 'ACQ_NOTIF_ON_RECEIV',
3029
            letter_code => 'ACQ_NOTIF_ON_RECEIV',
3030
            branchcode  => $library->{branchcode},
3030
            branchcode  => $library->{branchcode},
3031
            lang        => $borrower->{lang},
3031
            tables      => {
3032
            tables      => {
3032
                'branches'    => $library,
3033
                'branches'    => $library,
3033
                'borrowers'   => $borrower,
3034
                'borrowers'   => $borrower,
(-)a/C4/Circulation.pm (+2 lines)
Lines 3474-3479 sub SendCirculationAlert { Link Here
3474
                letter_code => $type,
3474
                letter_code => $type,
3475
                branchcode => $branch,
3475
                branchcode => $branch,
3476
                message_transport_type => $_,
3476
                message_transport_type => $_,
3477
                lang => $borrower->{lang},
3477
                tables => {
3478
                tables => {
3478
                    $issues_table => $item->{itemnumber},
3479
                    $issues_table => $item->{itemnumber},
3479
                    'items'       => $item->{itemnumber},
3480
                    'items'       => $item->{itemnumber},
Lines 3491-3496 sub SendCirculationAlert { Link Here
3491
                letter_code => $type,
3492
                letter_code => $type,
3492
                branchcode => $branch,
3493
                branchcode => $branch,
3493
                message_transport_type => $_,
3494
                message_transport_type => $_,
3495
                lang => $borrower->{lang},
3494
                tables => {
3496
                tables => {
3495
                    $issues_table => $item->{itemnumber},
3497
                    $issues_table => $item->{itemnumber},
3496
                    'items'       => $item->{itemnumber},
3498
                    'items'       => $item->{itemnumber},
(-)a/C4/Members.pm (+3 lines)
Lines 1542-1547 sub IssueSlip { Link Here
1542
    # FIXME Check callers before removing this statement
1542
    # FIXME Check callers before removing this statement
1543
    #return unless $borrowernumber;
1543
    #return unless $borrowernumber;
1544
1544
1545
    my $patron = Koha::Patrons->find( $borrowernumber );
1546
1545
    my @issues = @{ GetPendingIssues($borrowernumber) };
1547
    my @issues = @{ GetPendingIssues($borrowernumber) };
1546
1548
1547
    for my $issue (@issues) {
1549
    for my $issue (@issues) {
Lines 1602-1607 sub IssueSlip { Link Here
1602
        module => 'circulation',
1604
        module => 'circulation',
1603
        letter_code => $letter_code,
1605
        letter_code => $letter_code,
1604
        branchcode => $branch,
1606
        branchcode => $branch,
1607
        lang => $patron->lang,
1605
        tables => {
1608
        tables => {
1606
            'branches'    => $branch,
1609
            'branches'    => $branch,
1607
            'borrowers'   => $borrowernumber,
1610
            'borrowers'   => $borrowernumber,
(-)a/C4/Overdues.pm (+3 lines)
Lines 995-1000 sub parse_overdues_letter { Link Here
995
        return unless ( exists $params->{$required} && $params->{$required} );
995
        return unless ( exists $params->{$required} && $params->{$required} );
996
    }
996
    }
997
997
998
    my $patron = Koha::Patrons->find( $params->{borrowernumber} );
999
998
    my $substitute = $params->{'substitute'} || {};
1000
    my $substitute = $params->{'substitute'} || {};
999
    $substitute->{today} ||= output_pref( { dt => dt_from_string, dateonly => 1} );
1001
    $substitute->{today} ||= output_pref( { dt => dt_from_string, dateonly => 1} );
1000
1002
Lines 1035-1040 sub parse_overdues_letter { Link Here
1035
        module => 'circulation',
1037
        module => 'circulation',
1036
        letter_code => $params->{'letter_code'},
1038
        letter_code => $params->{'letter_code'},
1037
        branchcode => $params->{'branchcode'},
1039
        branchcode => $params->{'branchcode'},
1040
        lang => $patron->lang,
1038
        tables => \%tables,
1041
        tables => \%tables,
1039
        substitute => $substitute,
1042
        substitute => $substitute,
1040
        repeat => { item => \@item_tables },
1043
        repeat => { item => \@item_tables },
(-)a/C4/Reserves.pm (+4 lines)
Lines 232-237 sub AddReserve { Link Here
232
            module => 'reserves',
232
            module => 'reserves',
233
            letter_code => 'HOLDPLACED',
233
            letter_code => 'HOLDPLACED',
234
            branchcode => $branch,
234
            branchcode => $branch,
235
            lang => $borrower->{lang},
235
            tables => {
236
            tables => {
236
                'branches'    => $library,
237
                'branches'    => $library,
237
                'borrowers'   => $borrower,
238
                'borrowers'   => $borrower,
Lines 2007-2012 sub _koha_notify_reserve { Link Here
2007
    my %letter_params = (
2008
    my %letter_params = (
2008
        module => 'reserves',
2009
        module => 'reserves',
2009
        branchcode => $reserve->{branchcode},
2010
        branchcode => $reserve->{branchcode},
2011
        lang => $borrower->{lang},
2010
        tables => {
2012
        tables => {
2011
            'branches'       => $library,
2013
            'branches'       => $library,
2012
            'borrowers'      => $borrower,
2014
            'borrowers'      => $borrower,
Lines 2352-2357 sub ReserveSlip { Link Here
2352
    my ($branch, $borrowernumber, $biblionumber) = @_;
2354
    my ($branch, $borrowernumber, $biblionumber) = @_;
2353
2355
2354
#   return unless ( C4::Context->boolean_preference('printreserveslips') );
2356
#   return unless ( C4::Context->boolean_preference('printreserveslips') );
2357
    my $patron = Koha::Patrons->find( $borrowernumber );
2355
2358
2356
    my $reserve_id = GetReserveId({
2359
    my $reserve_id = GetReserveId({
2357
        biblionumber => $biblionumber,
2360
        biblionumber => $biblionumber,
Lines 2363-2368 sub ReserveSlip { Link Here
2363
        module => 'circulation',
2366
        module => 'circulation',
2364
        letter_code => 'HOLD_SLIP',
2367
        letter_code => 'HOLD_SLIP',
2365
        branchcode => $branch,
2368
        branchcode => $branch,
2369
        lang => $patron->lang,
2366
        tables => {
2370
        tables => {
2367
            'reserves'    => $reserve,
2371
            'reserves'    => $reserve,
2368
            'branches'    => $reserve->{branchcode},
2372
            'branches'    => $reserve->{branchcode},
(-)a/C4/Suggestions.pm (+2 lines)
Lines 502-512 sub ModSuggestion { Link Here
502
502
503
        # fetch the entire updated suggestion so that we can populate the letter
503
        # fetch the entire updated suggestion so that we can populate the letter
504
        my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} );
504
        my $full_suggestion = GetSuggestion( $suggestion->{suggestionid} );
505
        my $patron = Koha::Patrons->find( $full_suggestion->{suggestedby} );
505
        if (
506
        if (
506
            my $letter = C4::Letters::GetPreparedLetter(
507
            my $letter = C4::Letters::GetPreparedLetter(
507
                module      => 'suggestions',
508
                module      => 'suggestions',
508
                letter_code => $full_suggestion->{STATUS},
509
                letter_code => $full_suggestion->{STATUS},
509
                branchcode  => $full_suggestion->{branchcode},
510
                branchcode  => $full_suggestion->{branchcode},
511
                lang        => $patron->lang,
510
                tables      => {
512
                tables      => {
511
                    'branches'    => $full_suggestion->{branchcode},
513
                    'branches'    => $full_suggestion->{branchcode},
512
                    'borrowers'   => $full_suggestion->{suggestedby},
514
                    'borrowers'   => $full_suggestion->{suggestedby},
(-)a/Koha/ArticleRequest.pm (+1 lines)
Lines 108-113 sub notify { Link Here
108
            module                 => 'circulation',
108
            module                 => 'circulation',
109
            letter_code            => "AR_$status",
109
            letter_code            => "AR_$status",
110
            message_transport_type => 'email',
110
            message_transport_type => 'email',
111
            lang                   => $self->borrower->lang,
111
            tables                 => {
112
            tables                 => {
112
                article_requests => $self->id,
113
                article_requests => $self->id,
113
                borrowers        => $self->borrowernumber,
114
                borrowers        => $self->borrowernumber,
(-)a/Koha/Patron/Discharge.pm (+2 lines)
Lines 107-115 sub generate_as_pdf { Link Here
107
    my ($params) = @_;
107
    my ($params) = @_;
108
    return unless $params->{borrowernumber};
108
    return unless $params->{borrowernumber};
109
109
110
    my $patron = Koha::Patrons->find( $params->{borrowernumber} );
110
    my $letter = C4::Letters::GetPreparedLetter(
111
    my $letter = C4::Letters::GetPreparedLetter(
111
        module      => 'members',
112
        module      => 'members',
112
        letter_code => 'DISCHARGE',
113
        letter_code => 'DISCHARGE',
114
        lang        => $patron->lang,
113
        tables      => { borrowers => $params->{borrowernumber}, branches => $params->{'branchcode'}, },
115
        tables      => { borrowers => $params->{borrowernumber}, branches => $params->{'branchcode'}, },
114
    );
116
    );
115
117
(-)a/Koha/Patron/Password/Recovery.pm (+1 lines)
Lines 143-148 sub SendPasswordRecoveryEmail { Link Here
143
        module      => 'members',
143
        module      => 'members',
144
        letter_code => 'PASSWORD_RESET',
144
        letter_code => 'PASSWORD_RESET',
145
        branchcode  => $borrower->branchcode,
145
        branchcode  => $borrower->branchcode,
146
        lang        => $borrower->lang,
146
        substitute =>
147
        substitute =>
147
          { passwordreseturl => $uuidLink, user => $borrower->userid },
148
          { passwordreseturl => $uuidLink, user => $borrower->userid },
148
    );
149
    );
(-)a/circ/article-request-slip.pl (+3 lines)
Lines 25-30 use C4::Context; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::Auth;
26
use C4::Auth;
27
use Koha::ArticleRequests;
27
use Koha::ArticleRequests;
28
use Koha::Patrons;
28
29
29
my $cgi = new CGI;
30
my $cgi = new CGI;
30
31
Lines 43-53 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
43
my $ar = Koha::ArticleRequests->find($id);
44
my $ar = Koha::ArticleRequests->find($id);
44
45
45
$template->param( article_request => $ar );
46
$template->param( article_request => $ar );
47
my $patron = Koha::Patrons->find( $ar->borrowernumber );
46
48
47
my $slip = C4::Letters::GetPreparedLetter(
49
my $slip = C4::Letters::GetPreparedLetter(
48
    module                 => 'circulation',
50
    module                 => 'circulation',
49
    letter_code            => 'AR_SLIP',
51
    letter_code            => 'AR_SLIP',
50
    message_transport_type => 'print',
52
    message_transport_type => 'print',
53
    lang                   => $patron->lang,
51
    tables                 => {
54
    tables                 => {
52
        article_requests => $ar->id,
55
        article_requests => $ar->id,
53
        borrowers        => $ar->borrowernumber,
56
        borrowers        => $ar->borrowernumber,
(-)a/misc/cronjobs/advance_notices.pl (+3 lines)
Lines 58-63 use C4::Overdues; Link Here
58
use Koha::DateUtils;
58
use Koha::DateUtils;
59
use C4::Log;
59
use C4::Log;
60
use Koha::Libraries;
60
use Koha::Libraries;
61
use Koha::Patrons;
61
62
62
=head1 NAME
63
=head1 NAME
63
64
Lines 467-472 sub parse_letter { Link Here
467
    foreach my $required ( qw( letter_code borrowernumber ) ) {
468
    foreach my $required ( qw( letter_code borrowernumber ) ) {
468
        return unless exists $params->{$required};
469
        return unless exists $params->{$required};
469
    }
470
    }
471
    my $patron = Koha::Patrons->find( $params->{borrowernumber} );
470
472
471
    my %table_params = ( 'borrowers' => $params->{'borrowernumber'} );
473
    my %table_params = ( 'borrowers' => $params->{'borrowernumber'} );
472
474
Lines 486-491 sub parse_letter { Link Here
486
        module => 'circulation',
488
        module => 'circulation',
487
        letter_code => $params->{'letter_code'},
489
        letter_code => $params->{'letter_code'},
488
        branchcode => $table_params{'branches'},
490
        branchcode => $table_params{'branches'},
491
        lang => $patron->lang,
489
        substitute => $params->{'substitute'},
492
        substitute => $params->{'substitute'},
490
        tables     => \%table_params,
493
        tables     => \%table_params,
491
        message_transport_type => $params->{message_transport_type},
494
        message_transport_type => $params->{message_transport_type},
(-)a/misc/cronjobs/membership_expiry.pl (+4 lines)
Lines 130-135 use C4::Context; Link Here
130
use C4::Letters;
130
use C4::Letters;
131
use C4::Log;
131
use C4::Log;
132
132
133
use Koha::Patrons;
134
133
# These are defaults for command line options.
135
# These are defaults for command line options.
134
my $confirm;                              # -c: Confirm that the user has read and configured this script.
136
my $confirm;                              # -c: Confirm that the user has read and configured this script.
135
my $nomail;                               # -n: No mail. Will not send any emails.
137
my $nomail;                               # -n: No mail. Will not send any emails.
Lines 174-184 warn 'found ' . scalar( @$upcoming_mem_expires ) . ' soon expiring members' Link Here
174
# main loop
176
# main loop
175
$letter_type = 'MEMBERSHIP_EXPIRY' if !$letter_type;
177
$letter_type = 'MEMBERSHIP_EXPIRY' if !$letter_type;
176
foreach my $recent ( @$upcoming_mem_expires ) {
178
foreach my $recent ( @$upcoming_mem_expires ) {
179
    my $patron = Koha::Patrons->find( $recent->{borrowernumber} );
177
    my $from_address = $recent->{'branchemail'} || $admin_adress;
180
    my $from_address = $recent->{'branchemail'} || $admin_adress;
178
    my $letter =  C4::Letters::GetPreparedLetter(
181
    my $letter =  C4::Letters::GetPreparedLetter(
179
        module      => 'members',
182
        module      => 'members',
180
        letter_code => $letter_type,
183
        letter_code => $letter_type,
181
        branchcode  => $recent->{'branchcode'},
184
        branchcode  => $recent->{'branchcode'},
185
        lang        => $patron->lang,
182
        tables      => {
186
        tables      => {
183
            borrowers => $recent->{'borrowernumber'},
187
            borrowers => $recent->{'borrowernumber'},
184
            branches  => $recent->{'branchcode'},
188
            branches  => $recent->{'branchcode'},
(-)a/misc/cronjobs/notice_unprocessed_suggestions.pl (+1 lines)
Lines 58-63 for my $number_of_days (@days) { Link Here
58
                module      => 'suggestions',
58
                module      => 'suggestions',
59
                letter_code => 'TO_PROCESS',
59
                letter_code => 'TO_PROCESS',
60
                branchcode  => $patron->{branchcode},
60
                branchcode  => $patron->{branchcode},
61
                lang        => $patron->{lang},
61
                tables      => {
62
                tables      => {
62
                    suggestions => $suggestion->{suggestionid},
63
                    suggestions => $suggestion->{suggestionid},
63
                    branches    => $patron->{branchcode},
64
                    branches    => $patron->{branchcode},
(-)a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl (+1 lines)
Lines 123-128 foreach my $type (@types) { Link Here
123
        my $letter = C4::Letters::GetPreparedLetter(
123
        my $letter = C4::Letters::GetPreparedLetter(
124
            module      => $module,
124
            module      => $module,
125
            letter_code => $code,
125
            letter_code => $code,
126
            lang        => 'default', # It does not sound useful to send a lang here
126
            tables      => {
127
            tables      => {
127
                borrowers   => $issues->{'borrowernumber'},
128
                borrowers   => $issues->{'borrowernumber'},
128
                biblio      => $issues->{'biblionumber'},
129
                biblio      => $issues->{'biblionumber'},
(-)a/opac/opac-memberentry.pl (+1 lines)
Lines 153-158 if ( $action eq 'create' ) { Link Here
153
            my $letter = C4::Letters::GetPreparedLetter(
153
            my $letter = C4::Letters::GetPreparedLetter(
154
                module      => 'members',
154
                module      => 'members',
155
                letter_code => 'OPAC_REG_VERIFY',
155
                letter_code => 'OPAC_REG_VERIFY',
156
                lang        => 'default', # Patron does not have a preferred language defined yet
156
                tables      => {
157
                tables      => {
157
                    borrower_modifications => $verification_token,
158
                    borrower_modifications => $verification_token,
158
                },
159
                },
(-)a/opac/opac-shareshelf.pl (-1 / +4 lines)
Lines 169-179 sub notify_owner { Link Here
169
    my $toaddr = C4::Members::GetNoticeEmailAddress( $param->{owner} );
169
    my $toaddr = C4::Members::GetNoticeEmailAddress( $param->{owner} );
170
    return if !$toaddr;
170
    return if !$toaddr;
171
171
172
    my $patron = Koha::Patrons->find( $param->{owner} );
173
172
    #prepare letter
174
    #prepare letter
173
    my $letter = C4::Letters::GetPreparedLetter(
175
    my $letter = C4::Letters::GetPreparedLetter(
174
        module      => 'members',
176
        module      => 'members',
175
        letter_code => 'SHARE_ACCEPT',
177
        letter_code => 'SHARE_ACCEPT',
176
        branchcode  => C4::Context->userenv->{"branch"},
178
        branchcode  => C4::Context->userenv->{"branch"},
179
        lang        => $patron->lang,
177
        tables      => { borrowers => $param->{loggedinuser}, },
180
        tables      => { borrowers => $param->{loggedinuser}, },
178
        substitute  => { listname => $param->{shelfname}, },
181
        substitute  => { listname => $param->{shelfname}, },
179
    );
182
    );
Lines 239-244 sub send_invitekey { Link Here
239
            module      => 'members',
242
            module      => 'members',
240
            letter_code => 'SHARE_INVITE',
243
            letter_code => 'SHARE_INVITE',
241
            branchcode  => C4::Context->userenv->{"branch"},
244
            branchcode  => C4::Context->userenv->{"branch"},
245
            lang        => 'default', # Not sure how we could use something more useful else here
242
            tables      => { borrowers => $param->{loggedinuser}, },
246
            tables      => { borrowers => $param->{loggedinuser}, },
243
            substitute  => {
247
            substitute  => {
244
                listname => $param->{shelfname},
248
                listname => $param->{shelfname},
245
- 

Return to bug 17762