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

(-)a/C4/Letters.pm (-1 / +1 lines)
Lines 567-573 sub SendAlerts { Link Here
567
            },
567
            },
568
            repeat => $dataorders,
568
            repeat => $dataorders,
569
            want_librarian => 1,
569
            want_librarian => 1,
570
        ) or return;
570
        ) or return { error => "no_letter" };
571
571
572
        # Remove the order tag
572
        # Remove the order tag
573
        $letter->{content} =~ s/<order>(.*?)<\/order>/$1/gxms;
573
        $letter->{content} =~ s/<order>(.*?)<\/order>/$1/gxms;
(-)a/acqui/basket.pl (-4 / +2 lines)
Lines 178-187 if ( $op eq 'delete_confirm' ) { Link Here
178
    };
178
    };
179
    if ( $@ ) {
179
    if ( $@ ) {
180
    $redirect_url .= '&email_error='.$@;
180
    $redirect_url .= '&email_error='.$@;
181
    } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) {
181
    } elsif ( ref $err and exists $err->{error} ) {
182
        $redirect_url .= '&email_error=no_email';
182
        $redirect_url .= '&email_error=' . $err->{error};
183
    } elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_basketno" ) {
184
        $redirect_url .= '&email_error=no_basketno';
185
    } else {
183
    } else {
186
        $redirect_url .= '&email_ok=1';
184
        $redirect_url .= '&email_ok=1';
187
    }
185
    }
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (+2 lines)
Lines 301-306 Link Here
301
                This vendor has no contact selected for sending orders to or is missing an e-mail address.
301
                This vendor has no contact selected for sending orders to or is missing an e-mail address.
302
            [% ELSIF ( email_error == "no_basketno" ) %]
302
            [% ELSIF ( email_error == "no_basketno" ) %]
303
                No basket given.
303
                No basket given.
304
            [% ELSIF ( email_error == "no_letter" ) %]
305
                There is no notice template with code ACQORDER defined.
304
            [% ELSE %]
306
            [% ELSE %]
305
                ERROR! - [% email_error %]
307
                ERROR! - [% email_error %]
306
            [% END %]
308
            [% END %]
(-)a/t/db_dependent/Letters.t (-2 / +8 lines)
Lines 18-24 Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Test::More tests => 78;
21
use Test::More tests => 80;
22
use Test::MockModule;
22
use Test::MockModule;
23
use Test::Warn;
23
use Test::Warn;
24
24
Lines 431-436 warning_is { Link Here
431
is($err, 1, "Successfully sent order.");
431
is($err, 1, "Successfully sent order.");
432
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent order");
432
is($mail{'To'}, 'testemail@mydomain.com', "mailto correct in sent order");
433
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Order notice text constructed successfully');
433
is($mail{'Message'}, 'my vendor|John Smith|Ordernumber ' . $ordernumber . ' (Silence in the library) (1 ordered)', 'Order notice text constructed successfully');
434
435
$dbh->do(q{DELETE FROM letter WHERE code = 'TESTACQORDER';});
436
warning_like {
437
    $err = SendAlerts( 'orderacquisition', $basketno , 'TESTACQORDER' ) }
438
    qr/No orderacquisition TESTACQORDER letter transported by email/,
439
    "GetPreparedLetter warns about missing notice template";
440
is($err->{'error'}, 'no_letter', "No TESTACQORDER letter was defined.");
434
}
441
}
435
442
436
443
437
- 

Return to bug 5260