[open-ils-commits] r11856 - trunk/Open-ILS/src/perlmods/OpenILS/Application
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jan 15 16:59:04 EST 2009
Author: erickson
Date: 2009-01-15 16:58:58 -0500 (Thu, 15 Jan 2009)
New Revision: 11856
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
Log:
added the ability to update a pending address inline while approving it
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-15 21:53:22 UTC (rev 11855)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2009-01-15 21:58:58 UTC (rev 11856)
@@ -3151,14 +3151,19 @@
);
sub approve_user_address {
- my($self, $conn, $auth, $addr_id) = @_;
+ my($self, $conn, $auth, $addr) = @_;
my $e = new_editor(xact => 1, authtoken => $auth);
return $e->die_event unless $e->checkauth;
- my $addr = $e->retrieve_actor_user_address($addr_id)
- or return $e->die_event;
+ if(ref $addr) {
+ # if the caller passes an address object, assume they want to
+ # update it first before approving it
+ $e->update_actor_user_address($addr) or return $e->die_event;
+ } else {
+ $addr = $e->retrieve_actor_user_address($addr) or return $e->die_event;
+ }
my $user = $e->retrieve_actor_user($addr->usr);
return $e->die_event unless $e->allowed('UPDATE_USER', $user->home_ou);
- my $result = $e->json_query({from => ['actor.approve_pending_address', $addr_id]})->[0]
+ my $result = $e->json_query({from => ['actor.approve_pending_address', $addr->id]})->[0]
or return $e->die_event;
$e->commit;
return [values %$result]->[0];
More information about the open-ils-commits
mailing list