[open-ils-commits] r14130 - in trunk/Open-ILS: web/opac/locale/en-US xul/staff_client/chrome/content/OpenILS 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 Sep 23 13:59:12 EDT 2009
Author: phasefx
Date: 2009-09-23 13:59:07 -0400 (Wed, 23 Sep 2009)
New Revision: 14130
Added:
trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.js
trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.xul
Modified:
trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
trunk/Open-ILS/xul/staff_client/server/patron/holds.js
Log:
For Hold Cancel option, offer dialog for Cancel Reason and Cancel Note
Modified: trunk/Open-ILS/web/opac/locale/en-US/lang.dtd
===================================================================
--- trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-09-23 17:56:38 UTC (rev 14129)
+++ trunk/Open-ILS/web/opac/locale/en-US/lang.dtd 2009-09-23 17:59:07 UTC (rev 14130)
@@ -2037,6 +2037,13 @@
<!ENTITY staff.circ.holds.cancel.accesskey "C">
<!ENTITY staff.circ.holds.save_columns "Save Columns">
<!ENTITY staff.circ.holds.save_columns.accesskey "">
+<!ENTITY staff.hold_list.cancel_hold_dialog.title "Cancel Hold">
+<!ENTITY staff.hold_list.cancel_hold_dialog.header "Cancel Hold">
+<!ENTITY staff.hold_list.cancel_hold_dialog.description "Reason and Notes">
+<!ENTITY staff.hold_list.cancel_hold_dialog.cancel_btn.label "Cancel">
+<!ENTITY staff.hold_list.cancel_hold_dialog.cancel_btn.accesskey "C">
+<!ENTITY staff.hold_list.cancel_hold_dialog.apply_btn.label "Apply">
+<!ENTITY staff.hold_list.cancel_hold_dialog.apply_btn.accesskey "A">
<!ENTITY staff.cat.copy_browser.actions.sel_clip.label "Copy to Clipboard">
<!ENTITY staff.cat.copy_browser.actions.sel_clip.accesskey "C">
<!ENTITY staff.cat.copy_browser.actions.cmd_add_items_to_buckets.label "Add Items to Buckets">
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-09-23 17:56:38 UTC (rev 14129)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/OpenILS/data.js 2009-09-23 17:59:07 UTC (rev 14130)
@@ -560,6 +560,28 @@
this.chain.push(
function() {
var f = gen_fm_retrieval_func(
+ 'ahrcc',
+ [
+ api.FM_AHRCC_PCRUD_SEARCH.app,
+ api.FM_AHRCC_PCRUD_SEARCH.method,
+ [ obj.session.key, {"id":{"!=":null}}, {"order_by":{"ahrcc":"label"}} ],
+ false
+ ]
+ );
+ try {
+ f();
+ } catch(E) {
+ var error = 'Error: ' + js2JSON(E);
+ obj.error.sdump('D_ERROR',error);
+ throw(E);
+ }
+ }
+ );
+
+
+ this.chain.push(
+ function() {
+ var f = gen_fm_retrieval_func(
'au',
[
api.FM_AU_RETRIEVE_VIA_SESSION.app,
Modified: trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-09-23 17:56:38 UTC (rev 14129)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/main/constants.js 2009-09-23 17:59:07 UTC (rev 14130)
@@ -110,9 +110,11 @@
'FM_AHR_COUNT_RETRIEVE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count', 'cacheable' : true, 'ttl' : 60000 },
'FM_AHR_COUNT_RETRIEVE.authoritative' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.hold_requests.count.authoritative', 'cacheable' : true, 'ttl' : 60000 },
'FM_AHR_CANCEL' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.cancel' },
+ 'FM_AHR_UNCANCEL' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.uncancel' },
'FM_AHR_UPDATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.update' },
'FM_AHR_RESET' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.reset' },
'FM_AHR_STATUS' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.hold.status.retrieve' },
+ 'FM_AHRCC_PCRUD_SEARCH' : { 'app' : 'open-ils.pcrud', 'method' : 'open-ils.pcrud.search.ahrcc.atomic', 'secure' : false },
'FM_AIHU_CREATE' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.in_house_use.create' },
'FM_ANCC_RETRIEVE_VIA_ID' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.non_cataloged_circulation.retrieve' },
'FM_ANCC_RETRIEVE_VIA_USER' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.open_non_cataloged_circulation.user' },
@@ -298,6 +300,7 @@
'XUL_HOLD_PULL_LIST' : '/xul/server/admin/hold_pull_list.xhtml',
'XUL_HOLDS_BROWSER' : '/xul/server/patron/holds.xul',
'XUL_HOLD_DETAILS' : '/xul/server/patron/hold_details.xul',
+ 'XUL_HOLD_CANCEL' : '/xul/server/patron/hold_cancel.xul',
'XUL_IN_HOUSE_USE' : '/xul/server/circ/in_house_use.xul',
'XUL_LIST_CLIPBOARD' : '/xul/server/util/list_clipboard.xul',
'XUL_LOCAL_ADMIN' : '/xul/server/admin/index.xhtml',
Added: trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.js (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.js 2009-09-23 17:59:07 UTC (rev 14130)
@@ -0,0 +1,80 @@
+var data; var error;
+
+function default_focus() { document.getElementById('note_tb').focus(); } // parent interfaces often call this
+
+function hold_cancel_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');
+
+ build_cancel_reason_menu();
+
+ /* set widget behavior */
+ document.getElementById('cancel_btn').addEventListener(
+ 'command', function() { window.close(); }, false
+ );
+ document.getElementById('apply_btn').addEventListener(
+ 'command',
+ function() {
+ var note = document.getElementById('note_tb').value;
+ update_modal_xulG(
+ {
+ 'cancel_reason' : document.getElementById('ahrcc_menupopup').getAttribute('value'),
+ 'note' : note,
+ 'proceed' : 1
+ }
+ )
+ window.close();
+ },
+ false
+ );
+
+ default_focus();
+
+ } catch(E) {
+ var err_prefix = 'hold_cancel.js -> hold_cancel_init() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+
+}
+
+function build_cancel_reason_menu() {
+ try {
+
+ var ahrcc_menupopup = document.getElementById('ahrcc_menupopup');
+ util.widgets.remove_children(ahrcc_menupopup);
+ for (var i = 0; i < data.list.ahrcc.length; i++) {
+ //if (data.list.ahrcc[i].id() > 100) {
+ var menuitem = document.createElement('menuitem'); ahrcc_menupopup.appendChild(menuitem);
+ menuitem.setAttribute('label',data.list.ahrcc[i].label());
+ menuitem.setAttribute('value',data.list.ahrcc[i].id());
+ menuitem.setAttribute('id','ahrcc_'+data.list.ahrcc[i].id());
+ menuitem.setAttribute('oncommand',"var p = this.parentNode; p.parentNode.setAttribute('label',this.getAttribute('label')); p.setAttribute('value'," + data.list.ahrcc[i].id() + ")");
+ if (data.list.ahrcc[i].id() == 5) { // default Staff forced
+ ahrcc_menupopup.setAttribute('value',data.list.ahrcc[i].id());
+ ahrcc_menupopup.parentNode.setAttribute('label',data.list.ahrcc[i].label());
+ }
+ //}
+ }
+
+ } catch(E) {
+ var err_prefix = 'hold_cancel.js -> build_cancel_reason_menu() : ';
+ if (error) error.standard_unexpected_error_alert(err_prefix,E); else alert(err_prefix + E);
+ }
+}
+
Added: trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.xul
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.xul (rev 0)
+++ trunk/Open-ILS/xul/staff_client/server/patron/hold_cancel.xul 2009-09-23 17:59:07 UTC (rev 14130)
@@ -0,0 +1,55 @@
+<?xml version="1.0"?>
+<!-- Application: Evergreen Staff Client -->
+<!-- Dialog: Apply 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="hold_cancel_win"
+ onload="try { hold_cancel_init(); font_helper(); } catch(E) { alert(E); }"
+ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ title="&staff.hold_list.cancel_hold_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="hold_cancel.js"/>
+
+ <messagecatalog id="patronStrings" src="/xul/server/locale/<!--#echo var='locale'-->/patron.properties" />
+
+ <!-- ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
+ <!-- CONTENT -->
+ <dialogheader title="&staff.hold_list.cancel_hold_dialog.header;" description="&staff.hold_list.cancel_hold_dialog.description;" />
+ <toolbox flex="1">
+ <toolbar>
+ <toolbarspring/>
+ <toolbaritem>
+ <menulist id="ahrcc_menulist" label="">
+ <menupopup id="ahrcc_menupopup"/>
+ </menulist>
+ </toolbaritem>
+ </toolbar>
+ </toolbox>
+ <textbox id="note_tb" multiline="true" />
+ <hbox>
+ <spacer flex="1"/>
+ <button id="cancel_btn" label="&staff.hold_list.cancel_hold_dialog.cancel_btn.label;" accesskey="&staff.hold_list.cancel_hold_dialog.cancel_btn.accesskey;" />
+ <button id="apply_btn" label="&staff.hold_list.cancel_hold_dialog.apply_btn.label;" accesskey="&staff.hold_list.cancel_hold_dialog.apply_btn.accesskey;" />
+ </hbox>
+</window>
+
Modified: trunk/Open-ILS/xul/staff_client/server/patron/holds.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2009-09-23 17:56:38 UTC (rev 14129)
+++ trunk/Open-ILS/xul/staff_client/server/patron/holds.js 2009-09-23 17:59:07 UTC (rev 14130)
@@ -787,20 +787,31 @@
} else {
msg = $("patronStrings").getFormattedString('staff.patron.holds.holds_cancel.cancel_hold_message.singular', [hold_list]);
}
- var r = obj.error.yns_alert(msg,
+
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ JSAN.use('util.window');
+ var win = new util.window();
+ var my_xulG = win.open(
+ urls.XUL_HOLD_CANCEL,
+ 'hold_cancel',
+ 'chrome,resizable,modal',
+ {}
+ );
+ /*var r = obj.error.yns_alert(msg,
$("patronStrings").getString('staff.patron.holds.holds_cancel.cancel_hold_title'),
$("commonStrings").getString('common.yes'),
$("commonStrings").getString('common.no'),
null,
$("commonStrings").getString('common.check_to_confirm')
- );
- if (r == 0) {
+ );*/
+
+ if (my_xulG.proceed) {
var transits = [];
for (var i = 0; i < obj.retrieve_ids.length; i++) {
if (obj.holds_map[ obj.retrieve_ids[i].id ].hold.transit()) {
transits.push( obj.retrieve_ids[i].barcode );
}
- var robj = obj.network.simple_request('FM_AHR_CANCEL',[ ses(), obj.retrieve_ids[i].id]);
+ var robj = obj.network.simple_request('FM_AHR_CANCEL',[ ses(), obj.retrieve_ids[i].id, my_xulG.cancel_reason, my_xulG.note]);
if (typeof robj.ilsevent != 'undefined') throw(robj);
}
if (transits.length > 0) {
More information about the open-ils-commits
mailing list