3 # Copyright 2006 Biblibre
4 # Parts Copyright 2011 PTFS Europe
6 # This file is part of Koha.
8 # Koha is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # Koha is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Koha; if not, see <http://www.gnu.org/licenses>.
27 this script allow to add an order from a existing suggestion.
28 The suggestion must have 'ACCEPTED' as status.
36 the number of this basket.
40 the bookseller who sells this record.
44 to filter on title when searching among ACCEPTED suggestion.
48 to filter on author when searching among ACCEPTED suggestion.
52 to filter on note when searching among ACCEPTED suggestion.
62 the publication year of this record.
68 the isbn of this suggestion.
72 is the biblionumber to put to the new suggestion.
76 the id of the suggestion to select.
82 then call to the function : ConnectSuggestionAndBiblio.
83 i.e set the biblionumber of this suggestion.
92 #use warnings; FIXME - Bug 2505
95 use C4
::Auth
; # get_template_and_user
98 use C4
::Bookseller qw
/ GetBookSellerFromId /;
103 # getting the CGI params
104 my $basketno = $input->param('basketno');
105 my $booksellerid = $input->param('booksellerid');
106 my $author = $input->param('author');
107 my $title = $input->param('title');
108 my $publishercode = $input->param('publishercode');
109 my $op = $input->param('op');
110 my $suggestionid = $input->param('suggestionid');
111 my $duplicateNumber = $input->param('duplicateNumber');
112 my $uncertainprice = $input->param('uncertainprice');
114 $op = 'else' unless $op;
116 my $dbh = C4
::Context
->dbh;
117 my ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
119 template_name
=> "acqui/newordersuggestion.tt",
122 flagsrequired
=> { acquisition
=> 'order_manage' },
126 if ( $op eq 'connectDuplicate' ) {
127 ConnectSuggestionAndBiblio
( $suggestionid, $duplicateNumber );
130 # getting all suggestions.
131 my $suggestions_loop = SearchSuggestion
(
135 publishercode
=> $publishercode,
139 my $vendor = GetBookSellerFromId
($booksellerid);
141 suggestions_loop
=> $suggestions_loop,
142 basketno
=> $basketno,
143 booksellerid
=> $booksellerid,
144 name
=> $vendor->{'name'},
145 loggedinuser
=> $borrowernumber,
149 output_html_with_http_headers
$input, $cookie, $template->output;