summaryrefslogtreecommitdiff
path: root/LedgerSMB/Employee.pm
diff options
context:
space:
mode:
authoraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-17 23:16:35 +0000
committeraurynn_cmd <aurynn_cmd@4979c152-3d1c-0410-bac9-87ea11338e46>2007-10-17 23:16:35 +0000
commit9af6ae6be1019ea656a101dfe7b66709f82f68ca (patch)
tree524b0cb9de85fe3dc7adfdfa5c8c460d08f32731 /LedgerSMB/Employee.pm
parentb31d6b0e52b43fd0a3a1b6bdc8d5579d8cc22b58 (diff)
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
Diffstat (limited to 'LedgerSMB/Employee.pm')
-rw-r--r--LedgerSMB/Employee.pm21
1 files changed, 21 insertions, 0 deletions
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;