From 84f0cd0d44cb7b570523db143bd5614168745c8b Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 21 Feb 2006 16:19:57 +0000 Subject: [PATCH] some small tweaks and utility methods git-svn-id: svn://svn.open-ils.org/ILS/trunk@3148 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/admin/admin.css | 1 + .../xul/staff_client/server/admin/adminlib.js | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/admin/admin.css b/Open-ILS/xul/staff_client/server/admin/admin.css index 8f7acf922e..ff65241ba4 100644 --- a/Open-ILS/xul/staff_client/server/admin/admin.css +++ b/Open-ILS/xul/staff_client/server/admin/admin.css @@ -1,3 +1,4 @@ +body { font-family: Verdana, Tahoma; font-size: 10pt; } .welcome_box { position:absolute; top: 5px; right: 5px; } .title { font-weight: bold; font-size: 14pt; margin: 10px;} .hide_me { visibility: hidden; display: none } diff --git a/Open-ILS/xul/staff_client/server/admin/adminlib.js b/Open-ILS/xul/staff_client/server/admin/adminlib.js index af55c167d2..922a2e9cc0 100644 --- a/Open-ILS/xul/staff_client/server/admin/adminlib.js +++ b/Open-ILS/xul/staff_client/server/admin/adminlib.js @@ -1,6 +1,12 @@ var USER; var SESSION; var PERMS = {}; +var ORG_CACHE = {}; + +var XML_ELEMENT_NODE = 1; +var XML_TEXT_NODE = 3; + +var FETCH_ORG_UNIT = "open-ils.actor:open-ils.actor.org_unit.retrieve"; function fetchUser(session) { if(session == null ) { @@ -17,6 +23,10 @@ function fetchUser(session) { return user; } +function fetchFleshedUser(id) { + if(id == null) return null; +} + /** * Fetches the highest org at for each perm and stores the value in * PERMS[ permName ]. It also returns the org list to the caller @@ -73,3 +83,27 @@ function checkDisabled( node, itemOrg, perm ) { var mydepth = findOrgDepth(PERMS[perm]); if( mydepth != -1 && mydepth <= itemDepth ) node.disabled = false; } + + +function fetchOrgUnit(id, callback) { + + if(ORG_CACHE[id]) return ORG_CACHE[id]; + var req = new Request(FETCH_ORG_UNIT, SESSION, id); + + if(callback) { + req.callback( + function(r) { + var org = r.getResultObject(); + ORG_CACHE[id] = org; + callback(org); + } + ); + req.send(); + + } else { + req.send(true); + var org = req.result(); + ORG_CACHE[id] = org; + return org; + } +} -- 2.43.2