| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Initialize Staff Overrides | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Add a staff member Parameters
						$varsarray$vars An array of staff member info including: - user_id The user ID belonging
to this staff member - first_name The first name of this staff member -
last_name The last name of this staff member - email The email address of this
staff member - email_mobile The mobile email address of this staff member -
status The status of this staff member 'active', 'inactive' (optional, default
active) - groups An array of staff group IDs this staff member belongs to
Returns
						integerThe ID of the staff member added, void on error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			edit( integer $staff_id, array $vars )
				
Updates the given staff member with only the values given in $vars 
				
Updates the given staff member with only the values given in $vars Parameters
						$staff_idinteger$staff_id The ID of the staff member to update
$varsarray$vars An array of staff member info including: - first_name The first name of
this staff member (optional) - last_name The last name of this staff member
(optional) - email The email address of this staff member (optional) -
email_mobile The mobile email address of this staff member (optional) - status
The status of this staff member 'active', 'inactive' (optional, default
'active') - groups An array of staff group IDs this staff member belongs to
(optional)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $staff_id )
				
Permanently removes the staff member from the system 
				
Permanently removes the staff member from the system Parameters
						$staff_idinteger$staff_id The ID of the staff member to remove from the system
 | 
		
			| 
				 public 
				
				
				 | 
			#
			assignGroup( integer $staff_id, integer $staff_group_id )
				
Assigns the given staff ID to the given staff group ID 
				
Assigns the given staff ID to the given staff group ID Parameters
						$staff_idinteger$staff_id The ID of the staff member to assign to the given group
$staff_group_idinteger$staff_group_id The ID of the staff group to assign to the given staff member
 | 
		
			| 
				 public 
				
				
				 | 
			#
			addNotice( array $vars )
				
Adds a staff email notice 
				
Adds a staff email notice Parameters
						$varsarray$vars An array of staff notice information including: - staff_group_id The ID of
the staff group this notice will be added to - staff_id The ID of the staff
member - action The email group action
 | 
		
			| 
				 public 
				
				
				 | 
			#
			addNotices( mixed $staff_id, mixed $staff_group_id, array $actions )
				
Adds multiple staff email notices 
				
Adds multiple staff email notices Parameters
						$staff_idmixed$staff_id The ID of the staff member
$staff_group_idmixed$staff_group_id The ID of the staff group these notices will be added to
$actionsarray$vars A list of staff notices, each containing: - action The email group action
 | 
		
			| 
				 public 
				
				
				 | 
			#
			deleteNotice( integer $staff_id, integer $staff_group_id, string $action = null )
				
Deletes the given staff group notice 
				
Deletes the given staff group notice Parameters
						$staff_idinteger$staff_id The ID of the staff member
$staff_group_idinteger$staff_group_id The ID of the staff group the notice belongs to
$actionstring$action The email group action to remove (optional, default null to delete all
notices)
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $staff_id, integer $company_id = null )
				
Fetches a staff member and all associated staff settings and staff groups 
				
Fetches a staff member and all associated staff settings and staff groups Parameters
						$staff_idinteger$staff_id The ID of the staff member
$company_idinteger$company_id The ID of the company to set staff settings for (optional, if null,
no settings will be set)
Returns
						mixedAn array of objects or false if no results.
 
 See | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getByUserId( integer $user_id, integer $company_id = null )
				
Fetches a staff member and all associated staff settings and staff groups 
				
Fetches a staff member and all associated staff settings and staff groups Parameters
						$user_idinteger$user_id The ID of the user
$company_idinteger$company_id The ID of the company to set staff settings for (optional, if null,
no settings will be set)
Returns
						mixedAn array of objects or false if no results.
 
 See | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAllByEmailAction( string $action, integer $company_id, string $notice_type = "all", string $status = null )
				
Fetches all staff members that can be sent the email corresponding to the
given email group action 
				
Fetches all staff members that can be sent the email corresponding to the
given email group action Parameters
						$actionstring$action The email group action representing an email type
$company_idinteger$company_id The ID of the company whose staff members to fetch from
$notice_typestring$notice_type The type of email notice to fetch (optional) one of: - all Any
email notice type - null Notice types that are not set - bcc BCC notice types -
to To notice types
$statusstring$status The status of the staff member ("active", "inactive", or null for all;
optional, default null)
Returns
						arrayA list of stdClass objects, each representing a staff member
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getList( integer $company_id = null, string $status = null, integer $page = 1, string $order_by = array('id'=>"ASC") )
				
Fetches a list of all staff members 
				
Fetches a list of all staff members Parameters
						$company_idinteger$company_id The company ID to fetch (optional, default null)
$statusstring$status The status of the staff member to retrieve ('active', 'inactive',
default null for all)
$pageinteger$page The page to return results for
$order_bystring$order_by The sort and order conditions (e.g. array('sort_field'=>"ASC"),
optional)
Returns
						mixedAn array of objects when $count is false, an integer when $count is true, or
false if no results.
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			getListCount( integer $company_id = null, string $status = null )
				
Returns the total number of staff members returned from Staff::getList(),
useful in constructing pagination for the getList() method. 
				
Returns the total number of staff members returned from Staff::getList(),
useful in constructing pagination for the getList() method. Parameters
						$company_idinteger$company_id The company ID to fetch (optional, default null)
$statusstring$status The status of the staff member to retrieve ('active', 'inactive',
default null for all)
Returns
						integerThe total number of staff members
 
 See | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAll( integer $company_id = null, string $status = null, integer $staff_group_id = null )
				
Returns a list of all staff members 
				
Returns a list of all staff members Parameters
						$company_idinteger$company_id The ID of the company from which to fetch staff (optional)
$statusstring$status The status of the staff to fetch ('active' or 'inactive', null for all)
$staff_group_idinteger$staff_group_id The ID of the client group that the staff must belong to
(optional)
Returns
						arrayA list of stdClass objects each representing a staff member
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getNotices( integer $staff_id, integer $staff_group_id = null, boolean $group_by_action = true )
				
Fetches all staff group notices 
				
Fetches all staff group notices Parameters
						$staff_idinteger$staff_id The ID of the staff member
$staff_group_idinteger$staff_group_id The ID of the staff group (optional, default null for all)
$group_by_actionboolean$group_by_action True to group by the action, false otherwise (optional, default
true)
Returns
						arrayA list of all staff group notices
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			addQuickLink( integer $staff_id, integer $company_id, array $vars )
				
Adds a quicklink for a staff member 
				
Adds a quicklink for a staff member Parameters
						$staff_idinteger$staff_id The staff ID of this staff member
$company_idinteger$company_id The company ID of this staff member
$varsarray$vars An array of quicklink info including: - uri The URI of the link to save -
title The title of this quicklink - order The sort order of this quicklink
(optional, default 0)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			deleteQuickLink( integer $staff_id, integer $company_id, string $uri )
				
Removes a quicklink for a staff member 
				
Removes a quicklink for a staff member Parameters
						$staff_idinteger$staff_id The staff ID of this staff member
$company_idinteger$company_id The company ID of this staff member
$uristring$uri The URI of the link to remove
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getQuickLinks( integer $staff_id, integer $company_id )
				
Retrieves all quicklinks for a given staff member 
				
Retrieves all quicklinks for a given staff member Parameters
						$staff_idinteger$staff_id The staff ID of this staff member
$company_idinteger$company_id The company ID of this staff member
Returns
						mixedAn array of objects representing the quicklinks, or false if none exist
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			sendNotificationEmail( string $action, integer $company_id, array $tags = null, mixed $cc = null, mixed $bcc = null, array $attachments = null, array $options = null )
				
Sends the notification email matching the given action to all staff members
that should receive it. Sets Input errors on error 
				
Sends the notification email matching the given action to all staff members
that should receive it. Sets Input errors on error Parameters
						$actionstring$action The action that specifies the email group to use
$company_idinteger$company_id The company ID to send this email under
$tagsarray$tags An array of replacement tags containing the key/value pairs for the
replacements where the key is the tag to replace and the value is the value to
replace it with (optional; A 'staff' tag will automatically be set)
$ccmixed$cc The CC address(es) to send to. A string, or an array of email addresses
$bccmixed$bcc The BCC address(es) to send to. A string, or an array of email addresses
$attachmentsarray$attachments A multi-dimensional array of attachments containing: - path The
path to the attachment on the file system - name The name of the attachment
(optional, default '') - encoding The file encoding (optional, default 'base64')
- type The type of attachment (optional, default 'application/octet-stream')
$optionsarray$options An array of options including: - to_client_id The ID of the client the
message was sent to - from_staff_id The ID of the staff member the message was
sent from - from The from address - from_name The from name - reply_to The reply
to address
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSettings( integer $staff_id, integer $company_id )
				
Fetch all settings that may apply to this staff member. Settings are
inherited in the order of staff_settings -> company_settings -> settings
where "->" represents the left item inheriting (and overwriting in the case
of duplicates) values found in the right item. 
				
Fetch all settings that may apply to this staff member. Settings are
inherited in the order of staff_settings -> company_settings -> settings
where "->" represents the left item inheriting (and overwriting in the case
of duplicates) values found in the right item. Parameters
						$staff_idinteger$staff_id The staff ID to retrieve settings for
$company_idinteger$company_id The company ID to retrieve settings for
Returns
						mixedAn array of objects containg key/values for the settings, false if no records
found
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getSetting( integer $staff_id, string $key, integer $company_id = null )
				
Fetch a single setting by key name 
				
Fetch a single setting by key name Parameters
						$staff_idinteger$staff_id The ID of the staff member to fetch the setting for
$keystring$key The key name of the setting to fetch
$company_idinteger$company_id The ID of the company to inherit settings from
Returns
						mixedAn stdObject containg the key and value, false if no such key exists
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSettings( integer $staff_id, array $vars )
				
Add multiple staff settings, if duplicate key update the setting 
				
Add multiple staff settings, if duplicate key update the setting Parameters
						$staff_idinteger$staff_id The ID for the specified staff member
$varsarray$vars A single dimensional array of key/value pairs of settings
 | 
		
			| 
				 public 
				
				
				 | 
			#
			setSetting( integer $staff_id, string $key, string $value )
				
Add a staff setting, if duplicate key update the setting 
				
Add a staff setting, if duplicate key update the setting Parameters
						$staff_idinteger$staff_id The ID for the specified staff member
$keystring$key The key for this staff setting
$valuestring$value The value for this staff setting
 | 
		
			| 
				 public 
				
				
				 | 
			#
			unsetSetting( integer $staff_id, string $key )
				
Delets a staff setting Parameters
						$staff_idinteger$staff_id The ID for the specified staff member
$keystring$key The key for this staff setting
 | 
		
			| 
				 public 
				
				
				 | 
			#
			saveClientsWidgetsState( integer $staff_id, integer $company_id, array $widgets )
				
Saves the current state of the clients widget boxes 
				
Saves the current state of the clients widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to save the widget box state for
$company_idinteger$company_id The ID of the company to save the widget box state for (in
combination with $staff_id)
$widgetsarray$widgets An array of widget state information keyed by widget name including: -
open Whether or not the box is open (true/false)
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getClientsWidgetsState( integer $staff_id, integer $company_id )
				
Fetch the current state of the clients widget boxes 
				
Fetch the current state of the clients widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to fetch the widget box state for
$company_idinteger$company_id The ID of the company to fetch the widget box state for (in
combination with $staff_id)
Returns
						arrayAn array of widget box state data
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			saveHomeWidgetsState( integer $staff_id, integer $company_id, array $widgets )
				
Saves the current state of the home (dashboard) widget boxes 
				
Saves the current state of the home (dashboard) widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to save the widget box state for
$company_idinteger$company_id The ID of the company to save the widget box state for (in
combination with $staff_id)
$widgetsarray$widgets An array of widget state information keyed by widget name including: -
open Whether or not the box is open (true/false)
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getHomeWidgetsState( integer $staff_id, integer $company_id )
				
Fetch the current state of the home (dashboard) widget boxes 
				
Fetch the current state of the home (dashboard) widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to fetch the widget box state for
$company_idinteger$company_id The ID of the company to fetch the widget box state for (in
combination with $staff_id)
Returns
						arrayAn array of widget box state data
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			saveBillingWidgetsState( integer $staff_id, integer $company_id, array $widgets )
				
Saves the current state of the billing (dashboard) widget boxes 
				
Saves the current state of the billing (dashboard) widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to save the widget box state for
$company_idinteger$company_id The ID of the company to save the widget box state for (in
combination with $staff_id)
$widgetsarray$widgets An array of widget state information keyed by widget name including: -
open Whether or not the box is open (true/false)
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getBillingWidgetsState( integer $staff_id, integer $company_id )
				
Fetch the current state of the billing (dashboard) widget boxes 
				
Fetch the current state of the billing (dashboard) widget boxes Parameters
						$staff_idinteger$staff_id The ID of the staff member to fetch the widget box state for
$company_idinteger$company_id The ID of the company to fetch the widget box state for (in
combination with $staff_id)
Returns
						arrayAn array of widget box state data
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateStatus( string $status )
				
Validates the staff's 'status' field 
				
Validates the staff's 'status' field Parameters
						$statusstring$status The status to check
Returns
						booleanTrue if validated, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateUniqueCompanies( array $group_ids )
				
Validates that none of the staff group IDs given belong to the same
company 
				
Validates that none of the staff group IDs given belong to the same
company Parameters
						$group_idsarray$group_ids An array of staff group IDs
Returns
						booleanTrue if none of the staff group IDs belong to the same company, false otherwise
 
 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			validateNoticeActionExists( string $action, integer $staff_group_id )
				
Validates that the given action is available for this staff group 
				
Validates that the given action is available for this staff group Parameters
						$actionstring$action The email group action
$staff_group_idinteger$staff_group_id The ID of the staff group to check
Returns
						booleanTrue if the staff group has the action available, false otherwise
 
 |