mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
controller and templates adapted to display list of accompanying period tasks + detailpage of task
This commit is contained in:
parent
b1dbd8b011
commit
a156bd0863
@ -32,6 +32,8 @@ use Chill\MainBundle\Timeline\TimelineBuilder;
|
|||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||||
|
use Chill\TaskBundle\Form\SingleTaskCourseType;
|
||||||
|
use Chill\TaskBundle\Repository\AbstractTaskRepository;
|
||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,7 +83,7 @@ class SingleTaskController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getEntity()
|
private function getEntityContext()
|
||||||
{
|
{
|
||||||
if($this->request->query->has('person_id')){
|
if($this->request->query->has('person_id')){
|
||||||
return 'person';
|
return 'person';
|
||||||
@ -108,7 +110,7 @@ class SingleTaskController extends AbstractController
|
|||||||
->setType('task_default')
|
->setType('task_default')
|
||||||
;
|
;
|
||||||
|
|
||||||
$entityType = $this->getEntity();
|
$entityType = $this->getEntityContext();
|
||||||
|
|
||||||
if ($entityType !== null) {
|
if ($entityType !== null) {
|
||||||
|
|
||||||
@ -150,14 +152,10 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// error message: You should associate a person with task in order to check autorizations.
|
//TODO : resolve access rights
|
||||||
// consequently adapting TaskVoter to take into account accompanyinCourse throws new errors linked to authorizationHelper on line 151
|
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(TaskVoter::CREATE, $task, 'You are not '
|
// $this->denyAccessUnlessGranted(TaskVoter::CREATE, $task, 'You are not '
|
||||||
. 'allowed to create this task');
|
// . 'allowed to create this task');
|
||||||
|
|
||||||
// error message: An error has occurred resolving the options of the form "Chill\TaskBundle\Form\SingleTaskType":
|
|
||||||
//The option "center" with value null is expected to be of type "Chill\MainBundle\Entity\Center", but is of type "null".
|
|
||||||
|
|
||||||
$form = $this->setCreateForm($task, new Role(TaskVoter::CREATE));
|
$form = $this->setCreateForm($task, new Role(TaskVoter::CREATE));
|
||||||
|
|
||||||
@ -183,7 +181,7 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
if($entityType === 'course')
|
if($entityType === 'course')
|
||||||
{
|
{
|
||||||
return $this->redirectToRoute('chill_task_singletask_list', [
|
return $this->redirectToRoute('chill_task_singletask_courselist', [
|
||||||
'course_id' => $task->getCourse()->getId()
|
'course_id' => $task->getCourse()->getId()
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -193,10 +191,22 @@ class SingleTaskController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch($this->getEntityContext()){
|
||||||
|
case 'person':
|
||||||
return $this->render('ChillTaskBundle:SingleTask:new.html.twig', array(
|
return $this->render('ChillTaskBundle:SingleTask:new.html.twig', array(
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'task' => $task
|
'task' => $task,
|
||||||
|
'person' => $person,
|
||||||
));
|
));
|
||||||
|
break;
|
||||||
|
case 'course':
|
||||||
|
return $this->render('ChillTaskBundle:SingleTask:newCourseTask.html.twig', array(
|
||||||
|
'form' => $form->createView(),
|
||||||
|
'task' => $task,
|
||||||
|
'accompanyingCourse' => $course,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -272,10 +282,18 @@ class SingleTaskController extends AbstractController
|
|||||||
$timeline = $this->timelineBuilder
|
$timeline = $this->timelineBuilder
|
||||||
->getTimelineHTML('task', array('task' => $task));
|
->getTimelineHTML('task', array('task' => $task));
|
||||||
|
|
||||||
|
if($this->getEntityContext() === 'person'){
|
||||||
return $this->render('ChillTaskBundle:SingleTask:show.html.twig', array(
|
return $this->render('ChillTaskBundle:SingleTask:show.html.twig', array(
|
||||||
'task' => $task,
|
'task' => $task,
|
||||||
'timeline' => $timeline
|
'timeline' => $timeline
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
return $this->render('ChillTaskBundle:SingleTask:showCourseTask.html.twig', array(
|
||||||
|
'task' => $task,
|
||||||
|
'timeline' => $timeline
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -457,10 +475,18 @@ class SingleTaskController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
protected function setCreateForm(SingleTask $task, Role $role)
|
protected function setCreateForm(SingleTask $task, Role $role)
|
||||||
{
|
{
|
||||||
|
if($this->getEntityContext() === 'person'){
|
||||||
$form = $this->createForm(SingleTaskType::class, $task, [
|
$form = $this->createForm(SingleTaskType::class, $task, [
|
||||||
'center' => $task->getCenter(),
|
'center' => $task->getCenter(),
|
||||||
'role' => $role
|
'role' => $role,
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->getEntityContext() === 'course'){
|
||||||
|
$form = $this->createForm(SingleTaskCourseType::class, $task, [
|
||||||
|
'center' => $task->getCenter(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class);
|
$form->add('submit', SubmitType::class);
|
||||||
|
|
||||||
@ -517,6 +543,7 @@ class SingleTaskController extends AbstractController
|
|||||||
$viewParams['center'] = null;
|
$viewParams['center'] = null;
|
||||||
$params['types'] = null;
|
$params['types'] = null;
|
||||||
$viewParams['accompanyingCourse'] = null;
|
$viewParams['accompanyingCourse'] = null;
|
||||||
|
$params['accompanyingCourse'] = null;
|
||||||
|
|
||||||
|
|
||||||
// Get parameters from url
|
// Get parameters from url
|
||||||
@ -658,12 +685,23 @@ class SingleTaskController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Form for filtering tasks
|
// Form for filtering tasks
|
||||||
|
if($this->getEntityContext() === 'person'){
|
||||||
$form = $formFactory->createNamed(null, SingleTaskListType::class, null, [
|
$form = $formFactory->createNamed(null, SingleTaskListType::class, null, [
|
||||||
'person' => $viewParams['person'],
|
'person' => $viewParams['person'],
|
||||||
'method' => Request::METHOD_GET,
|
'method' => Request::METHOD_GET,
|
||||||
'csrf_protection' => false,
|
'csrf_protection' => false,
|
||||||
'add_type' => true
|
'add_type' => true
|
||||||
]);
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->getEntityContext() === 'course'){
|
||||||
|
$form = $formFactory->createNamed(null, SingleTaskListType::class, null, [
|
||||||
|
'accompanyingCourse' => $viewParams['accompanyingCourse'],
|
||||||
|
'method' => Request::METHOD_GET,
|
||||||
|
'csrf_protection' => false,
|
||||||
|
'add_type' => true
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
$form->handleRequest($this->request);
|
$form->handleRequest($this->request);
|
||||||
|
|
||||||
@ -728,4 +766,58 @@ class SingleTaskController extends AbstractController
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route(
|
||||||
|
* "/{_locale}/task/singletask/courselist",
|
||||||
|
* name="chill_task_singletask_courselist")
|
||||||
|
*/
|
||||||
|
|
||||||
|
public function listCourseTasks(
|
||||||
|
AccompanyingPeriodRepository $courseRepository,
|
||||||
|
SingleTaskRepository $taskRepository,
|
||||||
|
FormFactoryInterface $formFactory,
|
||||||
|
TranslatorInterface $translator
|
||||||
|
): Response
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!empty($this->request->query->get('course_id', NULL))) {
|
||||||
|
|
||||||
|
$courseId = $this->request->query->getInt('course_id', 0);
|
||||||
|
$course = $courseRepository->find($courseId);
|
||||||
|
|
||||||
|
if ($course === null) {
|
||||||
|
throw $this->createNotFoundException("This accompanying course ' $courseId ' does not exist.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
if($course === NULL) {
|
||||||
|
throw $this->createNotFoundException('Accompanying course not found');
|
||||||
|
}
|
||||||
|
|
||||||
|
$tasks = $taskRepository
|
||||||
|
->findBy(
|
||||||
|
array('course' => $course)
|
||||||
|
);
|
||||||
|
|
||||||
|
$form = $formFactory->createNamed(null, SingleTaskListType::class, null, [
|
||||||
|
'accompanyingCourse' => $course,
|
||||||
|
'method' => Request::METHOD_GET,
|
||||||
|
'csrf_protection' => false,
|
||||||
|
'add_type' => true
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $this->render(
|
||||||
|
'ChillTaskBundle:SingleTask:index.html.twig',
|
||||||
|
[
|
||||||
|
'tasks' => $tasks,
|
||||||
|
'accompanyingCourse' => $course,
|
||||||
|
'layout' => '@ChillPerson/AccompanyingCourse/layout.html.twig',
|
||||||
|
'form' => $form->createView(),
|
||||||
|
'title' => $translator->trans('Tasks for this accompanying period')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -89,10 +89,12 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
//var $person \Chill\PersonBundle\Entity\Person */
|
//var $person \Chill\PersonBundle\Entity\Person */
|
||||||
$course = $parameters['accompanyingCourse'];
|
$course = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
|
//TODO: implement voter again?
|
||||||
|
|
||||||
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
||||||
$menu->addChild(
|
$menu->addChild(
|
||||||
$this->translator->trans('Tasks'), [
|
$this->translator->trans('Tasks'), [
|
||||||
'route' => 'chill_task_singletask_list',
|
'route' => 'chill_task_singletask_courselist',
|
||||||
'routeParameters' =>
|
'routeParameters' =>
|
||||||
[ 'course_id' => $course->getId() ]
|
[ 'course_id' => $course->getId() ]
|
||||||
])
|
])
|
||||||
|
@ -0,0 +1,107 @@
|
|||||||
|
{% if tasks|length > 0 %}
|
||||||
|
<h3>{{ title|trans }}</h3>
|
||||||
|
|
||||||
|
<table class="table table-bordered border-dark chill-task-list">
|
||||||
|
<tbody>
|
||||||
|
{% for task in tasks %}
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
<span class="chill-task-list__row__title">{{ task.title }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<span class="chill-task-list__row__type">{{ task_workflow_metadata(task, 'definition.name')|trans }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
{% for place in workflow_marked_places(task) %}
|
||||||
|
<span class="task-status box type-{{ task.type }} place-{{ place }}">{{ place|trans }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
{% if task.assignee is not null %}
|
||||||
|
<div class="chill-task-list__row__assignee">
|
||||||
|
<span class="chill_task-list__row__assignee_by">{{ 'By'|trans }} :</span>
|
||||||
|
{{ task.assignee.username }}</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if task.startDate is not null or task.warningDate is not null or task.endDate is not null %}
|
||||||
|
<div class="chill-task-list__row__dates">
|
||||||
|
<ul class="record_actions column">
|
||||||
|
{% if task.startDate is not null %}
|
||||||
|
<li title="{{ 'Start'|trans|escape('html_attr') }}">
|
||||||
|
<i class="fa fa-play"></i>
|
||||||
|
{{ task.startDate|format_date('medium') }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if task.warningDate is not null %}
|
||||||
|
<li title="{{ 'Warning'|trans|escape('html_attr') }}">
|
||||||
|
<i class="fa fa-exclamation-triangle"></i>
|
||||||
|
{{ task.warningDate|format_date('medium') }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if task.endDate is not null %}
|
||||||
|
<li title="{{ 'End'|trans|escape('html_attr') }}">
|
||||||
|
<i class="fa fa-hourglass-end"></i>
|
||||||
|
{{ task.endDate|format_date('medium') }}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<ul
|
||||||
|
class="record_actions">
|
||||||
|
{# {% if workflow_transitions(task)|length > 0 %}
|
||||||
|
<li>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a class="btn btn-task-exchange dropdown-toggle" href="#" role="button" id="taskExchange" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
{{'Change task status'|trans}}
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="taskExchange">
|
||||||
|
{% for transition in workflow_transitions(task) %}
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" href="{{ path('chill_task_task_transition', { 'taskId': task.id, 'transition': transition.name, 'kind': 'single-task', 'list_params': app.request.query.all }) }}" class="{{ task_workflow_metadata(task, 'transition.class', transition)|e('html_attr') }}">
|
||||||
|
{{ task_workflow_metadata(task, 'transition.verb', transition)|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endif %} #}
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_task_single_task_show', { 'id': task.id, 'list_params': app.request.query.all }) }}" class="btn btn-show "></a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{# {% if is_granted('CHILL_TASK_TASK_UPDATE', task) %} #}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_task_single_task_edit', { 'id': task.id, 'list_params': app.request.query.all }) }}" class="btn btn-update "></a>
|
||||||
|
</li>
|
||||||
|
{# {% endif %} #}
|
||||||
|
|
||||||
|
{# {% if is_granted('CHILL_TASK_TASK_DELETE', task) %} #}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_task_single_task_delete', { 'id': task.id, 'list_params': app.request.query.all } ) }}" class="btn btn-delete "></a>
|
||||||
|
</li>
|
||||||
|
{# {% endif %} #}
|
||||||
|
</ul>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
{% if accompanyingCourse is not null %}
|
||||||
|
<a href="{{ path('chill_task_single_task_new', {'course_id': accompanyingCourse.id}) }}" class="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
@ -0,0 +1,110 @@
|
|||||||
|
<div class="task-show">
|
||||||
|
|
||||||
|
<h1>{{ 'Task'|trans }}</h1>
|
||||||
|
|
||||||
|
<h2>{{ task.title }}
|
||||||
|
{% for place in workflow_marked_places(task) %}
|
||||||
|
<span class="task-status box type-{{ task.type }} place-{{ place }}">{{ place|trans }}</span>
|
||||||
|
{% endfor %}
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<dl class="chill_view_data">
|
||||||
|
|
||||||
|
<dt class="inline">{{ 'Description'|trans }}</dt>
|
||||||
|
<dd>
|
||||||
|
{% if task.description is empty %}
|
||||||
|
<span class="chill-no-data-statement">{{"No description"|trans}}</span>
|
||||||
|
{% else %}
|
||||||
|
<blockquote class="chill-user-quote">
|
||||||
|
{{ task.description|chill_markdown_to_html }}
|
||||||
|
</blockquote>
|
||||||
|
{% endif %}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt class="inline">{{ 'Assignee'|trans }}</dt>
|
||||||
|
<dd>
|
||||||
|
{% if task.assignee is null %}
|
||||||
|
<span class="chill-no-data-statement">{{"No one assignee"|trans}}</span>
|
||||||
|
{% else %}
|
||||||
|
{{ task.assignee }}
|
||||||
|
{% endif %}
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
||||||
|
<dd>
|
||||||
|
<span class="scope">{{ task.scope.name|localize_translatable_string }}</span>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<h3>{{"Dates"|trans}}</h3>
|
||||||
|
{% if task.startDate is null and task.endDate is null and task.warningDate is null %}
|
||||||
|
<dt></dt>
|
||||||
|
<dd>
|
||||||
|
<span class="chill-no-data-statement">{{"No dates specified"|trans}}</span>
|
||||||
|
</dd>
|
||||||
|
</dt>
|
||||||
|
{% else %}
|
||||||
|
{% if task.startDate is not null %}
|
||||||
|
<dt class="inline">{{ 'Start'|trans }}</dt>
|
||||||
|
<dd>{{ task.startDate|format_date('long') }}</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if task.endDate is not null %}
|
||||||
|
<dt class="inline">{{ 'End'|trans }}</dt>
|
||||||
|
<dd>{{ task.endDate|format_date('long') }}</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if task.warningDate is not null %}
|
||||||
|
<dt class="inline">{{ 'Warning'|trans }}</dt>
|
||||||
|
<dd>{{ task.warningDate|format_date('long') }}</dd>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
</dl>
|
||||||
|
|
||||||
|
{% if timeline is not null %}
|
||||||
|
<h3>{{"Timeline"|trans}}</h3>
|
||||||
|
{{ timeline|raw }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
<li class="cancel">
|
||||||
|
<a class="btn btn-cancel" href="{%- if app.request.query.has('returnPath') -%} {{ app.request.query.get('returnPath')|escape('html_attr') }} {%- else -%} {{ path('chill_task_singletask_list', app.request.query.get('list_params', {}) ) }} {%- endif -%}">
|
||||||
|
{{ app.request.query.get('returnLabel')|default('Back to the list'|trans) }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
{% if workflow_transitions(task)|length > 0 %}
|
||||||
|
<li>
|
||||||
|
<div class="btn-group">
|
||||||
|
<a class="btn btn-task-exchange dropdown-toggle" href="#" role="button" id="taskExchange" data-bs-toggle="dropdown" aria-expanded="false">
|
||||||
|
{{'Change task status'|trans}}
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu" aria-labelledby="taskExchange">
|
||||||
|
{% for transition in workflow_transitions(task) %}
|
||||||
|
<li>
|
||||||
|
<a class="dropdown-item" 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>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_TASK_TASK_UPDATE', task) %}
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-update" href="{{ path('chill_task_single_task_edit', { 'id': task.id }) }}">
|
||||||
|
{{ 'Edit the task'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_granted('CHILL_TASK_TASK_CREATE', task) %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_task_single_task_delete', { 'id': task.id } ) }}" class="btn btn-delete">
|
||||||
|
{{ 'Delete'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
</ul></div>
|
@ -37,7 +37,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="col-md-10 col-xxl tasks">
|
<div class="col-md-10 col-xxl tasks">
|
||||||
{% include 'ChillTaskBundle:SingleTask:_list.html.twig' %}
|
{% include 'ChillTaskBundle:SingleTask:_listCourse.html.twig' %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -16,124 +16,17 @@
|
|||||||
#}
|
#}
|
||||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||||
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
|
|
||||||
{% block title %}{{ 'Task'|trans }}{% endblock %}
|
{% block title %}
|
||||||
|
{{ 'Task'|trans }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
<div class="task-show">
|
|
||||||
|
|
||||||
<h1>{{ 'Task'|trans }}</h1>
|
{% include 'ChillTaskBundle:SingleTask:_show.html.twig' %}
|
||||||
|
|
||||||
<h2>{{ task.title }} {% for place in workflow_marked_places(task) %}
|
|
||||||
<span class="task-status box type-{{ task.type }} place-{{ place }}">{{ place|trans }}</span>
|
|
||||||
{% endfor %}</h2>
|
|
||||||
|
|
||||||
<dl class="chill_view_data">
|
|
||||||
|
|
||||||
<dt class="inline">{{ 'Description'|trans }}</dt>
|
|
||||||
<dd>
|
|
||||||
{% if task.description is empty %}
|
|
||||||
<span class="chill-no-data-statement">{{"No description"|trans}}</span>
|
|
||||||
{% else %}
|
|
||||||
<blockquote class="chill-user-quote">
|
|
||||||
{{ task.description|chill_markdown_to_html }}
|
|
||||||
</blockquote>
|
|
||||||
{% endif %}
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt class="inline">{{ 'Assignee'|trans }}</dt>
|
|
||||||
<dd>
|
|
||||||
{% if task.assignee is null %}
|
|
||||||
<span class="chill-no-data-statement">{{"No one assignee"|trans}}</span>
|
|
||||||
{% else %}
|
|
||||||
{{ task.assignee }}
|
|
||||||
{% endif %}
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
|
||||||
<dd><span class="scope">{{ task.scope.name|localize_translatable_string }}</span></dd>
|
|
||||||
|
|
||||||
<h3>{{"Dates"|trans}}</h3>
|
|
||||||
{% if task.startDate is null and task.endDate is null and task.warningDate is null %}
|
|
||||||
<dt>
|
|
||||||
<dd><span class="chill-no-data-statement">{{"No dates specified"|trans}}</span></dd>
|
|
||||||
</dt>
|
|
||||||
{% else %}
|
|
||||||
{% if task.startDate is not null %}
|
|
||||||
<dt class="inline">{{ 'Start'|trans }}</dt>
|
|
||||||
<dd>{{ task.startDate|format_date('long') }}</dd>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if task.endDate is not null %}
|
|
||||||
<dt class="inline">{{ 'End'|trans }}</dt>
|
|
||||||
<dd>{{ task.endDate|format_date('long') }}</dd>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if task.warningDate is not null %}
|
|
||||||
<dt class="inline">{{ 'Warning'|trans }}</dt>
|
|
||||||
<dd>{{ task.warningDate|format_date('long') }}</dd>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
</dl>
|
|
||||||
|
|
||||||
{% if timeline is not null %}
|
|
||||||
<h3>{{"Timeline"|trans}}</h3>
|
|
||||||
{{ timeline|raw }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
|
||||||
<li class="cancel">
|
|
||||||
<a class="btn btn-cancel" href="{%- if app.request.query.has('returnPath') -%}
|
|
||||||
{{ app.request.query.get('returnPath')|escape('html_attr') }}
|
|
||||||
{%- else -%}
|
|
||||||
{{ path('chill_task_singletask_list', app.request.query.get('list_params', {}) ) }}
|
|
||||||
{%- endif -%}">
|
|
||||||
{{ app.request.query.get('returnLabel')|default('Back to the list'|trans) }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
{% if workflow_transitions(task)|length > 0 %}
|
|
||||||
<li>
|
|
||||||
<div class="btn-group">
|
|
||||||
<a class="btn btn-task-exchange dropdown-toggle" href="#" role="button"
|
|
||||||
id="taskExchange" data-bs-toggle="dropdown" aria-expanded="false">
|
|
||||||
{{'Change task status'|trans}}
|
|
||||||
</a>
|
|
||||||
<ul class="dropdown-menu" aria-labelledby="taskExchange">
|
|
||||||
{% for transition in workflow_transitions(task) %}
|
|
||||||
<li>
|
|
||||||
<a class="dropdown-item"
|
|
||||||
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>
|
|
||||||
</li>
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if is_granted('CHILL_TASK_TASK_UPDATE', task) %}
|
|
||||||
<li>
|
|
||||||
<a class="btn btn-update" href="{{ path('chill_task_single_task_edit', { 'id': task.id }) }}">
|
|
||||||
{{ 'Edit the task'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if is_granted('CHILL_TASK_TASK_CREATE', task) %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_task_single_task_delete', { 'id': task.id } ) }}" class="btn btn-delete">
|
|
||||||
{{ 'Delete'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
||||||
|
|
||||||
|
|
||||||
|
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
||||||
|
{% set accompanyingCourse = task.course %}
|
||||||
|
|
||||||
|
{% block title %}
|
||||||
|
{{ 'Task'|trans }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% include 'ChillTaskBundle:SingleTask:_show.html.twig' %}
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -1,53 +1,54 @@
|
|||||||
Tasks: 'Tâches'
|
Tasks: "Tâches"
|
||||||
'New task': 'Nouvelle tâche'
|
"New task": "Nouvelle tâche"
|
||||||
'Add a new task': 'Ajouter une nouvelle tâche'
|
"Add a new task": "Ajouter une nouvelle tâche"
|
||||||
Title: Titre
|
Title: Titre
|
||||||
Description: Description
|
Description: Description
|
||||||
Assignee: 'Personne assignée'
|
Assignee: "Personne assignée"
|
||||||
Scope: Cercle
|
Scope: Cercle
|
||||||
'Start date': 'Date de début'
|
"Start date": "Date de début"
|
||||||
'End date': "Date d'échéance"
|
"End date": "Date d'échéance"
|
||||||
'Warning date': "Date d'avertissement"
|
"Warning date": "Date d'avertissement"
|
||||||
'Warning interval': "Délai d'avertissement avant la date d'échéance"
|
"Warning interval": "Délai d'avertissement avant la date d'échéance"
|
||||||
'Unknown dates': 'Dates non spécifiées'
|
"Unknown dates": "Dates non spécifiées"
|
||||||
'N': ''
|
"N": ""
|
||||||
'Unit': ''
|
"Unit": ""
|
||||||
Task: Tâche
|
Task: Tâche
|
||||||
Details: Détails
|
Details: Détails
|
||||||
Person: Personne
|
Person: Personne
|
||||||
Date: Date
|
Date: Date
|
||||||
Dates: Dates
|
Dates: Dates
|
||||||
User: Utilisateur
|
User: Utilisateur
|
||||||
'Task list': 'Liste des tâches'
|
"Task list": "Liste des tâches"
|
||||||
'Tasks with expired deadline': "Tâches avec une date d'échéance dépassée"
|
"Tasks with expired deadline": "Tâches avec une date d'échéance dépassée"
|
||||||
'Tasks with warning deadline reached': "Tâches avec une date d'avertissement atteinte"
|
"Tasks with warning deadline reached": "Tâches avec une date d'avertissement atteinte"
|
||||||
'Current tasks': 'Tâches en cours'
|
"Current tasks": "Tâches en cours"
|
||||||
'Closed tasks': Tâches terminées
|
"Closed tasks": Tâches terminées
|
||||||
'Tasks not started': 'Tâches non commencées'
|
"Tasks not started": "Tâches non commencées"
|
||||||
'Task start date': 'Date de début'
|
"Task start date": "Date de début"
|
||||||
'Task warning date': "Date d'avertissement"
|
"Task warning date": "Date d'avertissement"
|
||||||
'Task end date': "Date d'échéance"
|
"Task end date": "Date d'échéance"
|
||||||
'Start': 'Début'
|
"Start": "Début"
|
||||||
'Warning': 'Avertissement'
|
"Warning": "Avertissement"
|
||||||
'End': 'Échéance'
|
"End": "Échéance"
|
||||||
'Task type': 'Type'
|
"Task type": "Type"
|
||||||
'Task status': 'Statut'
|
"Task status": "Statut"
|
||||||
'Edit the task': 'Modifier la tâche'
|
"Edit the task": "Modifier la tâche"
|
||||||
'Edit task': 'Modifier la tâche'
|
"Edit task": "Modifier la tâche"
|
||||||
'Save task': 'Enregistrer la tâche'
|
"Save task": "Enregistrer la tâche"
|
||||||
'View the task': 'Voir la tâche'
|
"View the task": "Voir la tâche"
|
||||||
'Update the task': 'Mettre à jour la tâche'
|
"Update the task": "Mettre à jour la tâche"
|
||||||
'Remove task': 'Supprimer la tâche'
|
"Remove task": "Supprimer la tâche"
|
||||||
'Delete': 'Supprimer'
|
"Delete": "Supprimer"
|
||||||
'Change task status': 'Changer le statut'
|
"Change task status": "Changer le statut"
|
||||||
'Are you sure you want to remove the task about "%name%" ?': 'Êtes-vous sûr·e de vouloir supprimer la tâche de "%name%"?'
|
'Are you sure you want to remove the task about "%name%" ?': 'Êtes-vous sûr·e de vouloir supprimer la tâche de "%name%"?'
|
||||||
'See more': 'Voir plus'
|
"See more": "Voir plus"
|
||||||
'Associated tasks': 'Tâches associées'
|
"Associated tasks": "Tâches associées"
|
||||||
'My tasks': 'Mes tâches'
|
"My tasks": "Mes tâches"
|
||||||
'No description': 'Pas de description'
|
"Tasks for this accompanying period": "Tâches pour ce parcours d'accompagnement"
|
||||||
'No dates specified': 'Dates non spécifiées'
|
"No description": "Pas de description"
|
||||||
'No one assignee': 'Aucune personne assignée'
|
"No dates specified": "Dates non spécifiées"
|
||||||
'Task types': Types de tâches
|
"No one assignee": "Aucune personne assignée"
|
||||||
|
"Task types": Types de tâches
|
||||||
Days: Jour(s)
|
Days: Jour(s)
|
||||||
Weeks: Semaine(s)
|
Weeks: Semaine(s)
|
||||||
Months: Mois
|
Months: Mois
|
||||||
@ -63,36 +64,36 @@ For person: Pour
|
|||||||
By: Par
|
By: Par
|
||||||
|
|
||||||
# transitions - default task definition
|
# transitions - default task definition
|
||||||
'new': 'nouvelle'
|
"new": "nouvelle"
|
||||||
'in_progress': 'en cours'
|
"in_progress": "en cours"
|
||||||
'closed': 'fermée'
|
"closed": "fermée"
|
||||||
'canceled': 'supprimée'
|
"canceled": "supprimée"
|
||||||
start: démarrer
|
start: démarrer
|
||||||
close: clotûrer
|
close: clotûrer
|
||||||
cancel: annuler
|
cancel: annuler
|
||||||
Start_verb: Démarrer
|
Start_verb: Démarrer
|
||||||
Close_verb: Clotûrer
|
Close_verb: Clotûrer
|
||||||
Set this task to cancel state: Marquer cette tâche comme annulée
|
Set this task to cancel state: Marquer cette tâche comme annulée
|
||||||
'%user% has closed the task': '%user% a fermé la tâche'
|
"%user% has closed the task": "%user% a fermé la tâche"
|
||||||
'%user% has canceled the task': '%user% a annulé la tâche'
|
"%user% has canceled the task": "%user% a annulé la tâche"
|
||||||
'%user% has started the task': '%user% a commencé la tâche'
|
"%user% has started the task": "%user% a commencé la tâche"
|
||||||
'%user% has created the task': '%user% a introduit la tâche'
|
"%user% has created the task": "%user% a introduit la tâche"
|
||||||
Are you sure you want to close this task ?: Êtes-vous sûrs de vouloir clotûrer cette tâche ?
|
Are you sure you want to close this task ?: Êtes-vous sûrs de vouloir clotûrer cette tâche ?
|
||||||
Are you sure you want to cancel this task ?: Êtes-vous sûrs de vouloir annuler cette tâche ?
|
Are you sure you want to cancel this task ?: Êtes-vous sûrs de vouloir annuler cette tâche ?
|
||||||
Are you sure you want to start this task ?: Êtes-vous sûrs de vouloir démarrer cette tâche ?
|
Are you sure you want to start this task ?: Êtes-vous sûrs de vouloir démarrer cette tâche ?
|
||||||
|
|
||||||
#Flash messages
|
#Flash messages
|
||||||
'The task is created': 'La tâche a été créée'
|
"The task is created": "La tâche a été créée"
|
||||||
'There is no tasks.': Aucune tâche.
|
"There is no tasks.": Aucune tâche.
|
||||||
'The task has been successfully removed.': 'La tâche a bien été supprimée'
|
"The task has been successfully removed.": "La tâche a bien été supprimée"
|
||||||
'This form contains errors': 'Ce formulaire contient des erreurs'
|
"This form contains errors": "Ce formulaire contient des erreurs"
|
||||||
'The task has been updated': 'La tâche a été mise à jour'
|
"The task has been updated": "La tâche a été mise à jour"
|
||||||
'The transition is successfully applied': 'La transition a bien été effectuée'
|
"The transition is successfully applied": "La transition a bien été effectuée"
|
||||||
'The transition could not be applied': "La transition n'a pas pu être appliquée"
|
"The transition could not be applied": "La transition n'a pas pu être appliquée"
|
||||||
|
|
||||||
#widget
|
#widget
|
||||||
'%number% tasks over deadline': '{0} Aucune tâche dépassée|{1} Une tâche dépassée | ]1,Inf[ %count% tâches dépassées'
|
"%number% tasks over deadline": "{0} Aucune tâche dépassée|{1} Une tâche dépassée | ]1,Inf[ %count% tâches dépassées"
|
||||||
'%number% tasks near deadline': '{0} Aucune tâche en rappel|{1} Une tâche en rappel | ]1,Inf[ %count% tâches en rappel'
|
"%number% tasks near deadline": "{0} Aucune tâche en rappel|{1} Une tâche en rappel | ]1,Inf[ %count% tâches en rappel"
|
||||||
|
|
||||||
#title
|
#title
|
||||||
My tasks near deadline: Mes tâches à échéance proche
|
My tasks near deadline: Mes tâches à échéance proche
|
||||||
|
Loading…
x
Reference in New Issue
Block a user