##############################################################################
##############################################################################
+# Holds blocking
+##############################################################################
+# Prevent the "Place hold" link from being displayed if a copy is available.
+# This is not perfect, given the umpteen different types of holds that are
+# possible, but addresses the major use case for libraries that don't want
+# to fetch copies from the shelves.
+ctx.holds_block.enabled = 'false';
+
+##############################################################################
# RefWorks configuration
##############################################################################
# RefWorks is a Web-based citation manager
FOR node IN xml.findnodes(xpath);
FOR attr IN ['count', 'available', 'unshadow', 'transcendant', 'org_unit'];
depth = node.getAttribute('depth');
+ org_unit = node.getAttribute('org_unit');
args.copy_counts.$depth.$attr = node.getAttribute(attr);
+ args.org_copy_counts.$org_unit.$attr = node.getAttribute(attr);
END;
END;
-
+
# Get preferred library copy count
args.plib_copy_counts = {};
count_type = 'pref_lib';
</div>
<div id="rdetail_actions_div">
-[% IF ctx.place_unfillable || attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0 %]
+ [%- search_ou = ctx.search_ou;
+ IF ctx.place_unfillable ||
+ (ctx.holds_block.enabled != 'true' &&
+ attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
+ ) ||
+ (ctx.holds_block.enable == 'true' && attrs.org_copy_counts.$search_ou.available > 0)
+ %]
<div class="rdetail_aux_utils place_hold">
<a href="[% mkurl(ctx.opac_root _ '/place_hold',
{hold_target => ctx.bre_id, hold_type => 'T', hold_source_page => mkurl()}, stop_parms) %]"
class="no-dec"><img src="[% ctx.media_prefix %]/images/green_check.png" alt="[% l('place hold') %]" /><span
class="place_hold">[% l('Place Hold') %]</span></a>
</div>
-[% END %]
+ [%- END -%]
<div class="rdetail_aux_utils toggle_list">
[% IF ctx.user;
INCLUDE "opac/parts/bookbag_actions.tt2";
<td nowrap='nowrap' width="1" align="right">
<div class="result_table_utils_cont">
<div class="result_table_utils">
-[% IF ctx.place_unfillable || attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0 %]
+[%- search_ou = ctx.search_ou;
+ IF ctx.place_unfillable ||
+ (ctx.holds_block.enabled != 'true' &&
+ attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
+ ) ||
+ (ctx.holds_block.enable == 'true' && attrs.org_copy_counts.$search_ou.available > 0)
+
+%]
<div class="results_aux_utils place_hold"><a
href="[% mkurl(ctx.opac_root _ '/place_hold',
{hold_target => rec.id, hold_type => 'T', hold_source_page => mkurl()}) %]"
src="[% ctx.media_prefix %]/images/green_check.png"
alt=""/><span class="result_place_hold">[% l('Place Hold') %]</span></a>
</div>
-[% END %]
+[%- END -%]
<div class="results_aux_utils result_util">
[% IF ctx.user;
INCLUDE "opac/parts/bookbag_actions.tt2";