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
28 this script modify the status of a subscription to ACCEPTED or to REJECTED
58 * aorr_confirm : to confirm accept or reject
59 * delete_confirm : to confirm the deletion
71 use C4::Auth; # get_template_and_user
72 use C4::Interface::CGI::Output;
76 my $title = $input->param('title');
77 my $author = $input->param('author');
78 my $note = $input->param('note');
79 my $copyrightdate =$input->param('copyrightdate');
80 my $publishercode = $input->param('publishercode');
81 my $volumedesc = $input->param('volumedesc');
82 my $publicationyear = $input->param('publicationyear');
83 my $place = $input->param('place');
84 my $isbn = $input->param('isbn');
85 my $status = $input->param('status');
86 my $suggestedbyme = $input->param('suggestedbyme');
87 my $op = $input->param('op');
88 $op = 'else' unless $op;
90 my $dbh = C4::Context->dbh;
91 my ($template, $loggedinuser, $cookie)
92 = get_template_and_user({template_name => "suggestion/acceptorreject.tmpl",
96 flagsrequired => {borrow => 1},
98 if ($op eq "aorr_confirm") {
99 my @suggestionlist = $input->param("aorr");
100 foreach my $suggestion (@suggestionlist) {
101 if ($suggestion =~ /(A|R)(.*)/) {
102 my ($newstatus,$suggestionid) = ($1,$2);
103 $newstatus="REJECTED" if $newstatus eq "R";
104 $newstatus="ACCEPTED" if $newstatus eq "A";
105 ModStatus($suggestionid,$newstatus,$loggedinuser);
111 if ($op eq "delete_confirm") {
112 my @delete_field = $input->param("delete_field");
113 foreach my $delete_field (@delete_field) {
114 &DelSuggestion($loggedinuser,$delete_field);
119 my $suggestions_loop= &SearchSuggestion("","","","",'ASKED',"");
120 $template->param(suggestions_loop => $suggestions_loop,
122 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
123 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
124 IntranetNav => C4::Context->preference("IntranetNav"),
126 output_html_with_http_headers $input, $cookie, $template->output;