diff options
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; |