[Koha-patches] Fwd: [PATCH] Bug 5292 Google Preview Option for OPAC
Nicole Engard
nengard at gmail.com
Fri Oct 8 17:15:21 CEST 2010
---------- Forwarded message ----------
From: Darrell Ulm <darrellulm at smfpl.org>
Date: Fri, Oct 8, 2010 at 9:47 AM
Subject: Fwd: [PATCH] Bug 5292 Google Preview Option for OPAC
To: Nicole Engard <nengard at gmail.com>
Nicole,
Below is the patch, and it should have arrived at:
koha-patches at lists.koha-community.org unless the email is down.
---
installer/data/mysql/en/mandatory/sysprefs.sql | 1 +
.../admin/preferences/enhanced-content.pref | 6 ++++++
.../opac-tmpl/prog/en/modules/opac-detail.tmpl | 10 ++++++++++
opac/opac-detail.pl | 2 ++
4 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql
b/installer/data/mysql/en/mandatory/sysprefs.sql
index 8bfed37..e2fe020 100644
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -286,3 +286,4 @@ INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
INSERT INTO `systempreferences`
(variable,value,explanation,options,type)
VALUES('ILS-DI:Authorized_IPs','','.','Restricts usage of ILS-DI to
some IPs','Free');
INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
('OverduesBlockCirc','noblock','When checking out an item should
overdues block checkout, generate a confirmation dialogue, or allow
checkout','noblock|confirmation|block','Choice');
INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
('DisplayMultiPlaceHold','1','Display the ability to place multiple
holds or not','','YesNo');
+INSERT INTO `systempreferences`
(variable,value,explanation,options,type) VALUES
('GooglePreview','1','Display the ability to place multiple holds or
not','','YesNo');
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref
b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref
index cecb7a6..0650808 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced-content.pref
@@ -130,6 +130,12 @@ Enhanced Content:
yes: Add
no: "Don't add"
- cover images from Google Books to search results and
item detail pages on the OPAC.
+ -
+ - pref: GooglePreview
+ choices:
+ yes: Add
+ no: "Don't add"
+ - add link to detail page to Google preview when it
exists for a biblio (by isbn)
Library Thing:
# Awkward syntax below, due to quoting conflicts
-
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
index b1fdf84..36cd7bb 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
@@ -70,6 +70,16 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
<div id="catalogue_detail_biblio">
<div id="bookcover">
+
+ <!-- TMPL_IF NAME="GooglePreview" -->
+ <!-- TMPL_IF NAME="normalized_isbn" -->
+ <script type="text/javascript"
src="http://books.google.com/books/previewlib.js"></script>
+ <script type="text/javascript">
+ GBS_insertPreviewButtonPopup('ISBN:' + <!-- TMPL_VAR
NAME="normalized_isbn" --> );
+ </script><br />
+ <!-- /TMPL_IF -->
+ <!-- /TMPL_IF -->
+
<!-- TMPL_IF NAME="OPACAmazonEnabled" --><!-- TMPL_IF
NAME="OPACAmazonCoverImages" --><!-- TMPL_IF
NAME="OPACURLOpenInNewWindow" --><a href="http://www.amazon<!--
TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR
NAME="normalized_isbn"
-->/ref=sib_dp_pt/002-7879865-0184864#reader-link"
target="_blank"><img border="0"
src="http://images.amazon.com/images/P/<!-- TMPL_VAR
NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image"
/></a><!-- TMPL_ELSE --><a href="http://www.amazon<!-- TMPL_VAR
NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn"
-->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0"
src="http://images.amazon.com/images/P/<!-- TMPL_VAR
NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="Cover Image"
/></a><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="SyndeticsEnabled" --><!-- TMPL_IF
NAME="SyndeticsCoverImages" --><!-- TMPL_IF
NAME="content_identifier_exists" --><!-- TMPL_IF NAME="using_https"
-->
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index 629ebd2..cec8e15 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -62,6 +62,8 @@ my ( $template, $borrowernumber, $cookie ) =
get_template_and_user(
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
+$template->param( 'GooglePreview' =>
C4::Context->preference('GooglePreView') );
+
$template->param( 'AllowOnShelfHolds' =>
C4::Context->preference('AllowOnShelfHolds') );
$template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) );
--
1.5.6.5
More information about the Koha-patches
mailing list