Adding Merge of two biblios from a virtualshelf
[koha_fer] / tags / review.pl
index c687034..421da4e 100755 (executable)
@@ -46,9 +46,9 @@ sub ajax_auth_cgi ($) {               # returns CGI object
        $debug and
        print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n";
        if ($auth_status ne "ok") {
-               output_ajax_with_http_headers $input,
+               output_with_http_headers $input, undef,
                        "window.alert('Your CGI session cookie ($sessid) is not current.  " . 
-                       "Please refresh the page and try again.');\n";
+                       "Please refresh the page and try again.');\n", 'js';
                exit 0;
        }
        $debug and print STDERR "AJAX request: " . Dumper($input),
@@ -72,7 +72,7 @@ if (is_ajax()) {
        if ($tag = $input->param('rej')) {
                $js_reply = (   blacklist($operator,$tag) ? 'success' : 'failure')  . "_reject('$tag');\n";
        }
-       output_ajax_with_http_headers $input, $js_reply;
+       output_with_http_headers $input, undef, $js_reply, 'js';
        exit;
 }
 
@@ -89,19 +89,19 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({
 });
 
 my ($op, @errors, @tags);
-$op   = $input->param('op') || 'none';
+$op   = lc($input->param('op')) || 'none';
 @tags = $input->param('tags');
 
 $borrowernumber == 0 and push @errors, {op_zero=>1};
-     if (lc($op) eq 'approve') {
+     if ($op eq 'approve') {
        foreach (@tags) {
                whitelist($borrowernumber,$_) or push @errors, {failed_ok=>$_};
        }
-} elsif (lc($op) eq 'reject' ) {
+} elsif ($op eq 'reject' ) {
        foreach (@tags) {
                blacklist($borrowernumber,$_) or push @errors, {failed_rej=>$_};
        }
-} elsif (lc($op) eq 'test'   ) {
+} elsif ($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 => lc($op),
+       op => $op,
        op_count => scalar(@tags),
        script_name => $script_name,
        approved => 0,          # dummy value (also EXPR)