From 5d3071f70dea8185b151e39bc79a9520639e0d1c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 2 Jun 2016 21:24:06 -0400 Subject: [PATCH] Bug 16641: Update Novelist in OPAC to use updated call to fetch content To test: 1 - Enable novelistselect content in the opac 2 - Find a record with novelist content, confirm it displays in tabs ro above or below accoring to pref 3 - Find a record without novelist content, note you get an empty tab 4 - Apply patch 5 - Ensure results have not changed for items with content 6 - Ensure tab does not display for item with no content Sponsored by: Walla Walla Public Library (http://www.wallawallapubliclibrary.org/) Los Gatos Library (http://www.losgatosca.gov/42/Los-Gatos-Library) Signed-off-by: Jesse Weaver Internal signoff. --- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 34 +++++++++++++++------- 1 file changed, 23 insertions(+), 11 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 fe72d01..d4b575f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -509,7 +509,7 @@ [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'above') %] - + @@ -585,7 +585,7 @@ [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'tab') %] -
  • Novelist Select
  • + [% END %] [% END %] @@ -783,9 +783,9 @@ [% END # / IF SyndeticsReviews && SYNDETICS_REVIEWS %] [% END # / IF SyndeticsEnabled %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && normalized_isbn ) %] -
    -
    + [% IF ( NovelistSelectProfile && NovelistSelectView == 'tab' && (normalized_isbn || normalized_upc) ) %] +
    +
    [% END # / IF NovelistSelectProfile && NovelistSelectView == 'tab' %] @@ -1024,10 +1024,10 @@ [% END %]
    - [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && normalized_isbn ) %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]

    Novelist Select

    -
    +
    [% END %] @@ -1100,10 +1100,10 @@ [% INCLUDE 'opac-detail-sidebar.inc' %] - [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && normalized_isbn ) %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'right' && ( normalized_isbn || normalized_upc ) ) %]

    Novelist Select

    -
    +
    [% END %] @@ -1474,8 +1474,20 @@ [% IF OPACLocalCoverImages %] KOHA.LocalCover.GetCoverFromBibnumber(true); [% END %] - [% IF ( NovelistSelectProfile && normalized_isbn ) %] - novSelect.loadContentForISBN('[% normalized_isbn %]','[% NovelistSelectProfile %]', '[% NovelistSelectPassword %]', function(d){}); + [% IF ( NovelistSelectProfile && ( normalized_isbn || normalized_upc ) ) %] + novSelect.loadContentForQuery( + { + ClientIdentifier : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', + ISBN : '[% IF normalized_isbn %][% normalized_isbn %][% ELSE %][% normalized_upc %][% END %]', + version : '2.1' + }, + '[% NovelistSelectProfile %]', + '[% NovelistSelectPassword %]', + function(d){ + if ( d.length > 0 ){ //If no content + $(".NovelistSelect").show(); + } + }); [% END %] [% IF ( OpacBrowseResults && busc ) %] -- 2.8.1