[open-ils-commits] r14865 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/main xul/staff_client/server/patron (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Nov 11 04:13:08 EST 2009
Author: phasefx
Date: 2009-11-11 04:13:02 -0500 (Wed, 11 Nov 2009)
New Revision: 14865
Added:
trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.js
trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.xul
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/server/patron/display.js
trunk/Open-ILS/xul/staff_client/server/patron/display.xul
trunk/Open-ILS/xul/staff_client/server/patron/display_horiz.xul
trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
Log:
Interface for viewing pending action/trigger notices for a patron, with the ability to reset or cancel the notices.
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-11-11 09:13:02 UTC (rev 14865)
@@ -1298,6 +1298,13 @@
<!ENTITY staff.patron_display.archived_penalty.end_date.accesskey "">
<!ENTITY staff.patron_display.archived_penalty.retrieve.label "Retrieve Archived Penalties">
<!ENTITY staff.patron_display.archived_penalty.retrieve.accesskey "R">
+<!ENTITY staff.patron_display.trigger_event.caption "Modify Triggered Events">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.label "Actions for Selected Events">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.accesskey "A">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.cancel.label "Cancel Event">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.cancel.accesskey "C">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.reset.label "Reset Event">
+<!ENTITY staff.patron_display.trigger_event.menu.actions.reset.accesskey "R">
<!ENTITY staff.patron_editor_interface_label "Patron Edit">
<!ENTITY staff.patron_interface_label "Patron ">
<!ENTITY staff.patron_navbar.bills 'Bills'>
@@ -2619,6 +2626,8 @@
<!ENTITY staff.patron.info_surveys.answer.value "Answer:">
<!ENTITY staff.patron.info.notes.label "Notes">
<!ENTITY staff.patron.info.notes.accesskey "N">
+<!ENTITY staff.patron.info.triggered_events.label "Triggered Events">
+<!ENTITY staff.patron.info.triggered_events.accesskey "v">
<!ENTITY staff.patron.info.stat_cats.label "Statistical Categories">
<!ENTITY staff.patron.info.stat_cats.accesskey "S">
<!ENTITY staff.patron.info.surveys.label "Surveys">
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-11-11 09:13:02 UTC (rev 14865)
@@ -143,6 +143,10 @@
'FM_ATC_VOID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.transit.abort' },
'FM_ATC_RETRIEVE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.transit.retrieve', 'secure' : false },
'FM_ATC_RETRIEVE_VIA_AOU' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.transit.retrieve_by_lib', 'secure' : false },
+ 'FM_ATEV_APROPOS_AHR' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.events.ahr', 'secure' : true },
+ 'FM_ATEV_APROPOS_CIRC' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.events.circ', 'secure' : true },
+ 'FM_ATEV_CANCEL' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.event.cancel.batch', 'secure' : false },
+ 'FM_ATEV_RESET' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.event.reset.batch', 'secure' : false },
'FM_AU_ID_RETRIEVE_VIA_BARCODE_OR_USERNAME' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.retrieve_id_by_barcode_or_username' },
'FM_AU_IDS_RETRIEVE_VIA_HASH' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.patron.search.advanced' },
'FM_AU_LIST_RETRIEVE_VIA_GROUP' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.usergroup.members.retrieve' },
@@ -363,6 +367,7 @@
'XUL_STAT_CAT_EDIT' : '/xul/server/admin/stat_cat_editor.xhtml',
'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
'XUL_TIMESTAMP_DIALOG' : '/xul/server/util/timestamp.xul',
+ 'XUL_TRIGGER_EVENTS' : '/xul/server/patron/trigger_events.xul',
'XUL_USER_BUCKETS' : '/xul/server/patron/user_buckets.xul',
'XUL_VERIFY_CREDENTIALS' : '/xul/server/main/verify_credentials.xul',
'XUL_VOLUME_BUCKETS' : '/xul/server/cat/volume_buckets.xul',
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display.js 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display.js 2009-11-11 09:13:02 UTC (rev 14865)
@@ -308,6 +308,18 @@
);
}
],
+ 'cmd_patron_info_triggered_events' : [
+ ['command'],
+ function(ev) {
+ obj.right_deck.set_iframe(
+ urls.XUL_TRIGGER_EVENTS,
+ {},
+ {
+ 'patron_id' : obj.patron.id()
+ }
+ );
+ }
+ ],
'cmd_patron_info_stats' : [
['command'],
function(ev) {
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display.xul 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display.xul 2009-11-11 09:13:02 UTC (rev 14865)
@@ -96,6 +96,7 @@
<command id="cmd_patron_bills" />
<command id="cmd_patron_edit" />
<command id="cmd_patron_info_notes" />
+ <command id="cmd_patron_info_triggered_events" />
<command id="cmd_patron_info_stats" />
<command id="cmd_patron_info_surveys" />
<command id="cmd_patron_info_groups" />
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display_horiz.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display_horiz.xul 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display_horiz.xul 2009-11-11 09:13:02 UTC (rev 14865)
@@ -96,6 +96,7 @@
<command id="cmd_patron_bills" />
<command id="cmd_patron_edit" />
<command id="cmd_patron_info_notes" />
+ <command id="cmd_patron_info_triggered_events" />
<command id="cmd_patron_info_stats" />
<command id="cmd_patron_info_surveys" />
<command id="cmd_patron_info_groups" />
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display_horiz_overlay.xul 2009-11-11 09:13:02 UTC (rev 14865)
@@ -90,6 +90,7 @@
<menupopup>
<menuitem label="&staff.patron_navbar.alert;" accesskey="&staff.patron_navbar.alert.accesskey;" command="cmd_patron_alert"/>
<menuitem label="&staff.patron.info.notes.label;" accesskey="&staff.patron.info.notes.accesskey;" command="cmd_patron_info_notes"/>
+ <menuitem label="&staff.patron.info.triggered_events.label;" accesskey="&staff.patron.info.triggered_events.accesskey;" command="cmd_patron_info_triggered_events"/>
<menuitem label="&staff.patron.info.stat_cats.label;" accesskey="&staff.patron.info.stat_cats.accesskey;" command="cmd_patron_info_stats"/>
<menuitem label="&staff.patron.info.surveys.label;" accesskey="&staff.patron.info.surveys.accesskey;" command="cmd_patron_info_surveys"/>
<menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
Modified: trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul 2009-11-11 08:05:07 UTC (rev 14864)
+++ trunk/Open-ILS/xul/staff_client/server/patron/display_overlay.xul 2009-11-11 09:13:02 UTC (rev 14865)
@@ -90,6 +90,7 @@
<menupopup>
<menuitem label="&staff.patron_navbar.alert;" accesskey="&staff.patron_navbar.alert.accesskey;" command="cmd_patron_alert"/>
<menuitem label="&staff.patron.info.notes.label;" accesskey="&staff.patron.info.notes.accesskey;" command="cmd_patron_info_notes"/>
+ <menuitem label="&staff.patron.info.triggered_events.label;" accesskey="&staff.patron.info.triggered_events.accesskey;" command="cmd_patron_info_triggered_events"/>
<menuitem label="&staff.patron.info.stat_cats.label;" accesskey="&staff.patron.info.stat_cats.accesskey;" command="cmd_patron_info_stats"/>
<menuitem label="&staff.patron.info.surveys.label;" accesskey="&staff.patron.info.surveys.accesskey;" command="cmd_patron_info_surveys"/>
<menuitem label="&staff.patron.info.group.label;" accesskey="&staff.patron.info.group.accesskey;" command="cmd_patron_info_groups"/>
Added: trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.js (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.js 2009-11-11 09:13:02 UTC (rev 14865)
@@ -0,0 +1,175 @@
+var list; var error; var net; var rows; var archived_rows;
+
+function $(id) { return document.getElementById(id); }
+
+//// parent interfaces often call these
+function default_focus() { $('atev_list').focus(); }
+function refresh() { populate_list(); }
+////
+
+function trigger_event_init() {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ commonStrings = $('commonStrings');
+ patronStrings = $('patronStrings');
+
+ if (typeof JSAN == 'undefined') {
+ throw(
+ commonStrings.getString('common.jsan.missing')
+ );
+ }
+
+ JSAN.errorLevel = "die"; // none, warn, or die
+ JSAN.addRepository('..');
+
+ JSAN.use('OpenILS.data'); data = new OpenILS.data(); data.stash_retrieve();
+ XML_HTTP_SERVER = data.server_unadorned;
+
+ JSAN.use('util.error'); error = new util.error();
+ JSAN.use('util.network'); net = new util.network();
+ JSAN.use('patron.util');
+ JSAN.use('util.list');
+ JSAN.use('util.functional');
+ JSAN.use('util.widgets');
+
+ dojo.require('openils.Util');
+
+ init_list();
+ $('cmd_cancel_event').addEventListener('command', gen_event_handler('cancel'), false);
+ $('cmd_reset_event').addEventListener('command', gen_event_handler('reset'), false);
+ populate_list();
+ default_focus();
+
+ } catch(E) {
+ var err_prefix = 'trigger_events.js -> trigger_event_init() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+}
+
+function gen_event_handler(method) { // cancel or reset?
+ return function(ev) {
+ try {
+ var sel = list.retrieve_selection();
+ var ids = util.functional.map_list( sel, function(o) { return JSON2js( o.getAttribute('retrieve_id') ); } );
+
+ var pm = $('progress'); pm.value = 0; pm.hidden = false;
+ var idx = -1;
+
+ var i = method == 'cancel' ? 'FM_ATEV_CANCEL' : 'FM_ATEV_RESET';
+ fieldmapper.standardRequest(
+ [ api[i].app, api[i].method ],
+ { async: true,
+ params: [ses(), [ids]],
+ onresponse: function(r) {
+ try {
+ idx++; pm.value = Number( pm.value ) + 100/ids.length;
+ var result = openils.Util.readResponse(r);
+ if (typeof result.ilsevent != 'undefined') { throw(result); }
+ } catch(E) {
+ error.standard_unexpected_error_alert('In patron/trigger_events.js, handle_'+i+'_event onresponse.',E);
+ }
+ },
+ onerror: function(r) {
+ try {
+ var result = openils.Util.readResponse(r);
+ throw(result);
+ } catch(E) {
+ error.standard_unexpected_error_alert('In patron/trigger_events.js, handle_'+i+'_event onerror.',E);
+ }
+ pm.hidden = true; pm.value = 0; populate_list();
+ },
+ oncomplete: function(r) {
+ try {
+ var result = openils.Util.readResponse(r);
+ } catch(E) {
+ error.standard_unexpected_error_alert('In patron/trigger_events.js, handle_'+i+'_event oncomplete.',E);
+ }
+ pm.hidden = true; pm.value = 0; populate_list();
+ }
+ }
+ );
+
+ } catch(E) {
+ alert('Error in patron/trigger_events.js, handle_???_event(): ' + E);
+ }
+ };
+}
+
+function init_list() {
+ try {
+
+ list = new util.list( 'atev_list' );
+ list.init(
+ {
+ 'columns' : [ 'atev' ],
+ 'retrieve_row' : retrieve_row,
+ 'on_select' : handle_selection
+ }
+ );
+
+ } catch(E) {
+ var err_prefix = 'trigger_events.js -> init_list() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+}
+
+function retrieve_row(params) { // callback function for fleshing rows in a list
+ params.row_node.setAttribute('retrieve_id',params.row.my.atev.id());
+ params.on_retrieve(params.row);
+ return params.row;
+}
+
+function handle_selection(ev) { // handler for list row selection event
+ var sel = list.retrieve_selection();
+ if (sel.length > 0) {
+ $('cmd_cancel_event').setAttribute('disabled','false');
+ $('cmd_reset_event').setAttribute('disabled','false');
+ } else {
+ $('cmd_cancel_event').setAttribute('disabled','true');
+ $('cmd_reset_event').setAttribute('disabled','true');
+ }
+};
+
+function populate_list() {
+ try {
+
+ rows = {};
+ list.clear();
+
+ function onResponse(r) {
+ var evt = openils.Util.readResponse(r);
+ var row_params = {
+ 'row' : {
+ 'my' : {
+ 'atev' : evt
+ }
+ }
+ };
+ rows[ evt.id() ] = list.append( row_params );
+
+ }
+
+ function onError(r) {
+ var evt = openils.Util.readResponse(r);
+ alert('error, evt = ' + js2JSON(evt));
+ }
+
+ var methods = ['FM_ATEV_APROPOS_CIRC','FM_ATEV_APROPOS_AHR'];
+ for (var i in methods) {
+ fieldmapper.standardRequest(
+ [api[methods[i]].app, api[methods[i]].method ],
+ { async: true,
+ params: [ses(), xul_param('patron_id')],
+ onresponse : onResponse,
+ onerror : onError,
+ oncomplete : function() {}
+ }
+ );
+ }
+
+ } catch(E) {
+ var err_prefix = 'trigger_events.js -> populate_list() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+}
Added: trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.xul (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/patron/trigger_events.xul 2009-11-11 09:13:02 UTC (rev 14865)
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Screen: Cancel/Reset Action::Trigger Events for Patron -->
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- PRESENTATION -->
+<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
+<?xml-stylesheet href="/xul/server/skin/global.css" type="text/css"?>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- LOCALIZATION -->
+<!DOCTYPE window PUBLIC "" ""[
+ <!--#include virtual="/opac/locale/${locale}/lang.dtd"-->
+]>
+
+<!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+<!-- OVERLAYS -->
+<?xul-overlay href="/xul/server/OpenILS/util_overlay.xul"?>
+
+<window id="trigger_event_win" onload="try { trigger_event_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- BEHAVIOR -->
+ <script type="text/javascript">var myPackageDir = 'open_ils_staff_client'; var IAMXUL = true;</script>
+ <scripts id="openils_util_scripts"/>
+
+ <script type="text/javascript" src="/xul/server/main/JSAN.js"/>
+ <script type="text/javascript" src="trigger_events.js"/>
+
+ <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties" />
+
+ <commandset id="trigger_event_cmds">
+ <command id="cmd_cancel_event" disabled="true"/>
+ <command id="cmd_reset_event" disabled="true"/>
+ </commandset>
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- CONTENT -->
+ <groupbox id="trigger_event_groupbox" flex="1" class="my_overflow">
+ <caption id="trigger_event_caption" label="&staff.patron_display.trigger_event.caption;"/>
+ <vbox flex="0">
+ <hbox flex="1">
+ <spacer flex="1" />
+ <progressmeter id="progress" flex="1" hidden="true" mode="undetermined"/>
+ <menubar>
+ <menu label="&staff.patron_display.trigger_event.menu.actions.label;"
+ accesskey="&staff.patron_display.trigger_event.menu.actions.accesskey;"
+ type="menu" style="-moz-user-focus: normal">
+ <menupopup>
+ <menuitem command="cmd_cancel_event" label="&staff.patron_display.trigger_event.menu.actions.cancel.label;" accesskey="&staff.patron-display.menu.actions.cancel.accesskey;"/>
+ <menuitem command="cmd_reset_event" label="&staff.patron_display.trigger_event.menu.actions.reset.label;" accesskey="&staff.patron-display.menu.actions.reset.accesskey;"/>
+ </menupopup>
+ </menu>
+ </menubar>
+ </hbox>
+ </vbox>
+ <tree id="atev_list" flex="1" enableColumnDrag="true" context="atev_actions" />
+ </groupbox>
+
+ <popupset id="atev_popupset">
+ <popup id="atev_actions" position="at_pointer">
+ <menuitem command="cmd_cancel_event" label="&staff.patron_display.trigger_event.menu.actions.cancel.label;" accesskey="&staff.patron-display.menu.actions.cancel.accesskey;"/>
+ <menuitem command="cmd_reset_event" label="&staff.patron_display.trigger_event.menu.actions.reset.label;" accesskey="&staff.patron-display.menu.actions.reset.accesskey;"/>
+ </popup>
+ </popupset>
+
+</window>
+
More information about the open-ils-commits
mailing list