7 use C4::Auth; # get_template_and_user
8 use C4::Interface::CGI::Output;
12 my $title = $input->param('title');
13 my $author = $input->param('author');
14 my $note = $input->param('note');
15 my $copyrightdate =$input->param('copyrightdate');
16 my $publishercode = $input->param('publishercode');
17 my $volumedesc = $input->param('volumedesc');
18 my $publicationyear = $input->param('publicationyear');
19 my $place = $input->param('place');
20 my $isbn = $input->param('isbn');
21 my $status = $input->param('status');
22 my $suggestedbyme = $input->param('suggestedbyme');
23 my $op = $input->param('op');
24 $op = 'else' unless $op;
26 my $dbh = C4::Context->dbh;
27 my ($template, $borrowernumber, $cookie)
28 = get_template_and_user({template_name => "opac-suggestions.tmpl",
32 flagsrequired => {borrow => 1},
34 if ($op eq "add_confirm") {
35 &newsuggestion($borrowernumber,$title,$author,$publishercode,$note,$copyrightdate,$volumedesc,$publicationyear,$place,$isbn,'');
36 # empty fields, to avoid filter in "searchsuggestion"
42 $publicationyear = '';
48 if ($op eq "delete_confirm") {
49 my @delete_field = $input->param("delete_field");
50 foreach my $delete_field (@delete_field) {
51 &delsuggestion($borrowernumber,$delete_field);
56 my $suggestions_loop= &searchsuggestion($borrowernumber,$author,$title,$publishercode,$status,$suggestedbyme);
57 $template->param(suggestions_loop => $suggestions_loop,
60 publishercode => $publishercode,
62 suggestedbyme => $suggestedbyme,
64 suggestion => C4::Context->preference("suggestion"),
65 virtualshelves => C4::Context->preference("virtualshelves"),
67 output_html_with_http_headers $input, $cookie, $template->output;