{# # The program's tasks, for the Tasks tab of the program detail page and form. Same harmonized columns as the # other tabs: Pictogram (no label), Type, Name, Description, Start date, End date, Status (last). No ID # column. Rows are in tree order: each task is followed by its sub-tasks, indented under it. # # Parameters: # program: the Program # taskTree: rows from TaskModel::getTaskTree(): {task, depth}, in display order # readOnly: true on the program form: no links, no filter, so that following one can't drop unsaved changes # taskPermissions: mt3smarketingprogram:tasks:* permissions (create, editown, editother), when not read-only # # Links carry returnTo=program, so that Save and Cancel on the task form come back to this program page # (see TaskController). Opened from Programs > Tasks, the task form goes back to the task list. #} {% set readOnly = readOnly|default(false) %} {% set taskPermissions = taskPermissions|default({}) %} {% set canCreate = not readOnly and program.id and taskPermissions['mt3smarketingprogram:tasks:create']|default(false) %} {% if canCreate %}
{% endif %} {% if not program.id %}{{ 'mt3s.marketing_program.task.save_program_first'|trans }}
{% elseif taskTree is empty %}{{ 'mt3s.marketing_program.task.empty'|trans }}
{% else %} {% if not readOnly %} {# Filter + click-to-sort on the detail page (mt3s-mp-program.js). The form's read-only copy stays plain. #} {{ include('@MT3SMarketingProgram/Program/_tab_table_filter.html.twig') }} {% endif %}| {{ 'mt3s.marketing_program.task.field.type'|trans }} | {{ 'mt3s.marketing_program.task.field.name'|trans }} | {{ 'mt3s.marketing_program.task.field.description'|trans }} | {{ 'mt3s.marketing_program.task.field.start_date'|trans }} | {{ 'mt3s.marketing_program.task.field.end_date'|trans }} | {{ 'mt3s.marketing_program.task.field.status'|trans }} | |
|---|---|---|---|---|---|---|
| {% set taskTypeIcon = mt3s_marketing_program_item_type_icon('task', task.type) %} {% if taskTypeIcon %}{% endif %} | {{ mt3s_marketing_program_item_type_name('task', task.type) ?? 'mt3s.marketing_program.description_item.type.unknown'|trans({'%key%': task.type}) }} | {% if canEdit %} {{ task.name }} {% else %} {{ task.name }} {% endif %} {% if task.taskKind == constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Milestone') %} {{ 'mt3s.marketing_program.task.kind.milestone_short'|trans }} {% elseif task.taskKind == constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Phase') %} {{ 'mt3s.marketing_program.task.kind.phase_short'|trans }} {% endif %} | {# Same 10-line clamp and read-more as the Description tab; URLs become links. #} {{ include('@MT3SMarketingProgram/Program/_description_read_more.html.twig', { 'text': task.description|default('')|striptags, 'id': 'program-task-desc-' ~ task.id, }) }} | {{ task.startDate ? task.startDate|date('Y-m-d') : '' }} | {{ task.endDate ? task.endDate|date('Y-m-d') : '' }} | {# A phase has no status of its own — skip the column value. #} {% if task.taskKind != constant('MauticPlugin\\MT3SMarketingProgramBundle\\Entity\\TaskKind::Phase') %} {{ task.status.labelKey|trans }} {% endif %} |