for the Circulate as Type column in xul lists, display the actual citm value instead...
authorJason Etheridge <jason@esilibrary.com>
Wed, 1 Jun 2011 07:21:06 +0000 (03:21 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 6 Jun 2011 16:09:53 +0000 (12:09 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/xul/staff_client/server/circ/alternate_copy_summary.js
Open-ILS/xul/staff_client/server/circ/util.js

index e3effb5..bfb015c 100644 (file)
@@ -178,7 +178,13 @@ function load_item() {
                     set("call_number", acn_obj.label());
                 });
             }
-            set("circ_as_type", details.copy.circ_as_type()); 
+            set("circ_as_type", details.copy.circ_as_type() != null && details.copy.circ_as_type() == 'object'
+                ? details.copy.circ_as_type()
+                : ( typeof data.hash.citm[ details.copy.circ_as_type() ] != 'undefined'
+                    ? data.hash.citm[ details.copy.circ_as_type() ].value
+                    : ''
+                )
+            ); 
             set("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().shortname() : data.hash.aou[ details.copy.circ_lib() ].shortname()); 
             set_tooltip("copy_circ_lib" , typeof details.copy.circ_lib() == 'object' ? details.copy.circ_lib().name() : data.hash.aou[ details.copy.circ_lib() ].name()); 
             var cm = details.copy.circ_modifier();
index 062665c..5351da1 100644 (file)
@@ -1074,7 +1074,14 @@ circ.util.columns = function(modify,params) {
             'flex' : 1,
             'primary' : false,
             'hidden' : true,
-            'editable' : false, 'render' : function(my) { return my.acp.circ_as_type(); }
+            'editable' : false, 'render' : function(my) {
+                return my.acp.circ_as_type() != null && my.acp.circ_as_type() == 'object'
+                    ? my.acp.circ_as_type()
+                    : ( typeof data.hash.citm[ my.acp.circ_as_type() ] != 'undefined'
+                        ? data.hash.citm[ my.acp.circ_as_type() ].value
+                        : ''
+                    );
+            }
         },
         {
             'persist' : 'hidden width ordinal',