Bugzilla – Attachment 10010 Details for
Bug 5292
Google Preview Option for OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5292 - Google Preview Option for OPAC
Bug-5292---Google-Preview-Option-for-OPAC.patch (text/plain), 5.50 KB, created by
Kyle M Hall
on 2012-06-09 10:52:24 UTC
(
hide
)
Description:
Bug 5292 - Google Preview Option for OPAC
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-06-09 10:52:24 UTC
Size:
5.50 KB
patch
obsolete
>From 4277ed47acd32381ba26e2b296a2e4b0f03ad9b4 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Sat, 9 Jun 2012 06:50:16 -0400 >Subject: [PATCH] Bug 5292 - Google Preview Option for OPAC > >Adds option to insert link for Google Books preview into opac for items >with available preview. > >Patch based on original work by Darrel Ulm. >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../admin/preferences/enhanced_content.pref | 7 +++++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 9 +++++++++ > opac/opac-detail.pl | 5 ++++- > 5 files changed, 28 insertions(+), 1 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 2ffe2df..2928016 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -365,3 +365,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('GoogleBooksPreview','1','Display the ability to place multiple holds or not','','YesNo'); >\ No newline at end of file >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index dbbdee3..66b08e6 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5308,6 +5308,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.09.00.XXX"; >+if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >+ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('GoogleBooksPreview','1','Display the ability to place multiple holds or not','','YesNo')"); >+ print "Upgrade to $DBversion done (Add GooglePreview syspref)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 bb3bc2d..c867139 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 >@@ -166,6 +166,13 @@ Enhanced Content: > yes: Add > no: "Don't add" > - cover images from Open Library to search results and item detail pages on the OPAC. >+ Google Books Preview: >+ - >+ - pref: GoogleBooksPreview >+ choices: >+ yes: Add >+ no: "Don't add" >+ - a Google Books preview link to the OPAC item details page when a matching ISBN is found. > Library Thing: > # Awkward syntax below, due to quoting conflicts > - >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index 3c45aff..18911d2 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -295,6 +295,15 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <div id="catalogue_detail_biblio"> > > <div id="bookcover"> >+ >+ [% IF ( GoogleBooksPreview ) %] >+ [% IF ( normalized_isbn ) %] >+ <script type="text/javascript" src="http://books.google.com/books/previewlib.js"></script> >+ <script type="text/javascript">GBS_insertPreviewButtonPopup('ISBN:' + [% normalized_isbn %] );</script> >+ <br/> >+ [% END %] >+ [% END %] >+ > [% IF ( OPACLocalCoverImages ) %]<div style="block" title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %] > [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% END %][% END %][% END %] > >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 0014c27..03770dc 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -75,7 +75,10 @@ if ( ! $record ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early > exit; > } >-$template->param( biblionumber => $biblionumber ); >+$template->param( >+ biblionumber => $biblionumber, >+ GoogleBooksPreview => C4::Context->preference('GoogleBooksPreview'), >+); > > # get biblionumbers stored in the cart > my @cart_list; >-- >1.7.2.5
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 5292
:
2868
| 10010