From 6c2984e78a5a8e26c995523655a9b86442813318 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 30 Dec 2011 10:34:03 +0100 Subject: [PATCH] Bug 5347: Set translatable the "no email" error Signed-off-by: Katrin Fischer This bookseller has no email shows up correctly, when vendor has no email address. Small change made: Changed bookseller to vendor. --- C4/Letters.pm | 2 +- acqui/lateorders.pl | 5 ++++- .../intranet-tmpl/prog/en/modules/acqui/lateorders.tt | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 5e3089bda5..28c6984c61 100644 --- a/C4/Letters.pm +++ b/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; diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl index 998899e620..55031ecc9b 100755 --- a/acqui/lateorders.pl +++ b/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; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt index 5ce1faebd6..cca2d8fdcf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt +++ b/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 vendor 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 %] -- 2.39.5