3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
26 use C4::Auth; # get_template_and_user
27 use C4::Interface::CGI::Output;
31 my $title = $input->param('title');
32 my $author = $input->param('author');
33 my $note = $input->param('note');
34 my $copyrightdate =$input->param('copyrightdate');
35 my $publishercode = $input->param('publishercode');
36 my $volumedesc = $input->param('volumedesc');
37 my $publicationyear = $input->param('publicationyear');
38 my $place = $input->param('place');
39 my $isbn = $input->param('isbn');
40 my $status = $input->param('status');
41 my $suggestedbyme = $input->param('suggestedbyme');
42 my $op = $input->param('op');
43 $op = 'else' unless $op;
45 my $dbh = C4::Context->dbh;
46 my ($template, $loggedinuser, $cookie)
47 = get_template_and_user({template_name => "suggestion/acceptorreject.tmpl",
51 flagsrequired => {borrow => 1},
53 if ($op eq "aorr_confirm") {
54 my @suggestionlist = $input->param("aorr");
55 foreach my $suggestion (@suggestionlist) {
56 if ($suggestion =~ /(A|R)(.*)/) {
57 my ($newstatus,$suggestionid) = ($1,$2);
58 $newstatus="REJECTED" if $newstatus eq "R";
59 $newstatus="ACCEPTED" if $newstatus eq "A";
60 ModStatus($suggestionid,$newstatus,$loggedinuser);
66 if ($op eq "delete_confirm") {
67 my @delete_field = $input->param("delete_field");
68 foreach my $delete_field (@delete_field) {
69 &DelSuggestion($loggedinuser,$delete_field);
74 my $suggestions_loop= &SearchSuggestion("","","","",'ASKED',"");
75 $template->param(suggestions_loop => $suggestions_loop,
77 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
78 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
79 IntranetNav => C4::Context->preference("IntranetNav"),
81 output_html_with_http_headers $input, $cookie, $template->output;