mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +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;
|
$viewParams['person'] = $person;
|
||||||
// collect parameters for filter
|
// collect parameters for filter
|
||||||
$params['person'] = $person;
|
$params['person'] = $person;
|
||||||
|
$statuses = $request->query->get('date_status', []);
|
||||||
|
|
||||||
if ($request->query->has('date_status')) {
|
if ($statuses) {
|
||||||
$statuses = $request->query->get('date_status');
|
|
||||||
$singleStatus = count($statuses) === 1;
|
|
||||||
// check for invalid parameters
|
// check for invalid parameters
|
||||||
$diff = \array_diff(
|
$diff = \array_diff(
|
||||||
$statuses,
|
$statuses,
|
||||||
@ -315,6 +314,8 @@ class SingleTaskController extends Controller
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$viewParams['isSingleStatus'] = $singleStatus = count($statuses) === 1;
|
||||||
|
|
||||||
foreach(SingleTaskRepository::DATE_STATUSES as $type) {
|
foreach(SingleTaskRepository::DATE_STATUSES as $type) {
|
||||||
if($request->query->has('date_status')
|
if($request->query->has('date_status')
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro date_status(title, tasks, count, paginator) %}
|
{% macro date_status(title, tasks, count, paginator, status, isSingleStatus, person) %}
|
||||||
{% if tasks|length > 0 %}
|
{% if tasks|length > 0 %}
|
||||||
<h2>{{ title|trans }}</h2>
|
<h2>{{ title|trans }}</h2>
|
||||||
|
|
||||||
@ -78,8 +78,33 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{% if tasks|length > paginator.getTotalItems %}
|
|
||||||
|
{% if isSingleStatus %}
|
||||||
|
{% if tasks|length > paginator.getTotalItems %}
|
||||||
{{ chill_pagination(paginator) }}
|
{{ 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 %}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -93,27 +118,29 @@
|
|||||||
<h1>{{ 'Task list'|trans }}</h1>
|
<h1>{{ 'Task list'|trans }}</h1>
|
||||||
|
|
||||||
{% if single_task_ended_tasks is defined %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if single_task_warning_tasks is defined %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if single_task_current_tasks is defined %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if single_task_not_started_tasks is defined %}
|
{% 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 %}
|
{% endif %}
|
||||||
|
|
||||||
<ul class="record_actions">
|
{% if isSingleStatus == false %}
|
||||||
<li>
|
<ul class="record_actions">
|
||||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
<li>
|
||||||
{{ 'Add a new task' | trans }}
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="sc-button bt-create">
|
||||||
</a>
|
{{ 'Add a new task' | trans }}
|
||||||
</li>
|
</a>
|
||||||
</ul>
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user