Fix place hold hiding logic
authorThomas Berezansky <tsbere@mvlc.org>
Wed, 1 Aug 2012 20:40:51 +0000 (16:40 -0400)
committerDan Scott <dscott@laurentian.ca>
Wed, 1 Aug 2012 20:55:23 +0000 (16:55 -0400)
Always show the place hold link for staff with permission to place holds
that won't fill currently.

Otherwise, only show the link if:
There are holdable copies
AND
We aren't blocking OR there are no available copies

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/src/templates/opac/parts/record/summary.tt2
Open-ILS/src/templates/opac/parts/result/table.tt2

index 32858db..990201d 100644 (file)
     <div id="rdetail_actions_div">
         [%- 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)
+                ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
+                    && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
+                )
          %]
         <div class="rdetail_aux_utils place_hold">
             <a href="[% mkurl(ctx.opac_root _ '/place_hold', 
index 1d809d6..225c21a 100644 (file)
                                                     <div class="result_table_utils">
 [%- 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)
-
+        ( attrs.marc_xml.findnodes('//*[local-name()="holdings" and @has_holdable="true"]').size > 0
+            && (ctx.holds_block.enabled != 'true' || attrs.org_copy_counts.$search_ou.available == 0)
+        )
 %]
                                                         <div class="results_aux_utils place_hold"><a
                                                                 href="[% mkurl(ctx.opac_root _ '/place_hold',