@@ -, +, @@ --- C4/Letters.pm | 2 +- acqui/lateorders.pl | 5 ++++- .../prog/en/modules/acqui/lateorders.tt | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) --- a/C4/Letters.pm +++ a/C4/Letters.pm @@ -399,7 +399,7 @@ sub SendAlerts { logaction( "ACQUISITION", "CLAIM ISSUE", undef, "To=" . $mail{To} . " Title=" . $innerletter->{title} . " Content=" . $innerletter->{content} ) if $type eq 'claimissues'; } } else { - die "This bookseller has no email\n"; + return {error => "no_email" }; } warn "sending to From $userenv->{emailaddress} subj $innerletter->{title} Mess $innerletter->{content}" if $debug; --- a/acqui/lateorders.pl +++ a/acqui/lateorders.pl @@ -78,12 +78,15 @@ unless ($delay =~ /^\d{1,3}$/) { if ($op and $op eq "send_alert"){ my @ordernums = $input->param("claim_for");# FIXME: Fallback values? + my $err; eval { - SendAlerts( 'claimacquisition', \@ordernums, $input->param("letter_code") ); # FIXME: Fallback value? + $err = SendAlerts( 'claimacquisition', \@ordernums, $input->param("letter_code") ); # FIXME: Fallback value? AddClaim ( $_ ) for @ordernums; }; if ( $@ ) { $template->param(error_claim => $@); + } elsif ( defined $err->{error} and $err->{error} eq "no_email" ) { + $template->{VARS}->{'error_claim'} = "no_email"; } else { $template->{VARS}->{'info_claim'} = 1; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt @@ -35,7 +35,11 @@ $(document).ready(function() {
[% IF error_claim %] -
[% error_claim %]
+ [% IF ( error_claim == "no_email" ) %] +
This bookseller has no email
+ [% ELSE %] +
[% error_claim %]
+ [% END %] [% END %] [% IF info_claim %]
Email has been sent.
@@ -62,7 +66,6 @@ $(document).ready(function() { Basket Claims count Claimed date - [% IF Supplier %] Check all
Uncheck all [% ELSE %] --