Bugzilla – Attachment 19143 Details for
Bug 10486
Allow external Z39.50 targets to be searched from the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10486 - Allow external Z39.50 targets to be searched from the OPAC (2/2)
Bug-10486---Allow-external-Z3950-targets-to-be-sea.patch (text/plain), 5.83 KB, created by
Jesse Weaver
on 2013-06-18 23:03:33 UTC
(
hide
)
Description:
Bug 10486 - Allow external Z39.50 targets to be searched from the OPAC (2/2)
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2013-06-18 23:03:33 UTC
Size:
5.83 KB
patch
obsolete
>From 890a9e4646f9b7043e54f43b4c44aa2fe139a50f Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Tue, 18 Jun 2013 17:00:58 -0600 >Subject: [PATCH] Bug 10486 - Allow external Z39.50 targets to be searched > from the OPAC (2/2) > >This adds a syspref to allow toggling this behavior. >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 33 ++++++++++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 7 +++++ > .../opac-tmpl/prog/en/modules/opac-results.tt | 4 +-- > opac/opac-search.pl | 1 + > 5 files changed, 44 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index fbd0387..4f9d831 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -427,3 +427,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACSearchExternalTargets','0','Whether to search external targets in the OPAC','','YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 8727951..059ad3f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7025,6 +7025,39 @@ if(CheckVersion($DBversion)) { > SetVersion($DBversion); > } > >+$DBversion = "3.13.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do( >+"INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACSearchExternalTargets','0','Whether to search external targets in the OPAC','','YesNo')" >+ ); >+ $dbh->do( q{ >+CREATE TABLE `external_targets` ( >+ `target_id` int(11) NOT NULL AUTO_INCREMENT, >+ `host` varchar(128) NOT NULL, >+ `port` int(11) NOT NULL, >+ `db` varchar(64) NOT NULL, >+ `userid` varchar(64) DEFAULT '', >+ `password` varchar(64) DEFAULT '', >+ `name` varchar(64) NOT NULL, >+ `syntax` varchar(64) NOT NULL, >+ `encoding` varchar(16) DEFAULT 'MARC-8', >+ PRIMARY KEY (`target_id`) >+) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8 >+ } ); >+ $dbh->do( q{ >+CREATE TABLE `external_target_restrictions` ( >+ `branchcode` varchar(10) NOT NULL, >+ `target_id` int(11) NOT NULL, >+ KEY `branchcode` (`branchcode`), >+ KEY `target_id` (`target_id`), >+ CONSTRAINT `external_target_restrictions_ibfk_1` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE, >+ CONSTRAINT `external_target_restrictions_ibfk_2` FOREIGN KEY (`target_id`) REFERENCES `external_targets` (`target_id`) ON DELETE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf >+ } ); >+ print "Upgrade to $DBversion done (Bug 10486 - Allow external Z39.50 targets to be searched from the OPAC)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 90295ef..81c7be1 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 >@@ -424,6 +424,13 @@ OPAC: > yes: Allow > no: Do not allow > - users to add a note when placing a hold. >+ - >+ - pref: OPACSearchExternalTargets >+ default: 0 >+ choices: >+ yes: Search >+ no: "Don't search" >+ - external targets from the OPAC. > > Policy: > - >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 6e78236..d2546f5 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >@@ -14,7 +14,7 @@ > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/jquery.rating.css" />[% END %] > > [% IF ( OverDriveEnabled ) %]<script type="text/javascript" src="[% themelang %]/js/overdrive.js"></script>[% END %] >-[% IF ( 1 ) %] >+[% IF ( OPACSearchExternalTargets ) %] > <script type="text/javascript" src="/opac-tmpl/lib/pz2.js"></script> > <script type="text/javascript" src="[% themelang %]/js/externalsearch.js"></script> > [% END %] >@@ -294,7 +294,7 @@ $(document).ready(function(){ > } ); > [% END %] > >- [% IF ( 1 ) %] >+ [% IF ( OPACSearchExternalTargets ) %] > KOHA.ExternalSearch.targets = { > [% FOREACH target IN external_search_targets %] > '[% target.host %]:[% target.port %]/[% target.db %]': { >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 8e6d055..aa89905 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -903,6 +903,7 @@ $template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksRe > $template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer'); > $template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults'); > >+$template->{VARS}->{OPACSearchExternalTargets} = C4::Context->preference('OPACSearchExternalTargets'); > $template->{VARS}->{external_search_targets} = GetExternalSearchTargets( C4::Context->userenv ? C4::Context->userenv->{branch} : '' ); > > $template->{VARS}->{OverDriveLibraryID} = C4::Context->preference('OverDriveLibraryID'); >-- >1.7.10.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 10486
:
19142
|
19143
|
19226
|
19227
|
19680
|
21687
|
21734
|
22084
|
22540
|
23109
|
23112
|
23113
|
24036
|
24206
|
24207
|
24208
|
25235
|
25236
|
25979
|
26002
|
26017
|
26129
|
26804
|
26988
|
27275
|
27276
|
27438
|
27439
|
27440
|
27559
|
27756
|
27781
|
27783
|
27785
|
27786
|
27787
|
27788
|
27789
|
27790