TaskHandler

This class contains the functions to perform the following:

- Retrieve Task(s)

- Insert Task(s) - Update Task(s)

api
package simPROAPI
subpackage Tasks
author Nathan Muir, Isaac Martin
version 2011-07-18

 Methods

TaskCategories

Categories(int $CompanyID) : array
Static

Parameters

$CompanyID

int

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

Returns

array

TaskInsert

Insert(int $CompanyID, array $TaskDetails) : int
Static
<?php
array_keys($TaskDetails) == array(
  "Subject",
  "AssignedID",
  "CustomerID",
  "SiteID",
  "ContactID",
  "Priority",
  "Status",
  "Category",
  "Description",
  "Notes",
  "DateCreated",
  "DateStart",
  "DateDue",
  "DateCompleted",
  "EstimatedHrs",
  "ActualHrs",
  "Billable",
  "DepartmentNo",
  "ShowJobcard",
  "QuoteConvert",
  "DisplayOrder",
  "SubTasks",
  "JobNo",
  "QuoteNo"
  );
?>

Parameters

$CompanyID

int

the company id

$TaskDetails

array

an associative array of task information.

Returns

int

TaskInsertSelfAppointed

InsertSelfAppointed(int $CompanyID, array $TaskDetails) : int
Static

creates a task with the current employee assigned.

<?php
array_keys($TaskDetails) == array(
  "Subject",
  "CustomerID",
  "SiteID",
  "ContactID",
  "Priority",
  "Status",
  "Category",
  "Description",
  "Notes",
  "DateCreated",
  "DateStart",
  "DateDue",
  "DateCompleted",
  "EstimatedHrs",
  "ActualHrs",
  "Billable",
  "DepartmentNo",
  "Milestone",
  "ShowJobcard",
  "QuoteConvert",
  "DisplayOrder",
  "SubTasks",
  "JobNo",
  "QuoteNo"
  );
?>

Parameters

$CompanyID

int

the company id

$TaskDetails

array

an associative array of task information.

Returns

int

TaskRetrieve

Retrieve(int $CompanyID, int $TaskNo) : array
Static

This function retrieves a task with a specific Task Number

uses \TaskHandler::RetrieveList()

Parameters

$CompanyID

int

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

$TaskNo

int

The task to retrieve

Returns

array

TaskRetrieve

RetrieveAllocated(int $CompanyID, int $JobNo = null, array $StatusList = array()) : array
Static

This function retrieves all the tasks allocated to the current employee

uses \TaskHandler::Search()

Parameters

$CompanyID

int

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

$JobNo = null

int

optional job number to find tasks for

$StatusList = array()

array

The list of statuses to return results for. If empty will return results for all statuses

Returns

array

TaskRetrieveList

RetrieveList(int $CompanyID, array $TaskNos, bool $Detail = false) : array
Static

This function retrieves details on the provided list of customer ids

used_by \TaskHandler::Search()
used_by \TaskHandler::Retrieve()

Parameters

$CompanyID

int

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

$TaskNos

array

list of Task ID's to retrieve.

$Detail = false

bool

unused

Returns

array

TaskUpdate

Update(int $CompanyID, int $TaskNo, array $TaskDetails) : bool
Static
<?php
array_keys($TaskDetails) === array(
  "Subject",
  "AssignedID",
  "CustomerID",
  "SiteID",
  "ContactID",
  "Priority",
  "Status",
  "Category",
  "Description",
  "Notes",
  "DateCreated",
  "DateStart",
  "DateDue",
  "DateCompleted",
  "EstimatedHrs",
  "ActualHrs",
  "Billable",
  "DepartmentNo",
  "Milestone",
  "ShowJobcard",
  "QuoteConvert",
  "DisplayOrder",
  "SubTasks",
  "JobNo",
  "QuoteNo"
  );
?>

Parameters

$CompanyID

int

the company id

$TaskNo

int

The task id to update with the supplied information

$TaskDetails

array

an associative array of task information.

Returns

bool

TaskUpdateAllocated

UpdateAllocated(int $CompanyID, int $TaskID, array $TaskDetails) : bool
Static

updates a task that is assigned to the current employee

<?php
array_keys($TaskDetails) === array(
  "Status",
  "Notes",
  "CompletedDate",
  "ActualHrs"
  );
?>

Parameters

$CompanyID

int

the company id

$TaskID

int

The task id to update with the supplied information

$TaskDetails

array

an associative array of task information.

Returns

bool