From 64d3349c978389a57511ee1b65514a9679cae6d3 Mon Sep 17 00:00:00 2001 From: phasefx Date: Fri, 10 Sep 2010 16:35:40 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.open-ils.org/ILS/trunk@17577 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/chrome/content/util/list.js | 21 +++++++++++++++++-- .../staff_client/server/patron/search_result.js | 24 ++++++++-------------- 2 files changed, 28 insertions(+), 17 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index e0568a15f..b8232ccd5 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -1746,19 +1746,36 @@ util.list.prototype = { 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) { diff --git a/Open-ILS/xul/staff_client/server/patron/search_result.js b/Open-ILS/xul/staff_client/server/patron/search_result.js index 4285e38a8..a7d337aba 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -29,21 +29,15 @@ patron.search_result.prototype = { 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, -- 2.11.0