[open-ils-commits] r9296 - in branches/dojo-admin/Open-ILS: src
src/extras web/conify/global/permission web/conify/js/fieldmapper
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Apr 10 16:25:08 EDT 2008
Author: miker
Date: 2008-04-10 15:47:41 -0400 (Thu, 10 Apr 2008)
New Revision: 9296
Modified:
branches/dojo-admin/Open-ILS/src/Makefile
branches/dojo-admin/Open-ILS/src/extras/autogen.sh
branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.js
branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js
branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/OrgUtils.js
Log:
OrgUtils implemented as extentions to the fieldmapper dojo class
Modified: branches/dojo-admin/Open-ILS/src/Makefile
===================================================================
--- branches/dojo-admin/Open-ILS/src/Makefile 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/src/Makefile 2008-04-10 19:47:41 UTC (rev 9296)
@@ -69,9 +69,14 @@
mkdir -p $(ADMINDIR)
cp -r ../admin/* $(ADMINDIR)
mkdir -p $(WEBDIR)
+ mkdir -p $(WEBDIR)/js/
+ mkdir -p $(WEBDIR)/js/opensrf
mkdir -p $(WEBDIR)/opac/extras/xsl/
cp -r ../web/* $(WEBDIR)
cp $(OPENSRF_LIBS)/javascript/* $(WEBDIR)/opac/common/js/
+ # dojo-ified opensrf libs
+ cp $(OPENSRF_LIBS)/javascript/opensrf*js $(WEBDIR)/js/opensrf/
+ cp $(OPENSRF_LIBS)/javascript/OpenSRF.js $(WEBDIR)/js/
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/mresult.xml
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rresult.xml
ln -sf $(WEBDIR)/opac/skin/default/xml/index.xml $(WEBDIR)/opac/skin/default/xml/rdetail.xml
Modified: branches/dojo-admin/Open-ILS/src/extras/autogen.sh
===================================================================
--- branches/dojo-admin/Open-ILS/src/extras/autogen.sh 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/src/extras/autogen.sh 2008-04-10 19:47:41 UTC (rev 9296)
@@ -16,6 +16,7 @@
[ -z "$CONFIG" ] && echo "usage: $0 <bootstrap_config>" && exit;
JSDIR="/openils/var/web/opac/common/js/";
+FMDOJODIR="/openils/var/web/js/fieldmapper/";
SLIMPACDIR="/openils/var/web/opac/extras/slimpac/";
echo "Updating fieldmapper";
@@ -26,6 +27,7 @@
echo "Updating OrgTree";
perl org_tree_js.pl "$CONFIG" > "$JSDIR/OrgTree.js";
+cp "$JSDIR/OrgTree.js" "$FMDOJODIR/"
echo "Updating OrgTree HTML";
perl org_tree_html_options.pl "$CONFIG" "$SLIMPACDIR/lib_list.inc";
Modified: branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.html 2008-04-10 19:47:41 UTC (rev 9296)
@@ -55,8 +55,6 @@
<script type="text/javascript" src="/js/fieldmapper/Fieldmapper.js"></script>
<script type="text/javascript" src="grp_tree.js"></script>
- <script language='javascript' src='/opac/common/js/OrgTree.js' type='text/javascript'></script>
- <script type="text/javascript" src="/js/fieldmapper/OrgUtils.js"></script>
</head>
Modified: branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.js
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.js 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/web/conify/global/permission/grp_tree.js 2008-04-10 19:47:41 UTC (rev 9296)
@@ -1,4 +1,5 @@
dojo.require('fieldmapper.dojoData');
+//dojo.require('fieldmapper.OrgUtils');
dojo.require('dojo.parser');
dojo.require('dojo.data.ItemFileWriteStore');
dojo.require('dojo.date.stamp');
Modified: branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/Fieldmapper.js 2008-04-10 19:47:41 UTC (rev 9296)
@@ -67,19 +67,20 @@
var result = null;
var args = {};
- if (dojo.isObject(params)) {
- args = params;
+ if (dojo.isArray(params)) {
+ args.params = params;
} else {
- if (dojo.isArray(params)) {
- args.params = params;
+ if (dojo.isObject(params)) {
+ args = params;
} else {
args.params = arguments.splice(1, arguments.length - 1);
}
- args.timeout = 10;
}
+ if (!args.timeout) args.timeout = 10;
+
if (!args.onerror) {
args.error = function (r) {
throw 'Error encountered! ' + r;
Modified: branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/OrgUtils.js
===================================================================
--- branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/OrgUtils.js 2008-04-10 16:11:11 UTC (rev 9295)
+++ branches/dojo-admin/Open-ILS/web/conify/js/fieldmapper/OrgUtils.js 2008-04-10 19:47:41 UTC (rev 9296)
@@ -3,6 +3,7 @@
dojo._hasResource["fieldmapper.OrgUtils"] = true;
dojo.provide("fieldmapper.OrgUtils");
dojo.require("fieldmapper.Fieldmapper");
+ dojo.require("fieldmapper.OrgTree", true);
fieldmapper.aou.globalOrgTree = {};
fieldmapper.aou.OrgCache = {};
@@ -24,11 +25,13 @@
}
}
- fieldmapper.aou.LoadOrg = function (id) {
- if (fieldmapper.aou.OrgCache[id] && fieldmapper.aou.OrgCache[id].loaded)
+ fieldmapper.aou.LoadOrg = function (id, slim_ok) {
+ var slim_o = fieldmapper.aou.OrgCache[id];
+
+ if (slim_o && (slim_ok || slim_o.loaded))
return fieldmapper.aou.OrgCache[id].org;
- var o = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],{ params: [null,id]});
+ var o = fieldmapper.standardRequest(['open-ils.actor','open-ils.actor.org_unit.retrieve'],[null,id]);
fieldmapper.aou.OrgCache[o.id()] = { loaded : true, org : o };
return o;
}
@@ -56,9 +59,10 @@
continue;
}
- var parent = fieldmapper.aou.findOrgUnit(x.parent_ou());
+ var parent = fieldmapper.aou.findOrgUnit(x.parent_ou(),true);
if (!parent.children()) parent.children([]);
parent.children().push(x);
+ fieldmapper.aou.OrgCache[x.id()].treePtr = x;
}
for (var i in globalOrgTypes) {
@@ -156,13 +160,16 @@
dojo.addOnUnload( function () {
for (var i in fieldmapper.aou.OrgCache) {
- x=fieldmapper.aou.OrgCache[i];
+ x=fieldmapper.aou.OrgCache[i].treePtr;
+ if (!x) continue;
+
x.children(null);
x.parent_ou(null);
fieldmapper.aou.OrgCache[i]=null;
}
fieldmapper.aou.globalOrgTree = null;
fieldmapper.aou.OrgCache = null;
+ fieldmapper.aou.OrgCacheSN = null;
fieldmapper.aout.OrgTypeCache = null;
});
}
More information about the open-ils-commits
mailing list