Fix for Bug 2682 ("Approving Multiple Tags - Doesn't Work"). Processing based on value of submit buttons didn't take into account capitalization.

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
This commit is contained in:
Owen Leonard 2008-10-15 10:36:32 -05:00 committed by Galen Charlton
parent 143b757cfe
commit bc297e0b72
2 changed files with 6 additions and 6 deletions

View File

@ -232,11 +232,11 @@ Calendar.setup({
</h4>
<!-- TMPL_IF NAME="op_count" -->
<div class="message" id="main_status">
<div class="dialog message" id="main_status">
<!-- TMPL_IF EXPR="op eq 'approve'" --> Approved
<!-- TMPL_ELSIF EXPR="op eq 'reject'" --> Rejected
<!-- TMPL_ELSIF EXPR="op eq 'test'" --> Tested
<!-- TMPL_ELSE --> Unkown Operation (<!-- TMPL_VAR NAME="op" -->) on
<!-- TMPL_ELSE -->Unknown Operation (<!-- TMPL_VAR NAME="op" -->) on
<!-- /TMPL_IF -->
<!-- TMPL_VAR NAME="op_count" --> Term(s).
</div>

View File

@ -93,15 +93,15 @@ $op = $input->param('op') || 'none';
@tags = $input->param('tags');
$borrowernumber == 0 and push @errors, {op_zero=>1};
if ($op eq 'approve') {
if (lc($op) eq 'approve') {
foreach (@tags) {
whitelist($borrowernumber,$_) or push @errors, {failed_ok=>$_};
}
} elsif ($op eq 'reject' ) {
} elsif (lc($op) eq 'reject' ) {
foreach (@tags) {
blacklist($borrowernumber,$_) or push @errors, {failed_rej=>$_};
}
} elsif ($op eq 'test' ) {
} elsif (lc($op) eq 'test' ) {
my $tag = $input->param('test');
push @tags, $tag;
my $check = is_approved($tag);
@ -205,7 +205,7 @@ $debug and print STDERR "number of approval_rows: " . scalar(@$tagloop) . "rows\
$template->param(
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
offset => $offset, # req'd for EXPR
op => $op,
op => lc($op),
op_count => scalar(@tags),
script_name => $script_name,
approved => 0, # dummy value (also EXPR)