Use the new status.opac_visible attribute in search summary
authorDan Scott <dan@coffeecode.net>
Tue, 7 Jun 2011 14:16:25 +0000 (10:16 -0400)
committerDan Scott <dan@coffeecode.net>
Mon, 13 Jun 2011 14:04:31 +0000 (10:04 -0400)
Until we exposed the OPAC visibility of the status element as set in
config.copy_status, We previously had to hardcode the logic for whether
a given copy should be displayed based on its status. Now we can simply
use the status.opac_visible attribute to determine visibility.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/web/opac/skin/default/xml/result/result_table.xml

index 8838a80..7ee942a 100644 (file)
                                                 return;
                                             }
 
-                                            /* 
-                                               Hardcoded check for copy statuses per default opac_visible
-                                               setting in config.copy_status; replace with a copy attribute
-                                               check for visible status if holdings_xml ever gets that
-                                            */
-                                            var ident;
+                                            /* Ensure the status is visible */
+                                            var visible_status;
                                             dojo.query('status', cp).forEach(function (status) {
-                                                ident = status.getAttribute('ident');
+                                                visible_status = status.getAttribute('opac_visible');
                                             });
-                                            if (parseInt(ident) !== 0 && /* Available */
-                                                parseInt(ident) != 1 &&  /* Checked out */
-                                                parseInt(ident) != 5 &&  /* In process */
-                                                parseInt(ident) != 6 &&  /* In transit */
-                                                parseInt(ident) != 7 &&  /* Reshelving */
-                                                parseInt(ident) != 8 &&  /* On holds shelf */
-                                                parseInt(ident) != 9 &&  /* On order */
-                                                parseInt(ident) != 12
-                                            ) {
+                                            if (visible_status == 'f') {
                                                 return;
                                             }
 
-
                                             /* Ensure the circulation library is visible */
                                             var lib_vis;
                                             dojo.query('circlib', cp).forEach(function (status) {