From 867581bd52b3da17f19654b0de23c56b9fcaba12 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 22 Sep 2009 03:51:49 +0000 Subject: [PATCH] after applying penalty, fetch new patron with .standing_penalties. The constructed/fake penalty wasn't good enough for further action with pcrud, only for display git-svn-id: svn://svn.open-ils.org/ILS/trunk@14080 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/patron/standing_penalties.js | 7 ++++++- Open-ILS/xul/staff_client/server/patron/util.js | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/patron/standing_penalties.js b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js index 9123ab65f..483e2f91c 100644 --- a/Open-ILS/xul/staff_client/server/patron/standing_penalties.js +++ b/Open-ILS/xul/staff_client/server/patron/standing_penalties.js @@ -179,7 +179,11 @@ function generate_request_handler_for_penalty_apply(penalty,id) { ); } else { penalty.id(req); - xulG.patron.standing_penalties( xulG.patron.standing_penalties().concat( penalty ) ); + JSAN.use('patron.util'); JSAN.use('util.functional'); + //xulG.patron.standing_penalties( xulG.patron.standing_penalties().concat( penalty ) ); // Not good enough for pcrud + xulG.patron = patron.util.retrieve_fleshed_au_via_id( ses(), xulG.patron.id() ); // So get the real deal instead + penalty = util.functional.find_list( xulG.patron.standing_penalties(), function(o) { return o.id() == req; } ); + var row_params = { 'row' : { 'my' : { @@ -338,6 +342,7 @@ function handle_archive_penalty(ev) { for (var i = 0; i < ids.length; i++) { outstanding_requests++; var penalty = util.functional.find_list( xulG.patron.standing_penalties(), function(o) { return o.id() == ids[i]; } ); +alert(js2JSON(penalty)); penalty.ischanged( 1 ); penalty.stop_date( util.date.formatted_date(new Date(),'%F') ); dojo.require('openils.PermaCrud'); diff --git a/Open-ILS/xul/staff_client/server/patron/util.js b/Open-ILS/xul/staff_client/server/patron/util.js index 68b223916..957e421a1 100644 --- a/Open-ILS/xul/staff_client/server/patron/util.js +++ b/Open-ILS/xul/staff_client/server/patron/util.js @@ -583,7 +583,7 @@ patron.util.retrieve_fleshed_au_via_id = function(session, id) { JSAN.use('util.network'); var network = new util.network(); var patron_obj = network.simple_request( - 'FM_AU_FLESHED_RETRIEVE_VIA_ID', + 'FM_AU_FLESHED_RETRIEVE_VIA_ID.authoritative', [ session, id ] ); patron.util.set_penalty_css(patron_obj); -- 2.11.0