From eff7d113a0c31e1e1a0d32626d5834b01a902fda 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. Signed-off-by: Dwayne Nance Signed-off-by: Alexis Rodegerdts Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- .../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 696f3a477f..e4fb61fb8f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -510,7 +510,7 @@ [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'above') %] - + @@ -586,7 +586,7 @@ [% IF ( NovelistSelectProfile && normalized_isbn ) %] [% IF ( NovelistSelectView == 'tab') %] -
  • Novelist Select
  • + [% END %] [% END %] @@ -784,9 +784,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' %] @@ -1022,10 +1022,10 @@ [% END %]
    - [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && normalized_isbn ) %] + [% IF ( NovelistSelectProfile && NovelistSelectView == 'below' && ( normalized_isbn || normalized_upc ) ) %]

    Novelist Select

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

    Novelist Select

    -
    +
    [% END %] @@ -1486,8 +1486,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.39.5