[open-ils-commits] r12688 - in trunk/Open-ILS/web: js/ui/default/actor/user templates/default/actor/user (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Mar 26 12:10:43 EDT 2009
Author: erickson
Date: 2009-03-26 12:10:40 -0400 (Thu, 26 Mar 2009)
New Revision: 12688
Added:
trunk/Open-ILS/web/js/ui/default/actor/user/trigger_events.js
trunk/Open-ILS/web/templates/default/actor/user/trigger_events.tt2
Log:
initial interface for managing pending notification events
Added: trunk/Open-ILS/web/js/ui/default/actor/user/trigger_events.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/actor/user/trigger_events.js (rev 0)
+++ trunk/Open-ILS/web/js/ui/default/actor/user/trigger_events.js 2009-03-26 16:10:40 UTC (rev 12688)
@@ -0,0 +1,65 @@
+dojo.require('dojox.grid.DataGrid');
+dojo.require('dojo.data.ItemFileWriteStore');
+dojo.require('openils.Util');
+dojo.require('openils.User');
+
+var evtCache = {};
+
+function init() {
+ var store = new dojo.data.ItemFileWriteStore({data:acqf.initStoreData()});
+ evtGrid.setStore(store);
+ evtGrid.render();
+
+ function onResponse(r) {
+ var evt = openils.Util.readResponse(r);
+ evtCache[evt.id()] = evt;
+ evtGrid.store.newItem(evt.toStoreItem());
+ }
+
+ fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.user.events.circ'],
+ { async: true,
+ params: [openils.User.authtoken, patronId],
+ onresponse : onResponse
+ }
+ );
+
+ fieldmapper.standardRequest(
+ ['open-ils.actor', 'open-ils.actor.user.events.ahr'],
+ { async: true,
+ params: [openils.User.authtoken, patronId],
+ onresponse : onResponse
+ }
+ );
+}
+
+function getField(rowIdx, item) {
+ if(!item) return '';
+ var evt = evtCache[this.grid.store.getValue(item, 'id')];
+
+ switch(this.field) {
+ case 'reactor':
+ return evt.event_def().reactor().module();
+ case 'validator':
+ return evt.event_def().validator().module();
+ case 'hook':
+ return evt.event_def().hook();
+ case 'target':
+ switch(evt.target().classname) {
+ case 'circ':
+ return evt.target().target_copy().barcode();
+ case 'ahr':
+ if(evt.target().currrent_copy())
+ return evt.target().currrent_copy().barcode();
+ }
+
+ }
+
+ return this.grid.store.getValue(item, this.field) || '';
+}
+
+function evtCancelSelected() {
+}
+
+openils.Util.addOnLoad(init);
+
Added: trunk/Open-ILS/web/templates/default/actor/user/trigger_events.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/actor/user/trigger_events.tt2 (rev 0)
+++ trunk/Open-ILS/web/templates/default/actor/user/trigger_events.tt2 2009-03-26 16:10:40 UTC (rev 12688)
@@ -0,0 +1,28 @@
+[% ctx.page_title = 'Events' %]
+[% WRAPPER default/base.tt2 %]
+<script src='[% ctx.media_prefix %]/js/ui/default/actor/user/trigger_events.js'> </script>
+<script>patronId = '[% ctx.page_args.0 %]'</script>
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="top" class='oils-header-panel'>
+ <div>User Events</div>
+ <div>
+ <button dojoType='dijit.form.Button' onClick='evtCancelSelected()'>Cancel Selected Events</button>
+ </div>
+</div>
+
+
+<div dojoType="dijit.layout.ContentPane" layoutAlign="client" style='height:100%;'>
+ <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>
+ </tr>
+ </thead>
+ </table>
+</div>
+
+[% END %]
More information about the open-ils-commits
mailing list