after applying penalty, fetch new patron with .standing_penalties. The constructed...
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Sep 2009 03:51:49 +0000 (03:51 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 22 Sep 2009 03:51:49 +0000 (03:51 +0000)
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
Open-ILS/xul/staff_client/server/patron/util.js

index 9123ab6..483e2f9 100644 (file)
@@ -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');
index 68b2239..957e421 100644 (file)
@@ -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);