From 6c3f711da2315a1f0220c0073a5a3d719c05ceab Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 23 Dec 2008 19:44:01 +0000 Subject: [PATCH] in patron retrieval interface for checkouts, replace the barcode.exist call with one that returns the user id or an event on failure git-svn-id: svn://svn.open-ils.org/ILS/trunk@11668 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../xul/staff_client/server/patron/barcode_entry.xul | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul index 448439ab7c..03c91415f7 100644 --- a/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul +++ b/Open-ILS/xul/staff_client/server/patron/barcode_entry.xul @@ -94,23 +94,25 @@ tb.disabled = true; document.getElementById('progress').setAttribute('hidden','false'); - net.simple_request('PATRON_BARCODE_EXISTS.authoritative',[ ses(), barcode ], + net.simple_request('FM_AU_ID_RETRIEVE_VIA_BARCODE_OR_USERNAME',[ ses(), barcode, null ], function(req) { document.getElementById('progress').setAttribute('hidden','true'); tb.disabled = false; tb.select(); tb.focus(); ; var robj = req.getResultObject(); if (typeof robj.ilsevent != 'undefined') { sound.bad(); - add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_retrieval_problem', [barcode, js2JSON(robj)])); - return; - } else if (robj == 0) { - sound.bad(); - add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_not_found', [barcode])); + switch(Number(robj.ilsevent)) { + case 1002 /* ACTOR_USER_NOT_FOUND */: + add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_not_found', [barcode])); + break; + default: + add_msg($("patronStrings").getFormattedString('staff.patron.barcode_entry.barcode_retrieval_problem', [barcode, js2JSON(robj)])); + } return; } if (g.data.user_org_unit_opt_in_enabled) { - var r = net.simple_request('USER_ORG_UNIT_OPT_IN_CHECK',[ ses(), robj ]); // FIXME -- robj is no longer returning a usr id + var r = net.simple_request('USER_ORG_UNIT_OPT_IN_CHECK',[ ses(), robj ]); if (typeof r.ilsevent != 'undefined') { throw(r); } else { -- 2.11.0