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 under the
9 # terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 2 of the License, or (at your option) any later
13 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with Koha; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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
100 use Koha
::Acquisition
::Bookseller
;
104 # getting the CGI params
105 my $basketno = $input->param('basketno');
106 my $booksellerid = $input->param('booksellerid');
107 my $author = $input->param('author');
108 my $title = $input->param('title');
109 my $publishercode = $input->param('publishercode');
110 my $op = $input->param('op');
111 my $suggestionid = $input->param('suggestionid');
112 my $duplicateNumber = $input->param('duplicateNumber');
113 my $uncertainprice = $input->param('uncertainprice');
115 $op = 'else' unless $op;
117 my $dbh = C4
::Context
->dbh;
118 my ( $template, $borrowernumber, $cookie ) = get_template_and_user
(
120 template_name
=> "acqui/newordersuggestion.tt",
123 flagsrequired
=> { acquisition
=> 'order_manage' },
127 if ( $op eq 'connectDuplicate' ) {
128 ConnectSuggestionAndBiblio
( $suggestionid, $duplicateNumber );
131 # getting all suggestions.
132 my $suggestions_loop = SearchSuggestion
(
136 publishercode
=> $publishercode,
140 my $vendor = Koha
::Acquisition
::Bookseller
->fetch({ id
=> $booksellerid });
142 suggestions_loop
=> $suggestions_loop,
143 basketno
=> $basketno,
144 booksellerid
=> $booksellerid,
145 name
=> $vendor->{'name'},
146 loggedinuser
=> $borrowernumber,
150 output_html_with_http_headers
$input, $cookie, $template->output;