LP#1441714 Remove 'NO COPIES' in Staff Client user/ldw/LP1441714_No_Copies_Message
authorLiam Whalen <liam.whalen@bc.libraries.coop>
Wed, 17 Jul 2013 00:23:57 +0000 (17:23 -0700)
committerLiam Whalen <liam.whalen@bc.libraries.coop>
Wed, 8 Apr 2015 17:50:08 +0000 (10:50 -0700)
When a record has only OPAC invisible items attached to it, the TPAC
displays a 'NO COPIES' message in the staff client.

This fix skips the check for opac visible items when the staff client is
being used.  This can result in incomplete information being displayed in
the summary of the available items because opac invisible items are
often incomplete and do not have shelving locations or libraries
assigned to them.

This fix checks for ctx.is_staff in a number of lines. This results in
holdings being excluded only if the copy is not visible and the
ctx.is_staff variable is not set.

Signed-off-by: Liam Whalen <liam.whalen@bc.libraries.coop>
Open-ILS/src/templates/opac/parts/misc_util.tt2

index 0af121c..f34d1ff 100644 (file)
                     # Check copy visibility
                     cp.deleted = copy.getAttribute('deleted');    
                     cp.visible = copy.getAttribute('opac_visible');
-                    NEXT IF (cp.deleted == 'true' OR cp.visible == 'false');
+                    NEXT IF (cp.deleted == 'true' OR (cp.visible == 'false' AND !(ctx.is_staff)));
 
                     # Iterate through all of the children to determine visibility
                     FOR node IN cp.childNodes;
                         END;
                     END;
 
-                    NEXT IF cp.visible == 'false';
+                    NEXT IF (cp.visible == 'false' AND !(ctx.is_staff));
                     
                     loc = copy.findnodes('./*[local-name()="location"]');
-                    NEXT IF loc.getAttribute('opac_visible') == 'false';
+                    NEXT IF (loc.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff));
 
                     circlib = copy.findnodes('./*[local-name()="circlib"]');
-                    NEXT IF circlib.getAttribute('opac_visible') == 'false';
+                    NEXT IF (circlib.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff));
 
                     status = copy.findnodes('./*[local-name()="status"]');
-                    NEXT IF status.getAttribute('opac_visible') == 'false';
+                    NEXT IF (status.getAttribute('opac_visible') == 'false' AND !(ctx.is_staff));
 
                     # extract the circ_lib id from the circ_lib node
                     circ_lib = copy.findnodes('./*[local-name()="circ_lib"]');