[open-ils-commits] r11321 - trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Nov 24 15:17:05 EST 2008
Author: erickson
Date: 2008-11-24 15:16:59 -0500 (Mon, 24 Nov 2008)
New Revision: 11321
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
when fleshing a user, retrieve penalties ranged to the requestor's workstation org
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-11-24 15:14:52 UTC (rev 11320)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2008-11-24 20:16:59 UTC (rev 11321)
@@ -319,21 +319,14 @@
}
$apputils->commit_db_session($session);
- my $fuser = flesh_user($new_patron->id());
- if( $opatron ) {
- # Log the new and old patron for investigation
- $logger->info("$user_session updating patron object. orig patron object = ".
- OpenSRF::Utils::JSON->perl2JSON($opatron). " |||| new patron = ".OpenSRF::Utils::JSON->perl2JSON($fuser));
- }
-
-
- return $fuser;
+ return flesh_user($new_patron->id(), new_editor(requestor => $user_obj));
}
sub flesh_user {
my $id = shift;
+ my $e = shift;
return new_flesh_user($id, [
"cards",
"card",
@@ -341,7 +334,7 @@
"addresses",
"billing_address",
"mailing_address",
- "stat_cat_entries" ] );
+ "stat_cat_entries" ], $e );
}
@@ -931,7 +924,7 @@
}
$card = $card->[0];
- my $user = flesh_user($card->usr());
+ my $user = flesh_user($card->usr(), new_editor(requestor => $user_obj));
$evt = $U->check_perms($user_obj->id, $user->home_ou, 'VIEW_USER');
return $evt if $evt;
@@ -2795,8 +2788,14 @@
my $id = shift;
my $fields = shift || [];
- my $e = shift || new_editor(xact=>1);
+ my $e = shift;
+ my $fetch_penalties = 0;
+ if(grep {$_ eq 'standing_penalties'} @$fields) {
+ $fields = [grep {$_ ne 'standing_penalties'} @$fields];
+ $fetch_penalties = 1;
+ }
+
my $user = $e->retrieve_actor_user(
[
$id,
@@ -2825,6 +2824,20 @@
}
}
+ if($fetch_penalties) {
+ # grab the user penalties ranged for this location
+ $user->standing_penalties(
+ $e->search_actor_user_standing_penalty([
+ { usr => $id,
+ org_unit => $U->get_org_ancestors($e->requestor->ws_ou)
+ },
+ { flesh => 1,
+ flesh_fields => {ausp => ['standing_penalty']}
+ }
+ ])
+ );
+ }
+
$e->rollback;
$user->clear_passwd();
return $user;
More information about the open-ils-commits
mailing list