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>.
25 use C4::Auth qw( get_template_and_user );
26 use C4::Output qw( output_html_with_http_headers );
28 use C4::Breeding qw( Z3950Search );
30 use Koha::Acquisition::Booksellers;
31 use Koha::BiblioFrameworks;
34 my $biblionumber = $input->param('biblionumber')||0;
35 my $frameworkcode = $input->param('frameworkcode') || q{};
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 $srchany = $input->param('srchany');
44 my $stdid = $input->param('stdid');
45 my $dewey = $input->param('dewey');
46 my $controlnumber = $input->param('controlnumber');
47 my $publicationyear = $input->param('publicationyear');
48 my $op = $input->param('op')||'';
49 my $booksellerid = $input->param('booksellerid');
50 my $basketno = $input->param('basketno');
51 my $page = $input->param('current_page') || 1;
52 $page = $input->param('goto_page') if $input->param('changepage_goto');
55 my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
57 my $vendor = Koha::Acquisition::Booksellers->find( $booksellerid );
59 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
61 template_name => "acqui/z3950_search.tt",
64 flagsrequired => { acquisition => 'order_manage' },
68 frameworkcode => $frameworkcode,
69 frameworks => $frameworks,
70 booksellerid => $booksellerid,
71 basketno => $basketno,
72 name => $vendor->name,
79 controlnumber=> $controlnumber,
80 biblionumber => $biblionumber,
85 publicationyear => $publicationyear,
88 if ( $op ne "do_search" ) {
89 my $schema = Koha::Database->new()->schema();
90 my $rs = $schema->resultset('Z3950server')->search(
92 recordtype => 'biblio',
93 servertype => ['zed', 'sru'],
95 { result_class => 'DBIx::Class::ResultClass::HashRefInflator',
96 order_by => ['rank', 'servername'],
100 serverloop => [ $rs->all ],
101 opsearch => "search",
103 output_html_with_http_headers $input, $cookie, $template->output;
107 my @id = $input->multi_param('id');
109 $template->param( emptyserverlist => 1 );
110 output_html_with_http_headers $input, $cookie, $template->output;
115 biblionumber => $biblionumber,
125 controlnumber => $controlnumber,
128 publicationyear => $publicationyear,
130 Z3950Search($pars, $template);
131 output_html_with_http_headers $input, $cookie, $template->output;