EmployeeHandler

This class contains the functions to perform the following:

  • Retrieve, Insert and Update Employees
  • Set the Employee Export Flag

api
package simPROAPI
subpackage Staff
author Nathan Muir
version 2011-08-15
uses \global\StaffHandler

 Methods

EmployeeAttachmentsRetrieve

AttachmentsRetrieve(mixed $CompanyID, int $EmployeeID) : array
Static

This function retrieves the list of attachemnts for the provided employee id

uses \StaffHandler::RetrieveAttachments()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$EmployeeID

int

The employee member to retrieve licences for

Returns

array

EmployeeFlag

Flag(int $CompanyID, int $EmployeeID) : bool
Static

This function flags a particular employee as exported

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeID

int

The employee to flag as exported

Returns

bool

EmployeeFlagList

FlagList(int $CompanyID, array $EmployeeIDs) : array
Static

This function flags a list of employees as exported

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeIDs

array

The employee list to flag as exported

Returns

array

EmployeeInsert

Insert(int $CompanyID, array $EmployeeDetails) : int
Static
<?php
array_keys($EmployeeDetails) == array(
                                "EmployeeName",
                                "HomeAddress",
                                "HomeSuburb",
                                "HomeState",
                                "HomePostcode",
                                "HomeCountry",
                                "Phone1",
                                "Mobile",
                                "Fax",
                                "Email",
                                "Active",
                                "TaxFileNo",
                                "AccountName",
                                "BSB",
                                "AccountNo",
                                "DateOfBirth",
                                "DateOfCommencement",
                               "Export",
                               "CustomFields",
                                "Position"
                                );
?>

Parameters

$CompanyID

int

the company id

$EmployeeDetails

array

an associative array of employee information.

Returns

int

EmployeeLicenceInsert

LicenceInsert(int $CompanyID, int $EmployeeID, array $LicenceDetails = array()) : bool
Static
<?php
array_keys($LicenceDetails) ==     array (
           'LicenceName',
           'LicenceReference',
           'LicenceExpiry',
        )

This function inserts a licence for a particular employee

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeID

int

employee ID to link the licence.

$LicenceDetails = array()

array

an associative array of licence information

Returns

bool

EmployeeLicencesRetrieve

LicencesRetrieve(int $CompanyID, int $EmployeeID) : array
Static

This function retrieves licences for the provided employee id

uses \StaffHandler::RetrieveLicences()

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeID

int

The employee member to retrieve licences for

Returns

array

EmployeeLicencesSearch

LicencesSearch(mixed $CompanyID, string $Search = '') : array
Static

This function retrieves licences for all employees under a company

Parameters

$CompanyID

mixed

the Company ID. In single company builds, this is 0.

$Search = ''

string

The search string for the licence name.

Returns

array

EmployeeRetrieve

Retrieve(mixed $CompanyID, int $EmployeeID) : array
Static

This function retrieves a employee with a specific ID

uses \EmployeeHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$EmployeeID

int

employee id

Returns

array

EmployeeRetrieveAll

RetrieveAll(mixed $CompanyID) : array
Static

This function retrieves a list of employees

uses \EmployeeHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

Returns

array

EmployeeRetrieveCurrent

RetrieveCurrent(array $Detail = array()) : array
Static

This function retrieves the currently logged in user as well as the server time

uses \EmployeeHandler::RetrieveList()

Parameters

$Detail = array()

array

the specification of which details to return - ("Zones","Departments","Companies","Billing"). Null/Empty/Empty array will return none.

Returns

array

EmployeeRetrieveExport

RetrieveExport(mixed $CompanyID) : array
Static

This function retrieves a list of employees that are ready for export

uses \EmployeeHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

Returns

array

EmployeeRetrieveList

RetrieveList(mixed $CompanyID, array $EmployeeIDs, array $Detail = array()) : array
Static

This function retrieves details on the provided list of employee ids

uses \StaffHandler::RetrieveList()
used_by \EmployeeHandler::Search()
used_by \EmployeeHandler::SearchFields()
used_by \EmployeeHandler::Retrieve()
used_by \EmployeeHandler::RetrieveCurrent()
used_by \EmployeeHandler::RetrieveExport()
used_by \EmployeeHandler::RetrieveAll()
used_by \StaffHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$EmployeeIDs

array

list of Employee ID's to retrieve.

$Detail = array()

array

the specification of which details to return - ("Zones","Departments","Companies","BillRates"). Null/Empty/Empty array will return none.

Returns

array

EmployeeSearchFields

SearchFields(mixed $CompanyID, array $SearchTerms) : array
Static

This function retrieve's a list of employees who's set of fields match their associated values

Implemented Search Terms are: SalesPerson, ProjectManagerID, UserName, Zone, ZoneName, Export

uses \EmployeeHandler::RetrieveList()

Parameters

$CompanyID

mixed

the Company IDs. Can be a single Company ID or an array of Company IDs. In single company builds, this is 0.

$SearchTerms

array

An associative array of Search Fields[key] and their search terms [value]

Returns

array

EmployeeTotalCount

TotalCount(int $CompanyID) : array
Static

This function returns the total number of Employees that are not archived

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

Returns

array

EmployeeUnFlag

UnFlag(int $CompanyID, int $EmployeeID) : bool
Static

This function Unflags a particular employee as exported

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeID

int

The employee to Unflag as exported

Returns

bool

EmployeeUnFlagList

UnFlagList(int $CompanyID, array $EmployeeIDs) : array
Static

This function Unflags a list of employees as exported

Parameters

$CompanyID

int

the Company ID. In single company builds, this is 0.

$EmployeeIDs

array

The employee list to Unflag as exported

Returns

array

EmployeeUpdate

Update(int $CompanyID, int $EmployeeID, array $EmployeeDetails) : bool
Static
<?php
array_keys($EmployeeDetails) == array(
                                "EmployeeName",
                                "HomeAddress",
                                "HomeSuburb",
                                "HomeState",
                                "HomePostcode",
                                "HomeCountry",
                                "Phone1",
                                "Mobile",
                                "Fax",
                                "Email",
                                "Active",
                                "TaxFileNo",
                                "AccountName",
                                "BSB",
                                "AccountNo",
                                "DateOfBirth",
                                "DateOfCommencement",
                                "Export",
                               "CustomFields",
                                "Position"
                                );
?>

Parameters

$CompanyID

int

the company id

$EmployeeID

int

The employee id to update with the supplied information

$EmployeeDetails

array

an associative array of employee information.

Returns

bool