From 229cdaecf6b8b70c88120de438e303990bd896a9 Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 3 Dec 2009 15:40:16 +0000 Subject: [PATCH] add some default event def granularities. when an override widget is defined, still try to set the value of the widget based on the object being edited git-svn-id: svn://svn.open-ils.org/ILS/trunk@15067 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 6 ++++-- .../default/conify/global/action_trigger/event_definition.js | 2 ++ .../default/conify/global/action_trigger/event_definition.tt2 | 10 ++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 7283f0a6d4..93183561c1 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -128,10 +128,14 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { build : function(onload) { + if(this.widgetValue == null) + this.widgetValue = (this.fmObject) ? this.fmObject[this.idlField.name]() : null; + if(this.widget) { // core widget provided for us, attach and move on if(this.parentNode) // may already be in the "right" place this.parentNode.appendChild(this.widget.domNode); + this._widgetLoaded(); return; } @@ -139,8 +143,6 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { this.parentNode = dojo.create('div'); this.onload = onload; - if(this.widgetValue == null) - this.widgetValue = (this.fmObject) ? this.fmObject[this.idlField.name]() : null; if(this.readOnly) { dojo.require('dijit.layout.ContentPane'); diff --git a/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js b/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js index f869cc44d9..d56b91dab8 100644 --- a/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js +++ b/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js @@ -14,6 +14,8 @@ var localeStrings = dojo.i18n.getLocalization('openils.conify', 'conify'); var eventDef = null; function loadEventDef() { + eventDefGranularity.attr('value', null); + edGrid.overrideEditWidgets.granularity = eventDefGranularity; edGrid.loadAll({order_by:{atevdef : 'hook'}}); openils.widget.Textarea.width = '600px'; openils.widget.Textarea.height = '600px'; diff --git a/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 b/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 index 3e33eb573f..aa49713b04 100644 --- a/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 +++ b/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 @@ -3,6 +3,16 @@ + +
-- 2.11.0