Bugzilla – Attachment 72812 Details for
Bug 11361
Add a Z39.50 search page in the OPAC to let members search for records on remote Koha instances
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug 11361 - Add a Z39.50 search page in the OPAC to let members search for records on remote Koha instances
Bug-11361---Add-a-Z3950-search-page-in-the-OPAC-to.patch (text/plain), 29.89 KB, created by
Maksim Sen
on 2018-03-13 17:37:00 UTC
(
hide
)
Description:
Bug 11361 - Add a Z39.50 search page in the OPAC to let members search for records on remote Koha instances
Filename:
MIME Type:
Creator:
Maksim Sen
Created:
2018-03-13 17:37:00 UTC
Size:
29.89 KB
patch
obsolete
>From 08beddab7909fd381556bd000ea5ec3ad190f97a Mon Sep 17 00:00:00 2001 >From: Blou <philippe.blouin@inlibro.com> >Date: Wed, 10 Feb 2016 16:01:11 -0500 >Subject: [PATCH] Bug 11361 - Add a Z39.50 search page in the OPAC to let > members search for records on remote Koha instances > >This patch adds the OPACZ3950 preference which activates a "Z39.50 Search" page in the OPAC. > >This page can be used to let members search for biblio records on remote Koha instances. If the "Show" link is clicked in the results page, the user is then redirected to the remote Koha's OPAC to see the record's details. > >This feature can be useful if you have multiple libraries with their own Koha instance and you want your users to be able to search for books in your other libraries. > >Please note that this will only work with Koha instances. The links in the results page won't work with other normal Z39.50 servers. > >Sponsored-by: CCSR ( http://www.ccsr.qc.ca ) >--- > C4/Auth.pm | 1 + > C4/Breeding.pm | 11 +- > Koha/Schema/Result/Z3950server.pm | 16 ++ > admin/z3950servers.pl | 2 +- > installer/data/mysql/sysprefs.sql | 3 +- > installer/data/mysql/updatedatabase.pl | 10 + > .../prog/en/modules/admin/preferences/opac.pref | 6 + > .../prog/en/modules/admin/z3950servers.tt | 11 +- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 1 + > .../bootstrap/en/includes/opac-bottom.inc | 12 + > .../bootstrap/en/modules/opac-z3950-search.tt | 298 +++++++++++++++++++++ > opac/opac-z3950-search.pl | 117 ++++++++ > 12 files changed, 480 insertions(+), 8 deletions(-) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt > create mode 100755 opac/opac-z3950-search.pl > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index c3ad351..cddeb55 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -529,6 +529,7 @@ sub get_template_and_user { > OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"), > OPACUserCSS => "" . C4::Context->preference("OPACUserCSS"), > OpacAuthorities => C4::Context->preference("OpacAuthorities"), >+ OpacZ3950 => C4::Context->preference("OpacZ3950"), > opac_css_override => $ENV{'OPAC_CSS_OVERRIDE'}, > opac_search_limit => $opac_search_limit, > opac_limit_override => $opac_limit_override, >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index a17406b..5a71845 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -131,12 +131,11 @@ The second parameter $template is a Template object. The routine uses this param > =cut > > sub Z3950Search { >- my ($pars, $template)= @_; >+ my ($pars, $template, $fromopac)= @_; > > my @id= @{$pars->{id}}; > my $page= $pars->{page}; > my $biblionumber= $pars->{biblionumber}; >- > my $show_next = 0; > my $total_pages = 0; > my @results; >@@ -193,7 +192,7 @@ sub Z3950Search { > for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) { > if ( $oResult[$k]->record($i) ) { > undef $error; >- ( $res, $error ) = _handle_one_result( $oResult[$k]->record($i), $servers[$k], ++$imported, $biblionumber, $xslh ); #ignores error in sequence numbering >+ ( $res, $error ) = _handle_one_result( $oResult[$k]->record($i), $servers[$k], ++$imported, $biblionumber, $xslh, $fromopac ); #ignores error in sequence numbering > push @breeding_loop, $res if $res; > push @errconn, { server => $servers[$k]->{servername}, error => $error, seq => $i+1 } if $error; > } >@@ -263,7 +262,7 @@ sub _build_query { > } > > sub _handle_one_result { >- my ( $zoomrec, $servhref, $seq, $bib, $xslh )= @_; >+ my ( $zoomrec, $servhref, $seq, $bib, $xslh, $fromopac )= @_; > > my $raw= $zoomrec->raw(); > my $marcrecord; >@@ -275,7 +274,7 @@ sub _handle_one_result { > } > SetUTF8Flag($marcrecord); > my $error; >- ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh); >+ ( $marcrecord, $error ) = _do_xslt_proc($marcrecord, $servhref, $xslh) unless $fromopac; > > my $batch_id = GetZ3950BatchId($servhref->{servername}); > my $breedingid = AddBiblioToBatch($batch_id, $seq, $marcrecord, 'UTF-8', 0, 0); >@@ -291,6 +290,7 @@ sub _handle_one_result { > { > biblionumber => $bib, > server => $servhref->{servername}, >+ host => $servhref->{host}, > breedingid => $breedingid, > }, $marcrecord) if $breedingid; > return ( $row, $error ); >@@ -323,6 +323,7 @@ sub _do_xslt_proc { > sub _add_rowdata { > my ($row, $record)=@_; > my %fetch= ( >+ biblionumber => 'biblio.biblionumber', > title => 'biblio.title', > author => 'biblio.author', > isbn =>'biblioitems.isbn', >diff --git a/Koha/Schema/Result/Z3950server.pm b/Koha/Schema/Result/Z3950server.pm >index f2a5de2..0735bf1 100644 >--- a/Koha/Schema/Result/Z3950server.pm >+++ b/Koha/Schema/Result/Z3950server.pm >@@ -120,6 +120,18 @@ __PACKAGE__->table("z3950servers"); > data_type: 'longtext' > is_nullable: 1 > >+=head2 attributes >+ >+ data_type: 'varchar' >+ is_nullable: 1 >+ size: 255 >+ >+=head2 opac >+ >+ data_type: 'tinyint' >+ is_nullable: 1 >+ size: 1 >+ > =cut > > __PACKAGE__->add_columns( >@@ -167,6 +179,10 @@ __PACKAGE__->add_columns( > { data_type => "longtext", is_nullable => 1 }, > "add_xslt", > { data_type => "longtext", is_nullable => 1 }, >+ "attributes", >+ { data_type => "varchar", is_nullable => 1, size => 255 }, >+ "opac", >+ { data_type => "tinyint", is_nullable => 1, size => 1 }, > ); > > =head1 PRIMARY KEY >diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl >index d1fe85b..cfe4c74 100755 >--- a/admin/z3950servers.pl >+++ b/admin/z3950servers.pl >@@ -66,7 +66,7 @@ if( $op eq 'delete_confirmed' && $id ) { > $id = 0; > } elsif ( $op eq 'add_validated' ) { > my @fields=qw/host port db userid password rank syntax encoding timeout >- recordtype checked servername servertype sru_options sru_fields >+ recordtype checked servername servertype sru_options sru_fields attributes opac > add_xslt/; > my $formdata = _form_data_hashref( $input, \@fields ); > if( $id ) { >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 76bb2cc..e4c69d9 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -603,5 +603,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('XSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on intranet','Free'), > ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), > ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), >-('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') >+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), >+('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo') > ; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index e8121d0..86ff057 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -15613,6 +15613,16 @@ if( CheckVersion( $DBversion ) ) { > print "Upgrade to $DBversion done (Bug 13287 - Add system preference PurgeSuggestionsOlderThan)\n"; > } > >+$DBversion = "XXX"; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1);"); >+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo')"); >+ print "Add opac column to z3950servers table.\nAdd OPACZ3950 preference.\n"; >+ SetVersion($DBversion); >+} >+ >+ >+# DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index c44b109..930c25c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -410,6 +410,12 @@ OPAC: > no: "Don't allow" > - patrons to search your authority records. > - >+ - pref: OpacZ3950 >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - patrons to search for bibliographic records in other libraries via Z39.50. >+ - > - pref: opacbookbag > choices: > yes: Allow >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >index 8bf8483..8d2c1b2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >@@ -81,6 +81,13 @@ > <input type="checkbox" name="checked" id="checked" value="1" /> > [% END %] > </li> >+ <li><label for="opac">OPAC (Shown in OPAC Z39.50 search): </label> >+ [% IF ( server.opac ) %] >+ <input type="checkbox" size="1" name="opac" id="opac" value="1" checked="checked" /> >+ [% ELSE %] >+ <input type="checkbox" size="1" name="opac" id="opac" value="1" /> >+ [% END %] >+ </li> > <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" /> > </li> > >@@ -159,7 +166,7 @@ > You searched for [% searchfield |html %] > [% END %] > <table id="serverst"> >- <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th></th> >+ <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>Attributes</th><th>OPAC</th><th>Options</th> > </tr></thead> > <tbody> > [% FOREACH loo IN loop %] >@@ -172,6 +179,8 @@ > <span>Authority</span> > [% END %] > </td> >+ <td>[% loo.attributes %]</td> >+ <td>[% IF loo.opac %]X[% END %]</td> > <td> > <div class="dropdown"> > <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 184ea27..fe266a0 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -278,6 +278,7 @@ > [% IF ( Koha.Preference( 'UseCourseReserves' ) == 1 ) %]<li><a href="/cgi-bin/koha/opac-course-reserves.pl">Course reserves</a></li>[% END %] > [% IF Koha.Preference( 'OpacBrowser' ) == 1 %]<li><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a></li>[% END %] > [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]<li><a href="/cgi-bin/koha/opac-authorities-home.pl">Authority search</a></li>[% END %] >+ [% IF Koha.Preference( 'OpacZ3950' ) %]<li><span id="z3950searchOpac"><a target="_blank" href="#" >Z39.50 Search</a></span></li>[% END %] > [% IF ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'reviewson' ) == 1 ) && ( Koha.Preference( 'OpacShowRecentComments' ) == 1 ) ) %]<li><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a></li>[% END %] > [% IF Koha.Preference( 'TagsEnabled' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a></li>[% END %] > [% IF Koha.Preference( 'OpacCloud' ) == 1 %]<li><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a></li>[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >index 8827242..c352892 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -274,6 +274,18 @@ $(document).ready(function() { > //]]> > </script> > [% END %] >+[% IF Koha.Preference( 'OpacZ3950' ) %] >+<script type="text/javascript"> >+//<![CDATA[ >+ $(document).ready(function() { >+ $("#z3950searchOpac").click(function(){ >+ window.open("/cgi-bin/koha/opac-z3950-search.pl","z3950searchOpac",'width=800,height=550,location=yes,toolbar=no,scrollbars=yes,resize=yes'); >+ return false; >+ }); >+ }); >+//]]> >+</script> >+[% END %] > [% IF SCO_login %] > [% SET SCOUserJS = Koha.Preference('SCOUserJS') %] > [% IF ( SCOUserJS ) %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >new file mode 100644 >index 0000000..eda770d >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >@@ -0,0 +1,298 @@ >+[% USE Koha %] >+[% INCLUDE 'doc-head-open.inc' %] >+Koha › Z39.50/SRU search results >+[% INCLUDE 'doc-head-close.inc' %] >+[% INCLUDE 'greybox.inc' %] >+[% BLOCK cssinclude %][% END %] >+ <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >+ <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/staff-global.css" /> >+ >+ <style type="text/css"> >+ .linktools { background-color:#FFF;border-top:1px solid #DDD; border-left: 1px solid #DDD; border-right: 1px solid #666; border-bottom:1px solid #666;display: none; white-space: nowrap;} >+ .linktools a { font-size : 85%; text-decoration:none; padding:.3em;;background-color:#FFF; display:block;float:left;border-right:1px solid #DDD;} >+ .linktools a:hover { background-color:#EEE;color:#CC3300;border-right:1px solid #CCC;} >+ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; } >+ >+ .input-prepend.input-block-level { >+ display: table; >+ margin: 2px; >+ } >+ .input-prepend.input-block-level .add-on { >+ display: table-cell; >+ width: 1%; /* remove this if you want default bootstrap button width */ >+ } >+ .input-prepend.input-block-level > input { >+ box-sizing: border-box; /* use bootstrap mixin or include vendor variants */ >+ -moz-box-sizing: border-box; /* for Firefox */ >+ display: table; /* table-cell is not working well in Chrome for small widths */ >+ min-height: inherit; >+ width: 100%; >+ } >+ .input-prepend.input-block-level > input { >+ border-left: 0; >+ } >+ .marginbot{ >+ margin-bottom:10px; >+ } >+ </style> >+</head> >+[% IF ( opsearch ) %] >+<body id="cat_z3950_search"> >+[% ELSE %] >+<body style="padding:.5em;"> >+[% END %] >+ <div class="main"> >+ <div class="container-fluid"> >+[% search_fields = [ >+ { label => "ISBN", prop => 'isbn' }, >+ { label => "ISSN", prop => 'issn' }, >+ { label => "Title", prop => 'title' }, >+ { label => "Author", prop => 'author' }, >+ { label => "Subject Heading", prop => 'subject' }, >+ { label => "Keyword (any)", prop => 'srchany' }, >+ { label => "LC call number", prop => 'lccall' }, >+ { label => "Control no.", prop => 'controlnumber' }, >+ { label => "Dewey", prop => 'dewey' }, >+ { label => "Standard ID", prop => 'stdid' } >+] %] >+[% IF ( opsearch ) %] >+<div class="row-fluid"> >+ <h2>Z39.50/SRU search</h2> >+</div> >+<form method="post" action="opac-z3950-search.pl" name="f"> >+ <div class="row-fluid"> >+ <input type="hidden" name="op" id="op" value="do_search" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> >+ <div id="search_params" class="span6 form-horizontal"> >+ <h2>Search Parameters</h2> >+ <div id="search_field" class="well"> >+ [% FOREACH field IN search_fields %] >+ <div class="input-prepend input-block-level"> >+ <span class="add-on">[% field.label %]</span> >+ <input type="text" id="[% field.prop %]" name="[% field.prop %]" value="[% ${field.prop} %]" /> >+ </div> >+ [% END %] >+ </div> >+ <div class="control-group"> >+ <div calss="controls"> >+ <button onclick="$("form[name='f']").submit();" class="btn search-submit">Search</button> >+ <a href="#">Cancel</a> >+ </div> >+ </div> >+ </div> >+ <div class="span5"> >+ <h2> >+ Search targets >+ <span style="display: inline; font-size: 70%; padding-left: 1em;"> >+ <span class="checkall"> >+ <a id="CheckAll" href="#">Select all</a> >+ </span> >+ <span class="clearall"> >+ <a id="CheckNone" href="#">Clear all</a> >+ </span> >+ </span> >+ </h2> >+ <div id="z3950_search_targets" class="well checkboxed"> >+ [% FOREACH serverloo IN serverloop %] >+ <div class="input-group"> >+ <label for="z3950_[% serverloo.id %]"> >+ <input style="vertical-align:-2px" type="checkbox" name="id" id="z3950_[% serverloo.id %]" value="[% serverloo.id %]" /> >+ [% serverloo.servername %] >+ </label> >+ </div> >+ [% END %] >+ </div> >+ </div> >+</form> >+ >+[% ELSE %] >+<div class="row-fluid"> >+ <h2>Results</h2> >+ <p>You searched for: >+ [% FOREACH field IN search_fields %] >+ [% IF ( ${field.prop} ) %]<em>[% field.label %]: </em><span class=term>[% ${field.prop} %]</span> [% END %] >+ [% END %] >+ </p> >+</div> >+ [% IF ( errconn ) %] >+ <div class="alert alert-danger"> >+ <ul> >+ [% FOREACH errcon IN errconn %] >+ [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li> >+ [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li> >+ [% ELSIF ( errcon.error == 'xslt_err' ) %]<li>[% errcon.server %]: Warning: XSLT error on search result [% errcon.seq %]</li> >+ [% ELSE %]<li>[% errcon.server %] record [% errcon.seq %]: [% errcon.error %]</li> >+ [% END %] >+ [% END %] >+ </ul> >+ </div> >+ [% END %] >+<div class="row-fluid marginbot"> >+ <div class="span12"> >+ [% IF ( breeding_loop ) %] >+ <table id="resultst" class="table table-condensed"> >+ <thead> <tr> >+ <th>Server</th> >+ <th>Title</th> >+ <th>Author</th> >+ <th>Date</th> >+ <th>Edition</th> >+ <th>ISBN</th> >+ <th>LCCN</th> >+ <th>MARC</th> >+ <th>Card</th> >+ <th> </th> >+ </tr></thead> >+ <tbody>[% FOREACH breeding_loo IN breeding_loop %] >+ [% IF ( breeding_loo.breedingid ) %] >+ <tr id="row[% breeding_loo.breedingid %]"> >+ <td>[% breeding_loo.server %] </td> >+ <td>[% breeding_loo.title |html %]</td> >+ <td>[% breeding_loo.author %]</td> >+ <td>[% breeding_loo.date %]</td> >+ <td>[% breeding_loo.edition %]</td> >+ <td>[% breeding_loo.isbn %]</td> >+ <td>[% breeding_loo.lccn %]</td> >+ <td><a href="/cgi-bin/koha/opac-showmarc.pl?importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">MARC</a></td> >+ <td><a href="/cgi-bin/koha/opac-showmarc.pl?viewas=card&importid=[% breeding_loo.breedingid %]" title="MARC" rel="gb_page_center[600,500]">Card</a></td> >+ <td><a target="_blank" href="http://[% breeding_loo.host %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% breeding_loo.biblionumber %]">Show</a></td> >+ </tr> >+ [% END %] >+ [% END %]</tbody> >+ </table> >+ </div> >+</div> >+ >+<form method="post" action="opac-z3950-search.pl" id="page_form" name="page_form"> >+ <input type="hidden" name="op" id="op" value="do_search" /> >+ <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" /> >+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" /> >+ <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /> >+ [% FOREACH field IN search_fields %] >+ <input type="hidden" name="[% field.prop %]" value="[% ${field.prop} %]" /> >+ [% END %] >+ >+ [% FOREACH server IN servers %] >+ <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" /> >+ [% END %] >+[% IF total_pages > 1 %] >+ <div class="row-fluid"> >+ <div class="span4"> >+ <div class="input-prepend input-append"> >+ [% IF ( show_prevbutton ) %] >+ <button class="btn" type="button" name="changepage_prev" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();">Previous Page</button> >+ [% END %] >+ <span class="add-on">Page [% current_page %] / [% total_pages %]</span> >+ [% IF ( show_nextbutton ) %] >+ <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next Page</button> >+ [% END %] >+ </div> >+ </div> >+ <div class="span2 offset5"> >+ <div class="input-prepend input-append"> >+ <span class="add-on">Go to page</span> >+ <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" type="text"/> >+ <button class="btn" type="submit" name="changepage_goto" onclick="return validate_goto_page();">Go</button> >+ </div> >+ </div> >+[% END %] >+</form> >+ >+ >+[% ELSE %] >+ <div class="alert alert-warning">Nothing found.</div> >+[% END %] >+ <div class="row-fluid marginbot"> >+ <div class="span12"> >+ <a class="btn" href="/cgi-bin/koha/opac-z3950-search.pl">Try another search</a> >+ </div> >+ </div> >+</div> >+[% END %] >+ >+ </div> >+</div> >+ >+[% IF ( numberpending ) %]<h3 align="center">Still [% numberpending %] servers to search</h3>[% END %] >+ >+[% INCLUDE 'opac-bottom.inc' %] >+[% BLOCK jsinclude %][% END %] >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript" src="[% interface %]/[% theme %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >+ >+<script type="text/javascript"> >+//<![CDATA[ >+function Import(GetThisOne,biblionumber) { >+ opener.document.location="../cataloguing/addbiblio.pl?biblionumber="+biblionumber+"&z3950=1&frameworkcode=[% frameworkcode %]&breedingid="+GetThisOne; >+ window.close(); >+ return false; >+} >+ >+function closemenu(){ >+ $(".linktools").hide(); >+ $("tr").removeClass("selected"); >+} >+ >+$(document).ready(function(){ >+ $("#CheckAll").click(function(){ >+ $(".checkboxed").checkCheckboxes(); >+ return false; >+ }); >+ $("#CheckNone").click(function(){ >+ $(".checkboxed").unCheckCheckboxes(); >+ return false; >+ }); >+ $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sDom": 't', >+ "aoColumnDefs": [ >+ { "aTargets": [ -1,-2,-3 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 1 ], "sType": "nsb-nse" }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "bPaginate": false >+ })); >+ /* Inline edit/delete links */ >+ $("td").click(function(event){ >+ var $tgt = $(event.target); >+ var row = $(this).parent(); >+ $(".linktools").hide(); >+ $("tr").removeClass("selected"); >+ row.addClass("selected"); >+ if($tgt.is("a")||$tgt.is(":nth-child(8)")||$tgt.is(":nth-child(9)")||$tgt.is(":nth-child(10)")){ >+ //Don't show inline links for cells containing links of their own. >+ } else { >+ var position = $(this).offset(); >+ var top = position.top+5; >+ var left = position.left+5; >+ $(".linktools",row).show().css("position","absolute").css("top",top).css("left",left); >+ } >+ }); >+ $("form[name='f']").submit(function(){ >+ if ($('input[type=checkbox]').filter(':checked').length == 0) { >+ alert(_("Please choose at least one external target")); >+ return false; >+ } else { >+ $("*").css("cursor", "progress"); >+ return true; >+ } >+ }); >+}); >+ >+[% IF ( total_pages ) %] >+function validate_goto_page(){ >+ var page = $('#goto_page').val(); >+ if(isNaN(page)) { >+ alert(_("The page entered is not a number.")); >+ return false; >+ } >+ else if(page < 1 || page > [% total_pages %] ) { >+ alert(_("The page should be a number between 1 and %s.").format([% total_pages %])); >+ return false; >+ } >+ else { >+ return true; >+ } >+} >+[% END %] >+</script> >diff --git a/opac/opac-z3950-search.pl b/opac/opac-z3950-search.pl >new file mode 100755 >index 0000000..d049e9d >--- /dev/null >+++ b/opac/opac-z3950-search.pl >@@ -0,0 +1,117 @@ >+#!/usr/bin/perl >+ >+# This is a completely new Z3950 clients search using async ZOOM -TG 02/11/06 >+# Copyright 2000-2002 Katipo Communications >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use strict; >+use warnings; >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Context; >+use C4::Breeding; >+use C4::Koha; >+ >+my $input = new CGI; >+my $error = $input->param('error'); >+my $biblionumber = $input->param('biblionumber') || 0; >+my $frameworkcode = $input->param('frameworkcode'); >+my $title = $input->param('title'); >+my $author = $input->param('author'); >+my $isbn = $input->param('isbn'); >+my $issn = $input->param('issn'); >+my $lccn = $input->param('lccn'); >+my $lccall = $input->param('lccall'); >+my $subject = $input->param('subject'); >+my $dewey = $input->param('dewey'); >+my $controlnumber = $input->param('controlnumber'); >+my $stdid = $input->param('stdid'); >+my $srchany = $input->param('srchany'); >+my $op = $input->param('op')||''; >+ >+my $page = $input->param('current_page') || 1; >+$page = $input->param('goto_page') if $input->param('changepage_goto'); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ >+ template_name => "opac-z3950-search.tt", >+ query => $input, >+ type => "opac", >+ authnotrequired => 1, >+ debug => 1, >+}); >+ >+$template->param( >+ frameworkcode => $frameworkcode, >+ isbn => $isbn, >+ issn => $issn, >+ lccn => $lccn, >+ lccall => $lccall, >+ title => $title, >+ author => $author, >+ controlnumber=> $controlnumber, >+ stdid => $stdid, >+ srchany => $srchany, >+ biblionumber => $biblionumber, >+ dewey => $dewey, >+ subject => $subject, >+); >+ >+if ( $op ne "do_search" ) { >+ my $schema = Koha::Database->new()->schema(); >+ my $rs = $schema->resultset('Z3950server')->search( >+ { >+ recordtype => 'biblio', >+ servertype => ['zed', 'sru'], >+ opac => '1', >+ }, >+ { result_class => 'DBIx::Class::ResultClass::HashRefInflator' }, >+ ); >+ $template->param( >+ serverloop => [ $rs->all ], >+ opsearch => "search", >+ ); >+ output_html_with_http_headers $input, $cookie, $template->output; >+ exit; >+} >+ >+my @id = $input->param('id'); >+if ( @id==0 ) { >+ # empty server list -> report and exit >+ $template->param( emptyserverlist => 1 ); >+ output_html_with_http_headers $input, $cookie, $template->output; >+ exit; >+} >+ >+my $pars= { >+ biblionumber => $biblionumber, >+ page => $page, >+ id => \@id, >+ isbn => $isbn, >+ issn => $issn, >+ title => $title, >+ author => $author, >+ dewey => $dewey, >+ subject => $subject, >+ lccall => $lccall, >+ controlnumber => $controlnumber, >+ stdid => $stdid, >+ srchany => $srchany, >+}; >+Z3950Search($pars, $template, 1); >+output_html_with_http_headers $input, $cookie, $template->output; >-- >2.7.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 11361
:
23365
|
60950
|
60951
|
60952
|
72812
|
72813
|
95808
|
100077
|
100463
|
100470
|
113334
|
119535
|
119536
|
119928