diff options
author | aurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-08-21 20:05:54 +0000 |
---|---|---|
committer | aurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-08-21 20:05:54 +0000 |
commit | eb497f995016bf851d68ee831cd15228ba15c4c4 (patch) | |
tree | 9c48b4f25fc7334a0f3e619695df487ed6399797 /LedgerSMB | |
parent | 767f00372726c561e86f3b57bf3437ae175dbb0b (diff) |
Further fixes to Recon and Admin. In testing.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2296 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/Admin.pm | 13 | ||||
-rw-r--r-- | LedgerSMB/DBObject/Admin.pm | 2 | ||||
-rw-r--r-- | LedgerSMB/DBObject/User.pm | 49 |
3 files changed, 56 insertions, 8 deletions
diff --git a/LedgerSMB/Admin.pm b/LedgerSMB/Admin.pm index 34acecb3..98a466bf 100644 --- a/LedgerSMB/Admin.pm +++ b/LedgerSMB/Admin.pm @@ -180,9 +180,16 @@ sub get_entire_user { my $self = shift @_; my $id = shift @_; - my $user = LedgerSMB::DBObject::User->new(base=>$self,copy=>'all'); - $user->get($id); - + my $user = {}; + my $u = LedgerSMB::DBObject::User->new(base=>$self,copy=>'all'); + $user->{user} = $u->get($id); + $user->{pref} = $u->preferences($id); + $user->{employee} = $u->employee($user->{user}->{entity_id}); + $user->{person} = $u->person($user->{user}->{entity_id}); + $user->{entity} = $u->entity($id); + $user->{roles} = $u->roles($id); + + return $user; } sub get_roles { diff --git a/LedgerSMB/DBObject/Admin.pm b/LedgerSMB/DBObject/Admin.pm index 67218005..52e1d8b3 100644 --- a/LedgerSMB/DBObject/Admin.pm +++ b/LedgerSMB/DBObject/Admin.pm @@ -96,7 +96,7 @@ sub save_roles { my $user = LedgerSMB::DBObject::User->new( base=>$self, copy=>'all' ); my $roles = $self->exec_method( procname => "admin__all_roles" ); - my $user_roles = $self->exec_method(procname => "admin__get_user_roles", args=>[ $self->{ username } ] ); + my $user_roles = $self->exec_method(procname => "admin__get_user_roles", args=>[ $user->{id} ] ); my %active_roles; for my $role (@{ $user_roles }) { diff --git a/LedgerSMB/DBObject/User.pm b/LedgerSMB/DBObject/User.pm index b09951a9..af02e7ff 100644 --- a/LedgerSMB/DBObject/User.pm +++ b/LedgerSMB/DBObject/User.pm @@ -40,10 +40,43 @@ sub get { my $self = shift @_; my $id = shift; - my $user = @{ $self->exec_method(funcname=>'admin__get_user', - args=>[$id])}[0]; - - return $user; + $self->{user} = @{ $self->exec_method( + funcname=>'admin__get_user', + args=>[$id] + ) + }[0]; + $self->{pref} = @{ $self->exec_method( + funcname=>'admin__user_preferences', + args=>[$id] + ) + }[0]; + $self->{person} = @{ $self->exec_method( + funcname=>'admin__user_preferences', + args=>[$self->{user}->{entity_id}] + ) + }[0]; + $self->{employee} = @{ $self->exec_method( + funcname=>'employee__get', + args=>[$id] + ) + }[0]; + $self->{entity} = @{ $self->exec_method( + funcname=>'entity__get_entity', + args=>[ $self->{user}->{entity_id} ] + ) + }[0]; + $self->{roles} = $self->exec_method( + funcname=>'admin__get_roles_for_user', + args=>[$id] + ); + + + #$user->{user} = $u->get($id); + #$user->{pref} = $u->preferences($id); + #$user->{employee} = $u->employee($user->{user}->{entity_id}); + #$user->{person} = $u->person($user->{user}->{entity_id}); + #$user->{entity} = $u->entity($id); + #$user->{roles} = $u->roles($id); } sub remove { @@ -79,4 +112,12 @@ sub get_all_users { $self->{users} = \@ret; } +sub roles { + + my $self = shift @_; + my $id = shift @_; + + +} + 1; |