* updates to make acquisition compatible with suggestions & serials
[wip/koha-chris_n.git] / acqui / suggestion-select.pl
1 #!/usr/bin/perl
2 use strict;
3 require Exporter;
4 use CGI;
5 use HTML::Template;
6
7 use C4::Auth;       # get_template_and_user
8 use C4::Interface::CGI::Output;
9 use C4::Suggestions;
10
11 my $input = new CGI;
12
13 my $basketid = $input->param('basket');
14 my $supplierid = $input->param('booksellerid');
15
16 my $title = $input->param('title');
17 my $author = $input->param('author');
18 my $note = $input->param('note');
19 my $copyrightdate =$input->param('copyrightdate');
20 my $publishercode = $input->param('publishercode');
21 my $volumedesc = $input->param('volumedesc');
22 my $publicationyear = $input->param('publicationyear');
23 my $place = $input->param('place');
24 my $isbn = $input->param('isbn');
25 my $status = $input->param('status');
26 my $suggestedbyme = $input->param('suggestedbyme');
27 my $op = $input->param('op');
28 $op = 'else' unless $op;
29
30 my $dbh = C4::Context->dbh;
31 my ($template, $borrowernumber, $cookie)
32     = get_template_and_user({template_name => "acqui/suggestion-select.tmpl",
33                              type => "intranet",
34                              query => $input,
35                              authnotrequired => 1,
36                              flagsrequired => {borrow => 1},
37                          });
38
39 my $suggestions_loop= &searchsuggestion($borrowernumber,$author,$title,$publishercode,$status,$suggestedbyme);
40 $template->param(suggestions_loop => $suggestions_loop,
41                                 title => $title,
42                                 author => $author,
43                                 publishercode => $publishercode,
44                                 status => $status,
45                                 suggestedbyme => $suggestedbyme,
46                                 basket => $basketid,
47                                 supplierid => $supplierid,
48                                 "op_$op" => 1,
49 );
50 output_html_with_http_headers $input, $cookie, $template->output;