$debug and print STDERR "op: " . Dumper($operator) . "\n";
my ($tag, $js_reply);
if ($tag = $input->param('test')) {
- $js_reply = ( is_approved( $tag) ? 'success' : 'failure') . "_test('$tag');\n";
+ my $check = is_approved($tag);
+ $js_reply = ( $check >= 1 ? 'success' :
+ $check <= -1 ? 'failure' : 'indeterminate' ) . "_test('$tag');\n";
}
if ($tag = $input->param('ok')) {
$js_reply = ( whitelist($operator,$tag) ? 'success' : 'failure') . "_approve('$tag');\n";
@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);
$template->param(
test_term => $tag,
- (is_approved($tag) ? 'verdict_ok' : 'verdict_rej') => 1,
+ ( $check >= 1 ? 'verdict_ok' :
+ $check <= -1 ? 'verdict_rej' : 'verdict_indeterminate' ) => 1,
);
}
$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)