first delivery
This commit is contained in:
1 parent
793fbc0c91
commit
f6684f3b2e
65 files changed
+5828
No files matched your search
@@ -0,0 +1,78 @@
|
||||
{#
|
||||
# The plan's tasks, for the Tasks tab of the plan detail page and form. Same columns as the task list
|
||||
# (Planning > Tasks): ID, Name, Description, Start date, End date, Status. Rows are in tree order:
|
||||
# each task is followed by its sub-tasks, indented under it.
|
||||
#
|
||||
# Parameters:
|
||||
# plan: the Plan
|
||||
# taskTree: rows from TaskModel::getTaskTree(): {task, depth}, in display order
|
||||
# readOnly: true on the plan form: no links, so that following one can't drop unsaved changes
|
||||
# taskPermissions: plan:tasks:* permissions (create, editown, editother), when not read-only
|
||||
#
|
||||
# Links carry returnTo=plan, so that Save and Cancel on the task form come back to this plan
|
||||
# (see TaskController). Opened from Planning > Tasks, the task form goes back to the task list.
|
||||
#}
|
||||
{% set readOnly = readOnly|default(false) %}
|
||||
{% set taskPermissions = taskPermissions|default({}) %}
|
||||
{% set canCreate = not readOnly and plan.id and taskPermissions['plan:tasks:create']|default(false) %}
|
||||
|
||||
{% if canCreate %}
|
||||
<div class="mb-md">
|
||||
<a class="btn btn-ghost plan-task-add" href="{{ path('plan_task_action', {'objectAction': 'new', 'plan': plan.id, 'returnTo': 'plan'}) }}" data-toggle="ajax">
|
||||
<i class="ri-add-line"></i> {{ 'mautic.plan.task.add'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if not plan.id %}
|
||||
<p class="text-muted">{{ 'mautic.plan.task.save_plan_first'|trans }}</p>
|
||||
{% elseif taskTree is empty %}
|
||||
<p class="text-muted">{{ 'mautic.plan.task.empty'|trans }}</p>
|
||||
{% else %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover plan-task-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-plan-task-id">{{ 'mautic.core.id'|trans }}</th>
|
||||
<th class="col-plan-task-name">{{ 'mautic.plan.task.field.name'|trans }}</th>
|
||||
<th class="visible-md visible-lg col-plan-task-description">{{ 'mautic.plan.task.field.description'|trans }}</th>
|
||||
<th class="col-plan-task-start">{{ 'mautic.plan.task.field.start_date'|trans }}</th>
|
||||
<th class="col-plan-task-end">{{ 'mautic.plan.task.field.end_date'|trans }}</th>
|
||||
<th class="col-plan-task-status">{{ 'mautic.plan.task.field.status'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in taskTree %}
|
||||
{% set task = row.task %}
|
||||
{% set canEdit = not readOnly and securityHasEntityAccess(taskPermissions['plan:tasks:editown']|default(false), taskPermissions['plan:tasks:editother']|default(false), task.createdBy) %}
|
||||
{% set childCount = taskTree|filter(r => r.task.parent and r.task.parent.id == task.id)|length %}
|
||||
<tr class="plan-task" data-task-id="{{ task.id }}" data-depth="{{ row.depth }}">
|
||||
<td>{{ task.id }}</td>
|
||||
<td>
|
||||
<span style="display: inline-block; padding-left: {{ row.depth * 24 }}px;">
|
||||
{% if row.depth > 0 %}
|
||||
<i class="ri-corner-down-right-line text-muted" title="{{ 'mautic.plan.task.subtask_of'|trans({'%parent%': task.parent.name}) }}"></i>
|
||||
{% endif %}
|
||||
{% if canEdit %}
|
||||
<a href="{{ path('plan_task_action', {'objectAction': 'edit', 'objectId': task.id, 'returnTo': 'plan'}) }}" data-toggle="ajax">{{ task.name }}</a>
|
||||
{% else %}
|
||||
{{ task.name }}
|
||||
{% endif %}
|
||||
{% if childCount > 0 %}
|
||||
<span class="text-muted small" title="{{ 'mautic.plan.task.subtasks'|trans }}">({{ childCount }})</span>
|
||||
{% endif %}
|
||||
</span>
|
||||
</td>
|
||||
<td class="visible-md visible-lg text-muted">
|
||||
{% set description = task.description|default('')|striptags|trim %}
|
||||
{{ description|length > 120 ? description|slice(0, 120) ~ '…' : description }}
|
||||
</td>
|
||||
<td>{{ task.startDate ? dateToFull(task.startDate) : '' }}</td>
|
||||
<td>{{ task.endDate ? dateToFull(task.endDate) : '' }}</td>
|
||||
<td><span class="label {{ task.status.labelClass }}">{{ task.status.labelKey|trans }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
Reference in new issue
Block a user