Task
An object for adding, viewing, editing and deleting a specific task.
Task PHP Methods
activeString() v5
Checks if the task is active
PARAMETERS:
NONE
RETURN VALUE:
string = Active | inactive add(array $fieldValues) v5
Adds a new record.
PARAMETERS:
$fieldValues = Array of the values for each column when adding the record (Associative array with key = field name & value = field value).
RETURN VALUE:
int = id of the new record.
0 = if fails addFromTemplate(int $taskType, int $taskTypeID, \WMT\ SQL\Task\TaskTemplate $taskTemplate, bool $isActive) v5
Sets default template for a task
PARAMETERS:
$taskType = int, task type
$taskTypeID = int, task type ID
$taskTemplate = object
$isActive = bool, true the task is active, fasle otherwise
RETURN VALUE:
VOID assignSkill(int $skillID, int $order = 1) v5
Assigns a skill to the loaded task
PARAMETERS:
$skillID = int, skill id
$order = int, skill order
RETURN VALUE:
VOID checkLoaded() v5
Checks if record is loaded. throwing an error if the record failed to load successfully.
PARAMETERS:
NONE
RETURN VALUE:
VOID complete(int $memberID) v5
Sets the loaded task to complete status
PARAMETERS:
$memberID = int, member ID
RETURN VALUE:
VOID completeString() v5
Checks if the task is completed
PARAMETERS:
NONE
RETURN VALUE:
string = complete | in progress convertHTML(string $htmlContent = "", string $prefix = "", bool $urlEncode = false) v5
Converts ~~ variables in the $htmlContent that is provided and returns the converted content. The title of the ~~ variables are converted by the content from the column in the database with the matching title.
PARAMETERS:
$htmlContent = String, HTML content body to convert.
$prefix= String, tilde code prefix if any.
$urlEncode = Bool, true if you want to apply URL encode to the content, false otherwise
RETURN VALUE:
String = Converted HTML delete(string $restoreQuery = "") v5
Deletes the loaded record from the database.
PARAMETERS:
$restoreQuery = FOR INTERNAL USE. FOR TYPICAL USAGE LEAVE THIS BLANK. The restore query to pass along when deleting an object with dependencies.
RETURN VALUE:
VOID duplicate(array $newValues = null) v5
Creates a duplicate record in the database of the current object
PARAMETERS:
$newValues = array, associative array with field name as key and field value as array value containing the new values if any
RETURN VALUE:
int = the id of the new record. function load(string $queryWhere) v5
Loads values for the record matching the criteria specified by $queryWhere. If the there is more than one record returned from the query then only the first record is loaded.
PARAMETERS:
$queryWhere = String, SQL where query.
RETURN VALUE:
Bool = true, if success, false otherwise getActiveString() v5
Checks if the task is active
PARAMETERS:
NONE
RETURN VALUE:
string = active | inactive getClientHTML() v5
Gets client name as HTML
PARAMETERS:
NONE
RETURN VALUE:
string = client name as HTML getCreditsAMinute(int $memberID) v5
Gets how many credits a minute the task with take
PARAMETERS:
$memberID = int, employee ID
RETURN VALUE:
int = number of credits consumed per minute (employee rate) getDatabaseName() v5
Returns object's database table name
PARAMETERS:
NONE
RETURN VALUE:
String = Database name getDefaultTRHTML() v5
Returns the default html code for a tr row with all of the fields from the database in it as ~~ vars
PARAMETERS:
NONE
RETURN VALUE:
String = the default HTML code for a tr row with all of the fields from the database in it as ~~ vars getEstimatedCompletion() v5
Gets estimate time to complete the loaded task
PARAMETERS:
NONE
RETURN VALUE:
string = estimate time to complete the loaded task getEstimatedPrice() v5
Gets estimate price for the loaded task
PARAMETERS:
NONE
RETURN VALUE:
string = estimate price for the loaded task getHighlightTask() v5
Gets the classes to highlight a task based on its status.
PARAMETERS:
NONE
RETURN VALUE:
string = the classes to highlight a task based on its status. getHoursUpdatedHTML() v5
Gets how long ago the loaded task updated for the last time
PARAMETERS:
NONE
RETURN VALUE:
string = how long ago the loaded task updated for the last time as HTML getID() v5
Sets object ID
PARAMETERS:
NONE
RETURN VALUE:
int = ID getJSON(bool $returnArr = false) v5
Get JSON array for the loaded record.
PARAMETERS:
Bool = true if want to return JSON, false otherwise
RETURN VALUE:
Object Array or JSON encoded version of the array getManagerHTML() v5
Gets HTML for the task's project manager as a hyperlink to manager details
PARAMETERS:
NONE
RETURN VALUE:
string = HTML for the task's project manager as a hyperlink to manager details getMaxCreditsTitle() v5
Gets max number of credits to use to complete the loaded task
PARAMETERS:
NONE
RETURN VALUE:
string = max number of credits to use to complete the loaded task getMembershipHTML() v5
Gets HTML of task user membership
PARAMETERS:
NONE
RETURN VALUE:
string = HTML of task user membership getMinutesNeededHTML() v5
Gets number of minutes needed to complete the loaded task
PARAMETERS:
NONE
RETURN VALUE:
string = number of minutes needed to complete the loaded task getPerformByHTML() v5
Gets task employee name as HTML
PARAMETERS:
NONE
RETURN VALUE:
string = task employee name as HTML getPresetEmails(\WMT\SQL\WMT\Site $site) v5
Gets preset email for the loaded task
PARAMETERS:
$site = object
RETURN VALUE:
string = preset email for the loaded task getPrimarySkill() v5
Gets the loaded task primary skill
PARAMETERS:
NONE
RETURN VALUE:
string = the loaded task primary skill getPrimarySkillID() v5
Gets the loaded task primary skill id
PARAMETERS:
NONE
RETURN VALUE:
int = the loaded task primary skill id getPriorityHTML() v5
Gets task priority as HTML
PARAMETERS:
NONE
RETURN VALUE:
string = task priority as HTML getProjectManager() v5
Gets task project manager name as HTML
PARAMETERS:
NONE
RETURN VALUE:
string = task project manager name as HTML getProjectManagerID() v5
Gets the loaded task project manager id
PARAMETERS:
NONE
RETURN VALUE:
int = the loaded task project manager id getRateTypeClass() v5
Get task rates (SR | TSK | CM | TRN)
PARAMETERS:
NONE
RETURN VALUE:
string = the loaded task rates getRateTypeColor() v5
Gets the loaded task rate type color
PARAMETERS:
NONE
RETURN VALUE:
string = the loaded task rate type color getRateTypeTitle() v5
Gets the loaded task rate type title
PARAMETERS:
NONE
RETURN VALUE:
string = the loaded task rate type title getSkillLevelHTML() v5
Gets skill level title for the loaded task as HTML
PARAMETERS:
NONE
RETURN VALUE:
string = skill level title for the loaded task as HTML getSkillLevelMinScore() v5
Gets skill level minimum for the loaded task
PARAMETERS:
NONE
RETURN VALUE:
int = skill level minimum for the loaded task getSkillLevelTitle() v5
Gets skill level title for the loaded task
PARAMETERS:
NONE
RETURN VALUE:
string = skill level title for the loaded task getStatusTitle() v5
Gets the loaded task status title (Ready to approve | completed etc)
PARAMETERS:
NONE
RETURN VALUE:
string = the loaded task status title getTaskIsForLink() v5
Gets task is for link like design link/ site link / project link etc
PARAMETERS:
NONE
RETURN VALUE:
string = task is for link like design link/ site link / project link etc getTypeTitle() v5
Gets task type title
PARAMETERS:
NONE
RETURN VALUE:
string = task type title getUTypeString(int $tUType) v5
Gets task user type
PARAMETERS:
$tUType = int, task user type
RETURN VALUE:
string = task user type as text getValue(string $fieldName = "value") v5
Returns the value from a specific column for this record.
PARAMETERS:
$fieldName = String, field name.
RETURN VALUE:
Field value hasField(string $fieldName) v5
Checks if the field shown or hidden
PARAMETERS:
$fieldName= String, Field title.
RETURN VALUE:
Bool= True if the field show is true, false otherwise hideAllFields() v5
hides all fields(columns)
PARAMETERS:
NONE
RETURN VALUE:
VOID hideField($fieldTitle) v5
Hides specific field title by its column title
PARAMETERS:
$fieldTitle = String, Field title.
RETURN VALUE:
VOID isLoaded() v5
Checks if an object is loaded correctly (can be used to check if ID exists).
PARAMETERS:
NONE
RETURN VALUE:
Bool = True if the object loaded successfully, false otherwise loadActiveTemplateID(int $templateID) v5
Loads a task template to the loaded template
PARAMETERS:
$templateID = int, task template ID
RETURN VALUE:
int = loaded task ID loadExtendedValues() v5
Loads task project details
PARAMETERS:
NONE
RETURN VALUE:
VOID loadFirstID() v5
Get object's first id
PARAMETERS:
NONE
RETURN VALUE:
int = First ID loadID(int $id) v5
Loads values for the record with the id specified.
PARAMETERS:
$id = int, record ID.
RETURN VALUE:
Bool = true, if success, false otherwise loadInProgress() v5
sets in progress value for the loaded task
PARAMETERS:
NONE
RETURN VALUE:
VOID loadNoteCount() v5
Load the loaded task notes
PARAMETERS:
NONE
RETURN VALUE:
VOID loadTemplate(int $taskTypeID, int $taskType, int $taskTemplateID) v5
Loads task template to the loaded task
PARAMETERS:
$taskTypeID = int, task type ID
$taskType = int, task type
$taskTemplateID = int, task template ID
RETURN VALUE:
bool = true if the template loaded successfully, false otherwise readyToApprove() v5
Sets the task to ready to approve status and send a notification to the client to approve it
PARAMETERS:
NONE
RETURN VALUE:
VOID removeSkill(int $assignID) v5
Removes an assigned skill to the loaded task
PARAMETERS:
$assignID = int, assign skill id
RETURN VALUE:
VOID save(array $fieldValues) v5
Saves the record with the new values specified in the $fieldValuesarray.
PARAMETERS:
$fieldValues = Array of the values for each column when adding the record (Associative array with key = field name & value = field value).
RETURN VALUE:
Bool = True on success, False otherwise. setMaxCredits(int $nMaxCredits) v5
Set max number of credits to use to complete the loaded task
PARAMETERS:
$nMaxCredits = int, max number of credits
RETURN VALUE:
VOID setMyMemberID(int $memberID) v5
Sets member's ID
PARAMETERS:
$memberID = int, member id
RETURN VALUE:
VOID setRateType(int $tRT) v5
Sets the rate type for the loaded task
PARAMETERS:
$tRT = int, task rate type
RETURN VALUE:
VOID setRestoreID(int $id) v5
Sets restor point ID
PARAMETERS:
$id = int, restore ID
RETURN VALUE:
VOID settingHasChat(bool $hasChat = true) v5
Sets task settings to allow chat with clients
PARAMETERS:
$hasChat = bool, true to allow chat with clients, false otherwise
RETURN VALUE:
VOID settingHasEmployee(bool $hasEmployee = true) v5
Sets task settings to assign employee to it
PARAMETERS:
$hasEmployee = bool, true to allow assign employee to it, false otherwise
RETURN VALUE:
VOID settingHTTPS(bool $useHTTPS = true) v5
Sets site to use https or http
PARAMETERS:
$useHTTPS = True if https on, false otherwise (default true).
RETURN VALUE:
VOID settingSiteURL(string $siteURL) v5
Sets Site Domain
PARAMETERS:
$siteURL = String, site URL
RETURN VALUE:
VOID setUpdated(int $nUpdated) v5
Sets task last updated date
PARAMETERS:
$nUpdated = int, timestamp of the last updated time
RETURN VALUE:
VOID showAllFields() v5
Show all fields(columns)
PARAMETERS:
NONE
RETURN VALUE:
VOID showField($fieldTitle) v5
Shows specific field title by its column title
PARAMETERS:
$fieldTitle = String, Field title.
RETURN VALUE:
VOID startTask(\WMT\Container $container, int $memberID) v5
Starts a task (time-in)
PARAMETERS:
$container = object
$memberID = int, member ID
RETURN VALUE:
VOID stopTask() v5
Time-out the task (stop working on it temp)
PARAMETERS:
NONE
RETURN VALUE:
VOID totalCost() v5
Get total cost of the loaded task
PARAMETERS:
NONE
RETURN VALUE:
float = total cost of the loaded taskTask PHP Variables
$inProgress v5
Task in progress $noteCount v5
Task notes count $noteType v5
note type as int $taskIsFor v5
Task is for $uTypeString v5
User type as string
Columns in the tasks Database Table:
id member tasktemplate tasktype tasktypeid title description complete taskbefore active added performby bonus membership readytoapprove priority approvedby ratetype hasquestion updated tasklevel maxcredits adminapprove minutesneeded awaiting
Code Example
Use the code below to
view a record in an
html page:
Use the code below to
add a record:
Use the code below to
delete a record: