Commit 268fc216 authored by simith's avatar simith Committed by Tomas Cohen Arazi

Bug 12505 - Acq claim: Show error message when no order is selected

If no order is selected on the acq claim page when clicking
'Claim order' an ugly perl error message is displayed.

This patch corrects the behaviour to display a human readable
'No order selected'
instead.
Signed-off-by: default avatarPaola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer's avatarKatrin Fischer <Katrin.Fischer.83@web.de>
Reworded commit message to reflect what the patch achieves.
Works as described and passes tests.
Signed-off-by: Tomas Cohen Arazi's avatarTomas Cohen Arazi <tomascohen@gmail.com>
parent 9958cce5
......@@ -324,6 +324,12 @@ sub SendAlerts {
LEFT JOIN aqbooksellers ON subscription.aqbooksellerid=aqbooksellers.id
WHERE serial.serialid IN (
};
if (!@$externalid){
carp "No Order seleted";
return { error => "no_order_seleted" };
}
$strsth .= join( ",", @$externalid ) . ")";
my $sthorders = $dbh->prepare($strsth);
$sthorders->execute;
......
......@@ -116,6 +116,8 @@ if ($op and $op eq "send_alert"){
$template->param(error_claim => $@);
} elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_email" ) {
$template->{VARS}->{'error_claim'} = "no_email";
} elsif ( ref $err and exists $err->{error} and $err->{error} eq "no_order_seleted"){
$template->{VARS}->{'error_claim'} = "no_order_seleted";
} else {
$template->{VARS}->{'info_claim'} = 1;
}
......
......@@ -83,6 +83,8 @@ $(document).ready(function() {
[% IF error_claim %]
[% IF ( error_claim == "no_email" ) %]
<div class="error">This vendor has no email</div>
[% ELSIF ( error_claim == "no_order_seleted" ) %]
<div class="error">No order selected</div>
[% ELSE %]
<div class="error">[% error_claim %]</div>
[% END %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment