dojo.require('openils.Util');
dojo.require('openils.User');
+// need these to represent the event def name
+dojo.requireLocalization('openils.conify', 'conify');
+var localeStrings = dojo.i18n.getLocalization('openils.conify', 'conify');
+
var evtCache = {};
function init() {
var evt = evtCache[this.grid.store.getValue(item, 'id')];
switch(this.field) {
+ case 'event_def':
+ return dojo.string.substitute(
+ localeStrings.EVENT_DEF_LABEL, [
+ fieldmapper.aou.findOrgUnit(evt.event_def().owner()).shortname(),
+ evt.event_def().name()
+ ]);
case 'reactor':
return evt.event_def().reactor().module();
case 'validator':
dojo.require('openils.Util');
dojo.require('openils.PermaCrud');
dojo.require('openils.widget.ProgressDialog');
+dojo.requireLocalization('openils.conify', 'conify');
+var localeStrings = dojo.i18n.getLocalization('openils.conify', 'conify');
function loadEventDef() {
edGrid.loadAll({order_by:{atevdef : 'hook'}});
circTestHookSelector.startup();
var defs = pcrud.search('atevdef', {hook : hooks.map(function(i){return i.key()})});
- circTestDefSelector.store = new dojo.data.ItemFileReadStore({data : atevdef.toStoreData(defs)});
- circTestDefSelector.searchAttr = 'id';
+ var defData = atevdef.toStoreData(defs);
+ circTestDefSelector.store = new dojo.data.ItemFileReadStore({data : defData});
+ circTestDefSelector.searchAttr = 'name';
circTestDefSelector.startup();
dojo.connect(circTestHookSelector, 'onChange',
);
}
+
+function eventDefGetter(rowIdx, item) {
+ if(!item) return '';
+ var def = this.grid.store.getValue(item, 'event_def');
+ return getDefName(def);
+}
+
+function getDefName(def) {
+
+ if(typeof def != 'object') {
+ edGrid.store.fetchItemByIdentity({
+ identity : def,
+ onItem : function(item) { def = new fieldmapper.atevdef().fromStoreItem(item); }
+ });
+ }
+
+ return dojo.string.substitute(
+ localeStrings.EVENT_DEF_LABEL, [
+ fieldmapper.aou.findOrgUnit(def.owner()).shortname(),
+ def.name()
+ ]);
+}
+
+
function evtTestCirc() {
var def = circTestDefSelector.attr('value');
var barcode = circTestBarcode.attr('value');
<table jsId="evtGrid" dojoType="dojox.grid.DataGrid" query="{id: '*'}">
<thead>
<tr>
- <th field="state" get='getField' width='12em'>State</th>
- <th field="hook" get='getField' width='12em'>Hook</th>
- <th field="reactor" get='getField' width='12em'>Reactor</th>
- <th field="validator" get='getField' width='12em'>Validator</th>
- <th field="target" get='getField' width='12em'>Target</th>
+ <th field="event_def" get='getField' width='auto'>Event Def.</th>
+ <th field="hook" get='getField' width='auto'>Hook</th>
+ <th field="reactor" get='getField' width='auto'>Reactor</th>
+ <th field="validator" get='getField' width='auto'>Validator</th>
+ <th field="target" get='getField' width='auto'>Target</th>
+ <th field="state" get='getField' width='auto'>State</th>
</tr>
</thead>
</table>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="edGrid"
dojoType="openils.widget.AutoGrid"
- fieldOrder="['id', 'owner', 'hook', 'active', 'delay', 'delay_field', 'group_field', 'validator', 'reactor']"
+ fieldOrder="['owner', 'name', 'hook', 'active', 'delay', 'delay_field', 'group_field', 'validator', 'reactor']"
suppressFields="['template', 'cleanup_failure', 'cleanup_success']"
query="{id: '*'}"
fmClass='atevdef'
<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>
+ <button dojoType='dijit.form.Button' onClick='tepGrid.showCreateDialog()'>New</button>
+ <button dojoType='dijit.form.Button' onClick='tepGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="tepGrid"
fmClass='atevparam'
defaultCellWidth='20'
editOnEnter='true'>
+ <thead>
+ <tr><th field='event_def' get='eventDefGetter'/></tr>
+ </thead>
</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>
+ <button dojoType='dijit.form.Button' onClick='teeGrid.showCreateDialog()'>New</button>
+ <button dojoType='dijit.form.Button' onClick='teeGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="teeGrid"
fmClass='atenv'
defaultCellWidth='20'
editOnEnter='true'>
+ <thead>
+ <tr><th field='event_def' get='eventDefGetter'/></tr>
+ </thead>
</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>
- <div><button dojoType='dijit.form.Button' onClick='thGrid.showCreateDialog()'>New</button></div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='thGrid.showCreateDialog()'>New</button>
+ <button dojoType='dijit.form.Button' onClick='thGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="thGrid"
fieldOrder="['key', 'core_type', 'description', 'passive']"
query="{key: '*'}"
fmClass='ath'
- defaultCellWidth='12'
+ defaultCellWidth='20'
editOnEnter='true'>
</table>
</div>
<div dojoType="dijit.layout.ContentPane" title='Reactors' id='tab-atreact'>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Trigger Reactors</div>
- <div><button dojoType='dijit.form.Button' onClick='trGrid.showCreateDialog()'>New</button></div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='trGrid.showCreateDialog()'>New</button>
+ <button dojoType='dijit.form.Button' onClick='trGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="trGrid"
<div dojoType="dijit.layout.ContentPane" title='Validators' id='tab-atval'>
<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
<div>Trigger Validators</div>
- <div><button dojoType='dijit.form.Button' onClick='tvGrid.showCreateDialog()'>New</button></div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='tvGrid.showCreateDialog()'>New</button>
+ <button dojoType='dijit.form.Button' onClick='tvGrid.deleteSelected()'>Delete Selected</button>
+ </div>
</div>
<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
<table jsId="tvGrid"