<!ENTITY staff.patron_display.penalty.menu.actions.accesskey "P">
<!ENTITY staff.patron_display.penalty.menu.apply.label "Apply Standing Penalty/Message">
<!ENTITY staff.patron_display.penalty.menu.apply.accesskey "S">
+<!ENTITY staff.patron_display.penalty.menu.actions.view.label "View Penalty/Message">
<!ENTITY staff.patron_display.penalty.menu.actions.remove.label "Remove Penalty/Message">
<!ENTITY staff.patron_display.penalty.menu.actions.remove.accesskey "R">
<!ENTITY staff.patron_display.penalty.menu.actions.edit.label "Modify Penalty/Message">
<!ENTITY staff.patron_display.apply_penalty_dialog.apply_btn.accesskey "A">
<!ENTITY staff.patron_display.apply_penalty_dialog.initials_entry.label "Initials">
<!ENTITY staff.patron_display.apply_penalty_dialog.initials_entry.accesskey "I">
+<!ENTITY staff.patron_display.view_penalty_dialog.title "View Standing Penalty/Message">
+<!ENTITY staff.patron_display.view_penalty_dialog.header "View Standing Penalty/Message">
+<!ENTITY staff.patron_display.view_penalty_dialog.close_btn.label "Close">
+<!ENTITY staff.patron_display.view_penalty_dialog.close_btn.accesskey "C">
<!ENTITY staff.patron_display.edit_penalty_dialog.title "Modify Standing Penalty/Message">
<!ENTITY staff.patron_display.edit_penalty_dialog.header "Modify Standing Penalty/Message">
<!ENTITY staff.patron_display.edit_penalty_dialog.description "Notes, Alerts, Blocks">
'XUL_STANDING_PENALTIES' : 'oils://remote/xul/server/patron/standing_penalties.xul',
'XUL_NEW_STANDING_PENALTY' : 'oils://remote/xul/server/patron/new_standing_penalty.xul',
'XUL_EDIT_STANDING_PENALTY' : 'oils://remote/xul/server/patron/edit_standing_penalty.xul',
+ 'XUL_VIEW_STANDING_PENALTY' : 'oils://remote/xul/server/patron/view_standing_penalty.xul',
'XUL_SCAN_ITEM_AS_MISSING_PIECES' : 'oils://remote/xul/server/circ/missing_pieces.xul',
'XUL_STAT_CAT_EDIT' : 'oils://remote/xul/server/admin/stat_cat_editor.xhtml',
'XUL_SURVEY_WIZARD' : 'chrome://open_ils_staff_client/content/admin/survey_wizard.xul',
init_archived_list();
window.standing_penalties_event_listeners = new EventListenerList();
document.getElementById('date1').year = document.getElementById('date1').year - 1;
+ window.standing_penalties_event_listeners.add(document.getElementById('cmd_view_message'), 'command', handle_view_message, false);
window.standing_penalties_event_listeners.add(document.getElementById('cmd_apply_penalty'), 'command', handle_apply_penalty, false);
window.standing_penalties_event_listeners.add(document.getElementById('cmd_remove_penalty'), 'command', handle_remove_penalty, false);
window.standing_penalties_event_listeners.add(document.getElementById('cmd_edit_penalty'), 'command', handle_edit_penalty, false);
var ids = util.functional.map_list( sel, function(o) { return JSON2js( o.getAttribute('retrieve_id') ); } );
if (which_list == list) { // top list
if (ids.length > 0) {
+ document.getElementById('cmd_view_message').setAttribute('disabled','false');
document.getElementById('cmd_remove_penalty').setAttribute('disabled','false');
document.getElementById('cmd_edit_penalty').setAttribute('disabled','false');
document.getElementById('cmd_archive_penalty').setAttribute('disabled','false');
} else {
+ document.getElementById('cmd_view_message').setAttribute('disabled','true');
document.getElementById('cmd_remove_penalty').setAttribute('disabled','true');
document.getElementById('cmd_edit_penalty').setAttribute('disabled','true');
document.getElementById('cmd_archive_penalty').setAttribute('disabled','true');
}
}
+function handle_view_message(ev) {
+ try {
+ JSAN.use('util.window');
+ var win = new util.window();
+
+ var sel = list.retrieve_selection();
+ var ids = util.functional.map_list( sel, function(o) { return JSON2js( o.getAttribute('retrieve_id') ); } );
+ if (ids.length > 0) {
+ for (var i = 0; i < ids.length; i++) {
+ var penalty = util.functional.find_list( xulG.patron.standing_penalties(), function(o) { return o.id() == ids[i]; } );
+ var my_xulG = win.open(
+ urls.XUL_VIEW_STANDING_PENALTY,
+ 'new_standing_penalty',
+ 'chrome,resizable,modal',
+ {
+ 'id' : typeof penalty.standing_penalty() == 'object' ? penalty.standing_penalty().id() : penalty.standing_penalty(),
+ 'note' : penalty.note()
+ }
+ );
+ }
+ }
+
+ } catch(E) {
+ var err_prefix = 'standing_penalties.js -> handle_view_penalty() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+}
+
function handle_apply_penalty(ev) {
try {
JSAN.use('util.window');
<messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties" />
<commandset id="penalty_cmds">
+ <command id="cmd_view_message" disabled="true"/>
<command id="cmd_apply_penalty" />
<command id="cmd_remove_penalty" disabled="true"/>
<command id="cmd_edit_penalty" disabled="true"/>
type="menu" style="-moz-user-focus: normal"
oncommand="this.focus(); this.firstChild.showPopup()">
<menupopup>
+ <menuitem command="cmd_view_message" label="&staff.patron_display.penalty.menu.actions.view.label;"/>
<menuitem command="cmd_remove_penalty" label="&staff.patron_display.penalty.menu.actions.remove.label;" accesskey="&staff.patron_display.menu.actions.remove.accesskey;"/>
<menuitem command="cmd_edit_penalty" label="&staff.patron_display.penalty.menu.actions.edit.label;" accesskey="&staff.patron_display.menu.actions.edit.accesskey;"/>
<menuitem command="cmd_archive_penalty" label="&staff.patron_display.penalty.menu.actions.archive.label;" accesskey="&staff.patron_display.menu.actions.archive.accesskey;"/>
<popupset id="csp_popupset">
<menupopup id="ausp_actions" position="at_pointer">
+ <menuitem command="cmd_view_message" label="&staff.patron_display.penalty.menu.actions.view.label;"/>
<menuitem command="cmd_remove_penalty" label="&staff.patron_display.penalty.menu.actions.remove.label;" accesskey="&staff.patron_display.menu.actions.remove.accesskey;"/>
<menuitem command="cmd_edit_penalty" label="&staff.patron_display.penalty.menu.actions.edit.label;" accesskey="&staff.patron_display.menu.actions.edit.accesskey;"/>
<menuitem command="cmd_archive_penalty" label="&staff.patron_display.penalty.menu.actions.archive.label;" accesskey="&staff.patron_display.menu.actions.archive.accesskey;"/>
--- /dev/null
+var data; var error;
+
+function default_focus() { document.getElementById('note_tb').focus(); } // parent interfaces often call this
+
+function view_penalty_init() {
+ try {
+
+ commonStrings = document.getElementById('commonStrings');
+ patronStrings = document.getElementById('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();
+
+ JSAN.use('util.error'); error = new util.error();
+ JSAN.use('util.widgets');
+
+ /* set widget values */
+ document.getElementById('note_tb').value = xul_param('note');
+
+ /* set widget behavior */
+ window.view_standing_penalty_event_listeners = new EventListenerList();
+
+
+ window.view_standing_penalty_event_listeners.add(document.getElementById('close_btn'),
+ 'command', function() { window.close(); }, false
+ );
+
+ } catch(E) {
+ var err_prefix = 'standing_penalties.js -> penalty_init() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+
+}
+
+function view_penalty_cleanup() {
+ try {
+ window.view_standing_penalty_event_listeners.removeAll();
+ } catch(E) {
+ var err_prefix = 'standing_penalties.js -> penalty_cleanup() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+
+}
\ No newline at end of file
--- /dev/null
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Dialog: view Standing Penalty to 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="view_penalty_win"
+ onload="try { view_penalty_init(); font_helper(); persist_helper(); } catch(E) { alert(E); }"
+ onunload="try { view_penalty_cleanup(); persist_helper_cleanup(); } catch(E) { alert(E); }"
+ oils_persist="height width sizemode"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ title="&staff.patron_display.view_penalty_dialog.title;">
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- 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="view_standing_penalty.js"/>
+
+ <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties" />
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- CONTENT -->
+ <dialogheader title="&staff.patron_display.view_penalty_dialog.header;" description="&staff.patron_display.view_penalty_dialog.description;" />
+ <textbox id="note_tb" class="ALL_FONTS_LARGE" flex="1" multiline="true" readonly="true" rows="3" onoverflow="this.rows = this.inputField.scrollHeight;"/>
+ <hbox>
+ <spacer flex="1"/>
+ <button id="close_btn" label="&staff.patron_display.view_penalty_dialog.close_btn.label;" accesskey="&staff.patron_display.close_penalty_dialog.close_btn.accesskey;" />
+ </hbox>
+</window>
+