@@ -, +, @@ --- 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 --- a/C4/Auth.pm +++ a/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( --- a/installer/data/mysql/sysprefs.sql +++ a/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'); --- a/installer/data/mysql/updatedatabase.pl +++ a/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); } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ a/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 --- a/koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/goodreadsreviews.inc @@ -0,0 +1,43 @@ + +
+
+

Goodreads reviews for [% title |html %]

+ + +
+
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -976,6 +976,11 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( IDreamBooksReviews ) %] [% END %] + +[% IF GoodReadsReviews %] +
  • Goodreads Reviews
  • +[% END %] + [% IF ( serialcollection ) %] @@ -1324,6 +1329,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] +[% IF GoodReadsReviews %] + [% INCLUDE 'goodreadsreviews.inc' %] +[% END %] + [% IF ( OPACLocalCoverImages && localimages.size ) %]

    Click on an image to view it in the image viewer

    --