X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=tags%2Freview.pl;h=37d14121c218cd8724c8458d93e342b1c060f77f;hb=2e0e15485ecae556b77037443af1077291fe3673;hp=8ea282d58b227c49c6ae2870fbb1b173af6ebe2c;hpb=e76bb63ae4f3acd5bd69ca80fb16874c3876023a;p=koha_fer diff --git a/tags/review.pl b/tags/review.pl index 8ea282d58b..37d14121c2 100755 --- a/tags/review.pl +++ b/tags/review.pl @@ -30,9 +30,9 @@ use C4::Auth qw(:DEFAULT check_cookie_auth); use C4::Context; use C4::Dates qw(format_date format_date_in_iso); # use C4::Koha; -use C4::Output 3.02 qw(:html :ajax pagination_bar); +use C4::Output qw(:html :ajax pagination_bar); use C4::Debug; -use C4::Tags 0.03 qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved); +use C4::Tags qw(get_tags get_approval_rows approval_counts whitelist blacklist is_approved); my $script_name = "/cgi-bin/koha/tags/review.pl"; my $needed_flags = { tools => 'moderate_tags' }; # FIXME: replace when more specific permission is created. @@ -41,7 +41,7 @@ sub ajax_auth_cgi ($) { # returns CGI object my $needed_flags = shift; my %cookies = fetch CGI::Cookie; my $input = CGI->new; - my $sessid = $cookies{'CGISESSID'}->value || $input->param('CGISESSID'); + my $sessid = $cookies{'CGISESSID'}->value; my ($auth_status, $auth_sessid) = check_cookie_auth($sessid, $needed_flags); $debug and print STDERR "($auth_status, $auth_sessid) = check_cookie_auth($sessid," . Dumper($needed_flags) . ")\n"; @@ -89,7 +89,12 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ }); my ($op, @errors, @tags); -$op = lc($input->param('op')) || 'none'; + +foreach (qw( approve reject test )) { + $op = $_ if ( $input->param("op-$_") ); +} +$op ||= 'none'; + @tags = $input->param('tags'); $borrowernumber == 0 and push @errors, {op_zero=>1}; @@ -197,9 +202,6 @@ if ($filter = $input->param('approved_by')) { # borrowernumber from link } $debug and print STDERR "filters: " . Dumper(\%filters); my $tagloop = get_approval_rows(\%filters); -for ( @{$tagloop} ) { - $_->{date_approved} = format_date( $_->{date_approved} ); -} my $qstring = $input->query_string; $qstring =~ s/([&;])*\blimit=\d+//; # remove pagination var $qstring =~ s/^;+//; # remove leading delims @@ -207,7 +209,6 @@ $qstring = "limit=$pagesize" . ($qstring ? '&' . $qstring : ''); $debug and print STDERR "number of approval_rows: " . scalar(@$tagloop) . "rows\n"; (scalar @errors) and $template->param(message_loop=>\@errors); $template->param( - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), offset => $offset, # req'd for EXPR op => $op, op_count => scalar(@tags),