[open-ils-commits] r12453 - in trunk/Open-ILS/xul/staff_client/server: cat locale/en-US (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Mar 6 15:50:33 EST 2009
Author: phasefx
Date: 2009-03-06 15:50:29 -0500 (Fri, 06 Mar 2009)
New Revision: 12453
Modified:
trunk/Open-ILS/xul/staff_client/server/cat/util.js
trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
Log:
charge patron prompt for mark item damaged. Still need to plugin code to handle checkin of the item
Modified: trunk/Open-ILS/xul/staff_client/server/cat/util.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-03-06 20:44:16 UTC (rev 12452)
+++ trunk/Open-ILS/xul/staff_client/server/cat/util.js 2009-03-06 20:50:29 UTC (rev 12453)
@@ -305,7 +305,31 @@
for (var i = 0; i < copies.length; i++) {
try {
var robj = network.simple_request('MARK_ITEM_DAMAGED',[ses(),copies[i].id()]);
- if (typeof robj.ilsevent != 'undefined') throw(robj);
+ if (typeof robj.ilsevent != 'undefined') {
+ switch(robj.textcode) {
+ case 'DAMAGE_CHARGE' :
+ JSAN.use('patron.util'); JSAN.use('util.money');
+ var patron_obj = patron.util.retrieve_fleshed_au_via_id( ses(), robj.payload.usr );
+ var patron_name = ( patron_obj.prefix() ? patron_obj.prefix() + ' ' : '') +
+ patron_obj.family_name() + ', ' +
+ patron_obj.first_given_name() + ' ' +
+ ( patron_obj.second_given_name() ? patron_obj.second_given_name() + ' ' : '' ) +
+ ( patron_obj.suffix() ? patron_obj.suffix() : '')
+ + ' : ' + patron_obj.card().barcode()
+
+ var r1 = error.yns_alert(
+ $("catStrings").getFormattedString('staff.cat.util.mark_item_damaged.charge_patron_prompt.message', [ copies[i].barcode(), patron_name, util.money.sanitize(robj.payload.charge) ]),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.title'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.ok_label'),
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.cancel_label'), null,
+ $("catStrings").getString('staff.cat.util.mark_item_damaged.charge_patron_prompt.confirm_action'));
+
+ robj = network.simple_request('MARK_ITEM_DAMAGED',[ ses(), copies[i].id(), {'apply_fines' : r1 == 0 ? 'apply' : 'noapply'} ]);
+ if (typeof robj.ilsevent != 'undefined') { throw(robj); }
+ break;
+ default: throw(robj);
+ }
+ }
count++;
} catch(E) {
error.standard_unexpected_error_alert($("catStrings").getFormattedString('staff.cat.util.mark_item_damaged.marking_error', [copies[i].barcode()]),E);
Modified: trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-03-06 20:44:16 UTC (rev 12452)
+++ trunk/Open-ILS/xul/staff_client/server/locale/en-US/cat.properties 2009-03-06 20:50:29 UTC (rev 12453)
@@ -339,6 +339,11 @@
staff.cat.util.mark_item_damaged.md_ok_label=OK
staff.cat.util.mark_item_damaged.md_cancel_label=Cancel
staff.cat.util.mark_item_damaged.md_confirm_action=Check here to confirm this action
+staff.cat.util.mark_item_damaged.charge_patron_prompt.message=Item %1$s will be marked damaged. Charge patron (%2$s) $%3$s for the damage?
+staff.cat.util.mark_item_damaged.charge_patron_prompt.title=Charge Patron For Damaged Item?
+staff.cat.util.mark_item_damaged.charge_patron_prompt.ok_label=OK
+staff.cat.util.mark_item_damaged.charge_patron_prompt.cancel_label=Cancel
+staff.cat.util.mark_item_damaged.charge_patron_prompt.confirm_action=Check here to confirm this action
staff.cat.util.mark_item_damaged.marking_error=Error marking item %1$s damaged.
staff.cat.util.mark_item_damaged.one_item_damaged=Item marked Damaged
staff.cat.util.mark_item_damaged.multiple_item_damaged=%1$s items marked Damaged.
More information about the open-ils-commits
mailing list