From: erickson Date: Mon, 20 Apr 2009 18:03:25 +0000 (+0000) Subject: treat linked aou objects with datatype = 'link' the same as dataype = 'org_unit'... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7cad2598c282035d4e41a2aeb6febe1ead40c8f5;p=evergreen%2Fmasslnc.git treat linked aou objects with datatype = 'link' the same as dataype = 'org_unit' objects git-svn-id: svn://svn.open-ils.org/ILS/trunk@12920 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 412100224c..4bcc042894 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -188,12 +188,16 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { 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 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { // 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(!dojo._hasResource['openils.widget.AutoFieldWidget']) { 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 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { this.widget.labelAttr = 'shortname'; this.widget.parentField = 'parent_ou'; var user = new openils.User(); + if(this.widgetValue == null) this.widgetValue = user.user.ws_ou();