Update issues_stats: add shelving location limit, replace cgi::scrolling_list, update...
[koha.git] / acqui / newordersuggestion.pl
blobcb8c2dc725ac16871d2b6f81e9b53e59f4ab04de
1 #!/usr/bin/perl
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
8 # version.
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
19 =head1 NAME
21 newordersuggestion.pl
23 =head1 DESCRIPTION
25 this script allow to add an order from a existing suggestion.
26 The suggestion must have 'ACCEPTED' as status.
28 =head1 CGI PARAMETERS
30 =over 4
32 =item basketno
34 the number of this basket.
36 =item booksellerid
38 the bookseller who sells this record.
40 =item title
42 to filter on title when searching among ACCEPTED suggestion.
44 =item author
46 to filter on author when searching among ACCEPTED suggestion.
48 =item note
50 to filter on note when searching among ACCEPTED suggestion.
52 =item copyrightdate
54 =item publishercode
56 =item volumedesc
58 =item publicationyear
60 the publication year of this record.
62 =item place
64 =item isbn
66 the isbn of this suggestion.
68 =item duplicateNumber
70 is the biblionumber to put to the new suggestion.
72 =item suggestionid
74 the id of the suggestion to select.
76 =item op
78 can be equal to
79 * connectDuplicate :
80 then call to the function : ConnectSuggestionAndBiblio.
81 i.e set the biblionumber of this suggestion.
82 * else :
83 is the default value.
85 =back
87 =cut
89 use strict;
90 require Exporter;
91 use CGI;
92 use C4::Auth; # get_template_and_user
93 use C4::Output;
94 use C4::Suggestions;
95 use C4::Biblio;
97 my $input = new CGI;
99 # getting the CGI params
100 my $basketno = $input->param('basketno');
101 my $supplierid = $input->param('booksellerid');
102 my $author = $input->param('author');
103 my $title = $input->param('title');
104 my $publishercode = $input->param('publishercode');
105 my $op = $input->param('op');
106 my $suggestionid = $input->param('suggestionid');
107 my $duplicateNumber = $input->param('duplicateNumber');
109 $op = 'else' unless $op;
111 my $dbh = C4::Context->dbh;
112 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
114 template_name => "acqui/newordersuggestion.tmpl",
115 type => "intranet",
116 query => $input,
117 authnotrequired => 1,
118 flagsrequired => { acquisition => 1 },
122 if ( $op eq 'connectDuplicate' ) {
123 ConnectSuggestionAndBiblio( $suggestionid, $duplicateNumber );
126 # getting all suggestions.
127 my $suggestions_loop =
128 &SearchSuggestion( $borrowernumber, $author, $title, $publishercode,'ACCEPTED',
129 -1 );
131 $template->param(
132 suggestions_loop => $suggestions_loop,
133 basketno => $basketno,
134 supplierid => $supplierid,
135 "op_$op" => 1,
138 output_html_with_http_headers $input, $cookie, $template->output;