mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
link between lists of task and tasks
This commit is contained in:
parent
341d826102
commit
d251074430
@ -298,10 +298,9 @@ class SingleTaskController extends Controller
|
||||
$viewParams['person'] = $person;
|
||||
// collect parameters for filter
|
||||
$params['person'] = $person;
|
||||
$statuses = $request->query->get('date_status', []);
|
||||
|
||||
if ($request->query->has('date_status')) {
|
||||
$statuses = $request->query->get('date_status');
|
||||
$singleStatus = count($statuses) === 1;
|
||||
if ($statuses) {
|
||||
// check for invalid parameters
|
||||
$diff = \array_diff(
|
||||
$statuses,
|
||||
@ -315,6 +314,8 @@ class SingleTaskController extends Controller
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$viewParams['isSingleStatus'] = $singleStatus = count($statuses) === 1;
|
||||
|
||||
foreach(SingleTaskRepository::DATE_STATUSES as $type) {
|
||||
if($request->query->has('date_status')
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
{% endmacro %}
|
||||
|
||||
{% macro date_status(title, tasks, count, paginator) %}
|
||||
{% macro date_status(title, tasks, count, paginator, status, isSingleStatus, person) %}
|
||||
{% if tasks|length > 0 %}
|
||||
<h2>{{ title|trans }}</h2>
|
||||
|
||||
@ -78,8 +78,33 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% if tasks|length > paginator.getTotalItems %}
|
||||
|
||||
{% if isSingleStatus %}
|
||||
{% if tasks|length > paginator.getTotalItems %}
|
||||
{{ chill_pagination(paginator) }}
|
||||
{% endif %}
|
||||
|
||||
<!-- lien retour -->
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_task_task_list_by_person', {'personId': person.id}) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
||||
{{ 'Add a new task' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_task_task_list_by_person', {'personId': person.id, 'date_status' : [ status ] }) }}" class="sc-button bt-cancel">
|
||||
{{ 'See more' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
@ -93,27 +118,29 @@
|
||||
<h1>{{ 'Task list'|trans }}</h1>
|
||||
|
||||
{% 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) }}
|
||||
{{ 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) }}
|
||||
{{ 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) }}
|
||||
{{ 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) }}
|
||||
{{ 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 %}
|
||||
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
||||
{{ 'Add a new task' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% if isSingleStatus == false %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
||||
{{ 'Add a new task' | trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
Loading…
x
Reference in New Issue
Block a user