3 # Copyright 2020 Aleisha Amohia <aleisha@catalyst.net.nz>
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.
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.
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>.
21 use C4::Auth qw( get_template_and_user );
22 use C4::Output qw( output_html_with_http_headers );
28 my ($template, $loggedinuser, $cookie)= get_template_and_user(
30 template_name => "recalls/request.tt",
33 flagsrequired => { recalls => "manage_recalls" },
38 my $op = $input->param('op') || 'list';
39 my @recall_ids = $input->multi_param('recall_ids');
40 my $biblionumber = $input->param('biblionumber');
41 my $recalls = Koha::Recalls->search({ biblio_id => $biblionumber, completed => 0 });
42 my $biblio = Koha::Biblios->find( $biblionumber );
44 if ( $op eq 'cancel_multiple_recalls' ) {
45 foreach my $id ( @recall_ids ) {
46 Koha::Recalls->find( $id )->set_cancelled;
51 if ( $op eq 'list' ) {
52 $recalls = Koha::Recalls->search({ biblio_id => $biblionumber, completed => 0 });
53 $biblio = Koha::Biblios->find( $biblionumber );
61 C4::Search::enabled_staff_search_views,
64 output_html_with_http_headers $input, $cookie, $template->output;