[open-ils-commits] r12779 - in trunk/Open-ILS/web: css/skin js/ui/default/conify/global/action_trigger templates/default/conify/global/action_trigger (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 3 14:27:01 EDT 2009
Author: erickson
Date: 2009-04-03 14:26:58 -0400 (Fri, 03 Apr 2009)
New Revision: 12779
Modified:
trunk/Open-ILS/web/css/skin/default.css
trunk/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js
trunk/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2
Log:
added initial 'test circ event def by barcode' functionality
Modified: trunk/Open-ILS/web/css/skin/default.css
===================================================================
--- trunk/Open-ILS/web/css/skin/default.css 2009-04-03 18:26:09 UTC (rev 12778)
+++ trunk/Open-ILS/web/css/skin/default.css 2009-04-03 18:26:58 UTC (rev 12779)
@@ -85,3 +85,8 @@
text-align:right;
float:right;
}
+
+
+.oils-progress-dialog { width: 300px; }
+
+
Modified: trunk/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js 2009-04-03 18:26:09 UTC (rev 12778)
+++ trunk/Open-ILS/web/js/ui/default/conify/global/action_trigger/event_definition.js 2009-04-03 18:26:58 UTC (rev 12779)
@@ -1,7 +1,12 @@
dojo.require('dijit.layout.TabContainer');
dojo.require('dijit.form.Textarea');
+dojo.require('dijit.form.FilteringSelect');
+dojo.require('dijit.form.TextBox');
+dojo.require('dojo.data.ItemFileReadStore');
dojo.require('openils.widget.AutoGrid');
dojo.require('openils.Util');
+dojo.require('openils.PermaCrud');
+dojo.require('openils.widget.ProgressDialog');
function loadEventDef() {
@@ -30,7 +35,59 @@
case 'tab-atval':
tvGrid.loadAll({order_by:{atval : 'module'}});
break;
+ case 'tab-test':
+ loadTestTab();
+ break;
}
}
+function loadTestTab() {
+ var pcrud = new openils.PermaCrud();
+ var hooks = pcrud.search('ath', {core_type : 'circ'});
+
+ circTestHookSelector.store = new dojo.data.ItemFileReadStore({data : ath.toStoreData(hooks, 'key', {identifier:'key'})});
+ circTestHookSelector.searchAttr = 'key';
+ 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';
+ circTestDefSelector.startup();
+
+ dojo.connect(circTestHookSelector, 'onChange',
+ function() {
+ circTestDefSelector.query = {hook : this.attr('value')};
+ }
+ );
+}
+
+function evtTestCirc() {
+ var def = circTestDefSelector.attr('value');
+ var barcode = circTestBarcode.attr('value');
+ if(!(def && barcode)) return;
+
+ progressDialog.show();
+
+ function handleResponse(r) {
+ var evt = openils.Util.readResponse(r);
+ progressDialog.hide();
+ if(evt && evt != '0') {
+ var output = evt.template_output();
+ if(!output) output = evt.error_output();
+ var pre = document.createElement('pre');
+ pre.innerHTML = output.data();
+ dojo.byId('test-event-output').appendChild(pre);
+ openils.Util.show('test-event-output');
+ }
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.circ', 'open-ils.circ.trigger_event_by_def_and_barcode.fire'],
+ { async: true,
+ params: [openils.User.authtoken, def, barcode],
+ oncomplete: handleResponse
+ }
+ );
+}
+
openils.Util.addOnLoad(loadEventDef);
Modified: trunk/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 2009-04-03 18:26:09 UTC (rev 12778)
+++ trunk/Open-ILS/web/templates/default/conify/global/action_trigger/event_definition.tt2 2009-04-03 18:26:58 UTC (rev 12779)
@@ -120,6 +120,40 @@
</div>
</div>
+ <div dojoType="dijit.layout.ContentPane" title='Test' id='tab-test'>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>Event Definition Tests</div>
+ <div></div>
+ </div>
+ <br/>
+ <div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:90%'>
+ <div style='border:1px solid #aaa;'>
+ <h2>Test Circulation</h2>
+ <table class='oils-generic-table'>
+ <tr>
+ <td>Trigger Hook</td>
+ <td><div dojoType='dijit.form.FilteringSelect' jsId='circTestHookSelector'/></td>
+ </tr>
+ <tr>
+ <td>Trigger Event Definition</td>
+ <td><div dojoType='dijit.form.FilteringSelect' jsId='circTestDefSelector'/></td>
+ </tr>
+ <tr>
+ <td>Barcode of Circulating Copy</td>
+ <td><div dojoType='dijit.form.TextBox' jsId='circTestBarcode'/></td>
+ </tr>
+ <tr>
+ <td colspan='2'><button dojoType='dijit.form.Button' onclick='evtTestCirc'>Go</button></td>
+ </tr>
+ </table>
+ </div>
+
+ <div id='test-event-output' style='width:90%;margin:20px;border:1px solid #aaa;' class='hidden'>
+ </div>
+ <div jsId='progressDialog' dojoType='openils.widget.ProgressDialog' indeterminate='true'></div>
+ </div>
+ </div>
+
</div>
[% END %]
More information about the open-ils-commits
mailing list