[open-ils-commits] r11341 - trunk/Open-ILS/web/js/dojo/openils/widget
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 25 10:51:39 EST 2008
Author: erickson
Date: 2008-11-25 10:51:37 -0500 (Tue, 25 Nov 2008)
New Revision: 11341
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js
Log:
created general perm group object and using that in the perm filtering select
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js 2008-11-25 15:48:07 UTC (rev 11340)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/PermGrpFilteringSelect.js 2008-11-25 15:51:37 UTC (rev 11341)
@@ -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;
}
More information about the open-ils-commits
mailing list