[open-ils-commits] r12920 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 20 14:03:28 EDT 2009


Author: erickson
Date: 2009-04-20 14:03:25 -0400 (Mon, 20 Apr 2009)
New Revision: 12920

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
treat linked aou objects with datatype = 'link' the same as dataype = 'org_unit' objects

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2009-04-20 18:02:14 UTC (rev 12919)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2009-04-20 18:03:25 UTC (rev 12920)
@@ -188,12 +188,16 @@
                 return false;
             var lclass = linkInfo.linkClass;
 
+            if(lclass == 'aou') {
+                this.widgetValue = fieldmapper.aou.findOrgUnit(this.widgetValue).shortname();
+                return;
+            }
+
             // first try the object list cache
             if(this.cache[lclass]) {
                 for(var k in this.cache[lclass]) {
                     var cc = this.cache[lclass][k];
                     if(cc[linkInfo.vfield.name]() == this.widgetValue) {
-                        console.log("serving " + this.idlField.name + " from list cache");
                         this.widgetValue = cc[linkInfo.vfield.selector]();
                         return;
                     }
@@ -202,7 +206,6 @@
 
             // then try the single object cache
             if(this.cacheSingle[lclass] && this.cacheSingle[lclass][this.widgetValue]) {
-                console.log("serving " + this.idlField.name + " from cacheSingle");
                 this.widgetValue = this.cacheSingle[lclass][this.widgetValue];
                 return;
             }
@@ -260,6 +263,8 @@
 
             if(linkClass == 'pgt')
                 return this._buildPermGrpSelector();
+            if(linkClass == 'aou')
+                return this._buildOrgSelector();
 
             this.widget = new dijit.form.FilteringSelect(this.dijitArgs, this.parentNode);
             this.widget.searchAttr = this.widget.labelAttr = vfield.selector || vfield.name;
@@ -321,6 +326,7 @@
             this.widget.labelAttr = 'shortname';
             this.widget.parentField = 'parent_ou';
             var user = new openils.User();
+
             if(this.widgetValue == null) 
                 this.widgetValue = user.user.ws_ou();
             



More information about the open-ils-commits mailing list