From 3de03b5225da4e5ca6f99d1074ac4271d6ac66ed Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Fri, 20 Dec 2013 11:27:57 -0500 Subject: [PATCH] disable checkout interface if an inactive card was used to retrieve the patron via the "F1" interface. This is the stock behavior outside of this branch, but was obscurred due to https://bugs.launchpad.net/evergreen/+bug/1154235 Signed-off-by: Jason Etheridge Signed-off-by: Jason Stephenson --- Open-ILS/xul/staff_client/server/patron/patron.js | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/patron/patron.js b/Open-ILS/xul/staff_client/server/patron/patron.js index 98b028e17e..775383208b 100644 --- a/Open-ILS/xul/staff_client/server/patron/patron.js +++ b/Open-ILS/xul/staff_client/server/patron/patron.js @@ -609,7 +609,31 @@ function patron_ui_populate() { } switch(main_interface) { case 'checkout': - cw.xulG.check_stop_checkouts = function() { return false; }; + cw.xulG.check_stop_checkouts = function() { + try { + var p_obj = patron.util.retrieve_fleshed_au_via_id( + ses(), + patron_id, + ["cards"] + ); + var cards = p_obj.cards(); + var barcodes = util.functional.map_list( + p_obj.cards(), + function (c) { + return c.barcode(); + } + ); + var idx = barcodes.indexOf( barcode_for_some_interfaces ); + if (idx == -1) { + return false; + } else { + return ! get_bool( cards[idx].active() ); + } + } catch(E) { + alert(E); + return false; + } + }; break; case 'items_out': break; -- 2.11.0