moved JS to external file. added tab for trigger environment. using override widget...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Mar 2009 01:24:33 +0000 (01:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 2 Mar 2009 01:24:33 +0000 (01:24 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12340 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js [new file with mode: 0644]
Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2

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
new file mode 100644 (file)
index 0000000..b4f585c
--- /dev/null
@@ -0,0 +1,36 @@
+dojo.require('dijit.layout.TabContainer');
+dojo.require('dijit.form.Textarea');
+dojo.require('openils.widget.AutoGrid');
+dojo.require('openils.Util');
+
+
+function loadEventDef() { 
+    edGrid.loadAll({order_by:{atevdef : 'hook'}}); 
+    edGrid.overrideEditWidgetClass.template = 'dijit.form.Textarea';
+    dojo.connect(eventDefTabs,'selectChild', tabLoader);
+}
+
+var loadedTabs = {'tab-atevdef' : true};
+function tabLoader(child) {
+    if(loadedTabs[child.id]) return;
+    loadedTabs[child.id] = true;
+    switch(child.id) {
+        case 'tab-atevparam': 
+            tepGrid.loadAll({order_by:{atevparam : 'event_def'}}); 
+            break;
+        case 'tab-ath': 
+            thGrid.loadAll({order_by:{ath : 'key'}}); 
+            break;
+        case 'tab-atenv': 
+            teeGrid.loadAll({order_by:{atenv : 'event_def'}}); 
+            break;
+        case 'tab-atreact': 
+            trGrid.loadAll({order_by:{atreact : 'module'}}); 
+            break;
+        case 'tab-atval': 
+            tvGrid.loadAll({order_by:{atval : 'module'}}); 
+            break;
+    }
+}
+
+openils.Util.addOnLoad(loadEventDef);
index 5b0834f..9c7de3a 100644 (file)
@@ -1,51 +1,62 @@
 [% WRAPPER default/base.tt2 %]
-<script>
-    dojo.require('dijit.layout.TabContainer');
-    dojo.require('openils.widget.AutoGrid');
-    var loaded = {'tab-atevdef' : true};
+<script src='[% ctx.media_prefix %]/js/ui/default/conify/global/action_trigger/event_definition.js'> </script>
 
-    openils.Util.addOnLoad(
-        function() { 
-            edGrid.loadAll({order_by:{atevdef : 'hook'}}); 
-            dojo.connect(tabs,'selectChild', 
-                function(child) { 
-                    if(loaded[child.id]) return;
-                    loaded[child.id] = true;
-                    switch(child.id) {
-                        case 'tab-ath': 
-                            thGrid.loadAll({order_by:{ath : 'key'}}); 
-                            break;
-                        case 'tab-atreact': 
-                            trGrid.loadAll({order_by:{atreact : 'module'}}); 
-                            break;
-                        case 'tab-atval': 
-                            tvGrid.loadAll({order_by:{atval : 'module'}}); 
-                            break;
-                    }
-                }
-            );
-        }
-    );
-</script>
-
-<div dojoType="dijit.layout.TabContainer" style='height:100%;' jsId='tabs'>
+<div dojoType="dijit.layout.TabContainer" style='height:100%;' jsId='eventDefTabs'>
 
     <div dojoType="dijit.layout.ContentPane" title='Event Definitions' selected='true' id='tab-atevdef'>
         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
             <div>Trigger Event Definitions</div>
-            <div><button dojoType='dijit.form.Button' onClick='edGrid.showCreateDialog()'>New</button></div>
+            <div><button dojoType='dijit.form.Button' onClick='edGrid.showCreatePane()'>New</button></div>
         </div>
         <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
             <table  jsId="edGrid" 
                     dojoType="openils.widget.AutoGrid" 
                     fieldOrder="['id', 'owner', 'hook', 'active', 'delay', 'validator', 'reactor']"
+                    suppressFields="['template']"
                     query="{id: '*'}" 
                     fmClass='atevdef'
+                    defaultCellWidth='8'
+                    editStyle='pane'
+                    editOnEnter='true'>
+            </table>
+        </div>
+    </div>
+
+    <div dojoType="dijit.layout.ContentPane" title='Event Parameters' id='tab-atevparam'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+            <div>Trigger Event Parameters</div>
+            <div><button dojoType='dijit.form.Button' onClick='tepGrid.showCreateDialog()'>New</button></div>
+        </div>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
+            <table  jsId="tepGrid" 
+                    dojoType="openils.widget.AutoGrid" 
+                    fieldOrder="['id', 'event_def', 'param', 'value']"
+                    query="{id: '*'}" 
+                    fmClass='atevparam'
+                    defaultCellWidth='20'
+                    editOnEnter='true'>
+            </table>
+        </div>
+    </div>
+
+    <div dojoType="dijit.layout.ContentPane" title='Event Environment' id='tab-atenv'>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+            <div>Trigger Event Environment</div>
+            <div><button dojoType='dijit.form.Button' onClick='teeGrid.showCreateDialog()'>New</button></div>
+        </div>
+        <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
+            <table  jsId="teeGrid" 
+                    dojoType="openils.widget.AutoGrid" 
+                    fieldOrder="['id', 'event_def', 'path', 'collector', 'label']"
+                    query="{id: '*'}" 
+                    fmClass='atenv'
+                    defaultCellWidth='20'
                     editOnEnter='true'>
             </table>
         </div>
     </div>
 
+
     <div dojoType="dijit.layout.ContentPane" title='Hooks' id='tab-ath'>
         <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
             <div>Trigger Hooks</div>
@@ -57,7 +68,6 @@
                     fieldOrder="['key', 'core_type', 'description', 'passive']"
                     query="{key: '*'}" 
                     fmClass='ath'
-                    fmClass='atval'
                     defaultCellWidth='12'
                     editOnEnter='true'>
             </table>
@@ -74,7 +84,6 @@
                     dojoType="openils.widget.AutoGrid" 
                     query="{module: '*'}" 
                     fmClass='atreact'
-                    fmClass='atval'
                     editOnEnter='true'>
                 <thead>
                     <tr>