'coust', 'description'),
'bool');
+
+INSERT INTO config.org_unit_setting_type
+ (name, label, datatype, description, grp, update_perm, view_perm)
+VALUES (
+ 'opac.reviews_and_more_new_tab',
+ oils_i18n_gettext(
+ 'opac.reviews_and_more_new_tab',
+ 'Open Reviews & More in a new tab',
+ 'coust',
+ 'label'
+ ),
+ 'bool',
+ oils_i18n_gettext(
+ 'opac.reviews_and_more_new_tab',
+ 'Allows the Reviews & More links in the search results to be opened in a new tab',
+ 'coust',
+ 'description'
+ ),
+ 'opac',
+ 93,
+ 192
+);
+
--- /dev/null
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO config.org_unit_setting_type
+ (name, label, datatype, description, grp, update_perm, view_perm)
+VALUES (
+ 'opac.reviews_and_more_new_tab',
+ oils_i18n_gettext(
+ 'opac.reviews_and_more_new_tab',
+ 'Open Reviews & More in a new tab',
+ 'coust',
+ 'label'
+ ),
+ 'bool',
+ oils_i18n_gettext(
+ 'opac.reviews_and_more_new_tab',
+ 'Allows the Reviews & More links in the search results to be opened in a new tab',
+ 'coust',
+ 'description'
+ ),
+ 'opac',
+ 93,
+ 192
+);
+COMMIT;
FOR sub IN xml.findnodes('//*[@tag="520"]/*[@code="a"]');
args.summaries.push(sub.textContent);
END;
- args.summary = (args.summaries.size) ? args.summaries.0 : '';
+ args.summary = (args.summaries.size) ? args.summaries : '';
# 250 gets pride of place for edition statement, and is the
# only logical choice for 880 graphic fields
END;
extras = [
- {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary},
+ {name => 'summaryplus', label => l('Reviews & More'), hide => hide_summary},
{name => 'annotation', label => l('Annotation'), hide => 1},
{name => 'awards', label => l('Awards, Reviews, & Suggested Reads')},
{name => 'excerpt', label => l('Excerpt'), hide => 1},
];
FOREACH extra IN extras;
- IF extra.hide; NEXT; END;
+ IF extra.hide;
+ IF extra.name != 'summaryplus';
+ NEXT;
+ ELSIF NOT ENV.OILS_CONTENT_CAFE_USER;
+ #If we are going to hide summaryplus because no
+ #conetent could be retrieved and we are not a
+ #Content Cafe user, then hide it.
+ #Otherwise show the summaryplus tab because
+ #it is confusing to click the Reviews & More links
+ #in the search results and not be taken to the
+ #Reviews and More tab.
+ NEXT;
+ END;
+ END;
name = extra.name;
%]
<div class="rdetail_extras">
<div class='rdetail_extras_div'>
- [%- IF attrs.summary %]
- <div class='rdetail-extras-summary'>
- <strong>[% l('Summary: ') %]</strong>
- [% FOR sum IN attrs.summaries %]
- [% IF !loop.first; '<br/>'; END %]
- <span>[% sum | html %] </span>
- [% END %]
- </div>
- [%- END %]
- [%- IF ENV.OILS_CONTENT_CAFE_USER %]
- <!-- Embedded content cafe iframe -->
- [% ident = attrs.isbn_clean || attrs.upc %]
- <iframe width="100%" height="400" frameborder="0"
- src="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%-
- ENV.OILS_CONTENT_CAFE_USER %]&Password=[% ENV.OILS_CONTENT_CAFE_PASS %]&ItemKey=[% ident | uri %]&Options=Y" >
- </iframe>
- [%- END %]
+ [% #Sitka does not want summaries in the Reviews & More tab %]
+ [%- IF attrs.summaries.0 AND 0 == 1 %]
+ <div class='rdetail-extras-summary'>
+ <strong>[% l('Summary: ') %]</strong>
+ [% FOR sum IN attrs.summaries %]
+ [% IF !loop.first; '<br/>'; END %]
+ <span>[% sum | html %] </span>
+ [% END %]
+ </div>
+ [% END %]
+ [% IF ENV.OILS_CONTENT_CAFE_USER %]
+ [% ident = attrs.isbn_clean || attrs.upc %]
+ [% IF ident %]
+ <!-- Embedded content cafe iframe -->
+ <iframe width="100%" height="400" frameborder="0"
+ src="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%-
+ ENV.OILS_CONTENT_CAFE_USER %]&Password=[% ENV.OILS_CONTENT_CAFE_PASS %]&ItemKey=[% ident | uri %]&Options=Y" >
+ </iframe>
+ [% ELSE %]
+ <div class='rdetail-extras-summary'>
+ [% l('There are currently no reviews available for this title.') %]
+ </div>
+ [%- END %]
+ [% END %]
</div>
-
</a>
[% END %]
</div>
- [% IF ENV.OILS_CONTENT_CAFE_USER %]
- [% ident = attrs.isbn_clean || attrs.upc %]
+ [% IF ENV.OILS_CONTENT_CAFE_USER;
+ IF NOT ctx.is_staff;
+ tpac_ou = ctx.physical_loc;
+ ELSE;
+ tpac_ou = ctx.ws_ou;
+ END;
+ new_window = ctx.get_org_setting(tpac_ou, 'opac.reviews_and_more_new_tab');
+ record = ctx.opac_root _ '/record/' _ rec.id;
+ name = 'summaryplus';
+ href = mkurl(record, {expand => name}) _ '#' _ name;
+ %]
<div class="results_aux_utils result_util">
- <a target='_blank'
- [% html_text_attr('title', l('Reviews and More for [_1]', attrs.title)) %]
- href="[% ctx.ext_proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%-
- ENV.OILS_CONTENT_CAFE_USER %]&Password=[%-
- ENV.OILS_CONTENT_CAFE_PASS %]&ItemKey=[% ident | uri %]&Options=Y" rel="nofollow" vocab="">
- <img src='[% ctx.media_prefix %]/images/starz.png' alt="[% l('Ratings Icon') %]"/>
+ <a title="[% l('Reviews and More') %]"
+ [% IF new_window; %]
+ [% IF NOT ctx.is_staff %]
+ target='_blank'
+ [% ELSE %]
+ target='_blank'
+ [%
+ #this code will open up the Content Cafe data in a new tab as opposed to target='_blank', which opens it in new window in
+ #in the staff client. When opening Content Cafe data in a new tab, there is a problem if the user has set a preferred
+ #search location via the staff client Admin menu. If this is the case, then the tab is not focused on the review and
+ #the user has to scroll down to see it. There is a fix on user/lwhalen/rt16523_with_staff_client_fix, but it requires a
+ #new staff client, so support has opted to go with opening in a new window until a staff client can be released.
+ #I am keeping this code in the source to make it esay to implement whenever support would like to change the behaviour from
+ #opening in a new window to opening in a new tab.
+ #href = "javascript:xulG.new_tab(xulG.urls.XUL_OPAC_WRAPPER, {}, {'opac_url' : 'oils://remote" _ href _ "'});void(0);"
+ %]
+ [% END %]
+ [% END %]
+ href="[% href %]">
+ <img src='[% ctx.media_prefix %]/images/starz.png'/>
<span class="results_reviews">[% l('Reviews & More') %]</span>
</a>
</div>