Bugzilla – Attachment 72813 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]
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), 9.82 KB, created by
Maksim Sen
on 2018-03-13 19:02:13 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 19:02:13 UTC
Size:
9.82 KB
patch
obsolete
>From fccf5bf17fc5c30fb62c536b5ab38332266053e9 Mon Sep 17 00:00:00 2001 >From: Maksim Sen <maksim.sen@inlibro.com> >Date: Tue, 13 Mar 2018 14:56:28 -0400 >Subject: [PATCH] Bug 11361 - Add a Z39.50 search page in the OPAC to let > members search for records on remote Koha instances > >Made changes wanted in the code review. >--- > C4/Auth.pm | 4 ---- > installer/data/mysql/atomicupdate/bug11361.perl | 8 ++++++++ > installer/data/mysql/sysprefs.sql | 4 ++-- > installer/data/mysql/updatedatabase.pl | 8 -------- > koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt | 6 +++--- > opac/opac-z3950-search.pl | 5 ++--- > 7 files changed, 16 insertions(+), 21 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug11361.perl > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index cddeb55..7fd62bd 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -526,10 +526,6 @@ sub get_template_and_user { > OPACFRBRizeEditions => C4::Context->preference("OPACFRBRizeEditions"), > OpacHighlightedWords => C4::Context->preference("OpacHighlightedWords"), > OPACShelfBrowser => "" . C4::Context->preference("OPACShelfBrowser"), >- 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/installer/data/mysql/atomicupdate/bug11361.perl b/installer/data/mysql/atomicupdate/bug11361.perl >new file mode 100644 >index 0000000..95a49b8 >--- /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/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index e4c69d9..a291c99 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -405,6 +405,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'), > ('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'), > ('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'), >+('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo'), > ('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'), > ('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'), > ('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'), >@@ -603,6 +604,5 @@ 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'), >-('OPACZ3950','0','','Allow patrons to search for bibliographic records in other libraries via Z39.50.','YesNo') >+('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') > ; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 86ff057..7f5c479 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -15613,14 +15613,6 @@ 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 >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index fe266a0..da64efe 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -278,7 +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( 'OpacZ3950' ) %]<li><span id="z3950searchOpac"><a target="_blank" href="#" >Search other catalogs</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/modules/opac-z3950-search.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >index eda770d..acd6a9e 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-z3950-search.tt >@@ -65,7 +65,7 @@ Koha › Z39.50/SRU search results > <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> >+ <h2>Search parameters</h2> > <div id="search_field" class="well"> > [% FOREACH field IN search_fields %] > <div class="input-prepend input-block-level"> >@@ -181,11 +181,11 @@ Koha › Z39.50/SRU search results > <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> >+ <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> >+ <button class="btn" type="button" name="changepage_next" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();">Next page</button> > [% END %] > </div> > </div> >diff --git a/opac/opac-z3950-search.pl b/opac/opac-z3950-search.pl >index d049e9d..7ff68d7 100755 >--- a/opac/opac-z3950-search.pl >+++ b/opac/opac-z3950-search.pl >@@ -18,8 +18,7 @@ > # 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 Modern::Perl; > use CGI; > > use C4::Auth; >@@ -52,7 +51,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ > template_name => "opac-z3950-search.tt", > query => $input, > type => "opac", >- authnotrequired => 1, >+ authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ), > debug => 1, > }); > >-- >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
|
180744
|
180745