From: phasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Wed, 2 Jun 2010 22:39:16 +0000 (+0000)
Subject: fix logic error that could result in partial list of available libs for workstation... 
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=978e30624c936da108b5d57ceae469b0167ec8de;p=contrib%2FConifer.git

fix logic error that could result in partial list of available libs for workstation registration

git-svn-id: svn://svn.open-ils.org/ILS/trunk@16566 dcc99617-32d9-48b4-a31d-7c20da2025e4
---

diff --git a/Open-ILS/xul/staff_client/server/main/ws_info.xul b/Open-ILS/xul/staff_client/server/main/ws_info.xul
index 8d634b688f..a4978271b6 100644
--- a/Open-ILS/xul/staff_client/server/main/ws_info.xul
+++ b/Open-ILS/xul/staff_client/server/main/ws_info.xul
@@ -97,9 +97,13 @@
 
             g.my_libs_shortname_hash = {};
             g.my_libs_ou_hash = {};
+            g.my_deduped_libs = [];
             for (var i = 0; i < g.my_libs.length; i++) {
-                g.my_libs_shortname_hash[ g.my_libs[i].id() ] = g.my_libs[i].shortname();
-                g.my_libs_ou_hash[ g.my_libs[i].id() ] = function(o){return o;}(g.my_libs[i]);
+                if (! defined g.my_libs_shortname_hash[ g.my_libs[i].id() ]) {
+                    g.my_libs_shortname_hash[ g.my_libs[i].id() ] = g.my_libs[i].shortname();
+                    g.my_libs_ou_hash[ g.my_libs[i].id() ] = function(o){return o;}(g.my_libs[i]);
+                    g.my_deduped_libs.push( g.my_libs[i] );
+                }
             }
 
             g.tb = document.getElementById('wsname');
@@ -133,7 +137,7 @@
 
             g.ml = util.widgets.make_menulist( 
                 util.functional.map_list( 
-                    util.fm_utils.flatten_ou_branch( g.my_libs_tree ),
+                    g.my_deduped_libs,
                     function(obj) { 
                         if (!default_lib) {
                             if ( get_bool( g.aout_hash[ obj.ou_type() ].can_have_users() ) ) default_lib = obj.id();