From 6e82493b65092f426cd5d5bdbacedc8d79d13469 Mon Sep 17 00:00:00 2001 From: Martin Persson Date: Thu, 8 Oct 2015 09:13:00 +0200 Subject: [PATCH] Bug 8630: Adlibris covers (OPAC templates) Changes to OPAC templates. Depends on new CSS clases defined in separate patch. Test plan: To test this particular patch (intranet templates) you need: * The syspref patch applied * The intranet CSS patch applied To test: * Apply this patch * Enable covers (if not done already) * Go to staff interface, log in as a priviliged user. * Select "More" -> "Administration" -> "Global system preferences" -> "Enhanced content". * Set ""AdlibrisCoversEnabled" to "Show" under "Adlibris". * Save changes * Add a book with a known cover/ISBN (if none exists) * Set MARC field 020 a, "INTERNATIONAL STANDARD BOOK NUMBER" to: 9780451524935 * Set MARC field 245 a, "Title" to: 1984 * Save changes * Test opac-results.tt * Search library catalog from OPAC for "1984". * You should be sent to: http://127.0.1.1/cgi-bin/koha/opac-search.pl?idx=&q=1984 * Cover image should be shown to the right of each title with CSS class: "adlibris-cover" * Test opac-detail.tt (continued from previous test's location) * Click on the title with cover (1984, ISBN: 9780451524935) * Cover should be displayed to the left in full size. * If clicked, should link to the full-size image. Test opac-results-grouped.tt * This template is only used if an external "grouping" server is setup and the syspref "OPACGroupResults" is set to "Use". * Personally I did not test this, b/c: terminally lazy * Test opac-showreviews.tt * Could not find any links to this location, manually enter it: http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl * Image should be shown to the right in full size. * If clicked it should take you to the detail view with the comments tab opened. * Test opac-showreviews-rss.tt * Click on the RSS icon from previous test's start location. URL should be: http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl?format=rss * An image tag linking to the full-size image without any styling class should be present. * Test opac-user.tt * Click on your username to open: http://127.0.1.1/cgi-bin/koha/opac-user.pl * Covers should be shown for checked out items with CSS class: adlibris-cover * When clicked the destination should be the same as clicking the title column entry: opac-details.pl * Test opac-opensearch.tt * Click on "Advanced search" and enter "1984" then press "Search" * This search screen uses a different template. * Cover image should be shown to the right of each title with CSS class: "adlibris-cover" * If clicked, should link to the OPAC detail view. * Test opac-readingrecord.tt * Click on your logged-in name to go to your personal page. * Click on "Your reading history" tab on the left. http://127.0.1.1/cgi-bin/koha/opac-readingrecord.pl * Covers should be shown in leftmost column with CSS class: adlibris-cover * If clicked, should link to the same as the 'Title' link. Sponsored-By: Halland County Library Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 7 +++++++ .../bootstrap/en/modules/opac-opensearch.tt | 7 +++++++ .../bootstrap/en/modules/opac-readingrecord.tt | 12 ++++++++++++ .../bootstrap/en/modules/opac-results-grouped.tt | 5 +++++ .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 9 +++++++++ .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 6 +++++- .../bootstrap/en/modules/opac-showreviews-rss.tt | 7 ++++++- .../bootstrap/en/modules/opac-showreviews.tt | 10 ++++++++-- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 14 +++++++++----- 9 files changed, 68 insertions(+), 9 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 3896a73d6b..efd92743e9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -13,6 +13,8 @@ [% ELSE %] [% AmazonAssocTag = '' %] [% END %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% ShowCourseReservesHeader = 0 %] [% IF Koha.Preference( 'UseCourseReserves' ) == 1 %] @@ -57,6 +59,11 @@ [% IF ( OPACLocalCoverImages ) %]
[% END %] + + [% IF ( AdlibrisEnabled && normalized_isbn ) %] + Cover image + [% END %] + [% IF ( OPACAmazonCoverImages ) %] [% IF ( OPACURLOpenInNewWindow ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt index c69585a49c..2e50ae99bd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-opensearch.tt @@ -1,5 +1,8 @@ [% USE Koha %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] + [% IF ( opensearchdescription ) %] [% LibraryName | html %] Search @@ -37,8 +40,12 @@ ISBN [% SEARCH_RESULT.isbn | html %] [% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL | html %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% ELSE %][% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber | html %][% END %][% END %] +[% END %] [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %] + [% ELSE %] [% END %][% END %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt index 745cfb5008..d03d51855a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt @@ -10,6 +10,8 @@ [% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %] [% INCLUDE 'masthead.inc' %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% IF Koha.Preference('AmazonAssocTag') %] [% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %] @@ -94,6 +96,16 @@ [% issuetype | html %] + [% IF ( AdlibrisEnabled && issue.normalized_isbn ) %] + [% IF issue.BiblioDefaultViewmarc %] + + [% ELSIF issue.BiblioDefaultViewisbd %] + + [% ELSE %] + + [% END %] + Adlibris cover image + [% END %] [% IF OPACAmazonCoverImages %] [% IF issue.normalized_isbn %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt index 25c5bb557e..da69b0d2eb 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results-grouped.tt @@ -1,6 +1,8 @@ [% USE raw %] [% USE Asset %] [% USE Koha %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › [% IF ( searchdesc ) %] @@ -158,6 +160,9 @@ href="/cgi-bin/koha/opac-rss.pl?[% query_cgi | html %][% limit_cgi | html %]" /> <tr> [% END %] <td> + [% IF ( AdlibrisEnabled && GROUP_RESULT.normalized_isbn ) %] + <img src="[% AdlibrisURL | html %]?isbn=[% GROUP_RESULT.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" /> + [% END %] [% IF ( OPACAmazonCoverImages ) %] <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="https://images-na.ssl-images-amazon.com/images/P/[% GROUP_RESULT.isbn | html %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %] </a> diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 7bb678abe6..fb3ac0de77 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -3,6 +3,8 @@ [% USE Koha %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsShowOnList ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && TagsInputOnList ) %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% INCLUDE 'doc-head-open.inc' %] <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › @@ -229,6 +231,13 @@ [% IF ( OPACLocalCoverImages ) %] <span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber | html %]" id="local-thumbnail[% loop.count | html %]"></span> [% END %] + + [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %] + <span title="[% SEARCH_RESULT.biblionumber | html %]" id="adlibris-thumbnail[% loop.count | html %]"> + <img src="[% AdlibrisURL | html %]?isbn=[% SEARCH_RESULT.normalized_isbn | html %]" + alt="Adlibris thumbnail for ISBN: [% SEARCH_RESULT.normalized_isbn | html %]" class="adlibris-cover" /> + </span> + [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( SEARCH_RESULT.normalized_isbn ) %] <span title="[% SEARCH_RESULT.biblionumber | html %]" id="amazon-thumbnail[% loop.count | html %]"><img src="https://images-na.ssl-images-amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn | html %].01.TZZZZZZZ.jpg" alt="" class="item-thumbnail" /></span> diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index e343a5b873..49d608bf9f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -5,6 +5,8 @@ [% SET PUBLIC = 2 %] [% SET TagsShowEnabled = ( ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsShowOnList') ) %] [% SET TagsInputEnabled = ( ( Koha.Preference( 'opacuserlogin' ) == 1 ) && ( Koha.Preference( 'TagsEnabled' ) == 1 ) && Koha.Preference('TagsInputOnList') ) %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% INCLUDE 'doc-head-open.inc' %] <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog › [% IF op == 'view' %]Contents of [% shelf.shelfname | html %][% ELSE %]Your lists[% END %][% INCLUDE 'doc-head-close.inc' %] @@ -306,7 +308,9 @@ [% IF ( OPACLocalCoverImages ) %] [% END %] - + [% IF ( AdlibrisEnabled && itemsloo.normalized_isbn ) %] + Adlibris cover image + [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( itemsloo.normalized_isbn ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt index d05a984501..0c464412c4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews-rss.tt @@ -1,4 +1,4 @@ -[% USE KohaDates # XML declaration should have no white space before it %] +[% USE KohaDates # XML declaration should have no white space before it %][% USE Koha %] <![CDATA[[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] Catalog Recent Comments]]> @@ -6,11 +6,16 @@ [% timestamp | html %] + [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] + [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% FOREACH review IN reviews %] New comment on [% review.title | html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl.subfield | html %][% END %] [% OPACBaseURL | html %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber | html %]#comments +[% END %] [% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %][% END %][% END %] [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt index 13a5d23a8f..eb6f255f2e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-showreviews.tt @@ -31,6 +31,8 @@

Recent comments Subscribe to recent comments

+ [% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] + [% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% FOREACH review IN reviews %] - [% IF ( JacketImages ) %][% END %] + [% IF ( JacketImages || AdlibrisEnabled ) %][% END %] @@ -209,8 +211,10 @@ [% FOREACH ISSUE IN ISSUES %] [% IF ( ISSUE.overdue ) %][% ELSE %][% END %] - [% IF ( JacketImages ) %] - [% IF ( JacketImages ) %][% END %] + [% IF ( JacketImages || AdlibrisEnabled ) %][% END %] [% UNLESS ( item_level_itypes ) %] [% END %] [% IF ( show_barcode ) %][% END %] @@ -484,7 +488,7 @@ [% FOREACH OVERDUE IN OVERDUES %] - [% IF ( JacketImages ) %] + [% IF ( JacketImages || AdlibrisEnabled ) %]
@@ -116,7 +118,9 @@ [% END %] [% END %] - + [% IF ( AdlibrisEnabled && review.normalized_isbn ) %] + Adlibris cover image + [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( review.normalized_isbn ) %] @@ -124,7 +128,9 @@ No cover image available [% END %] [% END %] - + [% IF ( AdlibrisEnabled && SEARCH_RESULT.normalized_isbn ) %] + Adlibris cover image + [% END %] [% IF ( SyndeticsEnabled && SyndeticsCoverImages ) %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 629ead9bfd..28cde29381 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -5,6 +5,8 @@ [% USE Branches %] [% USE ItemTypes %] [% USE Price %] +[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %] +[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %] [% SET borrower_club_enrollments = logged_in_user.get_club_enrollments(1) %] [% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1,1) %] @@ -181,7 +183,7 @@
[% issues_count | html %] Item(s) checked out
  Title Author Due
- + [% IF ( JacketImages || AdlibrisEnabled ) %] + [% IF ( AdlibrisEnabled && ISSUE.normalized_isbn ) %] + Adlibris cover image + [% END %] [% IF ( OPACAmazonCoverImages ) %] [% IF ( ISSUE.normalized_isbn ) %] View on Amazon.com @@ -467,7 +471,7 @@
  TitleItem typeBarcode
[% IF ( OPACAmazonCoverImages ) %] [% IF ( OVERDUE.normalized_isbn ) %] -- 2.39.5