{strip} {include file="./includes/TasksTaskHelpers.inc.html" inline} {$is_single = $is_single|default:false} {* This vars will be mutated by tasksHelper::getDatetime, must be inited first because of Smary & PHP 7.4 cause the warnings otherwise *} {$time_since_update_period = null} {$time_since_update_template = null} {$time_since_update_str = tasksHelper::getDatetime($task.update_datetime, $time_since_update_period, $time_since_update_template)} {$classes = ['t-task-outer-container']} {if !empty($is_single)} {$classes['is-single'] = 'is-single'} {/if} {if !empty($task.project.color)} {$classes[$task.project.color] = $task.project.color} {/if} {if $task.project.archive_datetime} {$classes['is-archived'] = 'is-archived'} {/if} {$_priority_class_array = [ "-1" => "is-low", "0" => "is-normal", "1" => "is-high", "2" => "is-urgent" ]} {$_priority_icon = ""} {if !empty($task.priority)} {if $task.priority == '-1'} {$_priority_icon = ""} {/if} {if $task.priority == '1'} {$_priority_icon = ""} {/if} {if $task.priority == '2'} {$_priority_icon = ""} {/if} {/if} {$_task_hooks = $task.hooks|default:[]} {$_backend_task_hook = $_task_hooks.backend_task|default:[]} {* MAIN TASK CONTAINER *}
{* CHECKBOX FOR LIST TYPE *}
{* USERPICK *}
{task_userpics_block}
{* CONTENT PART *}
{* @event backend_task.%plugin_id%.before_header *} {foreach $_backend_task_hook as $_}{$_.before_header|default:''}{/foreach} {* TASK HEADER *}
{$time_since_update_str} {* FAVORITE *}

{* PROJECT ICON *} {if !empty($task.project.icon_html)} {$task.project.icon_html} {/if} {* PRIORITY *} {$task.project_id}.{$task.number} {$_priority_icon} {* A delimeter between number and name that should get into clipboard when user selects text, but should not be visible *} : {* NAME *} {$task.name|escape|default:"(no name)"} {* STATUS *} {if !empty($task.status.name)} {* DATA *} {$_status_class_array = []} {$_styles_array = []} {if !$task.project.archive_datetime} {if !empty($task.status.params.title_color)} {$_color = $task.status.params.title_color} {$_styles_array[] = "color: #{$_color};"} {/if} {if !empty($task.status.params.button_color)} {$_background = $task.status.params.button_color} {$_styles_array[] = "border-color: #{$_background};"} {$_styles_array[] = "background: #{$_background};"} {/if} {/if} {if $task.project.archive_datetime} {$_status_class_array[] = "is-archived"} {elseif $task.status_id == -1} {$_status_class_array[] = "is-done"} {elseif $task.status_id == 0} {$_status_class_array[] = "is-new"} {elseif $task.status_id > 0} {$_status_class_array[] = "is-custom"} {/if} {* RENDER *} ( {if $task.project.archive_datetime}[`Archived`]{else}{$task.status.name}{/if} ) {/if} {* TAGS *}
{foreach $task.tags as $tag_id => $tag_name} {$tag_name|escape} {/foreach}

{* @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} {* @event backend_task.%plugin_id%.before_description *} {foreach $_backend_task_hook as $_}{$_.before_description|default:''}{/foreach} {* TASK CONTENT *}
{if $task.milestone}
{$task.milestone.name|escape}:   {$task.milestone.due_date|wa_date:'humandate'}  ({$task.milestone.view.due_text})
{/if} {if $task.due_date}
[`Due date`]:   {$task.due_date|wa_date:'humandate'}   ({$task.view.due_text})
{/if}
{function insertRelations data=null relation_name=null relation_type=null}
    {foreach $data as $id => $item}
  • {$relation_name}: #{$item['project']|escape}.{$item['number']|escape}  {if !empty($statuses[$item['status_id']])} {if !empty($statuses[$item['status_id']]['params'])} {$status_color = "color:#`$statuses[$item['status_id']]['params']['title_color']`;"} {$status_background = "border-color:#`$statuses[$item['status_id']]['params']['button_color']`;background:#`$statuses[$item['status_id']]['params']['button_color']`"} {else} {$status_color = ''} {$status_background = ''} {/if} {$statuses[$item['status_id']]['name']|escape} {/if} [`invert`]  [`remove link`]
  • {/foreach}
{/function} {if !empty($task.relations.parents)} {insertRelations data=$task.relations.parents relation_type="parent" relation_name="[`Parent task`]" } {/if} {if !empty($task.relations.childs)} {insertRelations data=$task.relations.childs relation_type="child" relation_name="[`Child task`]"} {/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 $_}{$_.after_description|default:''}{/foreach} {* ATTACHED FILES *} {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 $_}{$_.after_attachments|default:''}{/foreach} {/if} {function renderHeaderComment _l=[]} {$_l_attachments = $task->getLogAttachments($_l.id)} {$_l_attachments_count = count($_l_attachments.files) + count($_l_attachments.images)} {if !empty($_l.text) || $_l_attachments_count > 0}
{* @event backend_task.%plugin_id%.before_quote_header *} {foreach $_backend_task_hook as $_}{$_.before_quote_header|default:''}{/foreach}
{$_l.contact.name|escape} {$_l.create_datetime|wa_datetime:"humandatetime"} {* @event backend_task.%plugin_id%.quote_header *} {foreach $_backend_task_hook as $_}{$_.quote_header|default:''}{/foreach}
{* @event backend_task.%plugin_id%.after_quote_header *} {foreach $_backend_task_hook as $_}{$_.after_quote_header|default:''}{/foreach} {* @event backend_task.%plugin_id%.before_quote_description *} {foreach $_backend_task_hook as $_}{$_.before_quote_description|default:''}{/foreach}
{tasksTask::formatText($_l.text)} {* @event backend_task.%plugin_id%.quote_description *} {foreach $_backend_task_hook as $_}{$_.quote_description|default:''}{/foreach}
{* @event backend_task.%plugin_id%.after_quote_description *} {foreach $_backend_task_hook as $_}{$_.after_quote_description|default:''}{/foreach} {if $_l_attachments.files || $_l_attachments.images} {* @event backend_task.%plugin_id%.before_quote_attachments *} {foreach $_backend_task_hook as $_}{$_.before_quote_attachments|default:''}{/foreach}
{if $_l_attachments.images}
{foreach $_l_attachments.images as $_image}
{$_image.name|escape}
{/foreach}
{/if} {if $_l_attachments.files}
{foreach $_l_attachments.files as $_file} {/foreach}
{/if}
{* @event backend_task.%plugin_id%.quote_attachments *} {foreach $_backend_task_hook as $_}{$_.quote_attachments|default:''}{/foreach}
{* @event backend_task.%plugin_id%.after_quote_attachments *} {foreach $_backend_task_hook as $_}{$_.after_quote_attachments|default:''}{/foreach} {/if}
{/if} {/function} {* Obtain unique id and sort them in chronological order *} {$log_header_ids = array_unique([$task.assign_log_id, $task.comment_log_id])} {$_sort = sort($log_header_ids)} {foreach $log_header_ids as $log_id} {if !empty($task['log'][$log_id])} {$_l = $task.log[$log_id]} {renderHeaderComment _l=$_l} {/if} {/foreach} {* It need for load html of change_status_form *} {if !empty($is_single)}
{/if} {* @event backend_task.%plugin_id%.before_buttons *} {foreach $_backend_task_hook as $_}{$_.before_buttons|default:''}{/foreach} {* TASK BUTTONS *}
{$task->buttonHtml()} {if $task.next_status && $task.next_status.id != -1 && (($task.contact_id == $wa->user('id') && $task.assigned_contact_id == $task.contact_id) || $task->hasFullAccess())} {$task->buttonHtml(-1)} {/if}
{$_hash_type = $hash_type|default:''} {if ($_hash_type == 'inbox' || $_hash_type == 'hidden') && $task.priority <= 1}
{$intervals = ['1d' => '1 day', '3d' => '3 days', '1w' => '1 week', '2w' => '2 weeks']}
{/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} {* @event backend_task.%plugin_id%.before_hidden_block *} {foreach $_backend_task_hook as $_}{$_.before_hidden_block|default:''}{/foreach} {* TASK HIDDEN CONTENT *}
{* 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}
{$l.contact.name|escape} {$l.action_name} {$l.create_datetime|wa_datetime:"humandatetime"} {* MARK LAST NOT EMPTY FORWARD LOG ITEM *} {if $_is_forward && !$_empty_log_item && $task.assign_log_id && $task.assign_log_id == $l.id} {/if} {if $_is_comment} {/if} {if $_can_edit} [`Edit`] {/if} {if $_can_delete} [`Delete`] {/if}
{if !empty($l.text)}
{tasksTask::formatText($l.text)}
{/if} {if $l.status_changed}
[`Status:`] {if $l.before_status_id}{tasksHelper::statusNameHTML($l.before_status_id)}{/if} → {tasksHelper::statusNameHTML($l.after_status_id)}
{/if} {if $l.assignment_changed} {if $l.assigned_contact_id}
[`Assigned:`] {$l.assigned_contact.name|escape}
{else}
[`Assignment removed`]
{/if} {/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}" inline} {* @event backend_task.%plugin_id%.hidden_block *} {foreach $_backend_task_hook as $_}{$_.hidden_block|default:''}{/foreach}
{if $task.status_id == -1}
{/if} {* @event backend_task.%plugin_id%.after_hidden_block *} {foreach $_backend_task_hook as $_}{$_.after_hidden_block|default:''}{/foreach}
{* CONTAINER FOR DYNAMIC AJAX FORMS *}
{* LINK FOR TABLE VIEW *} {$_list_view_type = $list_vie_type|default:''} {if $_list_view_type == "table"} {/if} {$_files_hash = md5(uniqid($task.id, true))} {$_ignore_js = $ignore_js|default:false} {if !$_ignore_js} {/if}
{/strip}