From 385dbfdd64ced6726f9d37189084a8d0128ddf3b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 7 Mar 2013 14:11:20 -0500 Subject: [PATCH] hook up user_edit.xul with stringbundles Also get rid of user_edit.js's local grep function and replace with util.functional.filter_list; otherwise, it clashes with a different version of the grep function that expects the arguments in a different order. Signed-off-by: Galen Charlton --- Open-ILS/xul/staff_client/server/patron/user_edit.js | 16 ++++------------ Open-ILS/xul/staff_client/server/patron/user_edit.xul | 4 ++++ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/user_edit.js b/Open-ILS/xul/staff_client/server/patron/user_edit.js index 39d0001c77..0e0c44d998 100644 --- a/Open-ILS/xul/staff_client/server/patron/user_edit.js +++ b/Open-ILS/xul/staff_client/server/patron/user_edit.js @@ -248,19 +248,11 @@ function init_editor (u) { return true; } -function grep ( code, list ) { - var ret = []; - for (var i in list) { - if (code(list[i])) ret.push(list[i]); - } - return ret; -} - function trim_ou_tree (tree, list) { for (var i in tree) { if (!tree[i]) continue; - var type = grep( function(x) {return x.id() == tree[i].ou_type()}, ou_type_list )[0]; + var type = util.functional.filter_list( ou_type_list, function(x) {return x.id() == tree[i].ou_type()} )[0]; if ( type && type.can_have_users() == 't' ) list.push(tree[i]); @@ -280,9 +272,9 @@ function display_work_ou (root,ou_def,r) { findNodeByName(wrow,'a.id').setAttribute('workou_id', ou_def.id()); - var has_it = grep( - function(x){ return x.work_ou() == ou_def.id() }, - user_work_ous + var has_it = util.functional.filter_list( + user_work_ous, + function(x){ return x.work_ou() == ou_def.id() } ).length; findNodeByName(wrow,'a.id').checked = has_it > 0 ? true : false; diff --git a/Open-ILS/xul/staff_client/server/patron/user_edit.xul b/Open-ILS/xul/staff_client/server/patron/user_edit.xul index 960924b417..9529d002d5 100644 --- a/Open-ILS/xul/staff_client/server/patron/user_edit.xul +++ b/Open-ILS/xul/staff_client/server/patron/user_edit.xul @@ -14,6 +14,10 @@ ]> + + + + -- 2.11.0