hook up user_edit.xul with stringbundles collab/phasefx/stringbundles
authorGalen Charlton <gmc@esilibrary.com>
Thu, 7 Mar 2013 19:11:20 +0000 (14:11 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 7 Mar 2013 19:11:20 +0000 (14:11 -0500)
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 <gmc@esilibrary.com>
Open-ILS/xul/staff_client/server/patron/user_edit.js
Open-ILS/xul/staff_client/server/patron/user_edit.xul

index 39d0001..0e0c44d 100644 (file)
@@ -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;
index 960924b..9529d00 100644 (file)
     <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
 ]>
 
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
 <window id="patron_barcode_entry_win" 
     onload="try { init_editor(); } catch(E) { alert(js2JSON(E)); }"
     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">