{* @event backend_task.%plugin_id%.before_header *} {foreach $_backend_task_hook as $_}{$_.before_header|default:''}{/foreach} {* TASK HEADER *}
{if count($task.tags) === 0} {/if} {* HIDE FROM INBOX OPTIONS *} {$_hash_type = $hash_type|default:''} {if ($_hash_type == 'inbox' || $_hash_type == 'hidden') && $task.priority <= 1} {$intervals = ['1d' => _w('1 day'), '3d' => _w('3 days'), '1w' => _w('1 week'), '2w' => _w('2 weeks')]} 0} data-errormsg="[`You can't hide high priority task`]" {elseif $task.assigned_contact_id != $wa->user('id')} data-errormsg="[`You can only hide tasks assigned to you.`]" {/if} > {/if} {* EDIT & DELETE *} {if $task.rights_info.can_edit|default:false} [`Edit`] {/if} {if $task.rights_info.can_delete|default:false} {/if} {$is_public_link_exists = !!count($task.public_links)}
{* TAGS *}
    • {foreach $task.tags as $tag_id => $tag_name}
    • {$tag_name|escape}
    • {/foreach}
    {* USERS & DEADLINES *}
    {* AUTHOR OF THE LAST ASSIGNMENT *} {$_assignment_creator = $task.assignment_creator} {* CURRENT ASSIGNED CONTACT *} {$_assigned_contact = $task.assigned_contact}
    {if $task.status_id == -1}

    [`Closed`]

    {$task.update_datetime|wa_datetime:'humandatetime'}

    {else} {$_assigned_contact.name|escape}

    {if empty($_assigned_contact.delete) && $_assigned_contact.id} {$_assigned_contact.name|escape} {if $taskAssignedContactStatus} {$taskAssignedContactStatus->getName()|escape|truncate:23} {/if} {if $_assigned_contact.invited} [`invited`] {/if} {else} [`Unassigned`] {/if}

    {$task.update_datetime|wa_datetime:'humandatetime'}

    {/if}
    {* MILESTONE & DEADLINE *}
    {$_milestone = ''} {$_due_date = ''} {$_due_hint = ''} {$_due_class = ''} {if $task.milestone} {$_milestone = $task.milestone.name|escape} {if $task.milestone.due_date} {$_due_date = wa_date('humandate', $task.milestone.due_date, waDateTime::getDefaultTimezone())|escape} {/if} {$_due_hint = $task.milestone.view.due_text} {$_due_class = $task.milestone.view.due_color_class} {/if} {if $task.due_date} {* manually set due date overrides milestone general due date *} {$_due_date = wa_date('humandate', $task.due_date, waDateTime::getDefaultTimezone())|escape} {$_due_hint = $task.view.due_text} {$_due_class = $task.view.due_color_class} {/if}
    {if count($milestones)} {* inline milestone selector (dropdown) *} {else} {* no milstones in the project => no dropdown*}

    {if $_milestone} {$_milestone|truncate:32} {elseif $_due_date} {$_due_date} {else} [`No due date`] {/if}

    {/if} {if $_due_date}

    {if $_milestone} {$_due_date} {/if} {$_due_hint}

    {/if} {if $_milestone && !$_due_date}

    [`No due date`]

    {/if}
    {if !empty($user_roles) && count($user_roles) > 0 && $wa->tasks->isPremium()}
    {/if} {* @event backend_task.%plugin_id%.header *} {foreach $_backend_task_hook as $_}{$_.header|default:''}{/foreach}
    {* @event backend_task.%plugin_id%.after_header *} {foreach $_backend_task_hook as $_}{$_.after_header|default:''}{/foreach}
    {* TASK BODY *}

    {* PRIORITY *} {if !empty($_priority_icon)}{$_priority_icon}{/if} {$task.project_id}.{$task.number} {* A delimeter between number and name that should get into clipboard when user selects text, but should not be visible *} : {* TITLE *} {if !empty($task_type.name)} {$task_type.name|escape}:  {/if} {$task.name|escape|default:"(no name)"} {* STATUS *} {if !empty($task.status.name)} {if $task.project.archive_datetime} [`Archived`] {else} {tasksHelper::statusNameHTML($task.status.id)} {/if} {/if}

    {* ON-CLICK PRIORITY CHANGER *}
    {$task_ext_info_html} {* Show review widget if new task or completed *} {if !empty($task.log)} {$is_just_created_task = strtotime($task.create_datetime) - strtotime(date('Y-m-d H:i:s')) >= -1 } {$logs = array_values($task.log)} {$last_log = end($logs)} {$cond = $is_just_created_task || (isset($last_log) && $last_log.after_status_id == -1)} {if $cond && $wa->installer && method_exists($wa->installer, 'reviewWidget')} {$wa->installer->reviewWidget('app/tasks')} {/if} {/if} {* @event backend_task.%plugin_id%.before_buttons *} {foreach $_backend_task_hook as $_}{$_.before_buttons|default:''}{/foreach} {* TASK BUTTONS *}
    {* PRIMARY ACTION BUTTONS *}
    {if isset($task.next_status.id) && $task.next_status.id != -1 && (($task.contact_id == $wa->user('id') && $task.assigned_contact_id == $task.contact_id) || $task->hasFullAccess())} {* action buttons *}
    {$task->buttonHtml()}
    {/if} {if $task.status.id != -1} {* close button only *}
    {$task->buttonHtml(-1)}
    {/if}
    {* @event backend_task.%plugin_id%.buttons *} {foreach $_backend_task_hook as $_}{$_.buttons|default:''}{/foreach}

    {* @event backend_task.%plugin_id%.after_buttons *} {foreach $_backend_task_hook as $_}{$_.after_buttons|default:''}{/foreach} {* change_status_form HTML *} {if !empty($is_single)}
    {/if} {* @event backend_task.%plugin_id%.before_description *} {foreach $_backend_task_hook as $_}{$_.before_description|default:''}{/foreach} {* TASK CONTENT *}
    {function insertRelations data=null relation_name=null relation_type=null} {/function} {if !empty($task.relations.parents) || !empty($task.relations.childs)}
    {if !empty($task.relations.parents)} {* legacy: 'Parent task' *} {insertRelations data=$task.relations.parents relation_type="parent" relation_name="[`Linked task`]" } {/if} {if !empty($task.relations.childs)} {* legacy: 'Child task' *} {insertRelations data=$task.relations.childs relation_type="child" relation_name="[`Linked task`]"} {/if}
    {/if} {tasksTask::formatText($task.text)} {* @event backend_task.%plugin_id%.description *} {foreach $_backend_task_hook as $_}{$_.description|default:''}{/foreach}
    {* @event backend_task.%plugin_id%.after_description *} {foreach $_backend_task_hook as $_} {if !empty($_.after_description)}
    {$_.after_description}
    {/if} {/foreach} {* ATTACHMENTS *} {if $task.images || $task.files} {* @event backend_task.%plugin_id%.before_attachments *} {foreach $_backend_task_hook as $_}{$_.before_attachments|default:''}{/foreach}
    {if $task.images}
    {foreach $task.images as $image}
    {$image.name|escape}
    {/foreach}
    {/if} {if $task.files}
    {foreach $task.files as $file} {/foreach}
    {/if} {* @event backend_task.%plugin_id%.attachments *} {foreach $_backend_task_hook as $_}{$_.attachments|default:''}{/foreach}
    {* @event backend_task.%plugin_id%.after_attachments *} {foreach $_backend_task_hook as $_} {if !empty($_.after_attachments)}
    {$_.after_attachments}
    {/if} {/foreach} {/if}

    @ [`Following task updates`]

    {* WATCH *}

    [`History & Comments`] {count($task.log)}

    {* @event backend_task.%plugin_id%.before_hidden_block *} {foreach $_backend_task_hook as $_}{$_.before_hidden_block|default:''}{/foreach} {* COMMENT LIST *}
    {foreach $task.log as $l}
    {$_rights_info = $l.rights_info|default:[]} {$_can_edit = $_rights_info.can_edit|default:false} {$_can_delete = $_rights_info.can_delete|default:false} {$log_attachments = $task->getLogAttachments($l.id)} {$log_attachments_count = count($log_attachments.files) + count($log_attachments.images)} {$_is_comment = $l.action == tasksTaskLogModel::ACTION_TYPE_COMMENT} {$_is_forward = $l.action == tasksTaskLogModel::ACTION_TYPE_FORWARD} {$_empty_log_item = empty($l.text) && $log_attachments_count <= 0} {if $_is_forward} {$_can_edit = $_can_edit && !$_empty_log_item} {/if}
    {if $l.status_changed}
    {if isset($l.before_status_id) && $l.before_status_id != $l.after_status_id} {tasksHelper::statusNameHTML($l.before_status_id)}  →  {/if} {tasksHelper::statusNameHTML($l.after_status_id)}
    {/if} {$l.contact.name|escape|default:_w('(no name)')} {if $l.action == 'edit' || $l.action == 'comment' || $l.action == 'forward'|| $l.action == 'return'} {$l.action_name} {/if} {if $l.assignment_changed}
    {if $l.assigned_contact_id} {if !empty($l.assigned_contact.name)}{/if} {$l.assigned_contact.name|escape} {else} [`Assignment removed`] {/if}
    {/if} {$l.create_datetime|wa_datetime:"humandatetime"}
    {* MARK LAST NOT EMPTY FORWARD LOG ITEM *} {*** [wtf is that?] if $_is_forward && !$_empty_log_item && $task.assign_log_id && $task.assign_log_id == $l.id} {/if ***} {if $_is_comment && !empty($l.text)} {if !($task.comment_log_id == $l.id)} [`Pin`] {else} [`Pinned`] {/if} {/if} {if $_can_edit && $l.contact_id == $wa->user()->getId()} {/if} {if $_can_delete} {/if}
    {if !empty($l.text)}
    {tasksTask::formatText($l.text)}
    {/if} {if $log_attachments.files || $log_attachments.images}
    {if $log_attachments.images}
    {foreach $log_attachments.images as $image}
    {$image.name|escape}
    {/foreach}
    {/if} {if $log_attachments.files}
    {foreach $log_attachments.files as $file} {/foreach}
    {/if}
    {/if}
    {if $_can_edit} {/if}
    {foreachelse}

    [`There are no comments for this task yet.`]

    {/foreach}
    {* ADD COMMENT FORM *} {include file="./TaskCommentForm.inc.html" post_action_url="?module=tasksComments&action=add&task_id={$task.id}" action="add" inline} {* @event backend_task.%plugin_id%.hidden_block *} {foreach $_backend_task_hook as $_}{$_.hidden_block|default:''}{/foreach}
    {* @event backend_task.%plugin_id%.after_hidden_block *} {foreach $_backend_task_hook as $_}{$_.after_hidden_block|default:''}{/foreach}