mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-01 10:59:45 +00:00
Compare commits
1 Commits
small_issu
...
review_doc
Author | SHA1 | Date | |
---|---|---|---|
93c0197cdb |
@@ -73,14 +73,14 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $course);
|
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $course);
|
||||||
|
|
||||||
$documents = $em
|
$documents = $em
|
||||||
->getRepository("ChillDocStoreBundle:AccompanyingCourseDocument")
|
->getRepository(AccompanyingCourseDocument::class)
|
||||||
->findBy(
|
->findBy(
|
||||||
['course' => $course],
|
['course' => $course],
|
||||||
['date' => 'DESC']
|
['date' => 'DESC']
|
||||||
);
|
);
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'ChillDocStoreBundle:AccompanyingCourseDocument:index.html.twig',
|
'@ChillDocStore/AccompanyingCourseDocument/index.html.twig',
|
||||||
[
|
[
|
||||||
'documents' => $documents,
|
'documents' => $documents,
|
||||||
'accompanyingCourse' => $course
|
'accompanyingCourse' => $course
|
||||||
@@ -122,7 +122,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
$this->addFlash('error', $this->translator->trans("This form contains errors"));
|
$this->addFlash('error', $this->translator->trans("This form contains errors"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('ChillDocStoreBundle:AccompanyingCourseDocument:new.html.twig', [
|
return $this->render('@ChillDocStore/AccompanyingCourseDocument/new.html.twig', [
|
||||||
'document' => $document,
|
'document' => $document,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
'accompanyingCourse' => $course,
|
'accompanyingCourse' => $course,
|
||||||
@@ -138,7 +138,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
$this->denyAccessUnlessGranted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', $document);
|
$this->denyAccessUnlessGranted('CHILL_ACCOMPANYING_COURSE_DOCUMENT_SEE', $document);
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'ChillDocStoreBundle:AccompanyingCourseDocument:show.html.twig',
|
'@ChillDocStore/AccompanyingCourseDocument/show.html.twig',
|
||||||
['document' => $document, 'accompanyingCourse' => $course]);
|
['document' => $document, 'accompanyingCourse' => $course]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,7 +171,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->render(
|
return $this->render(
|
||||||
'ChillDocStoreBundle:AccompanyingCourseDocument:edit.html.twig',
|
'@ChillDocStore/AccompanyingCourseDocument/edit.html.twig',
|
||||||
[
|
[
|
||||||
'document' => $document,
|
'document' => $document,
|
||||||
'form' => $form->createView(),
|
'form' => $form->createView(),
|
||||||
|
@@ -3,8 +3,9 @@
|
|||||||
namespace Chill\DocStoreBundle\Repository;
|
namespace Chill\DocStoreBundle\Repository;
|
||||||
|
|
||||||
use App\Entity\AccompanyingCourseDocument;
|
use App\Entity\AccompanyingCourseDocument;
|
||||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
use Chill\DocStoreBundle\Entity\AccompanyingCourseDocument as EntityAccompanyingCourseDocument;
|
||||||
use Doctrine\Persistence\ManagerRegistry;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method AccompanyingCourseDocument|null find($id, $lockMode = null, $lockVersion = null)
|
* @method AccompanyingCourseDocument|null find($id, $lockMode = null, $lockVersion = null)
|
||||||
@@ -12,39 +13,41 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||||||
* @method AccompanyingCourseDocument[] findAll()
|
* @method AccompanyingCourseDocument[] findAll()
|
||||||
* @method AccompanyingCourseDocument[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
* @method AccompanyingCourseDocument[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||||
*/
|
*/
|
||||||
class AccompanyingCourseDocumentRepository extends ServiceEntityRepository
|
class AccompanyingCourseDocumentRepository implements ObjectRepository
|
||||||
{
|
{
|
||||||
public function __construct(ManagerRegistry $registry)
|
private EntityRepository $repository;
|
||||||
|
|
||||||
|
public function __construct(EntityManagerInterface $entityManager)
|
||||||
{
|
{
|
||||||
parent::__construct($registry, AccompanyingCourseDocument::class);
|
$this->repository = $entityManager->getRepository(EntityAccompanyingCourseDocument::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
public function getClassName()
|
||||||
// * @return AccompanyingCourseDocument[] Returns an array of AccompanyingCourseDocument objects
|
|
||||||
// */
|
|
||||||
/*
|
|
||||||
public function findByExampleField($value)
|
|
||||||
{
|
{
|
||||||
return $this->createQueryBuilder('a')
|
return EntityAccompanyingCourseDocument::class;
|
||||||
->andWhere('a.exampleField = :val')
|
|
||||||
->setParameter('val', $value)
|
|
||||||
->orderBy('a.id', 'ASC')
|
|
||||||
->setMaxResults(10)
|
|
||||||
->getQuery()
|
|
||||||
->getResult()
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
public function find($id): ?EntityAccompanyingCourseDocument
|
||||||
public function findOneBySomeField($value): ?AccompanyingCourseDocument
|
|
||||||
{
|
{
|
||||||
return $this->createQueryBuilder('a')
|
return $this->repository->find($id);
|
||||||
->andWhere('a.exampleField = :val')
|
}
|
||||||
->setParameter('val', $value)
|
|
||||||
->getQuery()
|
/**
|
||||||
->getOneOrNullResult()
|
* @return EntityAccompanyingCourseDocument[]
|
||||||
;
|
*/
|
||||||
|
|
||||||
|
public function findAll(): array
|
||||||
|
{
|
||||||
|
return $this->repository->findAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findBy(array $criteria, $orderBy = null, $limit = null, $offset = null): array
|
||||||
|
{
|
||||||
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function findOneBy(array $criteria): ?EntityAccompanyingCourseDocument
|
||||||
|
{
|
||||||
|
return $this->repository->findOneBy($criteria);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
@@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a href="{{ path('accompanying_course_document_index', {'course': accompanyingCourse.id}) }}" class="btn btn-cancel">
|
<a href="{{ chill_return_path_or('accompanying_course_document_index', {'course': accompanyingCourse.id}) }}" class="btn btn-cancel">
|
||||||
{{ 'Back to the list' | trans }}
|
{{ 'Cancel' | trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="edit">
|
<li class="edit">
|
||||||
|
@@ -28,7 +28,6 @@ use Chill\MainBundle\Entity\HasCentersInterface;
|
|||||||
use Chill\MainBundle\Entity\HasScopesInterface;
|
use Chill\MainBundle\Entity\HasScopesInterface;
|
||||||
use Chill\MainBundle\Entity\Scope;
|
use Chill\MainBundle\Entity\Scope;
|
||||||
use Chill\MainBundle\Entity\Address;
|
use Chill\MainBundle\Entity\Address;
|
||||||
use Chill\MainBundle\Entity\Center;
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||||
@@ -978,15 +977,6 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
return $this->addressLocation;
|
return $this->addressLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCenter(): ?Center
|
|
||||||
{
|
|
||||||
if (count($this->getPersons()) === 0){
|
|
||||||
return null;
|
|
||||||
} else {
|
|
||||||
return $this->getPersons()->first()->getCenter();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Groups({"write"})
|
* @Groups({"write"})
|
||||||
*/
|
*/
|
||||||
|
@@ -146,7 +146,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
|||||||
* groups={"general", "creation"}
|
* groups={"general", "creation"}
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
private ?\DateTimeImmutable $deathdate = null;
|
private ?\DateTimeImmutable $deathdate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The person's place of birth
|
* The person's place of birth
|
||||||
|
@@ -66,7 +66,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'id' => $period->getId()
|
'id' => $period->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 40]);
|
->setExtras(['order' => 50]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ const appMessages = {
|
|||||||
active: "En file active"
|
active: "En file active"
|
||||||
},
|
},
|
||||||
open_at: "ouvert le ",
|
open_at: "ouvert le ",
|
||||||
by: "Référent: ",
|
by: "par ",
|
||||||
emergency: "urgent",
|
emergency: "urgent",
|
||||||
confidential: "confidentiel",
|
confidential: "confidentiel",
|
||||||
regular: "régulier",
|
regular: "régulier",
|
||||||
@@ -87,7 +87,7 @@ const appMessages = {
|
|||||||
no_address: "Il n'y a pas d'adresse associée au parcours"
|
no_address: "Il n'y a pas d'adresse associée au parcours"
|
||||||
},
|
},
|
||||||
scopes: {
|
scopes: {
|
||||||
title: "Services concernés",
|
title: "Services",
|
||||||
add_at_least_one: "Indiquez au moins un service",
|
add_at_least_one: "Indiquez au moins un service",
|
||||||
},
|
},
|
||||||
referrer: {
|
referrer: {
|
||||||
|
@@ -6,6 +6,7 @@ use Chill\PersonBundle\Privacy\PrivacyEvent;
|
|||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
|
use Doctrine\ORM\EntityManager;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -19,18 +20,15 @@ use Symfony\Component\Security\Core\Role\Role;
|
|||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
use Chill\TaskBundle\Repository\SingleTaskRepository;
|
use Chill\TaskBundle\Repository\SingleTaskRepository;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\MainBundle\Repository\CenterRepository;
|
|
||||||
use Chill\MainBundle\Repository\ScopeRepository;
|
|
||||||
use Chill\MainBundle\Repository\UserRepository;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
|
use Chill\MainBundle\Entity\UserRepository;
|
||||||
use Chill\TaskBundle\Event\TaskEvent;
|
use Chill\TaskBundle\Event\TaskEvent;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Chill\TaskBundle\Event\UI\UIEvent;
|
use Chill\TaskBundle\Event\UI\UIEvent;
|
||||||
|
use Chill\MainBundle\Repository\CenterRepository;
|
||||||
use Chill\MainBundle\Timeline\TimelineBuilder;
|
use Chill\MainBundle\Timeline\TimelineBuilder;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriodRepository;
|
|
||||||
use Chill\PersonBundle\Repository\PersonRepository;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface as TranslationTranslatorInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class SingleTaskController
|
* Class SingleTaskController
|
||||||
@@ -39,23 +37,22 @@ use Symfony\Contracts\Translation\TranslatorInterface as TranslationTranslatorIn
|
|||||||
*/
|
*/
|
||||||
class SingleTaskController extends AbstractController
|
class SingleTaskController extends AbstractController
|
||||||
{
|
{
|
||||||
protected EventDispatcherInterface $eventDispatcher;
|
|
||||||
|
|
||||||
protected TimeLineBuilder $timelineBuilder;
|
/**
|
||||||
|
* @var EventDispatcherInterface
|
||||||
|
*/
|
||||||
|
protected $eventDispatcher;
|
||||||
|
|
||||||
protected LoggerInterface $logger;
|
/**
|
||||||
|
*
|
||||||
protected PersonRepository $personRepository;
|
* @var TimelineBuilder
|
||||||
|
*/
|
||||||
protected AccompanyingPeriodRepository $courseRepository;
|
protected $timelineBuilder;
|
||||||
|
|
||||||
protected UserRepository $userRepository;
|
/**
|
||||||
|
* @var LoggerInterface
|
||||||
protected CenterRepository $centerRepository;
|
*/
|
||||||
|
protected $logger;
|
||||||
protected ScopeRepository $scopeRepository;
|
|
||||||
|
|
||||||
protected SingleTaskRepository $taskRepository;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SingleTaskController constructor.
|
* SingleTaskController constructor.
|
||||||
@@ -65,35 +62,11 @@ class SingleTaskController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
EventDispatcherInterface $eventDispatcher,
|
EventDispatcherInterface $eventDispatcher,
|
||||||
TimelineBuilder $timelineBuilder,
|
TimelineBuilder $timelineBuilder,
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger
|
||||||
SingleTaskRepository $singleTaskRepository,
|
|
||||||
PersonRepository $personRepository,
|
|
||||||
AccompanyingPeriodRepository $courseRepository,
|
|
||||||
UserRepository $userRepository,
|
|
||||||
CenterRepository $centerRepository,
|
|
||||||
ScopeRepository $scopeRepository
|
|
||||||
) {
|
) {
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
$this->timelineBuilder = $timelineBuilder;
|
$this->timelineBuilder = $timelineBuilder;
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->taskRepository = $singleTaskRepository;
|
|
||||||
$this->scopeRepository = $scopeRepository;
|
|
||||||
$this->centerRepository = $centerRepository;
|
|
||||||
$this->userRepository = $userRepository;
|
|
||||||
$this->personRepository = $personRepository;
|
|
||||||
$this->courseRepository = $courseRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private function getEntityContext(Request $request)
|
|
||||||
{
|
|
||||||
if($request->query->has('person_id')){
|
|
||||||
return 'person';
|
|
||||||
} else if ($request->query->has('course_id')) {
|
|
||||||
return 'course';
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -104,58 +77,40 @@ class SingleTaskController extends AbstractController
|
|||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function newAction(
|
public function newAction(
|
||||||
TranslationTranslatorInterface $translator,
|
Request $request,
|
||||||
Request $request
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$task = (new SingleTask())
|
$task = (new SingleTask())
|
||||||
->setAssignee($this->getUser())
|
->setAssignee($this->getUser())
|
||||||
->setType('task_default')
|
->setType('task_default')
|
||||||
;
|
;
|
||||||
|
|
||||||
$entityType = $this->getEntityContext($request);
|
|
||||||
|
|
||||||
if ($entityType !== null) {
|
if ($request->query->has('person_id')) {
|
||||||
|
|
||||||
$entityId = $request->query->getInt("{$entityType}_id", 0); // sf4 check:
|
$personId = $request->query->getInt('person_id', 0); // sf4 check:
|
||||||
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
// prevent error: `Argument 2 passed to ::getInt() must be of the type int, null given`
|
||||||
|
|
||||||
switch($entityType){
|
if ($personId === null) {
|
||||||
case 'person':
|
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
||||||
$person = $this->personRepository
|
|
||||||
->find($entityId);
|
|
||||||
|
|
||||||
if ($person === null) {
|
|
||||||
$this->createNotFoundException("Invalid person id");
|
|
||||||
}
|
|
||||||
|
|
||||||
$task->setPerson($person);
|
|
||||||
|
|
||||||
break;
|
|
||||||
case 'course':
|
|
||||||
$course = $this->courseRepository
|
|
||||||
->find($entityId);
|
|
||||||
|
|
||||||
if($course === null) {
|
|
||||||
$this->createNotFoundException("Invalid accompanying course id");
|
|
||||||
}
|
|
||||||
|
|
||||||
$task->setCourse($course);
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
new Response("You must provide a {$entityType}_id", Response::HTTP_BAD_REQUEST);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$person = $this->getDoctrine()->getManager()
|
||||||
|
->getRepository(Person::class)
|
||||||
|
->find($personId);
|
||||||
|
|
||||||
|
if ($person === null) {
|
||||||
|
$this->createNotFoundException("Invalid person id");
|
||||||
|
}
|
||||||
|
|
||||||
|
$task->setPerson($person);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO : resolve access rights
|
$this->denyAccessUnlessGranted(TaskVoter::CREATE, $task, 'You are not '
|
||||||
|
. 'allowed to create this task');
|
||||||
// $this->denyAccessUnlessGranted(TaskVoter::CREATE, $task, 'You are not '
|
|
||||||
// . 'allowed to create this task');
|
|
||||||
|
|
||||||
$form = $this->setCreateForm($task, new Role(TaskVoter::CREATE));
|
$form = $this->setCreateForm($task, new Role(TaskVoter::CREATE));
|
||||||
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted()) {
|
if ($form->isSubmitted()) {
|
||||||
@@ -169,101 +124,70 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
$this->addFlash('success', $translator->trans("The task is created"));
|
$this->addFlash('success', $translator->trans("The task is created"));
|
||||||
|
|
||||||
switch($entityType){
|
return $this->redirectToRoute('chill_task_singletask_list', [
|
||||||
case 'person':
|
'person_id' => $task->getPerson()->getId()
|
||||||
return $this->redirectToRoute('chill_task_singletask_list', [
|
]);
|
||||||
'person_id' => $task->getPerson()->getId()
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'course':
|
|
||||||
return $this->redirectToRoute('chill_task_singletask_courselist', [
|
|
||||||
'course_id' => $task->getCourse()->getId()
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->addFlash('error', $translator->trans("This form contains errors"));
|
$this->addFlash('error', $translator->trans("This form contains errors"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch($this->getEntityContext($request)){
|
return $this->render('ChillTaskBundle:SingleTask:new.html.twig', array(
|
||||||
case 'person':
|
'form' => $form->createView(),
|
||||||
return $this->render('@ChillTask/SingleTask/Person/new.html.twig', array(
|
'task' => $task
|
||||||
'form' => $form->createView(),
|
));
|
||||||
'task' => $task,
|
|
||||||
'person' => $person,
|
|
||||||
));
|
|
||||||
break;
|
|
||||||
case 'course':
|
|
||||||
return $this->render('@ChillTask/SingleTask/AccompanyingCourse/new.html.twig', array(
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'task' => $task,
|
|
||||||
'accompanyingCourse' => $course,
|
|
||||||
));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @Route(
|
||||||
* "/{_locale}/task/single-task/{id}/show",
|
* "/{_locale}/task/single-task/{id}/show",
|
||||||
* name="chill_task_single_task_show"
|
* name="chill_task_single_task_show"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function showAction($id)
|
public function showAction(Request $request, $id)
|
||||||
{
|
{
|
||||||
|
|
||||||
// $em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$task = $this->taskRepository->find($id);
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
|
|
||||||
|
if ($task->getPerson() !== null) {
|
||||||
|
$personId = $task->getPerson()->getId();
|
||||||
|
|
||||||
|
if ($personId === null) {
|
||||||
|
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
||||||
|
}
|
||||||
|
|
||||||
|
$person = $this->getDoctrine()->getManager()
|
||||||
|
->getRepository(Person::class)
|
||||||
|
->find($personId);
|
||||||
|
|
||||||
|
if ($person === null) {
|
||||||
|
throw $this->createNotFoundException("Invalid person id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $task, 'You are not '
|
||||||
|
. 'allowed to view this task');
|
||||||
|
|
||||||
if (!$task) {
|
if (!$task) {
|
||||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($task->getPerson() !== null) {
|
$timeline = $this->timelineBuilder
|
||||||
|
->getTimelineHTML('task', array('task' => $task));
|
||||||
$person = $task->getPerson();
|
|
||||||
|
$event = new PrivacyEvent($person, array(
|
||||||
if ($person === null) {
|
|
||||||
throw $this->createNotFoundException("Invalid person id");
|
|
||||||
}
|
|
||||||
|
|
||||||
$event = new PrivacyEvent($person, array(
|
|
||||||
'element_class' => SingleTask::class,
|
'element_class' => SingleTask::class,
|
||||||
'element_id' => $task->getId(),
|
'element_id' => $task->getId(),
|
||||||
'action' => 'show'
|
'action' => 'show'
|
||||||
));
|
));
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
}
|
return $this->render('ChillTaskBundle:SingleTask:show.html.twig', array(
|
||||||
|
'task' => $task,
|
||||||
if ($task->getCourse() === null)
|
'timeline' => $timeline
|
||||||
{
|
));
|
||||||
return new Response("You must provide a course_id", Response::HTTP_BAD_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(TaskVoter::SHOW, $task, 'You are not '
|
|
||||||
. 'allowed to view this task');
|
|
||||||
|
|
||||||
$timeline = $this->timelineBuilder
|
|
||||||
->getTimelineHTML('task', array('task' => $task));
|
|
||||||
|
|
||||||
|
|
||||||
if($task->getContext() instanceof Person){
|
|
||||||
return $this->render('@ChillTask/SingleTask/Person/show.html.twig', array(
|
|
||||||
'task' => $task,
|
|
||||||
'timeline' => $timeline
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
return $this->render('@ChillTask/SingleTask/AccompanyingCourse/show.html.twig', array(
|
|
||||||
'task' => $task,
|
|
||||||
'timeline' => $timeline
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -274,30 +198,28 @@ class SingleTaskController extends AbstractController
|
|||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function editAction(
|
public function editAction(
|
||||||
|
Request $request,
|
||||||
$id,
|
$id,
|
||||||
TranslationTranslatorInterface $translator,
|
TranslatorInterface $translator
|
||||||
Request $request
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
$task = $em->getRepository(SingleTask::class)->find($id);
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
|
|
||||||
if ($task->getContext() instanceof Person) {
|
if ($task->getPerson() !== null) {
|
||||||
|
$personId = $task->getPerson()->getId();
|
||||||
$person = $task->getPerson();
|
if ($personId === null) {
|
||||||
if ($person === null) {
|
|
||||||
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
$person = $this->getDoctrine()->getManager()
|
||||||
|
->getRepository(Person::class)
|
||||||
|
->find($personId);
|
||||||
|
|
||||||
$course = $task->getCourse();
|
if ($person === null) {
|
||||||
|
throw $this->createNotFoundException("Invalid person id");
|
||||||
if ($course === null) {
|
|
||||||
throw $this->createNotFoundException("Invalid accompanying period id");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(TaskVoter::UPDATE, $task, 'You are not '
|
$this->denyAccessUnlessGranted(TaskVoter::UPDATE, $task, 'You are not '
|
||||||
. 'allowed to edit this task');
|
. 'allowed to edit this task');
|
||||||
|
|
||||||
@@ -324,25 +246,19 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
$this->addFlash('success', $translator
|
$this->addFlash('success', $translator
|
||||||
->trans("The task has been updated"));
|
->trans("The task has been updated"));
|
||||||
|
|
||||||
if($task->getContext() instanceof Person){
|
$event = new PrivacyEvent($person, array(
|
||||||
$event = new PrivacyEvent($person, array(
|
|
||||||
'element_class' => SingleTask::class,
|
'element_class' => SingleTask::class,
|
||||||
'element_id' => $task->getId(),
|
'element_id' => $task->getId(),
|
||||||
'action' => 'update'
|
'action' => 'update'
|
||||||
));
|
));
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
|
return $this->redirectToRoute(
|
||||||
|
'chill_task_singletask_list',
|
||||||
|
$request->query->get('list_params', [])
|
||||||
|
);
|
||||||
|
|
||||||
return $this->redirectToRoute(
|
|
||||||
'chill_task_singletask_list',
|
|
||||||
$request->query->get('list_params', [])
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return $this->redirectToRoute(
|
|
||||||
'chill_task_singletask_courselist',
|
|
||||||
$request->query->get('list_params', [])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$this->addFlash('error', $translator->trans("This form contains errors"));
|
$this->addFlash('error', $translator->trans("This form contains errors"));
|
||||||
}
|
}
|
||||||
@@ -354,26 +270,17 @@ class SingleTaskController extends AbstractController
|
|||||||
return $event->getResponse();
|
return $event->getResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($task->getContext() instanceof Person){
|
$event = new PrivacyEvent($person, array(
|
||||||
$event = new PrivacyEvent($person, array(
|
'element_class' => SingleTask::class,
|
||||||
'element_class' => SingleTask::class,
|
'element_id' => $task->getId(),
|
||||||
'element_id' => $task->getId(),
|
'action' => 'edit'
|
||||||
'action' => 'edit'
|
));
|
||||||
));
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
|
||||||
|
return $this->render('ChillTaskBundle:SingleTask:edit.html.twig', array(
|
||||||
return $this->render('@ChillTask/SingleTask/Person/edit.html.twig', array(
|
'task' => $task,
|
||||||
'task' => $task,
|
'form' => $form->createView()
|
||||||
'form' => $form->createView()
|
));
|
||||||
));
|
|
||||||
} else {
|
|
||||||
return $this->render('@ChillTask/SingleTask/AccompanyingCourse/edit.html.twig', array(
|
|
||||||
'task' => $task,
|
|
||||||
'form' => $form->createView(),
|
|
||||||
'accompanyingCourse' => $course
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -386,9 +293,11 @@ class SingleTaskController extends AbstractController
|
|||||||
public function deleteAction(
|
public function deleteAction(
|
||||||
Request $request,
|
Request $request,
|
||||||
$id,
|
$id,
|
||||||
TranslationTranslatorInterface $translator
|
TranslatorInterface $translator
|
||||||
) {
|
) {
|
||||||
$task = $this->taskRepository->find($id);
|
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
$task = $em->getRepository(SingleTask::class)->find($id);
|
||||||
|
|
||||||
if (!$task) {
|
if (!$task) {
|
||||||
throw $this->createNotFoundException('Unable to find Task entity.');
|
throw $this->createNotFoundException('Unable to find Task entity.');
|
||||||
@@ -400,31 +309,18 @@ class SingleTaskController extends AbstractController
|
|||||||
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
return new Response("You must provide a person_id", Response::HTTP_BAD_REQUEST);
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = $this->personRepository
|
$person = $this->getDoctrine()->getManager()
|
||||||
|
->getRepository(Person::class)
|
||||||
->find($personId);
|
->find($personId);
|
||||||
|
|
||||||
if ($person === null) {
|
if ($person === null) {
|
||||||
throw $this->createNotFoundException("Invalid person id");
|
throw $this->createNotFoundException("Invalid person id");
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
$courseId = $task->getCourse()->getId();
|
|
||||||
if ($courseId === null){
|
|
||||||
return new Response("You must provide a course_id", Response::HTTP_BAD_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
$course = $this->courseRepository
|
|
||||||
->find($courseId);
|
|
||||||
|
|
||||||
if($course === null){
|
|
||||||
throw $this->createNotFoundException("Invalid accompanying period id");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: reactivate right to delete
|
$this->denyAccessUnlessGranted(TaskVoter::DELETE, $task, 'You are not '
|
||||||
|
. 'allowed to delete this task');
|
||||||
// $this->denyAccessUnlessGranted(TaskVoter::DELETE, $task, 'You are not '
|
|
||||||
// . 'allowed to delete this task');
|
|
||||||
|
|
||||||
$form = $this->createDeleteForm($id);
|
$form = $this->createDeleteForm($id);
|
||||||
|
|
||||||
@@ -438,8 +334,10 @@ class SingleTaskController extends AbstractController
|
|||||||
'task_id' => $task->getId(),
|
'task_id' => $task->getId(),
|
||||||
'description' => $task->getDescription(),
|
'description' => $task->getDescription(),
|
||||||
'assignee' => $task->getAssignee(),
|
'assignee' => $task->getAssignee(),
|
||||||
// TODO reimplement scope
|
'scope_id' => $task->getScope()->getId(),
|
||||||
// 'scope_id' => $task->getScope()->getId(),
|
//'start_date' => $task->getStartDate()->format('Y-m-d'),
|
||||||
|
//'end_date' => $task->getEndDate()->format('Y-m-d'),
|
||||||
|
//'warning_interval' => $task->getWarningInterval()->format('Y-m-d')
|
||||||
));
|
));
|
||||||
|
|
||||||
$em = $this->getDoctrine()->getManager();
|
$em = $this->getDoctrine()->getManager();
|
||||||
@@ -449,35 +347,19 @@ class SingleTaskController extends AbstractController
|
|||||||
$this->addFlash('success', $translator
|
$this->addFlash('success', $translator
|
||||||
->trans("The task has been successfully removed."));
|
->trans("The task has been successfully removed."));
|
||||||
|
|
||||||
if($task->getContext() instanceof Person){
|
return $this->redirect($this->generateUrl(
|
||||||
return $this->redirect($this->generateUrl(
|
'chill_task_singletask_list',
|
||||||
'chill_task_singletask_list',
|
$request->query->get('list_params', [
|
||||||
$request->query->get('list_params', [
|
'person_id' => $person->getId()
|
||||||
'person_id' => $person->getId()
|
])));
|
||||||
])));
|
|
||||||
} else {
|
|
||||||
return $this->redirect($this->generateUrl(
|
|
||||||
'chill_task_singletask_courselist',
|
|
||||||
$request->query->get('list_params', [
|
|
||||||
'course_id' => $course->getId()
|
|
||||||
])));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($task->getContext() instanceof Person){
|
|
||||||
return $this->render('@ChillTask/SingleTask/Person/confirm_delete.html.twig', array(
|
|
||||||
'task' => $task,
|
|
||||||
'delete_form' => $form->createView()
|
|
||||||
));
|
|
||||||
} else {
|
|
||||||
return $this->render('@ChillTask/SingleTask/AccompanyingCourse/confirm_delete.html.twig', array(
|
|
||||||
'task' => $task,
|
|
||||||
'delete_form' => $form->createView(),
|
|
||||||
'accompanyingCourse' => $course
|
|
||||||
));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
return $this->render('ChillTaskBundle:SingleTask:confirm_delete.html.twig', array(
|
||||||
|
'task' => $task,
|
||||||
|
'delete_form' => $form->createView()
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -490,7 +372,7 @@ class SingleTaskController extends AbstractController
|
|||||||
{
|
{
|
||||||
$form = $this->createForm(SingleTaskType::class, $task, [
|
$form = $this->createForm(SingleTaskType::class, $task, [
|
||||||
'center' => $task->getCenter(),
|
'center' => $task->getCenter(),
|
||||||
'role' => $role,
|
'role' => $role
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$form->add('submit', SubmitType::class);
|
$form->add('submit', SubmitType::class);
|
||||||
@@ -506,7 +388,7 @@ class SingleTaskController extends AbstractController
|
|||||||
* name="chill_task_single_my_tasks"
|
* name="chill_task_single_my_tasks"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function myTasksAction(TranslationTranslatorInterface $translator)
|
public function myTasksAction(TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
return $this->redirectToRoute('chill_task_singletask_list', [
|
return $this->redirectToRoute('chill_task_singletask_list', [
|
||||||
'user_id' => $this->getUser()->getId(),
|
'user_id' => $this->getUser()->getId(),
|
||||||
@@ -520,21 +402,22 @@ class SingleTaskController extends AbstractController
|
|||||||
* Arguments:
|
* Arguments:
|
||||||
* - user_id
|
* - user_id
|
||||||
* - scope_id
|
* - scope_id
|
||||||
* - course_id
|
|
||||||
* - person_id
|
* - person_id
|
||||||
* - hide_form (hide the form to filter the tasks)
|
* - hide_form (hide the form to filter the tasks)
|
||||||
* - status: date state, amongst SingleTaskRepository::DATE_STATUSES, or 'closed'
|
* - status: date state, amongst SingleTaskRepository::DATE_STATUSES, or 'closed'
|
||||||
*
|
*
|
||||||
* @Route(
|
* @Route(
|
||||||
* "/{_locale}/task/single-task/list",
|
* "/{_locale}/task/singletask/list",
|
||||||
* name="chill_task_singletask_list"
|
* name="chill_task_singletask_list"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
public function listAction(
|
public function listAction(
|
||||||
|
Request $request,
|
||||||
PaginatorFactory $paginatorFactory,
|
PaginatorFactory $paginatorFactory,
|
||||||
// SingleTaskRepository $taskRepository,
|
SingleTaskRepository $taskRepository,
|
||||||
FormFactoryInterface $formFactory,
|
PersonRepository $personRepository,
|
||||||
Request $request
|
CenterRepository $centerRepository,
|
||||||
|
FormFactoryInterface $formFactory
|
||||||
) {
|
) {
|
||||||
/* @var $viewParams array The parameters for the view */
|
/* @var $viewParams array The parameters for the view */
|
||||||
/* @var $params array The parameters for the query */
|
/* @var $params array The parameters for the query */
|
||||||
@@ -545,13 +428,13 @@ class SingleTaskController extends AbstractController
|
|||||||
$params['user'] = null;
|
$params['user'] = null;
|
||||||
$viewParams['center'] = null;
|
$viewParams['center'] = null;
|
||||||
$params['types'] = null;
|
$params['types'] = null;
|
||||||
$viewParams['accompanyingCourse'] = null;
|
|
||||||
$params['accompanyingCourse'] = null;
|
|
||||||
|
|
||||||
|
|
||||||
|
// Get parameters from url
|
||||||
if (!empty($request->query->get('person_id', NULL))) {
|
if (!empty($request->query->get('person_id', NULL))) {
|
||||||
|
|
||||||
$personId = $request->query->getInt('person_id', 0);
|
$personId = $request->query->getInt('person_id', 0);
|
||||||
$person = $this->personRepository->find($personId);
|
$person = $personRepository->find($personId);
|
||||||
|
|
||||||
if ($person === null) {
|
if ($person === null) {
|
||||||
throw $this->createNotFoundException("This person ' $personId ' does not exist.");
|
throw $this->createNotFoundException("This person ' $personId ' does not exist.");
|
||||||
@@ -561,23 +444,9 @@ class SingleTaskController extends AbstractController
|
|||||||
$viewParams['person'] = $person;
|
$viewParams['person'] = $person;
|
||||||
$params['person'] = $person;
|
$params['person'] = $person;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($request->query->get('course_id', NULL))) {
|
|
||||||
|
|
||||||
$courseId = $request->query->getInt('course_id', 0);
|
|
||||||
$course = $this->courseRepository->find($courseId);
|
|
||||||
|
|
||||||
if ($course === null) {
|
|
||||||
throw $this->createNotFoundException("This accompanying course ' $courseId ' does not exist.");
|
|
||||||
}
|
|
||||||
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::SEE, $course);
|
|
||||||
|
|
||||||
$viewParams['accompanyingCourse'] = $course;
|
|
||||||
$params['accompanyingCourse'] = $course;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!empty($request->query->get('center_id', NULL))) {
|
if (!empty($request->query->get('center_id', NULL))) {
|
||||||
$center = $this->centerRepository->find($this->request->query->getInt('center_id'));
|
$center = $centerRepository->find($request->query->getInt('center_id'));
|
||||||
if ($center === null) {
|
if ($center === null) {
|
||||||
throw $this->createNotFoundException('center not found');
|
throw $this->createNotFoundException('center not found');
|
||||||
}
|
}
|
||||||
@@ -585,7 +454,7 @@ class SingleTaskController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($request->query->get('types', []))) {
|
if(!empty($request->query->get('types', []))) {
|
||||||
$types = $this->request->query->get('types', []);
|
$types = $request->query->get('types', []);
|
||||||
if (count($types) > 0) {
|
if (count($types) > 0) {
|
||||||
$params['types'] = $types;
|
$params['types'] = $types;
|
||||||
}
|
}
|
||||||
@@ -598,7 +467,7 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
$userId = $request->query->getInt('user_id', 0);
|
$userId = $request->query->getInt('user_id', 0);
|
||||||
$user = $this->getDoctrine()->getManager()
|
$user = $this->getDoctrine()->getManager()
|
||||||
->getRepository(User::class)
|
->getRepository('ChillMainBundle:User')
|
||||||
->find($userId);
|
->find($userId);
|
||||||
|
|
||||||
if ($user === null) {
|
if ($user === null) {
|
||||||
@@ -614,7 +483,8 @@ class SingleTaskController extends AbstractController
|
|||||||
|
|
||||||
$scopeId = $request->query->getInt('scope_id', 0);
|
$scopeId = $request->query->getInt('scope_id', 0);
|
||||||
|
|
||||||
$scope = $this->scopeRepository
|
$scope = $this->getDoctrine()->getManager()
|
||||||
|
->getRepository('ChillMainBundle:Scope')
|
||||||
->find($scopeId);
|
->find($scopeId);
|
||||||
|
|
||||||
if ($scope === null) {
|
if ($scope === null) {
|
||||||
@@ -625,9 +495,11 @@ class SingleTaskController extends AbstractController
|
|||||||
$params['scope'] = $scope;
|
$params['scope'] = $scope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// collect parameters for filter
|
||||||
$possibleStatuses = \array_merge(SingleTaskRepository::DATE_STATUSES, [ 'closed' ]);
|
$possibleStatuses = \array_merge(SingleTaskRepository::DATE_STATUSES, [ 'closed' ]);
|
||||||
$statuses = $request->query->get('status', $possibleStatuses);
|
$statuses = $request->query->get('status', $possibleStatuses);
|
||||||
|
|
||||||
|
// check for invalid statuses
|
||||||
$diff = \array_diff($statuses, $possibleStatuses);
|
$diff = \array_diff($statuses, $possibleStatuses);
|
||||||
if (count($diff) > 0) {
|
if (count($diff) > 0) {
|
||||||
return new Response(
|
return new Response(
|
||||||
@@ -646,6 +518,7 @@ class SingleTaskController extends AbstractController
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// different query if regarding to date or 'closed'
|
||||||
if (in_array($status, SingleTaskRepository::DATE_STATUSES)) {
|
if (in_array($status, SingleTaskRepository::DATE_STATUSES)) {
|
||||||
$params['date_status'] = $status;
|
$params['date_status'] = $status;
|
||||||
$params['is_closed'] = false;
|
$params['is_closed'] = false;
|
||||||
@@ -654,14 +527,14 @@ class SingleTaskController extends AbstractController
|
|||||||
$params['is_closed'] = true;
|
$params['is_closed'] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = $this->taskRepository
|
$count = $taskRepository
|
||||||
->countByParameters($params, $this->getUser())
|
->countByParameters($params, $this->getUser())
|
||||||
;
|
;
|
||||||
$paginator = $paginatorFactory->create($count);
|
$paginator = $paginatorFactory->create($count);
|
||||||
|
|
||||||
$viewParams['single_task_'.$status.'_count'] = $count;
|
$viewParams['single_task_'.$status.'_count'] = $count;
|
||||||
$viewParams['single_task_'.$status.'_paginator'] = $paginator;
|
$viewParams['single_task_'.$status.'_paginator'] = $paginator;
|
||||||
$viewParams['single_task_'.$status.'_tasks'] = $this->taskRepository
|
$viewParams['single_task_'.$status.'_tasks'] = $taskRepository
|
||||||
->findByParameters($params, $this->getUser(),
|
->findByParameters($params, $this->getUser(),
|
||||||
$singleStatus ? $paginator->getCurrentPage()->getFirstItemNumber() : 0,
|
$singleStatus ? $paginator->getCurrentPage()->getFirstItemNumber() : 0,
|
||||||
$singleStatus ? $paginator->getItemsPerPage() : 10)
|
$singleStatus ? $paginator->getItemsPerPage() : 10)
|
||||||
@@ -670,16 +543,16 @@ class SingleTaskController extends AbstractController
|
|||||||
$tasks_count = $tasks_count + $count;
|
$tasks_count = $tasks_count + $count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// total number of tasks
|
||||||
$viewParams['tasks_count'] = $tasks_count;
|
$viewParams['tasks_count'] = $tasks_count;
|
||||||
|
|
||||||
if ($viewParams['person'] !== null){
|
if ($viewParams['person'] !== null){
|
||||||
$viewParams['layout'] = '@ChillPerson/Person/layout.html.twig';
|
$viewParams['layout'] = '@ChillPerson/Person/layout.html.twig';
|
||||||
} else if ($viewParams['accompanyingCourse'] !== null){
|
|
||||||
$viewParams['layout'] = '@ChillPerson/AccompanyingCourse/layout.html.twig';
|
|
||||||
} else {
|
} else {
|
||||||
$viewParams['layout'] = '@ChillMain/layout.html.twig';
|
$viewParams['layout'] = '@ChillMain/layout.html.twig';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Form for filtering tasks
|
||||||
$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,
|
||||||
@@ -697,14 +570,14 @@ class SingleTaskController extends AbstractController
|
|||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('@ChillTask/SingleTask/index.html.twig',
|
return $this->render('ChillTaskBundle:SingleTask:index.html.twig',
|
||||||
array_merge($viewParams, [ 'form' => $form->createView() ]));
|
\array_merge($viewParams, [ 'form' => $form->createView() ]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function getPersonParam(Request $request)
|
protected function getPersonParam(Request $request, EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$person = $this->personRepository
|
$person = $em->getRepository(Person::class)
|
||||||
->find($request->query->getInt('person_id'))
|
->find($request->query->getInt('person_id'))
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -718,9 +591,9 @@ class SingleTaskController extends AbstractController
|
|||||||
return $person;
|
return $person;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getUserParam(Request $request)
|
protected function getUserParam(Request $request, EntityManagerInterface $em)
|
||||||
{
|
{
|
||||||
$user = $this->userRepository
|
$user = $em->getRepository(User::class)
|
||||||
->find($request->query->getInt('user_id'))
|
->find($request->query->getInt('user_id'))
|
||||||
;
|
;
|
||||||
|
|
||||||
@@ -750,55 +623,4 @@ class SingleTaskController extends AbstractController
|
|||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* "/{_locale}/task/single-task/courselist",
|
|
||||||
* name="chill_task_singletask_courselist")
|
|
||||||
*/
|
|
||||||
|
|
||||||
public function listCourseTasks(
|
|
||||||
FormFactoryInterface $formFactory,
|
|
||||||
TranslationTranslatorInterface $translator,
|
|
||||||
Request $request
|
|
||||||
): Response
|
|
||||||
{
|
|
||||||
|
|
||||||
if (!empty($request->query->get('course_id', NULL))) {
|
|
||||||
|
|
||||||
$courseId = $request->query->getInt('course_id', 0);
|
|
||||||
$course = $this->courseRepository->find($courseId);
|
|
||||||
|
|
||||||
if ($course === null) {
|
|
||||||
throw $this->createNotFoundException("This accompanying course ' $courseId ' does not exist.");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if($course === NULL) {
|
|
||||||
throw $this->createNotFoundException('Accompanying course not found');
|
|
||||||
}
|
|
||||||
|
|
||||||
$tasks = $this->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(
|
|
||||||
'@ChillTask/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')
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -64,7 +64,7 @@ class TaskController extends AbstractController
|
|||||||
'id' => $task->getId(),
|
'id' => $task->getId(),
|
||||||
'list_params' => $request->query->get('list_params', [])
|
'list_params' => $request->query->get('list_params', [])
|
||||||
]);
|
]);
|
||||||
$task->getCourse() === null ? $defaultTemplate = '@ChillTask/SingleTask/Person/transition.html.twig' : $defaultTemplate = '@ChillTask/SingleTask/AccompanyingCourse/transition.html.twig';
|
$defaultTemplate = '@ChillTask/SingleTask/transition.html.twig';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return new Response("The type '$kind' is not implemented",
|
return new Response("The type '$kind' is not implemented",
|
||||||
|
@@ -10,7 +10,6 @@ use Chill\MainBundle\Entity\HasScopeInterface;
|
|||||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
use Chill\MainBundle\Validator\Constraints\Entity\UserCircleConsistency;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AbstractTask
|
* AbstractTask
|
||||||
@@ -68,16 +67,9 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
|||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
* targetEntity="\Chill\PersonBundle\Entity\Person"
|
* targetEntity="\Chill\PersonBundle\Entity\Person"
|
||||||
* )
|
* )
|
||||||
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $person;
|
private $person;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var AccompanyingPeriod
|
|
||||||
* @ORM\ManyToOne(targetEntity="\Chill\PersonBundle\Entity\AccompanyingPeriod")
|
|
||||||
*/
|
|
||||||
|
|
||||||
private $course;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -85,6 +77,7 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
|||||||
* @ORM\ManyToOne(
|
* @ORM\ManyToOne(
|
||||||
* targetEntity="\Chill\MainBundle\Entity\Scope"
|
* targetEntity="\Chill\MainBundle\Entity\Scope"
|
||||||
* )
|
* )
|
||||||
|
* @Assert\NotNull()
|
||||||
*/
|
*/
|
||||||
private $circle;
|
private $circle;
|
||||||
|
|
||||||
@@ -209,11 +202,6 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
|||||||
return $this->person;
|
return $this->person;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCourse(): ?AccompanyingPeriod
|
|
||||||
{
|
|
||||||
return $this->course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getCircle(): ?Scope
|
public function getCircle(): ?Scope
|
||||||
{
|
{
|
||||||
return $this->circle;
|
return $this->circle;
|
||||||
@@ -231,12 +219,6 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCourse(AccompanyingPeriod $course)
|
|
||||||
{
|
|
||||||
$this->course = $course;
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setCircle(Scope $circle)
|
public function setCircle(Scope $circle)
|
||||||
{
|
{
|
||||||
$this->circle = $circle;
|
$this->circle = $circle;
|
||||||
@@ -247,23 +229,11 @@ abstract class AbstractTask implements HasScopeInterface, HasCenterInterface
|
|||||||
{
|
{
|
||||||
if ($this->getPerson() instanceof Person) {
|
if ($this->getPerson() instanceof Person) {
|
||||||
return $this->getPerson()->getCenter();
|
return $this->getPerson()->getCenter();
|
||||||
} else {
|
|
||||||
return $this->getCourse()->getCenter();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContext()
|
|
||||||
{
|
|
||||||
// if ($this->getCourse() instanceof AccompanyingPeriod){
|
|
||||||
// return $this->getCourse();
|
|
||||||
// } else {
|
|
||||||
// return $this->getPerson();
|
|
||||||
// }
|
|
||||||
return $this->getPerson() ?? $this->getCourse();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getScope(): ?\Chill\MainBundle\Entity\Scope
|
public function getScope(): ?\Chill\MainBundle\Entity\Scope
|
||||||
{
|
{
|
||||||
|
@@ -284,7 +284,6 @@ class SingleTaskListType extends AbstractType
|
|||||||
->setDefined('person')
|
->setDefined('person')
|
||||||
->setDefault('person', null)
|
->setDefault('person', null)
|
||||||
->setAllowedTypes('person', [Person::class, 'null'])
|
->setAllowedTypes('person', [Person::class, 'null'])
|
||||||
->setDefined('accompanyingCourse')
|
|
||||||
->setDefined('add_status')
|
->setDefined('add_status')
|
||||||
->setDefault('add_status', false)
|
->setDefault('add_status', false)
|
||||||
->setAllowedTypes('add_status', ['bool'])
|
->setAllowedTypes('add_status', ['bool'])
|
||||||
|
@@ -48,12 +48,11 @@ class SingleTaskType extends AbstractType
|
|||||||
'center' => $options['center'],
|
'center' => $options['center'],
|
||||||
'role' => $options['role'],
|
'role' => $options['role'],
|
||||||
'placeholder' => 'Not assigned'
|
'placeholder' => 'Not assigned'
|
||||||
])
|
])
|
||||||
->add('circle', ScopePickerType::class, [
|
->add('circle', ScopePickerType::class, [
|
||||||
'center' => $options['center'],
|
'center' => $options['center'],
|
||||||
'role' => $options['role'],
|
'role' => $options['role']
|
||||||
'required' => false
|
])
|
||||||
])
|
|
||||||
->add('startDate', ChillDateType::class, [
|
->add('startDate', ChillDateType::class, [
|
||||||
'required' => false
|
'required' => false
|
||||||
])
|
])
|
||||||
@@ -62,7 +61,8 @@ class SingleTaskType extends AbstractType
|
|||||||
])
|
])
|
||||||
->add('warningInterval', DateIntervalType::class, [
|
->add('warningInterval', DateIntervalType::class, [
|
||||||
'required' => false
|
'required' => false
|
||||||
]);
|
])
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
@@ -28,7 +28,7 @@ use Symfony\Component\Translation\TranslatorInterface;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class MenuBuilder implements LocalMenuBuilderInterface
|
class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -53,55 +53,28 @@ class MenuBuilder implements LocalMenuBuilderInterface
|
|||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||||
{
|
{
|
||||||
switch($menuId) {
|
/* @var $person \Chill\PersonBundle\Entity\Person */
|
||||||
case 'person':
|
|
||||||
$this->buildPersonMenu($menu, $parameters);
|
|
||||||
break;
|
|
||||||
case 'accompanyingCourse':
|
|
||||||
$this->buildAccompanyingCourseMenu($menu, $parameters);
|
|
||||||
break;
|
|
||||||
case 'section':
|
|
||||||
$menu->setExtras('icons', 'tasks');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new \LogicException("this menuid $menuId is not implemented");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildPersonMenu($menu, $parameters){
|
|
||||||
|
|
||||||
//var $person \Chill\PersonBundle\Entity\Person */
|
|
||||||
$person = $parameters['person'] ?? null;
|
$person = $parameters['person'] ?? null;
|
||||||
|
|
||||||
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $person)) {
|
if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $person)) {
|
||||||
$menu->addChild(
|
$menu->addChild(
|
||||||
$this->translator->trans('Tasks'), [
|
$this->translator->trans('Tasks'), [
|
||||||
'route' => 'chill_task_singletask_list',
|
'route' => 'chill_task_singletask_list',
|
||||||
'routeParameters' =>
|
'routeParameters' => $menuId === 'person' ?
|
||||||
[ 'person_id' => $person->getId() ]
|
[ 'person_id' => $person->getId() ]
|
||||||
])
|
:
|
||||||
->setExtra('order', 400);
|
null,
|
||||||
|
])
|
||||||
|
->setExtra('order', 400)
|
||||||
|
;
|
||||||
|
if ($menuId === 'section') {
|
||||||
|
$menu->setExtra('icons', 'tasks');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildAccompanyingCourseMenu($menu, $parameters){
|
|
||||||
|
|
||||||
$course = $parameters['accompanyingCourse'];
|
|
||||||
|
|
||||||
// if ($this->authorizationChecker->isGranted(TaskVoter::SHOW, $course)) {
|
|
||||||
$menu->addChild(
|
|
||||||
$this->translator->trans('Tasks'), [
|
|
||||||
'route' => 'chill_task_singletask_courselist',
|
|
||||||
'routeParameters' =>
|
|
||||||
[ 'course_id' => $course->getId() ]
|
|
||||||
])
|
|
||||||
->setExtra('order', 400);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return ['person', 'accompanyingCourse'];
|
return ['person'];
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,19 +0,0 @@
|
|||||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_task_list' %}
|
|
||||||
{% set course = task.course %}
|
|
||||||
|
|
||||||
{% block title 'Remove task'|trans %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
{{ include('@ChillMain/Util/confirmation_template.html.twig',
|
|
||||||
{
|
|
||||||
'title' : 'Remove task'|trans,
|
|
||||||
'confirm_question' : 'Are you sure you want to remove the task about accompanying period "%id%" ?'|trans({ '%id%' : course.id } ),
|
|
||||||
'cancel_route' : 'chill_task_singletask_courselist',
|
|
||||||
'cancel_parameters' : app.request.query.get('list_params', { } ),
|
|
||||||
'form' : delete_form,
|
|
||||||
} ) }}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,15 +0,0 @@
|
|||||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_edit' %}
|
|
||||||
{% set course = task.course %}
|
|
||||||
|
|
||||||
{% block title %}
|
|
||||||
{{ 'Edit task'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
{% include '@ChillTask/SingleTask/_edit.html.twig' %}
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,106 +0,0 @@
|
|||||||
{% 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>
|
|
@@ -1,13 +0,0 @@
|
|||||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
|
||||||
{# {% set person = task.person %} #}
|
|
||||||
|
|
||||||
{% block title %}
|
|
||||||
{{ 'New task'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
{% include '@ChillTask/SingleTask/_new.html.twig' %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,17 +0,0 @@
|
|||||||
{% 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 '@ChillTask/SingleTask/_show.html.twig' %}
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,12 +0,0 @@
|
|||||||
{% extends "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_task_list' %}
|
|
||||||
{% set accompanyingCourse = task.course %}
|
|
||||||
|
|
||||||
{% block title 'Remove task'|trans %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
{% include '@ChillTask/SingleTask/_transition.html.twig' %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,31 +0,0 @@
|
|||||||
{#
|
|
||||||
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#}
|
|
||||||
{% extends person is defined ? "@ChillPerson/Person/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_edit' %}
|
|
||||||
{% set person = task.person %}
|
|
||||||
|
|
||||||
{% block title %}
|
|
||||||
{{ 'Edit task'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block personcontent %}
|
|
||||||
|
|
||||||
{% include '@ChillTask/SingleTask/_edit.html.twig' %}
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,257 +0,0 @@
|
|||||||
{% macro date_status(title, tasks, count, paginator, status, isSingleStatus, person, user) %}
|
|
||||||
{% 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>
|
|
||||||
|
|
||||||
{% if person is null %}
|
|
||||||
<div>
|
|
||||||
<span class="chill-task-list__row__person-for">{{ 'For person'|trans }} :</span>
|
|
||||||
<span class="chill-task-list__row__person">
|
|
||||||
<a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a>
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<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>
|
|
||||||
|
|
||||||
{% 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="btn btn-cancel">
|
|
||||||
{{ 'Back to the list' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if user is not null %}
|
|
||||||
<a href="{{ path('chill_task_singletask_list') }}" class="btn btn-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="btn btn-create">
|
|
||||||
{{ 'Add a new task' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
{% if user is not null %}
|
|
||||||
<a href="{{ path('chill_task_single_task_new') }}" class="btn btn-create">
|
|
||||||
{{ 'Add a new task' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{% else %}
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_task_singletask_list', app.request.query.all|merge({ 'status': [ status ] })) }}" class="btn btn-misc">
|
|
||||||
{{ 'See more' | trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
{% endmacro %}
|
|
||||||
|
|
||||||
{% import _self as helper %}
|
|
||||||
|
|
||||||
<h1>{{ app.request.query.get('title', null)|escape('html')|default('Task list'|trans) }}</h1>
|
|
||||||
|
|
||||||
{% if false == app.request.query.boolean('hide_form', false) %}
|
|
||||||
<h2>{{ 'Filter the tasks'|trans }}</h2>
|
|
||||||
{{ form_start(form) }}
|
|
||||||
{{ form_row(form.user_id) }}
|
|
||||||
|
|
||||||
{% if form.status is defined %}
|
|
||||||
{{ form_row(form.status) }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if form.types is defined %}
|
|
||||||
{{ form_row(form.types) }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if form.person_id is defined %}
|
|
||||||
{{ form_row(form.person_id) }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if form.center_id is defined %}
|
|
||||||
{{ form_row(form.center_id) }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
<button type="submit" class="btn btn-submit">{{ 'Filter'|trans }}</button>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{{ form_end(form)}}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if tasks_count == 0 %}
|
|
||||||
<p class="chill-no-data-statement">{{ "There is no tasks."|trans }}</p>
|
|
||||||
{% if person is not null and is_granted('CHILL_TASK_TASK_CREATE', person) %}
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
{% if person is not null %}
|
|
||||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
|
||||||
{{ 'Add a new task' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
{% else %}
|
|
||||||
|
|
||||||
{% if false == app.request.query.boolean('hide_form', false) %}
|
|
||||||
<h2>{{ 'Tasks'|trans }}</h2>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{# TODO reimplement right to create task. #}
|
|
||||||
{# {% if person is not null and is_granted('CHILL_TASK_TASK_CREATE', person) %} #}
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li>
|
|
||||||
{% if person is not null %}
|
|
||||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
|
||||||
{{ 'Add a new task' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{# {% endif %} #}
|
|
||||||
|
|
||||||
{% 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 tasks', 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 and is_granted('CHILL_TASK_TASK_CREATE', person) %}
|
|
||||||
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
|
||||||
{{ 'Add a new task' | trans }}
|
|
||||||
</a>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% 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>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
@@ -1,33 +0,0 @@
|
|||||||
{#
|
|
||||||
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
#}
|
|
||||||
{% extends person is defined ? "@ChillPerson/Person/layout.html.twig" : "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
|
||||||
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
|
||||||
{% set person = task.person %}
|
|
||||||
|
|
||||||
{% block title %}
|
|
||||||
{{ 'Task'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block personcontent %}
|
|
||||||
|
|
||||||
{% include '@ChillTask/SingleTask/_show.html.twig' %}
|
|
||||||
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,12 +0,0 @@
|
|||||||
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_task_list' %}
|
|
||||||
{% set person = task.person %}
|
|
||||||
|
|
||||||
{% block title 'Remove task'|trans %}
|
|
||||||
|
|
||||||
{% block personcontent %}
|
|
||||||
|
|
||||||
{% include '@ChillTask/SingleTask/_transition.html.twig' %}
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@@ -1,25 +0,0 @@
|
|||||||
<div class="task-edit">
|
|
||||||
|
|
||||||
<h1>{{ 'Edit task'|trans }}</h1>
|
|
||||||
|
|
||||||
{{ form_start(form) }}
|
|
||||||
|
|
||||||
{{ form_row(form.title) }}
|
|
||||||
{{ form_row(form.description) }}
|
|
||||||
{{ form_row(form.assignee) }}
|
|
||||||
{{ form_row(form.circle) }}
|
|
||||||
{{ form_row(form.startDate) }}
|
|
||||||
{{ form_row(form.endDate) }}
|
|
||||||
{{ form_row(form.warningInterval) }}
|
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
|
||||||
<li class="cancel">
|
|
||||||
<a class="btn btn-cancel" href={% if task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
|
|
||||||
{{ 'Cancel'|trans }}</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
{{ form_end(form) }}
|
|
||||||
</div>
|
|
@@ -0,0 +1,244 @@
|
|||||||
|
{% macro date_status(title, tasks, count, paginator, status, isSingleStatus, person, user) %}
|
||||||
|
{% 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>
|
||||||
|
|
||||||
|
{% if person is null %}
|
||||||
|
<div>
|
||||||
|
<span class="chill-task-list__row__person-for">{{ 'For person'|trans }} :</span> <span class="chill-task-list__row__person"><a href="{{ path('chill_person_view', {person_id : task.person.Id}) }}">{{ task.person}}</a></span>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<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>
|
||||||
|
|
||||||
|
{% 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="btn btn-cancel">
|
||||||
|
{{ 'Back to the list' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if user is not null %}
|
||||||
|
<a href="{{ path('chill_task_singletask_list') }}" class="btn btn-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="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
{% if user is not null %}
|
||||||
|
<a href="{{ path('chill_task_single_task_new') }}" class="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_task_singletask_list', app.request.query.all|merge({ 'status': [ status ] })) }}" class="btn btn-misc">
|
||||||
|
{{ 'See more' | trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% import _self as helper %}
|
||||||
|
|
||||||
|
<h1>{{ app.request.query.get('title', null)|escape('html')|default('Task list'|trans) }}</h1>
|
||||||
|
|
||||||
|
{% if false == app.request.query.boolean('hide_form', false) %}
|
||||||
|
<h2>{{ 'Filter the tasks'|trans }}</h2>
|
||||||
|
{{ form_start(form) }}
|
||||||
|
{{ form_row(form.user_id) }}
|
||||||
|
|
||||||
|
{% if form.status is defined %}
|
||||||
|
{{ form_row(form.status) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if form.types is defined %}
|
||||||
|
{{ form_row(form.types) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if form.person_id is defined %}
|
||||||
|
{{ form_row(form.person_id) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if form.center_id is defined %}
|
||||||
|
{{ form_row(form.center_id) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
<button type="submit" class="btn btn-submit">{{ 'Filter'|trans }}</button>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{ form_end(form)}}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if tasks_count == 0 %}
|
||||||
|
<p class="chill-no-data-statement">{{ "There is no tasks."|trans }}</p>
|
||||||
|
{% if person is not null and is_granted('CHILL_TASK_TASK_CREATE', person) %}
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
{% if person is not null %}
|
||||||
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
{% if false == app.request.query.boolean('hide_form', false) %}
|
||||||
|
<h2>{{ 'Tasks'|trans }}</h2>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if person is not null and is_granted('CHILL_TASK_TASK_CREATE', person) %}
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li>
|
||||||
|
{% if person is not null %}
|
||||||
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% 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 tasks', 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 and is_granted('CHILL_TASK_TASK_CREATE', person) %}
|
||||||
|
<a href="{{ path('chill_task_single_task_new', {'person_id': person.id}) }}" class="btn btn-create">
|
||||||
|
{{ 'Add a new task' | trans }}
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
@@ -1,30 +0,0 @@
|
|||||||
<div class="task-new">
|
|
||||||
|
|
||||||
<h1>{{ 'New task'|trans }}</h1>
|
|
||||||
|
|
||||||
{{ form_start(form) }}
|
|
||||||
|
|
||||||
{{ form_errors(form) }}
|
|
||||||
|
|
||||||
{{ form_row(form.title) }}
|
|
||||||
{{ form_row(form.description) }}
|
|
||||||
{{ form_row(form.assignee) }}
|
|
||||||
{{ form_row(form.circle) }}
|
|
||||||
{{ form_row(form.startDate) }}
|
|
||||||
{{ form_row(form.endDate) }}
|
|
||||||
{{ form_row(form.warningInterval) }}
|
|
||||||
|
|
||||||
<ul class="record_actions sticky-form-buttons">
|
|
||||||
<li class="cancel">
|
|
||||||
<a class="btn btn-cancel" href={% if task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
|
|
||||||
{{'Cancel'|trans}}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
{{ form_widget(form.submit, { 'label': 'Add a new task'|trans, 'attr': {'class': 'btn btn-save'} }) }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{{ form_end(form) }}
|
|
||||||
|
|
||||||
</div>
|
|
@@ -1,112 +0,0 @@
|
|||||||
<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>
|
|
||||||
|
|
||||||
{% if task.scope is not null %}
|
|
||||||
<dt class="inline">{{ 'Scope'|trans }}</dt>
|
|
||||||
<dd>
|
|
||||||
<span class="scope">{{ task.scope.name|localize_translatable_string }}</span>
|
|
||||||
</dd>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<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 task.person is not null %} "{{ path('chill_task_singletask_list', { 'person_id': task.person.id, 'list_params': app.request.query.get('list_params', {} )} ) }}" {% else %} "{{ chill_return_path_or('chill_task_singletask_courselist', {'course_id': task.course.id}) }}" {% endif %}>
|
|
||||||
{{'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, 'list_params': app.request.query.all['list_params'] }) }}">
|
|
||||||
{{ '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, 'list_params': app.request.query.all['list_params'] } ) }}" class="btn btn-delete">
|
|
||||||
{{ 'Delete'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul></div>
|
|
@@ -1,23 +0,0 @@
|
|||||||
<h2>{{ 'Apply transition on task <em>%title%</em>'|trans({ '%title%': task.title } )|raw }}</h2>
|
|
||||||
|
|
||||||
|
|
||||||
{% if task_workflow_metadata(task, 'transition.sentence_confirmation', transition) is not empty %}
|
|
||||||
<p class="message-confirm">{{ task_workflow_metadata(task, 'transition.sentence_confirmation', transition)|trans }}</p>
|
|
||||||
{% else %}
|
|
||||||
<p>{{ 'Are you sure to apply the transition %name% on this task ?'|trans({ '%name%': task_workflow_metadata(task, 'transition.name', transition)|default(transition.name)|trans }) }}</p>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{{ form_start(form) }}
|
|
||||||
|
|
||||||
<ul class="record_actions">
|
|
||||||
<li class="cancel">
|
|
||||||
<a href="{{ path('chill_task_singletask_list', app.request.query.get('list_params', { }) ) }}" class="btn btn-cancel">
|
|
||||||
{{ 'Back to the list'|trans }}
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
{{ form_widget(form.submit, { 'attr' : { 'class' : "btn btn-task-exchange green" }, 'label': task_workflow_metadata(task, 'transition.apply_transition_submit_label', transition)|default('apply')|trans } ) }}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
{{ form_end(form) }}
|
|
@@ -0,0 +1,59 @@
|
|||||||
|
{#
|
||||||
|
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#}
|
||||||
|
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set activeRouteKey = 'chill_task_single_task_edit' %}
|
||||||
|
{% set person = task.person %}
|
||||||
|
|
||||||
|
{% block title %}{{ 'Edit task'|trans }}{% endblock %}
|
||||||
|
|
||||||
|
{% block personcontent %}
|
||||||
|
<div class="task-edit">
|
||||||
|
|
||||||
|
<h1>{{ 'Edit task'|trans }}</h1>
|
||||||
|
|
||||||
|
{{ form_start(form) }}
|
||||||
|
|
||||||
|
{{ form_row(form.title) }}
|
||||||
|
{{ form_row(form.description) }}
|
||||||
|
{{ form_row(form.assignee) }}
|
||||||
|
{{ form_row(form.circle) }}
|
||||||
|
{{ form_row(form.startDate) }}
|
||||||
|
{{ form_row(form.endDate) }}
|
||||||
|
{{ form_row(form.warningInterval) }}
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
<li class="cancel">
|
||||||
|
<a class="btn btn-cancel" href="{% apply spaceless %}
|
||||||
|
{% if app.request.query.has('returnPath') %}
|
||||||
|
{{ app.request.query.get('returnPath')|escape('html_attr') }}">
|
||||||
|
{% else %}
|
||||||
|
{{ path('chill_task_single_task_show', { 'id': task.id, 'list_params': app.request.query.get('list_params', { } )} ) }}
|
||||||
|
{% endif %}
|
||||||
|
{% endapply %}">
|
||||||
|
{{ app.request.query.get('returnLabel')|default('Cancel'|trans) }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{{ form_widget(form.submit, { 'label': 'Save task', 'attr': {'class' : 'btn btn-update'}})}}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{ form_end(form) }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
@@ -15,32 +15,30 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
|
|
||||||
{% extends layout %}
|
{% extends '@ChillPerson/Person/layout.html.twig' %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}{{ 'Task list'|trans }}{% endblock %}
|
||||||
{{ 'Task list'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% macro thead() %}{% endmacro %}
|
{% macro thead() %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro row(task) %}{% endmacro %}
|
{% macro row(task) %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% block filtertasks %}
|
{% block filtertasks %}
|
||||||
{% if person is not null %}
|
{% if person is not null %}
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
<div class="tasks">
|
<div class="tasks">
|
||||||
{% include '@ChillTask/SingleTask/Person/list.html.twig' %}
|
{% include 'ChillTaskBundle:SingleTask:_list.html.twig' %}
|
||||||
|
</div>
|
||||||
</div>
|
{% endblock %}
|
||||||
{% endblock %}
|
{% 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 '@ChillTask/SingleTask/AccompanyingCourse/list.html.twig' %}
|
</div>
|
||||||
|
{% endblock %}
|
||||||
</div>
|
{% endif %}
|
||||||
{% endblock %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@@ -14,17 +14,37 @@
|
|||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#}
|
#}
|
||||||
{% extends person is defined ? "@ChillPerson/Person/layout.html.twig" : "@ChillPerson/AccompanyingCourse/layout.html.twig" %}
|
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||||
|
|
||||||
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
{% set activeRouteKey = 'chill_task_single_task_new' %}
|
||||||
{% set person = task.person %}
|
{% set person = task.person %}
|
||||||
|
|
||||||
{% block title %}
|
{% block title %}{{ 'New task'|trans }}{% endblock %}
|
||||||
{{ 'New task'|trans }}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
{% include '@ChillTask/SingleTask/_new.html.twig' %}
|
<div class="task-new">
|
||||||
|
|
||||||
|
<h1>{{ 'New task'|trans }}</h1>
|
||||||
|
|
||||||
|
{{ form_start(form) }}
|
||||||
|
|
||||||
|
{{ form_errors(form) }}
|
||||||
|
|
||||||
|
{{ form_row(form.title) }}
|
||||||
|
{{ form_row(form.description) }}
|
||||||
|
{{ form_row(form.assignee) }}
|
||||||
|
{{ form_row(form.circle) }}
|
||||||
|
{{ form_row(form.startDate) }}
|
||||||
|
{{ form_row(form.endDate) }}
|
||||||
|
{{ form_row(form.warningInterval) }}
|
||||||
|
|
||||||
|
<ul class="record_actions sticky-form-buttons">
|
||||||
|
<li>
|
||||||
|
{{ form_widget(form.submit, { 'label': 'Add a new task'|trans, 'attr': {'class': 'btn btn-save'} }) }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{ form_end(form) }}
|
||||||
|
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
@@ -0,0 +1,139 @@
|
|||||||
|
{#
|
||||||
|
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
#}
|
||||||
|
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set activeRouteKey = 'chill_task_single_task_show' %}
|
||||||
|
{% set person = task.person %}
|
||||||
|
|
||||||
|
{% block title %}{{ 'Task'|trans }}{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block personcontent %}
|
||||||
|
<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>
|
||||||
|
<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 %}
|
@@ -0,0 +1,34 @@
|
|||||||
|
{% extends "@ChillPerson/Person/layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set activeRouteKey = 'chill_task_task_list' %}
|
||||||
|
{% set person = task.person %}
|
||||||
|
|
||||||
|
{% block title 'Remove task'|trans %}
|
||||||
|
|
||||||
|
{% block personcontent %}
|
||||||
|
|
||||||
|
<h2>{{ 'Apply transition on task <em>%title%</em>'|trans({ '%title%': task.title } )|raw }}</h2>
|
||||||
|
|
||||||
|
|
||||||
|
{% if task_workflow_metadata(task, 'transition.sentence_confirmation', transition) is not empty %}
|
||||||
|
<p class="message-confirm">{{ task_workflow_metadata(task, 'transition.sentence_confirmation', transition)|trans }}</p>
|
||||||
|
{% else %}
|
||||||
|
<p>{{ 'Are you sure to apply the transition %name% on this task ?'|trans({ '%name%': task_workflow_metadata(task, 'transition.name', transition)|default(transition.name)|trans }) }}</p>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{{ form_start(form) }}
|
||||||
|
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li class="cancel">
|
||||||
|
<a href="{{ path('chill_task_singletask_list', app.request.query.get('list_params', { }) ) }}" class="btn btn-cancel">
|
||||||
|
{{ 'Back to the list'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{{ form_widget(form.submit, { 'attr' : { 'class' : "btn btn-task-exchange green" }, 'label': task_workflow_metadata(task, 'transition.apply_transition_submit_label', transition)|default('apply')|trans } ) }}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{ form_end(form) }}
|
||||||
|
|
||||||
|
{% endblock %}
|
@@ -32,9 +32,7 @@ use Psr\Log\LoggerInterface;
|
|||||||
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
use Chill\MainBundle\Security\ProvideRoleHierarchyInterface;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Chill\TaskBundle\Security\Authorization\AuthorizationEvent;
|
use Chill\TaskBundle\Security\Authorization\AuthorizationEvent;
|
||||||
@@ -146,15 +144,17 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
|||||||
// do regular check.
|
// do regular check.
|
||||||
return $this->voter->voteOnAttribute($attribute, $subject, $token);
|
return $this->voter->voteOnAttribute($attribute, $subject, $token);
|
||||||
|
|
||||||
|
/*
|
||||||
if ($subject instanceof AbstractTask) {
|
if ($subject instanceof AbstractTask) {
|
||||||
$associated = $subject->getPerson() ?? $subject->getCourse();
|
if ($subject->getPerson() === null) {
|
||||||
if ($associated === null) {
|
|
||||||
throw new \LogicException("You should associate a person with task "
|
throw new \LogicException("You should associate a person with task "
|
||||||
. "in order to check autorizations");
|
. "in order to check autorizations");
|
||||||
}
|
}
|
||||||
|
|
||||||
$person = $subject->getPerson();
|
$person = $subject->getPerson();
|
||||||
} elseif ($subject instanceof Person) {
|
} elseif ($subject instanceof Person) {
|
||||||
|
$person = $subject;
|
||||||
|
} else {
|
||||||
// subject is null. We check that at least one center is reachable
|
// subject is null. We check that at least one center is reachable
|
||||||
$centers = $this->authorizationHelper->getReachableCenters($token->getUser(), new Role($attribute));
|
$centers = $this->authorizationHelper->getReachableCenters($token->getUser(), new Role($attribute));
|
||||||
|
|
||||||
@@ -168,10 +168,6 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
|||||||
|
|
||||||
if (NULL === $center) {
|
if (NULL === $center) {
|
||||||
return false;
|
return false;
|
||||||
} elseif ($associated instanceof AccompanyingPeriod && !$this->accessDecisionManager->decide($token, [AccompanyingPeriodVoter::SEE], $associated)) {
|
|
||||||
return false;
|
|
||||||
} elseif ($associated instanceof AccompanyingPeriod && !$this->accessDecisionManager->decide($token, [AccompanyingPeriodVoter::SEE], $associated)) {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->authorizationHelper->userHasAccess(
|
return $this->authorizationHelper->userHasAccess(
|
||||||
@@ -179,7 +175,7 @@ final class TaskVoter extends AbstractChillVoter implements ProvideRoleHierarchy
|
|||||||
$subject,
|
$subject,
|
||||||
$attribute
|
$attribute
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getRoles()
|
public function getRoles()
|
||||||
|
@@ -1,6 +1,11 @@
|
|||||||
services:
|
services:
|
||||||
Chill\TaskBundle\Controller\:
|
Chill\TaskBundle\Controller\:
|
||||||
resource: "../../Controller"
|
resource: '../../Controller'
|
||||||
autowire: true
|
tags: ['controller.service_arguments']
|
||||||
autoconfigure: true
|
|
||||||
tags: ["controller.service_arguments"]
|
Chill\TaskBundle\Controller\SingleTaskController:
|
||||||
|
arguments:
|
||||||
|
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
|
||||||
|
$timelineBuilder: '@chill_main.timeline_builder'
|
||||||
|
$logger: '@chill.main.logger'
|
||||||
|
tags: ['controller.service_arguments']
|
||||||
|
@@ -1,22 +1,23 @@
|
|||||||
services:
|
services:
|
||||||
Chill\TaskBundle\Menu\UserMenuBuilder:
|
Chill\TaskBundle\Menu\UserMenuBuilder:
|
||||||
arguments:
|
arguments:
|
||||||
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
|
$tokenStorage: '@Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface'
|
||||||
$counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask'
|
$counter: '@Chill\TaskBundle\Templating\UI\CountNotificationTask'
|
||||||
$translator: '@Symfony\Component\Translation\TranslatorInterface'
|
$translator: '@Symfony\Component\Translation\TranslatorInterface'
|
||||||
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||||
tags:
|
tags:
|
||||||
- { name: "chill.menu_builder" }
|
- { name: 'chill.menu_builder' }
|
||||||
|
|
||||||
Chill\TaskBundle\Menu\MenuBuilder:
|
Chill\TaskBundle\Menu\PersonMenuBuilder:
|
||||||
autowire: true
|
arguments:
|
||||||
autoconfigure: true
|
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||||
tags:
|
$translator: '@Symfony\Component\Translation\TranslatorInterface'
|
||||||
- { name: "chill.menu_builder" }
|
tags:
|
||||||
|
- { name: 'chill.menu_builder' }
|
||||||
Chill\TaskBundle\Menu\SectionMenuBuilder:
|
|
||||||
arguments:
|
Chill\TaskBundle\Menu\SectionMenuBuilder:
|
||||||
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
arguments:
|
||||||
$translator: '@Symfony\Component\Translation\TranslatorInterface'
|
$authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||||
tags:
|
$translator: '@Symfony\Component\Translation\TranslatorInterface'
|
||||||
- { name: "chill.menu_builder" }
|
tags:
|
||||||
|
- { name: 'chill.menu_builder' }
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Chill\Migrations\Task;
|
|
||||||
|
|
||||||
use Doctrine\DBAL\Schema\Schema;
|
|
||||||
use Doctrine\Migrations\AbstractMigration;
|
|
||||||
|
|
||||||
final class Version20210909153533 extends AbstractMigration
|
|
||||||
{
|
|
||||||
public function getDescription(): string
|
|
||||||
{
|
|
||||||
return 'An accompanying period can be linked to a task. Key course_id is added to single task entity';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function up(Schema $schema): void
|
|
||||||
{
|
|
||||||
|
|
||||||
$this->addSql('ALTER TABLE chill_task.recurring_task ADD course_id INT DEFAULT NULL');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.recurring_task ADD CONSTRAINT FK_9F663B90591CC992 FOREIGN KEY (course_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
||||||
$this->addSql('CREATE INDEX IDX_9F663B90591CC992 ON chill_task.recurring_task (course_id)');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.single_task ADD course_id INT DEFAULT NULL');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.single_task ADD CONSTRAINT FK_194CB3D8591CC992 FOREIGN KEY (course_id) REFERENCES chill_person_accompanying_period (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
|
||||||
$this->addSql('CREATE INDEX IDX_194CB3D8591CC992 ON chill_task.single_task (course_id)');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function down(Schema $schema): void
|
|
||||||
{
|
|
||||||
$this->addSql('ALTER TABLE chill_task.recurring_task DROP CONSTRAINT FK_9F663B90591CC992');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.recurring_task DROP course_id');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.single_task DROP CONSTRAINT FK_194CB3D8591CC992');
|
|
||||||
$this->addSql('ALTER TABLE chill_task.single_task DROP course_id');
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,55 +1,53 @@
|
|||||||
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%"?'
|
||||||
'Are you sure you want to remove the task about accompanying period "%id%" ?': 'Êtes-vous sûr·e de vouloir supprimer la tâche du parcours "%id%"?'
|
'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
|
||||||
@@ -65,36 +63,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
|
||||||
@@ -109,4 +107,4 @@ All centers: Tous les centres
|
|||||||
CHILL_TASK_TASK_CREATE: Ajouter une tâche
|
CHILL_TASK_TASK_CREATE: Ajouter une tâche
|
||||||
CHILL_TASK_TASK_DELETE: Supprimer une tâche
|
CHILL_TASK_TASK_DELETE: Supprimer une tâche
|
||||||
CHILL_TASK_TASK_SHOW: Voir une tâche
|
CHILL_TASK_TASK_SHOW: Voir une tâche
|
||||||
CHILL_TASK_TASK_UPDATE: Modifier une tâche
|
CHILL_TASK_TASK_UPDATE: Modifier une tâche
|
Reference in New Issue
Block a user