3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
16 # Suite 330, Boston, MA 02111-1307 USA
21 use C4
::Auth
; # get_template_and_user
26 my $title = $input->param('title');
27 my $author = $input->param('author');
28 my $note = $input->param('note');
29 my $copyrightdate = $input->param('copyrightdate');
30 my $publishercode = $input->param('publishercode');
31 my $volumedesc = $input->param('volumedesc');
32 my $publicationyear = $input->param('publicationyear');
33 my $place = $input->param('place');
34 my $isbn = $input->param('isbn');
35 my $status = $input->param('status');
36 my $suggestedbyme = $input->param('suggestedbyme');
37 my $op = $input->param('op');
38 $op = 'else' unless $op;
40 my ( $template, $borrowernumber, $cookie );
42 my $dbh = C4
::Context
->dbh;
44 if ( C4
::Context
->preference("AnonSuggestions") ) {
45 ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
47 template_name
=> "opac-suggestions.tmpl",
53 if ( !$borrowernumber ) {
54 $borrowernumber = C4
::Context
->preference("AnonSuggestions");
58 ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
60 template_name
=> "opac-suggestions.tmpl",
68 if ( $op eq "add_confirm" ) {
70 $borrowernumber, $title, $author, $publishercode,
71 $note, $copyrightdate, $volumedesc, $publicationyear,
75 # empty fields, to avoid filter in "SearchSuggestion"
81 $publicationyear = '';
87 if ( $op eq "delete_confirm" ) {
88 my @delete_field = $input->param("delete_field");
89 foreach my $delete_field (@delete_field) {
90 &DelSuggestion
( $borrowernumber, $delete_field );
95 my $suggestions_loop =
96 &SearchSuggestion
( $borrowernumber, $author, $title, $publishercode, $status,
99 suggestions_loop
=> $suggestions_loop,
102 publishercode
=> $publishercode,
104 suggestedbyme
=> $suggestedbyme,
109 output_html_with_http_headers
$input, $cookie, $template->output;