Bugzilla – Attachment 16826 Details for
Bug 9817
Add Goodreads reviews tab to the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9817 Add Goodreads reviews to OPAC
Bug-9817-Add-Goodreads-reviews-to-OPAC.patch (text/plain), 7.38 KB, created by
Chris Cormack
on 2013-03-23 06:14:20 UTC
(
hide
)
Description:
Bug 9817 Add Goodreads reviews to OPAC
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2013-03-23 06:14:20 UTC
Size:
7.38 KB
patch
obsolete
>From fa6672f8196d8de7426d369ac62863c748996828 Mon Sep 17 00:00:00 2001 >From: Chris Cormack <chris@bigballofwax.co.nz> >Date: Tue, 12 Mar 2013 21:40:46 +1300 >Subject: [PATCH] Bug 9817 Add Goodreads reviews to OPAC > >To test >1/ Go to systempreferences and turn on goodreads reviews >2/ Search for a book in your opac, that is likely to be in Goodreads, >and that has an isbn >3/ Look in the opac detail page for a good reads review tab > >Should work in both prog and ccsr > >Signed-off-by: Liz Rea <liz@catalyst.net.nz> >Very lovely! > >Note: fixed a paste error in the database update description. >Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net> >Tested both themes, looks alright >--- > C4/Auth.pm | 2 + > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 11 +++++ > .../admin/preferences/enhanced_content.pref | 12 ++++++ > .../prog/en/includes/goodreadsreviews.inc | 43 ++++++++++++++++++++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 9 ++++ > 6 files changed, 78 insertions(+) > create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index ca061b5..05b359e 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -336,6 +336,8 @@ sub get_template_and_user { > noItemTypeImages => C4::Context->preference("noItemTypeImages"), > marcflavour => C4::Context->preference("marcflavour"), > persona => C4::Context->preference("persona"), >+ GoodReadsReviews => C4::Context->preference("GoodReadsReviews"), >+ GoodReadsKey => C4::Context->preference("GoodReadsKey"), > ); > if ( $in->{'type'} eq "intranet" ) { > $template->param( >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 5d536c5..f6b2c7b 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -423,3 +423,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('DisplayIconsXSLT', '1', '', 'If ON, displays the format, audience, and material type icons in XSLT MARC21 results and detail pages.', 'YesNo'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'); > INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice') >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('GoodReadsReviews','0','Show Goodreads Reviews','','YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6285633..f324c34 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6499,6 +6499,17 @@ if ( CheckVersion($DBversion) ) { > AND user_permissions.code = 'circulate_remaining_permissions' > }); > print "Upgrade to $DBversion done ( Add circ permission overdues_report )\n"; >+} >+ >+$DBversion = "3.11.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do( >+ qq{ >+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('GoodReadsReviews','0','Show Goodreads Reviews','','YesNo'); >+ } >+ ); >+ print >+"Upgrade to $DBversion done (Bug 9817: Add GoodReads Reviews to OPAC)\n"; > SetVersion($DBversion); > } > >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 ba6a6ac..c009eba 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 >@@ -326,3 +326,15 @@ Enhanced Content: > yes: Enable > no: "Don't enable" > - the ability to use Koha Plugins. Note, the plugin system must also be enabled in the Koha configuration file to be fully enabled. >+ Good Reads: >+ - >+ - Good reads API key >+ - pref: GoodReadsKey >+ class: password >+ - you can get a key from http://www.goodreads.com/api/keys >+ - >+ - pref: GoodReadsReviews >+ choices: >+ yes: "Show" >+ no: "Don't show" >+ - a tab in the holdings section in the OPAC for Goodreads reviews >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc b/koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc >new file mode 100644 >index 0000000..48dda68 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc >@@ -0,0 +1,43 @@ >+<style> >+ #goodreads-widget { >+ font-family: georgia, serif; >+ padding: 18px 0; >+ width:565px; >+ } >+ #goodreads-widget h1 { >+ font-weight:normal; >+ font-size: 16px; >+ border-bottom: 1px solid #BBB596; >+ margin-bottom: 0; >+ } >+ #goodreads-widget a { >+ text-decoration: none; >+ color:#660; >+ } >+ iframe{ >+ background-color: #fff; >+ } >+ #goodreads-widget a:hover { text-decoration: underline; } >+ #goodreads-widget a:active { >+ color:#660; >+ } >+ #gr_footer { >+ width: 100%; >+ border-top: 1px solid #BBB596; >+ text-align: right; >+ } >+ #goodreads-widget .gr_branding{ >+ color: #382110; >+ font-size: 11px; >+ text-decoration: none; >+ font-family: verdana, arial, helvetica, sans-serif; >+ } >+</style> >+<div id="goodreadreviews"> >+<div id="goodreads-widget"> >+ <div id="gr_header"><h1>Goodreads reviews for [% title |html %]</h1></div> >+ <iframe id="the_iframe" src="http://www.goodreads.com/api/reviews_widget_iframe?did=4504&format=html&header_text=Goodreads+reviews+for+[% title |uri %]&isbn=[% normalized_isbn %]&links=660&review_back=fff&stars=000&text=000" width="800" height="400" frameborder="0"></iframe> >+ <div id="gr_footer"> >+ </div> >+</div> >+</div> >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 2617b54..b9b2124 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -976,6 +976,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > [% IF ( IDreamBooksReviews ) %] > <li id='tab_idb_critic_reviews' style="display:none;"><a href='#idb_critic_reviews'>Book reviews by critics ( XXX )</a></li> > [% END %] >+ >+[% IF GoodReadsReviews %] >+ <li id="tab_goodreadreviews"><a href="#goodreadreviews">Goodreads Reviews</a></li> >+[% END %] >+ > </ul> > > [% IF ( serialcollection ) %] >@@ -1324,6 +1329,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > </div> > [% END %] > >+[% IF GoodReadsReviews %] >+ [% INCLUDE 'goodreadsreviews.inc' %] >+[% END %] >+ > [% IF ( OPACLocalCoverImages && localimages.size ) %] > <div id="images"> > <p>Click on an image to view it in the image viewer</p> >-- >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 9817
:
16104
|
16119
|
16442
| 16826