[open-ils-commits] r17577 - in trunk/Open-ILS/xul/staff_client: chrome/content/util server/patron (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Sep 10 12:35:44 EDT 2010


Author: phasefx
Date: 2010-09-10 12:35:40 -0400 (Fri, 10 Sep 2010)
New Revision: 17577

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
   trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
Log:
move Patron Search over to fm_columns instead of patron.util.columns (the former makes use of fm_IDL.xml and can automagically make use of new fields, etc.).  Also give fm_columns the ability to hide virtual fields from the column picker

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2010-09-10 16:35:37 UTC (rev 17576)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/list.js	2010-09-10 16:35:40 UTC (rev 17577)
@@ -1746,19 +1746,36 @@
                         if (column_extras['*']['expanded_label']) {
                             def.label = my_class.label + ': ' + def.label;
                         }
+                        if (column_extras['*']['remove_virtual']) {
+                            if (my_field.virtual) {
+                                def.remove_me = true;
+                            }
+                        }
                     }
                     if (column_extras[col_id]) {
                         for (var attr in column_extras[col_id]) {
                             def[attr] = column_extras[col_id][attr];
                         }
+                        if (column_extras[col_id]['keep_me']) {
+                            def.remove_me = false;
+                        }
                     }
                 }
-                return def;
+                if (def.remove_me) {
+                    dump('Skipping ' + def.label + '\n');
+                    return null;
+                } else {
+                    dump('Defining ' + def.label + '\n');
+                    return def;
+                }
             }
  
             for (var i = 0; i < my_class.fields.length; i++) {
                 var my_field = my_class.fields[i];
-                columns.push( col_def(my_field) );
+                var def = col_def(my_field);
+                if (def) {
+                    columns.push( def );
+                }
             }
 
         } catch(E) {

Modified: trunk/Open-ILS/xul/staff_client/server/patron/search_result.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/search_result.js	2010-09-10 16:35:37 UTC (rev 17576)
+++ trunk/Open-ILS/xul/staff_client/server/patron/search_result.js	2010-09-10 16:35:40 UTC (rev 17577)
@@ -29,21 +29,15 @@
         JSAN.use('util.list'); obj.list = new util.list('patron_list');
 
         JSAN.use('patron.util');
-        var columns = patron.util.columns(
-            {
-                /* 'active' : { 'hidden' : 'false' }, */
-                'barred' : { 'hidden' : 'false' },
-                'family_name' : { 'hidden' : 'false' },
-                'first_given_name' : { 'hidden' : 'false' },
-                'second_given_name' : { 'hidden' : 'false' },
-                'dob' : { 'hidden' : obscure_dob }
-            },
-            {
-                'except_these' : [
-                    'au_barcode',
-                ]
-            }
-        );
+        var columns = obj.list.fm_columns('au',{
+            '*' : { 'remove_virtual' : true, 'expanded_label' : false, 'hidden' : true },
+            'au_barcode' : { 'hidden' : false },
+            'au_barred' : { 'hidden' : false },
+            'au_family_name' : { 'hidden' : false },
+            'au_first_given_name' : { 'hidden' : false },
+            'au_second_given_name' : { 'hidden' : false },
+            'au_dob' : { 'hidden' : false }
+        });
         obj.list.init(
             {
                 'columns' : columns,



More information about the open-ils-commits mailing list