tasks_log
Triggered when the processing log is obtained for a task list. Allows modifying or extending the log entries before they are displayed.
Teamwork
Input (passed by reference)
$logs array Tasks processing log entries.
$logs[task_id][log_id]['id'] int Log entry ID.
$logs[task_id][log_id]['task_id'] int Task ID.
$logs[task_id][log_id]['project_id'] int ID of the project in which the task landed after the execution of an action.
$logs[task_id][log_id]['contact_id'] int ID of the contact who executed the action.
$logs[task_id][log_id]['text'] string Text entered during the execution of the action.
$logs[task_id][log_id]['create_datetime'] datetime Date and time of the action execution.
$logs[task_id][log_id]['before_status_id'] int ID of the task status before the action execution.
$logs[task_id][log_id]['after_status_id'] int ID of the task status after the action execution.
$logs[task_id][log_id]['action'] string Task action type from the list: 'add', 'edit', '' (other action, i.e. a status change).
$logs[task_id][log_id]['assigned_contact_id'] int ID of the user to whom the task was assigned after the action execution.
$logs[task_id][log_id]['contact'] array The properties of the user, who executed the action, with the following keys:
$logs[task_id][log_id]['contact']['id'] int User ID.
$logs[task_id][log_id]['contact']['login'] string Login name.
$logs[task_id][log_id]['contact']['firstname'] string First name.
$logs[task_id][log_id]['contact']['middlename'] string Middle name.
$logs[task_id][log_id]['contact']['lastname'] string Last name.
$logs[task_id][log_id]['contact']['name'] string Full name.
$logs[task_id][log_id]['contact']['company'] string Company name.
$logs[task_id][log_id]['contact']['photo'] int Value of the
$logs[task_id][log_id]['contact']['photo_url'] string Relative URL of the user image.
$logs[task_id][log_id]['assigned_contact'] array The properties of the assigned user as an array with the same keys as described for the
$logs[task_id][log_id]['status_changed'] bool Flag denoting whether the task status was changed as a result of the executed action.
$logs[task_id][log_id]['action_name'] string The task’s status name.
$logs[task_id][log_id]['assignment_changed'] bool Flag denoting whether the assigned user was changed as a result of the executed action.
$logs[task_id][log_id]['id'] int Log entry ID.
$logs[task_id][log_id]['task_id'] int Task ID.
$logs[task_id][log_id]['project_id'] int ID of the project in which the task landed after the execution of an action.
$logs[task_id][log_id]['contact_id'] int ID of the contact who executed the action.
$logs[task_id][log_id]['text'] string Text entered during the execution of the action.
$logs[task_id][log_id]['create_datetime'] datetime Date and time of the action execution.
$logs[task_id][log_id]['before_status_id'] int ID of the task status before the action execution.
$logs[task_id][log_id]['after_status_id'] int ID of the task status after the action execution.
$logs[task_id][log_id]['action'] string Task action type from the list: 'add', 'edit', '' (other action, i.e. a status change).
$logs[task_id][log_id]['assigned_contact_id'] int ID of the user to whom the task was assigned after the action execution.
$logs[task_id][log_id]['contact'] array The properties of the user, who executed the action, with the following keys:
$logs[task_id][log_id]['contact']['id'] int User ID.
$logs[task_id][log_id]['contact']['login'] string Login name.
$logs[task_id][log_id]['contact']['firstname'] string First name.
$logs[task_id][log_id]['contact']['middlename'] string Middle name.
$logs[task_id][log_id]['contact']['lastname'] string Last name.
$logs[task_id][log_id]['contact']['name'] string Full name.
$logs[task_id][log_id]['contact']['company'] string Company name.
$logs[task_id][log_id]['contact']['photo'] int Value of the
photo
field stored in the wa_contact
table.$logs[task_id][log_id]['contact']['photo_url'] string Relative URL of the user image.
$logs[task_id][log_id]['assigned_contact'] array The properties of the assigned user as an array with the same keys as described for the
contact
array.$logs[task_id][log_id]['status_changed'] bool Flag denoting whether the task status was changed as a result of the executed action.
$logs[task_id][log_id]['action_name'] string The task’s status name.
$logs[task_id][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 tasksLog(&$logs) { // Modify the logs before they are displayed, if necessary. array_walk($logs, function (&$task_logs) { array_walk($task_logs, function (&$task_log_entry) { // E.g., set a custom parameter value for each log entry. $plugin_param_name = $this->id . '_some_param_name'; $task_log_entry['params'][$plugin_param_name] = '...'; }); }); }