task_log

Triggered when the task actions log is obtained. Allows modifying or extending the contents of log entries before display.

Teamwork

Input (passed by reference)

$log array The list of log entries. Array keys are log entry IDs. Each list item is an array with the following keys:
$log[log_id]['id'] int Log entry ID.
$log[log_id]['task_id'] int Task ID.
$log[log_id]['project_id'] int ID of the project in which the task landed after the execution of an action.
$log[log_id]['contact_id'] int ID of the contact who executed the action.
$log[log_id]['text'] string Text entered during the execution of the action.
$log[log_id]['create_datetime'] datetime Date and time of the action execution.
$log[log_id]['before_status_id'] int ID of the task status before the action execution.
$log[log_id]['after_status_id'] int ID of the task status after the action execution.
$log[log_id]['action'] string Task action type from the list: 'add', 'edit', '' (other action, i.e. a status change).
$log[log_id]['assigned_contact_id'] int ID of the user to whom the task was assigned after the action execution.
$log[log_id]['contact'] array The properties of the user, who executed the action, with the following keys:
$log[log_id]['contact']['id'] int User ID.
$log[log_id]['contact']['login'] string Login name.
$log[log_id]['contact']['firstname'] string First name.
$log[log_id]['contact']['middlename'] string Middle name.
$log[log_id]['contact']['lastname'] string Last name.
$log[log_id]['contact']['name'] string Full name.
$log[log_id]['contact']['company'] string Company name.
$log[log_id]['contact']['photo'] int Value of the photo field stored in the wa_contact table.
$log[log_id]['contact']['photo_url'] string Relative URL of the user image.
$log[log_id]['assigned_contact'] array The properties of the assigned user as an array with the same keys as described for the contact array.
$log[log_id]['status_changed'] bool Flag denoting whether the task status was changed as a result of the executed action.
$log[log_id]['action_name'] string The task’s status name.
$log[log_id]['assignment_changed'] bool Flag denoting whether the assigned user was changed as a result of the executed action.
… your plugin code …

Output

Teamwork

Plugin code example

PHP

public function taskLog(&$log)
{
    array_walk($log, function (&$item) {
        // E.g., hide photos of users in the task log.
        $item['contact']['photo_url'] = null;
    });
}