if (x.parent_ou() == null || x.parent_ou() == '') {
globalOrgTree = x;
continue;
- } else {
- x.parent_ou(orgArraySearcher[x.parent_ou()]);
- }
- if (!x.parent_ou().children())
- x.parent_ou().children(new Array());
+ }
- x.parent_ou().children().push(x.id());
+ var parent = findOrgUnit(x.parent_ou());
+ if (!parent.children()) parent.children(new Array());
+ parent.children().push(x);
}
+
function _tree_killer () {
for (var i in orgArraySearcher) {
x=orgArraySearcher[i];
}
var globalOrgTypes = JSON2js("[/*--S aout--*/[null,null,null,null,0,0,0,1,\"Consortium\",\"Everywhere in PINES\"]/*--E aout--*/,/*--S aout--*/[null,null,null,null,0,0,1,2,\"System\",\"Local Library System\",1]/*--E aout--*/,/*--S aout--*/[null,null,null,null,1,1,2,3,\"Branch\",\"This Branch\",2]/*--E aout--*/,/*--S aout--*/[null,null,null,null,1,1,3,5,\"Bookmobile\",\"Your Bookmobile\",3]/*--E aout--*/,/*--S aout--*/[null,null,null,null,1,1,3,4,\"Sub-lib\",\"This Specialized Library\",3]/*--E aout--*/]");
+
+alert(js2JSON(globalOrgTree));
}
+/*
function EX(message) { this.init(message); }
EX.prototype.init = function(message) { this.message = message; }
EX.prototype.toString = function() { return "\n *** Exception Occured \n" + this.message; }
EXCommunication.prototype.constructor = EXCommunication;
EXCommunication.baseClass = EX.prototype.constructor;
function EXCommunication(message) { this.init("EXCommunication: " + message); }
+*/
/* ----------------------------------------------------------------------- */
function cleanISBN(isbn) {
tree.add(node.id(), -1, node.name(),
"javascript:orgSelect(" + node.id() + ");", node.name());
else {
- tree.add(node.id(), node.parent_ou().id(), node.name(),
+ tree.add(node.id(), findOrgUnit(node.parent_ou()).id(), node.name(),
"javascript:orgSelect(" + node.id() + ");", node.name());
}
}