Bug 19532: (follow-up) aria-hidden attr on OPAC, and more
[koha.git] / recalls / recalls_queue.pl
1 #!/usr/bin/perl
2
3 # Copyright 2020 Aleisha Amohia <aleisha@catalyst.net.nz>
4 #
5 # This file is part of Koha.
6 # Koha is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # Koha is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with Koha; if not, see <http://www.gnu.org/licenses>.
18
19 use Modern::Perl;
20 use CGI qw ( -utf8 );
21 use C4::Auth qw( get_template_and_user );
22 use C4::Output qw( output_html_with_http_headers );
23 use Koha::BiblioFrameworks;
24
25 my $query = new CGI;
26 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
27     {
28       template_name   => "recalls/recalls_queue.tt",
29       query           => $query,
30       type            => "intranet",
31       flagsrequired   => { recalls => 'manage_recalls' },
32       debug           => 1,
33     }
34 );
35
36 my $op = $query->param('op') || 'list';
37 my @recall_ids = $query->multi_param('recall_ids');
38 if ( $op eq 'cancel_multiple_recalls' ) {
39     foreach my $id ( @recall_ids ) {
40         Koha::Recalls->find( $id )->set_cancelled;
41     }
42     $op = 'list'
43 }
44 elsif ( $op eq 'list' ) {
45     my $recalls = Koha::Recalls->search({ old => undef });
46     $template->param(
47         recalls => $recalls,
48         checkboxes => 1,
49     );
50 }
51
52 # Checking if there is a Fast Cataloging Framework
53 $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );
54
55 # writing the template
56 output_html_with_http_headers $query, $cookie, $template->output;