From: Dan Scott Date: Tue, 31 May 2011 02:49:00 +0000 (-0400) Subject: Plug the many OPAC visibility holes in search result item display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=30992ad5459ebf2b135ba614040d68399f60fffd;p=evergreen%2Fjoelewis.git Plug the many OPAC visibility holes in search result item display Check volume and circ_lib and copy status OPAC visibility (and deleted status in the case of volumes) in addition to the existing copy and copy-location checks. Worst hack is hard-coded copy status IDs of 0, 7, 12 - but this is currently used throughout the code, so one more can't hurt that much (OWWW). Signed-off-by: Dan Scott --- diff --git a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml index 5ff3ba86fd..517ce19315 100644 --- a/Open-ILS/web/opac/skin/default/xml/result/result_table.xml +++ b/Open-ILS/web/opac/skin/default/xml/result/result_table.xml @@ -149,6 +149,12 @@ if (item_cnt >= max_items) { return output.innerHTML; } + if (vol.getAttribute('deleted') == 't') { + return; + } + if (vol.getAttribute('opac_visible') == 'f') { + return; + } dojo.query('copy', vol).forEach(function (cp) { if (item_cnt >= max_items) { return; @@ -159,6 +165,28 @@ if (cp.getAttribute('opac_visible') == 'f') { return; } + + /* Hardcoded check for copy status 0, 7, or 12 */ + var ident; + dojo.query('status', cp).forEach(function (status) { + ident = status.getAttribute('ident'); + }); + if (parseInt(ident) !== 0 && + parseInt(ident) != 7 && + parseInt(ident) != 12) { + return; + } + + + /* Ensure the circulation library is visible */ + var lib_vis; + dojo.query('circlib', cp).forEach(function (status) { + lib_vis = status.getAttribute('opac_visible'); + }); + if (lib_vis != 't') { + return; + } + var cp_entry = dojo.create('div'); var loc_visible; var vol_appended = false;