From 57671ab276ee5fcd26d7ed7537d3272cd71717e0 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 25 Nov 2008 15:51:37 +0000 Subject: [PATCH] created general perm group object and using that in the perm filtering select git-svn-id: svn://svn.open-ils.org/ILS/trunk@11341 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../dojo/openils/widget/PermGrpFilteringSelect.js | 33 ++-------------------- 1 file changed, 3 insertions(+), 30 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js b/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js index 00e4229de7..29d34fe608 100644 --- a/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js +++ b/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js @@ -1,48 +1,21 @@ if(!dojo._hasResource["openils.widget.PermGrpFilteringSelect"]){ - dojo._hasResource["openils.widget.PermGrpFilteringSelect"] = true; dojo.provide("openils.widget.PermGrpFilteringSelect"); dojo.require("dijit.form.FilteringSelect"); dojo.require('dojo.data.ItemFileReadStore'); dojo.require('openils.Util'); + dojo.require('openils.PermGrp'); dojo.declare( "openils.widget.PermGrpFilteringSelect", [dijit.form.FilteringSelect], { - fetchGroups : function(onload) { - - if(this.groupTree) - return onload(); - var self = this; - - fieldmapper.standardRequest( - ['open-ils.actor', 'open-ils.actor.groups.tree.retrieve'], - { async: true, - oncomplete: function(r) { - self.groupTree = openils.Util.readResponse(r); - onload(); - } - } - ); - }, - - flatten : function(node) { - if(!node) { - node = this.groupTree; - this.groupMap = {}; - } - this.groupMap[node.id()] = node; - for(var idx in node.children()) - this.flatten(node.children()[idx]); - }, - drawGroups : function() { var self = this; - this.fetchGroups(function(){self._drawGroups()}); + openils.PermGrp.fetchGroupTree(function(){self._drawGroups()}); }, _drawGroups : function(node, depth, list) { if(!node) { - node = this.groupTree; + node = openils.PermGrp.groupTree; list = []; depth = 0; } -- 2.11.0