add some default event def granularities. when an override widget is defined, still...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Dec 2009 15:40:16 +0000 (15:40 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 3 Dec 2009 15:40:16 +0000 (15:40 +0000)
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
Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js
Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2

index 7283f0a..9318356 100644 (file)
@@ -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');
index f869cc4..d56b91d 100644 (file)
@@ -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';
index 3e33eb5..aa49713 100644 (file)
@@ -3,6 +3,16 @@
 <script src='[% ctx.media_prefix %]/js/ui/default/conify/global/action_trigger/event_definition.js'> </script>
 <script>openils.Util.addOnLoad(loadEventDef)</script>
 
+<div class='hidden'>
+    <select dojoType='dijit.form.ComboBox' jsId='eventDefGranularity'>
+        <option value='hourly'>Hourly</option>
+        <option value='daily'>Daily</option>
+        <option value='weekly'>Weekly</option>
+        <option value='monthly'>Monthly</option>
+        <option value='yearly'>Yearly</option>
+    </select>
+</div>
+
 
 <div dojoType="dijit.layout.TabContainer" style='height:100%;' jsId='eventDefTabs'>