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 under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along
19 # with Koha; if not, write to the Free Software Foundation, Inc.,
20 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 use C4::Bookseller qw/ GetBookSellerFromId /;
37 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
39 template_name => "acqui/z3950_search.tmpl",
43 flagsrequired => { acquisition => 'order_manage' },
49 my $dbh = C4::Context->dbh;
50 my $biblionumber = $input->param('biblionumber')||0;
51 my $frameworkcode = $input->param('frameworkcode')||'';
52 my $title = $input->param('title');
53 my $author = $input->param('author');
54 my $isbn = $input->param('isbn');
55 my $issn = $input->param('issn');
56 my $lccn = $input->param('lccn');
57 my $lccall = $input->param('lccall');
58 my $subject = $input->param('subject');
59 my $dewey = $input->param('dewey');
60 my $controlnumber = $input->param('controlnumber');
61 my $op = $input->param('op')||'';
62 my $booksellerid = $input->param('booksellerid');
63 my $basketno = $input->param('basketno');
65 my $page = $input->param('current_page') || 1;
66 $page = $input->param('goto_page') if $input->param('changepage_goto');
69 my $frameworks = getframeworks;
70 my @frameworkcodeloop;
71 foreach my $thisframeworkcode ( keys %$frameworks ) {
73 value => $thisframeworkcode,
74 frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
76 if ( $row{'value'} eq $frameworkcode){
77 $row{'active'} = 'true';
79 push @frameworkcodeloop, \%row;
82 my $vendor = GetBookSellerFromId($booksellerid);
83 $template->param( frameworkcode => $frameworkcode,
84 frameworkcodeloop => \@frameworkcodeloop,
85 booksellerid => $booksellerid,
86 basketno => $basketno,
87 name => $vendor->{'name'},
94 controlnumber=> $controlnumber,
95 biblionumber => $biblionumber,
100 if ( $op ne "do_search" ) {
101 my $sth = $dbh->prepare("select id,host,name,checked from z3950servers order by host");
103 my $serverloop = $sth->fetchall_arrayref( {} );
105 serverloop => $serverloop,
106 opsearch => "search",
108 output_html_with_http_headers $input, $cookie, $template->output;
112 my @id = $input->param('id');
114 $template->param( emptyserverlist => 1 );
115 output_html_with_http_headers $input, $cookie, $template->output;
120 random => $input->param('random') || rand(1000000000),
121 biblionumber => $biblionumber,
130 controlnumber => $controlnumber,
134 Z3950Search($pars, $template);
135 output_html_with_http_headers $input, $cookie, $template->output;