From: erickson Date: Thu, 28 Jan 2010 15:43:31 +0000 (+0000) Subject: don't assume a null org unit value should default to the users workstation org unit... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e136f953f7b12cbb46dae154aaa6014a65ad3260;p=evergreen%2Fpines.git don't assume a null org unit value should default to the users workstation org unit. that's misleading. created a new flag to force this assumption. when not set, the value remains null git-svn-id: svn://svn.open-ils.org/ILS/trunk@15397 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 5262192bea..6ae70d59d0 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -22,6 +22,8 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { * orgLimitPerms -- If this field defines a set of org units and an orgLimitPerms * is defined, the code will limit the org units in the set to those * allowed by the permission + * orgDefaultsToWs -- If this is an org unit field and the widget has no value, + * set the value equal to the users's workstation org unit. Othwerwise, leave it null * selfReference -- The primary purpose of an AutoFieldWidget is to render the value * or widget for a field on an object (that may or may not link to another object). * selfReference allows you to sidestep the indirection and create a selector widget @@ -433,7 +435,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { this.widget.parentField = 'parent_ou'; var user = new openils.User(); - if(this.widgetValue == null) + if(this.widgetValue == null && this.orgDefaultsToWs) this.widgetValue = user.user.ws_ou(); // if we have a limit perm, find the relevent orgs (async)