diff options
author | aurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-09-23 23:23:03 +0000 |
---|---|---|
committer | aurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46> | 2008-09-23 23:23:03 +0000 |
commit | 0a1573bd053a30b3ba2690fcf3545be02cb2eaa8 (patch) | |
tree | e449b9d1099e01686a6059720750ccd495ec45d8 /LedgerSMB | |
parent | 9937eb3c4ef04f15ceb7cd1106d6bffb10304355 (diff) |
Lots of fixes for editing users. Minor changes to Person.sql, specifically person__save_contact.
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2339 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r-- | LedgerSMB/DBObject/Admin.pm | 9 | ||||
-rw-r--r-- | LedgerSMB/DBObject/Location.pm | 1 | ||||
-rw-r--r-- | LedgerSMB/DBObject/User.pm | 16 |
3 files changed, 25 insertions, 1 deletions
diff --git a/LedgerSMB/DBObject/Admin.pm b/LedgerSMB/DBObject/Admin.pm index 5ab869b0..e16e5dea 100644 --- a/LedgerSMB/DBObject/Admin.pm +++ b/LedgerSMB/DBObject/Admin.pm @@ -264,4 +264,11 @@ sub get_countries { $self->debug({file => '/tmp/user'}); return $self->{countries}; } -1; +sub get_contact_classes { + + my $self = shift @_; + my $sth = $self->{dbh}->prepare("select id, class as classname from contact_class"); + my $code = $sth->execute(); + return $sth->fetchall_arrayref({}); +} +1;
\ No newline at end of file diff --git a/LedgerSMB/DBObject/Location.pm b/LedgerSMB/DBObject/Location.pm index 3deb967f..1b7e2699 100644 --- a/LedgerSMB/DBObject/Location.pm +++ b/LedgerSMB/DBObject/Location.pm @@ -69,5 +69,6 @@ sub get_all { my $type = shift @_; my @locations = $self->exec_method(funcname=>$type."__all_locations", args=>[$user_id]); + return \@locations; } 1;
\ No newline at end of file diff --git a/LedgerSMB/DBObject/User.pm b/LedgerSMB/DBObject/User.pm index 7682acbe..0ca6bcfc 100644 --- a/LedgerSMB/DBObject/User.pm +++ b/LedgerSMB/DBObject/User.pm @@ -141,4 +141,20 @@ sub roles { } +sub save_contact { + + my $self = shift @_; + my $id = shift @_; + my $contact = shift @_; + + my @ret = $self->exec_method(funcname=>"person__save_contact", + args=>[ + $self->{entity_id}, + $self->{contacts}->[$id]->{contact_class}, + $self->{contacts}->[$id]->{contact}, + $contact + ] + ); +} + 1; |