3 # This is a completely new Z3950 clients search using async ZOOM -TG 02/11/06
4 # Copyright 2000-2002 Katipo Communications
5 # Copyright 2010 Catalyst IT
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it
10 # under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 3 of the License, or
12 # (at your option) any later version.
14 # Koha is distributed in the hope that it will be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with Koha; if not, see <http://www.gnu.org/licenses>.
31 use C4
::Bookseller qw
/ GetBookSellerFromId /;
34 my $biblionumber = $input->param('biblionumber')||0;
35 my $frameworkcode = $input->param('frameworkcode')||'';
36 my $title = $input->param('title');
37 my $author = $input->param('author');
38 my $isbn = $input->param('isbn');
39 my $issn = $input->param('issn');
40 my $lccn = $input->param('lccn');
41 my $lccall = $input->param('lccall');
42 my $subject = $input->param('subject');
43 my $dewey = $input->param('dewey');
44 my $controlnumber = $input->param('controlnumber');
45 my $op = $input->param('op')||'';
46 my $booksellerid = $input->param('booksellerid');
47 my $basketno = $input->param('basketno');
48 my $page = $input->param('current_page') || 1;
49 $page = $input->param('goto_page') if $input->param('changepage_goto');
52 my $frameworks = getframeworks
;
53 my @frameworkcodeloop;
54 foreach my $thisframeworkcode ( keys %$frameworks ) {
56 value
=> $thisframeworkcode,
57 frameworktext
=> $frameworks->{$thisframeworkcode}->{'frameworktext'},
59 if ( $row{'value'} eq $frameworkcode){
60 $row{'active'} = 'true';
62 push @frameworkcodeloop, \
%row;
65 my $vendor = GetBookSellerFromId
($booksellerid);
67 my ( $template, $loggedinuser, $cookie ) = get_template_and_user
(
69 template_name
=> "acqui/z3950_search.tt",
72 flagsrequired
=> { acquisition
=> 'order_manage' },
76 frameworkcode
=> $frameworkcode,
77 frameworkcodeloop
=> \
@frameworkcodeloop,
78 booksellerid
=> $booksellerid,
79 basketno
=> $basketno,
80 name
=> $vendor->{'name'},
87 controlnumber
=> $controlnumber,
88 biblionumber
=> $biblionumber,
93 if ( $op ne "do_search" ) {
94 my $schema = Koha
::Database
->new()->schema();
95 my $rs = $schema->resultset('Z3950server')->search(
97 recordtype
=> 'biblio',
98 servertype
=> ['zed', 'sru'],
100 { result_class
=> 'DBIx::Class::ResultClass::HashRefInflator' },
103 serverloop
=> [ $rs->all ],
104 opsearch
=> "search",
106 output_html_with_http_headers
$input, $cookie, $template->output;
110 my @id = $input->param('id');
112 $template->param( emptyserverlist
=> 1 );
113 output_html_with_http_headers
$input, $cookie, $template->output;
118 biblionumber
=> $biblionumber,
128 controlnumber
=> $controlnumber,
132 Z3950Search
($pars, $template);
133 output_html_with_http_headers
$input, $cookie, $template->output;