From: phasefx Date: Wed, 6 Jan 2010 16:39:14 +0000 (+0000) Subject: work log for renewals, and some debugging for for checkouts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7bfbe3cd92d712af334d495a644949f8819e9400;p=evergreen%2Fpines.git work log for renewals, and some debugging for for checkouts git-svn-id: svn://svn.open-ils.org/ILS/trunk@15262 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 3b1b98337c..3669821138 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -426,23 +426,27 @@ circ.checkout.prototype = { //I could override map_row_to_column here } ); - obj.error.work_log( - document.getElementById('circStrings').getFormattedString( - (get_bool(checkout.payload.circ.opac_renewal())||get_bool(checkout.payload.circ.phone_renewal())||get_bool(checkout.payload.circ.desk_renewal())) ? - 'staff.circ.work_log_renew.message' : 'staff.circ.work_log_checkout.message', - [ - ses('staff_usrname'), - xulG.patron.family_name(), - xulG.patron.card().barcode(), - checkout.payload.copy.barcode() - ] - ), { - 'au_id' : xulG.patron.id(), - 'au_family_name' : xulG.patron.family_name(), - 'au_barcode' : xulG.patron.card().barcode(), - 'acp_barcode' : checkout.payload.copy.barcode() - } - ); + try { + obj.error.work_log( + document.getElementById('circStrings').getFormattedString( + (get_bool(checkout.payload.circ.opac_renewal())||get_bool(checkout.payload.circ.phone_renewal())||get_bool(checkout.payload.circ.desk_renewal())) ? + 'staff.circ.work_log_renew.message' : 'staff.circ.work_log_checkout.message', + [ + ses('staff_usrname'), + xulG.patron.family_name(), + xulG.patron.card().barcode(), + checkout.payload.copy.barcode() + ] + ), { + 'au_id' : xulG.patron.id(), + 'au_family_name' : xulG.patron.family_name(), + 'au_barcode' : xulG.patron.card().barcode(), + 'acp_barcode' : checkout.payload.copy.barcode() + } + ); + } catch(E) { + obj.error.sdump('D_ERROR','Error with work_logging in server/circ/checkout.js, _checkout:' + E); + } document.getElementById('msg_area').removeChild(x); /* if (typeof obj.on_checkout == 'function') { diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 4efd066251..b2fdf2b1eb 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -2896,6 +2896,47 @@ circ.util.renew_via_barcode = function ( params, async ) { break; } } + try { + var ibarcode = renew[0].payload.copy ? renew[0].payload.copy.barcode() : params.barcode; + var p_id = renew[0].payload.patron ? renew[0].payload.patron.id() : renew[0].payload.circ.usr(); + var pname; var pbarcode; + if (renew[0].patron) { + pname = renew[0].payload.patron.family_name(); + pbarcode = typeof renew[0].payload.patron.card() == 'object' ? renew[0].payload.patron.card().barcode() : null; + } else { + if (circ.util.renew_via_barcode.last_usr_id == p_id) { + pname = circ.util.renew_via_barcode.last_pname; + pbarcode = circ.util.renew_via_barcode.last_pbarcode; + } else { + JSAN.use('patron.util'); var p = patron.util.retrieve_fleshed_au_via_id(ses(),p_id); + pname = p.family_name(); + pbarcode = typeof p.card() == 'object' ? p.card().barcode() : null; + if (pname) { + circ.util.renew_via_barcode.last_usr_id = p_id; + circ.util.renew_via_barcode.last_pname = pname; + circ.util.renew_via_barcode.last_pbarcode = pbarcode; + } + } + } + error.work_log( + document.getElementById('circStrings').getFormattedString( + 'staff.circ.work_log_renew.message', + [ + ses('staff_usrname'), + pname ? pname : '???', + pbarcode ? pbarcode : '???', + ibarcode ? ibarcode : '???' + ] + ), { + 'au_id' : p_id, + 'au_family_name' : pname, + 'au_barcode' : pbarcode, + 'acp_barcode' : ibarcode + } + ); + } catch(E) { + error.sdump('D_ERROR','Error with work_logging in server/circ/util.js, renew_via_barcode():' + E); + } if (typeof async == 'function') async(renew); return renew; } catch(E) {