From 9af6ae6be1019ea656a101dfe7b66709f82f68ca Mon Sep 17 00:00:00 2001 From: aurynn_cmd Date: Wed, 17 Oct 2007 23:16:35 +0000 Subject: Serious updates to the Admin controller; Creation of a User controller/object - I would like to use this to save/load roles, as well. Creation of Person stored procs, Entity stored procs. Serious updates to the employee stored procs. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1778 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Employee.pm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'LedgerSMB/Employee.pm') diff --git a/LedgerSMB/Employee.pm b/LedgerSMB/Employee.pm index d0b09829..59a550f2 100644 --- a/LedgerSMB/Employee.pm +++ b/LedgerSMB/Employee.pm @@ -48,6 +48,10 @@ our $VERSION = '1.0.0'; sub save { my $self = shift; + + my $person = shift @{ $self->exec_method (procname => 'person_save', + args => [] )}; + my $hashref = shift @{ $self->exec_method( procname => "employee_save" ) }; $self->merge( $hashref, 'id' ); } @@ -70,4 +74,21 @@ sub search { $self->exec_method( procname => "employee_search" ); } +sub set_location { + + my $self = shift @_; + my $location = shift @_; + + my $code = $self->exec_method ( procname => 'employee_set_location', + args=>[ $self->{id}, $location->{id} ] ); + + if ($code) { + + # good, it worked. + + return 1; + } + return 0; +} + 1; -- cgit v1.2.3