mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
197 lines
10 KiB
Twig
197 lines
10 KiB
Twig
{% macro date_status(title, tasks, count, paginator, status, isSingleStatus, person, user) %}
|
|
{% if tasks|length > 0 %}
|
|
<h2>{{ title|trans }}</h2>
|
|
|
|
<table class="records_list">
|
|
<thead>
|
|
<tr>
|
|
<th class="chill-red">{{ 'Title'|trans }}</th>
|
|
<th class="chill-green">{{ 'Task type'|trans }}</th>
|
|
{% if person is null %}
|
|
<th>{{ 'Person'|trans }}</th>
|
|
{% endif %}
|
|
<th class="chill-orange">{{ 'Task status'|trans }}</th>
|
|
<th>{{ 'Dates'|trans }}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for task in tasks %}
|
|
<tr>
|
|
<td>{{ task.title }}</td>
|
|
<td>{{ task.type }}</td>
|
|
{% if person is null %}
|
|
<td><a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a></td>
|
|
{% endif %}
|
|
<td>
|
|
{% for place in workflow_marked_places(task) %}
|
|
<span class="">{{ place|trans }}</span>
|
|
{% endfor %}
|
|
</td>
|
|
<td>
|
|
{% if task.startDate is null and task.warningDate is null and task.endDate is null %}
|
|
{{'No dates specified'|trans}}
|
|
{% else %}
|
|
<ul class="record_actions_column">
|
|
{% if task.startDate is not null %}
|
|
<li>
|
|
{{'Start'|trans}} :{{ task.startDate|localizeddate('medium', 'none') }}
|
|
</li>
|
|
{% endif %}
|
|
{% if task.warningDate is not null %}
|
|
<li>
|
|
{{'Warning'|trans}} :{{ task.warningDate|localizeddate('medium', 'none') }}
|
|
</li>
|
|
{% endif %}
|
|
{% if task.endDate is not null %}
|
|
<li>
|
|
{{'End'|trans}} :{{ task.endDate|localizeddate('medium', 'none') }}
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
{% endif %}
|
|
</td>
|
|
<td>
|
|
<ul class="record_actions">
|
|
<li>
|
|
<div class="bt-dropdown">
|
|
<a href="" class="sc-button bt-task-exchange"> </a>
|
|
<div class="bt-dropdown-content">
|
|
{% for transition in workflow_transitions(task) %}
|
|
<a href="{{ path('chill_task_task_transition', { 'taskId': task.id, 'transition': transition.name, 'kind': 'single-task', 'return_path': app.request.uri }) }}" class="{{ task_workflow_metadata(task, 'transition.class', transition)|e('html_attr') }}">{{ task_workflow_metadata(task, 'transition.verb', transition)|trans }}</a>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<a href="{{ path('chill_task_single_task_show', { 'id': task.id }) }}" class="sc-button bt-show "></a>
|
|
</li>
|
|
{% if is_granted('CHILL_TASK_TASK_UPDATE', task) %}
|
|
<li>
|
|
<a href="{{ path('chill_task_single_task_edit', { 'id': task.id }) }}" class="sc-button bt-update "></a>
|
|
</li>
|
|
{% endif %}
|
|
{% if is_granted('CHILL_TASK_TASK_DELETE', task) %}
|
|
<li>
|
|
<a href="{{ path('chill_task_single_task_delete', { 'id': task.id } ) }}" class="sc-button bt-delete "></a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
|
|
|
|
{% if isSingleStatus %}
|
|
{% if tasks|length < paginator.getTotalItems %}
|
|
{{ chill_pagination(paginator) }}
|
|
{% endif %}
|
|
|
|
<!-- lien retour -->
|
|
<ul class="record_actions">
|
|
<li>
|
|
{% if person is not null %}
|
|
<a href="{{ path('chill_task_singletask_list', {'person_id': person.id}) }}" class="sc-button bt-cancel">
|
|
{{ 'Back to the list' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
{% if user is not null %}
|
|
<a href="{{ path('chill_task_singletask_list') }}" class="sc-button bt-cancel">
|
|
{{ 'Back to the list' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
<li>
|
|
{% if person is not null %}
|
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
{% if user is not null %}
|
|
<a href="{{ path('chill_task_single_task_new') }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
</ul>
|
|
{% else %}
|
|
<ul class="record_actions">
|
|
<li>
|
|
{% if person is not null %}
|
|
<a href="{{ path('chill_task_singletask_list', {'person_id': person.id, 'status' : [ status ] }) }}" class="sc-button">
|
|
{{ 'See more' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
{% if user is not null %}
|
|
<a href="{{ path('chill_task_singletask_list', {'status' : [ status ] }) }}" class="sc-button">
|
|
{{ 'See more' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
</li>
|
|
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% import _self as helper %}
|
|
|
|
|
|
<h1>{{ 'Task list'|trans }}</h1>
|
|
{% if tasks_count == 0 %}
|
|
<p class="chill-no-data-statement">{{ "There is no tasks."|trans }}</p>
|
|
{% if person is not null %}
|
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
<!-- Pour l'instant, il n'est pas encore possible d'ajouter une tache sans personne liée -->
|
|
<!-- {% if person is null %}
|
|
<a href="{{ path('chill_task_single_task_new') }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %} -->
|
|
{% else %}
|
|
|
|
{% if single_task_ended_tasks is defined %}
|
|
{{ helper.date_status('Tasks with expired deadline', single_task_ended_tasks, single_task_ended_count, single_task_ended_paginator, 'ended', isSingleStatus, person) }}
|
|
{% endif %}
|
|
|
|
{% if single_task_warning_tasks is defined %}
|
|
{{ helper.date_status('Tasks with warning deadline reached', single_task_warning_tasks, single_task_warning_count, single_task_warning_paginator, 'warning', isSingleStatus, person) }}
|
|
{% endif %}
|
|
|
|
{% if single_task_current_tasks is defined %}
|
|
{{ helper.date_status('Current tasks', single_task_current_tasks, single_task_current_count, single_task_current_paginator, 'current', isSingleStatus, person) }}
|
|
{% endif %}
|
|
|
|
{% if single_task_not_started_tasks is defined %}
|
|
{{ helper.date_status('Tasks not started', single_task_not_started_tasks, single_task_not_started_count, single_task_not_started_paginator, 'not_started', isSingleStatus, person) }}
|
|
{% endif %}
|
|
|
|
{% if single_task_closed_tasks is defined %}
|
|
{{ helper.date_status('Closed', single_task_closed_tasks, single_task_closed_count, single_task_closed_paginator, 'closed', isSingleStatus, person) }}
|
|
{% endif %}
|
|
|
|
{% if isSingleStatus == false %}
|
|
<ul class="record_actions">
|
|
<li>
|
|
{% if person is not null %}
|
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %}
|
|
<!-- Pour l'instant, il n'est pas encore possible d'ajouter une tache sans personne liée -->
|
|
<!-- {% if person is null %}
|
|
<a href="{{ path('chill_task_single_task_new') }}" class="sc-button bt-create">
|
|
{{ 'Add a new task' | trans }}
|
|
</a>
|
|
{% endif %} -->
|
|
</li>
|
|
</ul>
|
|
{% endif %}
|
|
|
|
{% endif %}
|