[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 4e1293fb42b4641cbeb4118b6ffe266c09a7a272

Evergreen Git git at git.evergreen-ils.org
Mon Jan 20 16:59:30 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  4e1293fb42b4641cbeb4118b6ffe266c09a7a272 (commit)
      from  a6a6c94485ed47a1fe46669d7221cb5bf01a5a7d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 4e1293fb42b4641cbeb4118b6ffe266c09a7a272
Author: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
Date:   Wed Jan 15 17:53:25 2014 -0500

    LP#882586: In Serial Control View, show copy templates owned by ancestors
    
    When creating/editing distributions, dropdowns for Receive Unit Template
    and Bind Unit Template now show copy templates owned not only at the
    distribution's holding lib, but at any of the holding lib's ancestors.
    
    Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/xul/staff_client/chrome/content/util/fm_utils.js b/Open-ILS/xul/staff_client/chrome/content/util/fm_utils.js
index e0cfe7c..34868d3 100644
--- a/Open-ILS/xul/staff_client/chrome/content/util/fm_utils.js
+++ b/Open-ILS/xul/staff_client/chrome/content/util/fm_utils.js
@@ -3,7 +3,7 @@ dump('entering util/fm_utils.js\n');
 if (typeof util == 'undefined') var util = {};
 util.fm_utils = {};
 
-util.fm_utils.EXPORT_OK    = [ 'flatten_ou_branch', 'find_ou', 'compare_aou_a_is_b_or_ancestor', 'sort_func_aou_by_depth_and_then_string', 'find_common_aou_ancestor', 'find_common_aou_ancestors' ];
+util.fm_utils.EXPORT_OK    = [ 'flatten_ou_branch', 'find_ou', 'compare_aou_a_is_b_or_ancestor', 'sort_func_aou_by_depth_and_then_string', 'find_common_aou_ancestor', 'find_common_aou_ancestors',  'aou_get_ancestor_list_by_id' ];
 util.fm_utils.EXPORT_TAGS    = { ':all' : util.fm_utils.EXPORT_OK };
 
 util.fm_utils.flatten_ou_branch = function(branch) {
@@ -145,3 +145,19 @@ util.fm_utils.find_common_aou_ancestors = function(orgs) {
     }
 }
 
+/* There wasn't already something like this in staff client JS? Really? */
+util.fm_utils.aou_get_ancestor_list_by_id = function(aou_id) {
+    JSAN.use('OpenILS.data');
+    var data = new OpenILS.data();
+    data.stash_retrieve();
+
+    var list = [];
+
+    var aou = data.hash.aou[aou_id];
+    do {
+        list.push(aou.id());
+        aou = data.hash.aou[aou.parent_ou()];
+    } while (aou);
+
+    return list;
+}
diff --git a/Open-ILS/xul/staff_client/server/serial/sdist_editor.js b/Open-ILS/xul/staff_client/server/serial/sdist_editor.js
index d080f8a..96e1048 100644
--- a/Open-ILS/xul/staff_client/server/serial/sdist_editor.js
+++ b/Open-ILS/xul/staff_client/server/serial/sdist_editor.js
@@ -401,10 +401,22 @@ serial.sdist_editor.prototype = {
                 return obj.act_lists[lib_id];
             }
             
+            /* get (and cache) list of ancestors for lib_id */
+            obj.aou_ancestor_list_by_id =
+                obj.aou_ancestor_list_by_id || [];
+
+            if (!obj.aou_ancestor_list_by_id[lib_id]) {
+                JSAN.use('util.fm_utils');
+                obj.aou_ancestor_list_by_id[lib_id] = util.fm_utils.aou_get_ancestor_list_by_id(lib_id);
+
+                if (!obj.aou_ancestor_list_by_id[lib_id].length)
+                    throw "ancestor list for " + lib_id + " empty?"; /* unlikely */
+            }
+
             var act_list = obj.network.request(
                 'open-ils.pcrud',
                 'open-ils.pcrud.search.act',
-                [ ses(), {"owning_lib" : lib_id }, {"order_by" : {"act" : "name"} } ]
+                [ ses(), {"owning_lib" : obj.aou_ancestor_list_by_id[lib_id] }, {"order_by" : {"act" : "name"} } ]
             );
 
             if (act_list == null) {

-----------------------------------------------------------------------

Summary of changes:
 .../staff_client/chrome/content/util/fm_utils.js   |   18 +++++++++++++++++-
 .../xul/staff_client/server/serial/sdist_editor.js |   14 +++++++++++++-
 2 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list