Bugzilla – Attachment 95808 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]
[patch]
Bug11361 - opac z3950 search
Bug11361---opac-z3950-search.patch (text/plain), 27.82 KB, created by
Arthur Bousquet
on 2019-11-25 20:21:12 UTC
(
hide
)
Description:
Bug11361 - opac z3950 search
Filename:
MIME Type:
Creator:
Arthur Bousquet
Created:
2019-11-25 20:21:12 UTC
Size:
27.82 KB
patch
obsolete
>From c31e755764d1b69081b2bb459dfba8322b442bad Mon Sep 17 00:00:00 2001 >From: Arthur Bousquet <arthur.bousquet@inlibro.com> >Date: Mon, 25 Nov 2019 14:32:44 -0500 >Subject: [PATCH] Bug11361 - opac z3950 search > >bug11361 - atomicupdate bug >--- > C4/Auth.pm | 1 + > C4/Breeding.pm | 10 +- > Koha/Schema/Result/Z3950server.pm | 8 + > admin/z3950servers.pl | 2 +- > installer/data/mysql/atomicupdate/bug11361.perl | 8 + > .../prog/en/modules/admin/preferences/opac.pref | 6 + > .../prog/en/modules/admin/z3950servers.tt | 10 +- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 2 + > .../bootstrap/en/includes/opac-bottom.inc | 12 + > .../bootstrap/en/modules/opac-z3950-search.tt | 304 +++++++++++++++++++++ > opac/opac-z3950-search.pl | 117 ++++++++ > 11 files changed, 474 insertions(+), 6 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug11361.perl > 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 a882880..fd03171 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -565,6 +565,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 8f3e4a8..12b36be 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -126,7 +126,7 @@ 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}; >@@ -188,7 +188,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; > } >@@ -286,7 +286,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; >@@ -298,7 +298,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); >@@ -312,6 +312,7 @@ sub _handle_one_result { > { > biblionumber => $bib, > server => $servhref->{servername}, >+ host => $servhref->{host}, > breedingid => $breedingid, > }, $marcrecord) if $breedingid; > return ( $row, $error ); >@@ -344,6 +345,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 e72eb9a..b606eae 100644 >--- a/Koha/Schema/Result/Z3950server.pm >+++ b/Koha/Schema/Result/Z3950server.pm >@@ -120,6 +120,12 @@ __PACKAGE__->table("z3950servers"); > data_type: 'longtext' > is_nullable: 1 > >+=head2 opac >+ >+ data_type: 'tinyint' >+ is_nullable: 1 >+ size: 1 >+ > =cut > > __PACKAGE__->add_columns( >@@ -167,6 +173,8 @@ __PACKAGE__->add_columns( > { data_type => "longtext", is_nullable => 1 }, > "add_xslt", > { data_type => "longtext", is_nullable => 1 }, >+ "opac", >+ { data_type => "tinyint", is_nullable => 1, size => 1 }, > ); > > =head1 PRIMARY KEY >diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl >index cb22666..45815c8 100755 >--- a/admin/z3950servers.pl >+++ b/admin/z3950servers.pl >@@ -67,7 +67,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 opac > add_xslt/; > my $formdata = _form_data_hashref( $input, \@fields ); > if( $id ) { >diff --git a/installer/data/mysql/atomicupdate/bug11361.perl b/installer/data/mysql/atomicupdate/bug11361.perl >new file mode 100644 >index 0000000..7f9d794 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug11361.perl >@@ -0,0 +1,8 @@ >+$DBversion = "XXX"; >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do("ALTER TABLE z3950servers ADD COLUMN opac TINYINT(1) AFTER attributes;"); >+ $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."; >+ print "Add OPACZ3950 preference."; >+ SetVersion($DBversion); >+} >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 e268558..5af3e23 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 >@@ -449,6 +449,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 9efe6ce..e509618 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt >@@ -79,6 +79,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 | html %]" /> > </li> > >@@ -157,7 +164,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>Opac</th><th>Options</th> > </tr></thead> > <tbody> > [% FOREACH loo IN loop %] >@@ -170,6 +177,7 @@ > <span>Authority</span> > [% END %] > </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 | html %]" 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 c61938a..d678279 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -305,6 +305,8 @@ > [% 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 1705cee..1ca298a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc >@@ -316,6 +316,18 @@ $(document).ready(function() { > [% Koha.Preference('OPACUserJS') | $raw %] > </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..6c6aac2 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >@@ -0,0 +1,304 @@ >+[% 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 %]" >+ [% IF ( serverloo.checked ) %]checked="checked"[% END %] >+ /> >+ [% 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.opacurl %]/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..ee3da25 >--- /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 2 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 Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11361
:
23365
|
60950
|
60951
|
60952
|
72812
|
72813
|
95808
|
100077
|
100463
|
100470
|
113334
|
119535
|
119536
|
119928