Block "Place Hold" link in TPAC if item is available
authorArt Rhyno <art632000@yahoo.ca>
Fri, 27 Jul 2012 15:39:14 +0000 (11:39 -0400)
committerDan Scott <dscott@laurentian.ca>
Tue, 31 Jul 2012 17:29:00 +0000 (13:29 -0400)
Suppress the display of the "Place Hold" link based on whether an item
is available. This is set as a preference in config.tt2. Some sites
may want the ability to place holds regardless of availability.

Signed-off-by: Art Rhyno <art632000@yahoo.ca>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/config.tt2
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index 813280a..bb08435 100644 (file)
@@ -6,6 +6,12 @@
 ##############################################################################
 
 ##############################################################################
+# Holds blocking
+##############################################################################
+# Block the ability to place holds if item is available
+ctx.holds_block.enabled = 'true';
+
+##############################################################################
 # RefWorks configuration
 ##############################################################################
 # RefWorks is a Web-based citation manager
index 9f83fc6..0ea975c 100644 (file)
     </div>
 
     <div id="rdetail_actions_div">
+        [%- depth = ctx.search_ou - 1; IF ctx.copy_summary.$depth.available == 0 OR ctx.holds_block.enabled == 'false' %]
         <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 %]
         <div class="rdetail_aux_utils toggle_list">
         [%  IF ctx.user;
             INCLUDE "opac/parts/bookbag_actions.tt2";
index 662041e..8fa61e4 100644 (file)
                                             <td nowrap='nowrap' width="1" align="right">
                                                 <div class="result_table_utils_cont">
                                                     <div class="result_table_utils">
+                                                        [%- depth = ctx.search_ou - 1; IF args.copy_counts.$depth.available == 0 OR ctx.holds_block.enabled == 'false' %]
                                                         <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 %]
                                                         <div class="results_aux_utils result_util">
                                                             [%  IF ctx.user;
                                                                 INCLUDE "opac/parts/bookbag_actions.tt2";