From 6aa65984340feccbb732da4555cc9abde596145b Mon Sep 17 00:00:00 2001 From: pines Date: Mon, 4 Sep 2006 00:23:40 +0000 Subject: [PATCH] get rid of Barcode column in patron search git-svn-id: svn://svn.open-ils.org/ILS/trunk@5909 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../server/patron/search_result.js | 5 ++ .../xul/staff_client/server/patron/util.js | 47 +++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) 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 b076e59874..bf78f52341 100644 --- a/Open-ILS/xul/staff_client/server/patron/search_result.js +++ b/Open-ILS/xul/staff_client/server/patron/search_result.js @@ -33,6 +33,11 @@ patron.search_result.prototype = { 'first_given_name' : { 'hidden' : 'false' }, 'second_given_name' : { 'hidden' : 'false' }, 'dob' : { 'hidden' : 'false' }, + }, + { + 'except_these' : [ + 'barcode', + ], } ); obj.list.init( diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index ff8def25dc..8c55ee2d74 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -91,7 +91,16 @@ patron.util.mbts_columns = function(modify,params) { var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);}); new_c.push( function(y){ return y; }( x ) ); } - return new_c; + c = new_c; + } + if (params.except_these) { + JSAN.use('util.functional'); + var new_c = []; + for (var i = 0; i < c.length; i++) { + var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);}); + if (!x) new_c.push(c[i]); + } + c = new_c; } } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); @@ -158,8 +167,18 @@ patron.util.mb_columns = function(modify,params) { var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);}); new_c.push( function(y){ return y; }( x ) ); } - return new_c; + c = new_c; + } + if (params.except_these) { + JSAN.use('util.functional'); + var new_c = []; + for (var i = 0; i < c.length; i++) { + var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);}); + if (!x) new_c.push(c[i]); + } + c = new_c; } + } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); } @@ -221,8 +240,18 @@ patron.util.mp_columns = function(modify,params) { var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);}); new_c.push( function(y){ return y; }( x ) ); } - return new_c; + c = new_c; } + if (params.except_these) { + JSAN.use('util.functional'); + var new_c = []; + for (var i = 0; i < c.length; i++) { + var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);}); + if (!x) new_c.push(c[i]); + } + c = new_c; + } + } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); } @@ -364,8 +393,18 @@ patron.util.columns = function(modify,params) { var x = util.functional.find_list(c,function(d){return(d.id==params.just_these[i]);}); new_c.push( function(y){ return y; }( x ) ); } - return new_c; + c = new_c; } + if (params.except_these) { + JSAN.use('util.functional'); + var new_c = []; + for (var i = 0; i < c.length; i++) { + var x = util.functional.find_list(params.except_these,function(d){return(d==c[i].id);}); + if (!x) new_c.push(c[i]); + } + c = new_c; + } + } return c.sort( function(a,b) { if (a.label < b.label) return -1; if (a.label > b.label) return 1; return 0; } ); } -- 2.43.2