{% if options['with_icon'] == true %}
{% endif %}
{% if address.street is not empty %}
{{ address.street }}
{% endif %}
{% if address.streetNumber is not empty %}
{{ address.streetNumber }}
{% endif %}
{% if address.postCode is not empty %}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig
index 132e81a3e..0d23d499d 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Layout/_footer.html.twig
@@ -1,4 +1,4 @@
\ No newline at end of file
+
{{ 'User manual'|trans }}
+
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Layout/_header-logo.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Layout/_header-logo.html.twig
index be59b454f..f619dc151 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Layout/_header-logo.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Layout/_header-logo.html.twig
@@ -1 +1 @@
-
\ No newline at end of file
+
diff --git a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
index 26182d936..f1681c60a 100644
--- a/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
+++ b/src/Bundle/ChillMainBundle/Serializer/Normalizer/CenterNormalizer.php
@@ -20,19 +20,32 @@
namespace Chill\MainBundle\Serializer\Normalizer;
use Chill\MainBundle\Entity\Center;
+use Chill\MainBundle\Repository\CenterRepository;
+use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
+use Symfony\Component\Serializer\Exception\InvalidArgumentException;
+use Symfony\Component\Serializer\Exception\UnexpectedValueException;
/**
*
*
*/
-class CenterNormalizer implements NormalizerInterface
+class CenterNormalizer implements NormalizerInterface, DenormalizerInterface
{
+ private CenterRepository $repository;
+
+
+ public function __construct(CenterRepository $repository)
+ {
+ $this->repository = $repository;
+ }
+
public function normalize($center, string $format = null, array $context = array())
{
/** @var Center $center */
return [
'id' => $center->getId(),
+ 'type' => 'center',
'name' => $center->getName()
];
}
@@ -41,4 +54,30 @@ class CenterNormalizer implements NormalizerInterface
{
return $data instanceof Center;
}
+
+ public function denormalize($data, string $type, string $format = null, array $context = [])
+ {
+ if (FALSE === \array_key_exists('type', $data)) {
+ throw new InvalidArgumentException('missing "type" key in data');
+ }
+ if ('center' !== $data['type']) {
+ throw new InvalidArgumentException('type should be equal to "center"');
+ }
+ if (FALSE === \array_key_exists('id', $data)) {
+ throw new InvalidArgumentException('missing "id" key in data');
+ }
+
+ $center = $this->repository->find($data['id']);
+
+ if (null === $center) {
+ throw new UnexpectedValueException("The type with id {$data['id']} does not exists");
+ }
+
+ return $center;
+ }
+
+ public function supportsDenormalization($data, string $type, string $format = null)
+ {
+ return $type === Center::class;
+ }
}
diff --git a/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
new file mode 100644
index 000000000..90a707e40
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Templating/Entity/AddressRender.php
@@ -0,0 +1,67 @@
+ true,
+ 'has_no_address' => false,
+ 'multiline' => true,
+ ];
+
+ public function __construct(EngineInterface $templating)
+ {
+ $this->templating = $templating;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function supports($entity, array $options): bool
+ {
+ return $entity instanceof Address;
+ }
+
+ /**
+ * @param Address addr
+ */
+ public function renderString($addr, array $options): string
+ {
+ $lines = [];
+ if (!empty($addr->getStreet())) {
+ $lines[0] = $addr->getStreet();
+ }
+ if (!empty($addr->getStreetNumber())) {
+ $lines[0] .= ", ".$addr->getStreetNumber();
+ }
+ if (!empty($addr->getPostcode())) {
+ $lines[1] = \strtr("{postcode} {label}", [
+ '{postcode}' => $addr->getPostcode()->getCode(),
+ '{label}' => $addr->getPostcode()->getName()
+ ]);
+ }
+
+ return implode(" - ", $lines);
+ }
+
+ /**
+ * {@inheritDoc}
+ * @param Address addr
+ */
+ public function renderBox($addr, array $options): string
+ {
+ $options = \array_merge(self::DEFAULT_OPTIONS, $options);
+
+ return $this->templating
+ ->render('@ChillMain/Address/entity_render.html.twig', [
+ 'address' => $addr,
+ 'options' => $options
+ ]);
+ }
+}
diff --git a/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php
new file mode 100644
index 000000000..79551d23c
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Tests/Templating/Entity/AddressRenderTest.php
@@ -0,0 +1,55 @@
+get(EngineInterface::class);
+ $renderer = new AddressRender($engine);
+
+ $this->assertEquals($expectedString, $renderer->renderString($addr, []));
+ return;
+ $this->assertIsString($renderer->renderBox($addr, []));
+ }
+
+
+ public function addressDataProvider(): \Iterator
+ {
+ $addr = new Address();
+ $country = (new Country())
+ ->setName([ "fr" => "Pays" ])
+ ->setCountryCode("BE")
+ ;
+ $postCode = new PostalCode();
+ $postCode->setName("Locality")
+ ->setCode("012345")
+ ->setCountry($country)
+ ;
+
+ $addr->setStreet("Rue ABC")
+ ->setStreetNumber("5")
+ ->setPostcode($postCode)
+ ;
+
+ yield[ $addr, "Rue ABC, 5 - 012345 Locality"];
+ }
+
+}
diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml
index ada65b08a..68a3eb764 100644
--- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml
+++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml
@@ -9,15 +9,14 @@ servers:
description: "Your current dev server"
components:
- parameters:
- _format:
- name: _format
- in: path
- required: true
- schema:
- type: string
- enum:
- - json
+ schemas:
+ Center:
+ type: object
+ properties:
+ id:
+ type: integer
+ name:
+ type: string
paths:
/1.0/search.json:
diff --git a/src/Bundle/ChillMainBundle/config/services/templating.yaml b/src/Bundle/ChillMainBundle/config/services/templating.yaml
index 29dc676d1..9d103f690 100644
--- a/src/Bundle/ChillMainBundle/config/services/templating.yaml
+++ b/src/Bundle/ChillMainBundle/config/services/templating.yaml
@@ -41,3 +41,10 @@ services:
Chill\MainBundle\Templating\ChillMarkdownRenderExtension:
tags:
- { name: twig.extension }
+
+ Chill\MainBundle\Templating\Entity\AddressRender:
+ arguments:
+ - '@Symfony\Component\Templating\EngineInterface'
+ tags:
+ - { name: 'chill.render_entity' }
+
diff --git a/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php b/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php
new file mode 100644
index 000000000..3be8d9ea1
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/migrations/Version20210525144016.php
@@ -0,0 +1,31 @@
+addSql('ALTER TABLE chill_main_address DROP CONSTRAINT FK_165051F6114B8DD9');
+ $this->addSql('ALTER TABLE chill_main_address ADD CONSTRAINT FK_165051F6114B8DD9 FOREIGN KEY (linkedToThirdParty_id) REFERENCES chill_3party.third_party (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE');
+ }
+
+ public function down(Schema $schema): void
+ {
+ $this->addSql('ALTER TABLE chill_main_address DROP CONSTRAINT fk_165051f6114b8dd9');
+ $this->addSql('ALTER TABLE chill_main_address ADD CONSTRAINT fk_165051f6114b8dd9 FOREIGN KEY (linkedtothirdparty_id) REFERENCES chill_3party.third_party (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
index 0d8189b6a..860cdfad7 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseApiController.php
@@ -75,10 +75,10 @@ $workflow = $this->registry->get($accompanyingPeriod);
switch ($request->getMethod()) {
case Request::METHOD_POST:
- $participation = $accompanyingPeriod->addPerson($person);
+ $participation = $accompanyingPeriod->createParticipationFor($person);
break;
case Request::METHOD_DELETE:
- $participation = $accompanyingPeriod->removePerson($person);
+ $participation = $accompanyingPeriod->closeParticipationFor($person);
break;
default:
throw new BadRequestException("This method is not supported");
diff --git a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
index 6786cb05f..e5b0cdda7 100644
--- a/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
+++ b/src/Bundle/ChillPersonBundle/Controller/AccompanyingCourseController.php
@@ -72,7 +72,7 @@ class AccompanyingCourseController extends Controller
$em->persist($period);
$em->flush();
- return $this->redirectToRoute('chill_person_accompanying_course_show', [
+ return $this->redirectToRoute('chill_person_accompanying_course_edit', [
'accompanying_period_id' => $period->getId()
]);
@@ -92,17 +92,16 @@ class AccompanyingCourseController extends Controller
}
/**
- * Show page of Accompanying Course section
+ * Edit page of Accompanying Course section
*
- * the page show all blocks except one active edit block, managed by vuejs component
- * that's why title of page is 'edit accompanying course'
+ * the page edit all blocks managed by vuejs component
*
- * @Route("/{_locale}/parcours/{accompanying_period_id}/show", name="chill_person_accompanying_course_show")
+ * @Route("/{_locale}/parcours/{accompanying_period_id}/edit", name="chill_person_accompanying_course_edit")
* @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"})
*/
- public function showAction(AccompanyingPeriod $accompanyingCourse): Response
+ public function editAction(AccompanyingPeriod $accompanyingCourse): Response
{
- return $this->render('@ChillPerson/AccompanyingCourse/show.html.twig', [
+ return $this->render('@ChillPerson/AccompanyingCourse/edit.html.twig', [
'accompanyingCourse' => $accompanyingCourse
]);
}
diff --git a/src/Bundle/ChillPersonBundle/Controller/ApiPersonController.php b/src/Bundle/ChillPersonBundle/Controller/ApiPersonController.php
deleted file mode 100644
index bfaf22d7b..000000000
--- a/src/Bundle/ChillPersonBundle/Controller/ApiPersonController.php
+++ /dev/null
@@ -1,30 +0,0 @@
-
- *
- * 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
.
- */
-namespace Chill\PersonBundle\Controller;
-
-use Symfony\Bundle\FrameworkBundle\Controller\Controller;
-use Symfony\Component\HttpFoundation\JsonResponse;
-
-
-class ApiPersonController extends Controller
-{
- public function viewAction($id, $_format)
- {
-
- }
-}
diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php
new file mode 100644
index 000000000..84f1ebf66
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Controller/PersonApiController.php
@@ -0,0 +1,50 @@
+
+ *
+ * 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
.
+ */
+namespace Chill\PersonBundle\Controller;
+
+use Chill\PersonBundle\Security\Authorization\PersonVoter;
+use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
+use Symfony\Component\Security\Core\Role\Role;
+use Chill\MainBundle\CRUD\Controller\ApiController;
+use Symfony\Component\HttpFoundation\Request;
+
+
+class PersonApiController extends ApiController
+{
+ private AuthorizationHelper $authorizationHelper;
+
+ /**
+ * @param AuthorizationHelper $authorizationHelper
+ */
+ public function __construct(AuthorizationHelper $authorizationHelper)
+ {
+ $this->authorizationHelper = $authorizationHelper;
+ }
+
+ protected function createEntity(string $action, Request $request): object
+ {
+ $person = parent::createEntity($action, $request);
+
+ // TODO temporary hack to allow creation of person with fake center
+ $centers = $this->authorizationHelper->getReachableCenters($this->getUser(),
+ new Role(PersonVoter::CREATE));
+ $person->setCenter($centers[0]);
+
+ return $person;
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
index 0d6346c01..27721012d 100644
--- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
+++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
@@ -476,7 +476,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class,
'name' => 'social_work_social_issue',
'base_path' => '/api/1.0/person/social-work/social-issue',
-// 'controller' => \Chill\PersonBundle\Controller\OpeningApiController::class,
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
@@ -493,6 +492,28 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
]
],
+ [
+ 'class' => \Chill\PersonBundle\Entity\Person::class,
+ 'name' => 'person',
+ 'base_path' => '/api/1.0/person/person',
+ 'base_role' => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
+ 'controller' => \Chill\PersonBundle\Controller\PersonApiController::class,
+ 'actions' => [
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true,
+ Request::METHOD_POST=> true,
+ ],
+ 'roles' => [
+ Request::METHOD_GET => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
+ Request::METHOD_HEAD => \Chill\PersonBundle\Security\Authorization\PersonVoter::SEE,
+ Request::METHOD_POST => \Chill\PersonBundle\Security\Authorization\PersonVoter::CREATE,
+
+ ]
+ ],
+ ]
+ ],
]
]);
}
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
index d5b43446c..9841a99f3 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php
@@ -483,9 +483,9 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
}
/**
- * Add Person
+ * Open a new participation for a person
*/
- public function addPerson(Person $person = null): AccompanyingPeriodParticipation
+ public function createParticipationFor(Person $person): AccompanyingPeriodParticipation
{
$participation = new AccompanyingPeriodParticipation($this, $person);
$this->participations[] = $participation;
@@ -493,10 +493,24 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
return $participation;
}
+ public function addPerson(Person $person = null): self
+ {
+ if (NULL !== $person) {
+ $this->createParticipationFor($person);
+ }
+
+ return $this;
+ }
+
/**
- * Remove Person
+ * Close a participation for a person
+ *
+ * Search for the person's participation and set the end date at
+ * 'now'.
+ *
+ * @return void
*/
- public function removePerson(Person $person): ?AccompanyingPeriodParticipation
+ public function closeParticipationFor($person): ?AccompanyingPeriodParticipation
{
$participation = $this->getOpenParticipationContainsPerson($person);
@@ -506,6 +520,17 @@ class AccompanyingPeriod implements TrackCreationInterface, TrackUpdateInterface
return $participation;
}
+
+
+ /**
+ * Remove Person
+ */
+ public function removePerson(Person $person): self
+ {
+ $this->closeParticipationFor($person);
+
+ return $this;
+ }
public function getClosingMotive(): ?ClosingMotive
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php
index 0d64da0fc..18b5bd38d 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php
@@ -51,7 +51,7 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface
* @ORM\ManyToOne(
* targetEntity="Chill\PersonBundle\Entity\AccompanyingPeriod",
* inversedBy="comments")
- * @ORM\JoinColumn(nullable=false)
+ * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private $accompanyingPeriod;
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
index cf796722a..a50e28621 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
@@ -32,7 +32,7 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap;
use Symfony\Component\Serializer\Annotation\Groups;
/**
- * @ORM\Entity(repositoryClass=ResourceRepository::class)
+ * @ORM\Entity
* @ORM\Table(name="chill_person_accompanying_period_resource")
* @DiscriminatorMap(typeProperty="type", mapping={
* "accompanying_period_resource"=Resource::class
diff --git a/src/Bundle/ChillPersonBundle/Entity/Person.php b/src/Bundle/ChillPersonBundle/Entity/Person.php
index 1afa6278c..a4fb185fb 100644
--- a/src/Bundle/ChillPersonBundle/Entity/Person.php
+++ b/src/Bundle/ChillPersonBundle/Entity/Person.php
@@ -421,6 +421,31 @@ class Person implements HasCenterInterface
return $this->accompanyingPeriodParticipations;
}
+ /**
+ * Return a collection of participation, where the participation
+ * is still opened, not a draft, and the period is still opened
+ */
+ public function getOpenedParticipations(): Collection
+ {
+ // create a criteria for filtering easily
+ $criteria = Criteria::create();
+ $criteria
+ ->andWhere(Criteria::expr()->eq('endDate', NULL))
+ ->orWhere(Criteria::expr()->gt('endDate', new \DateTime('now')))
+ ;
+
+ return $this->getAccompanyingPeriodParticipations()
+ ->matching($criteria)
+ ->filter(function (AccompanyingPeriodParticipation $app) {
+ $period = $app->getAccompanyingPeriod();
+ return (
+ NULL === $period->getClosingDate()
+ || new \DateTime('now') < $period->getClosingDate()
+ )
+ && AccompanyingPeriod::STEP_DRAFT !== $period->getStep();
+ });
+ }
+
/**
* Get the accompanying periods of a give person with the chronological order.
*/
diff --git a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php
index e9ce20b53..49543c42d 100644
--- a/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php
+++ b/src/Bundle/ChillPersonBundle/Menu/AccompanyingCourseMenuBuilder.php
@@ -43,7 +43,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
->setExtras(['order' => 10]);
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
- 'route' => 'chill_person_accompanying_course_show',
+ 'route' => 'chill_person_accompanying_course_edit',
'routeParameters' => [
'accompanying_period_id' => $period->getId()
]])
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php
index c99ca8efc..5c1525b52 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ClosingMotiveRepository.php
@@ -27,46 +27,41 @@ use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
-/**
- * Class ClosingMotiveRepository
- * Entity repository for closing motives
- *
- * @package Chill\PersonBundle\Repository
- */
final class ClosingMotiveRepository
{
private EntityRepository $repository;
+ private EntityManagerInterface $entityManager;
+
public function __construct(EntityManagerInterface $entityManager)
{
+ $this->entityManager = $entityManager;
$this->repository = $entityManager->getRepository(ClosingMotive::class);
}
/**
- * @param bool $onlyLeaf
* @return mixed
*/
public function getActiveClosingMotive(bool $onlyLeaf = true)
{
- $rsm = new ResultSetMappingBuilder($this->repository->getEntityManager());
+ $rsm = new ResultSetMappingBuilder($this->entityManager);
$rsm->addRootEntityFromClassMetadata($this->repository->getClassName(), 'cm');
- $sql = "SELECT ".(string) $rsm."
+ $sql = "SELECT " . (string) $rsm . "
FROM chill_person_accompanying_period_closingmotive AS cm
WHERE
active IS TRUE ";
-
+
if ($onlyLeaf) {
$sql .= "AND cm.id NOT IN (
SELECT DISTINCT parent_id FROM chill_person_accompanying_period_closingmotive WHERE parent_id IS NOT NULL
)";
}
-
+
$sql .= " ORDER BY cm.ordering ASC";
return $this
- ->repository
- ->getEntityManager()
+ ->entityManager
->createNativeQuery($sql, $rsm)
->getResult();
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php
index aca7a9c68..b3a20780e 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/CommentRepository.php
@@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Comment|null find($id, $lockMode = null, $lockVersion = null)
- * @method Comment|null findOneBy(array $criteria, array $orderBy = null)
- * @method Comment[] findAll()
- * @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class CommentRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php
index c2851b851..596bfc2ee 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/OriginRepository.php
@@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Origin|null find($id, $lockMode = null, $lockVersion = null)
- * @method Origin|null findOneBy(array $criteria, array $orderBy = null)
- * @method Origin[] findAll()
- * @method Origin[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class OriginRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php
index c32f74762..3923126aa 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/ResourceRepository.php
@@ -24,21 +24,19 @@ namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
use Chill\PersonBundle\Entity\AccompanyingPeriod\Resource;
use Doctrine\ORM\EntityRepository;
-use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
-use Doctrine\Persistence\ManagerRegistry;
+use Doctrine\ORM\EntityManagerInterface;
-/**
- * @method Resource|null find($id, $lockMode = null, $lockVersion = null)
- * @method Resource|null findOneBy(array $criteria, array $orderBy = null)
- * @method Resource[] findAll()
- * @method Resource[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
-final class ResourceRepository extends ServiceEntityRepository
+final class ResourceRepository
{
private EntityRepository $repository;
- public function __construct(ManagerRegistry $registry)
+ public function __construct(EntityManagerInterface $entityManager)
{
- parent::__construct($registry, Resource::class);
+ $this->repository = $entityManager->getRepository(Resource::class);
+ }
+
+ public function find($id, $lockMode = null, $lockVersion = null): ?Resource
+ {
+ return $this->repository->find($id, $lockMode, $lockVersion);
}
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php
index 0f157ed42..f902c7cc8 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodParticipationRepository.php
@@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method AccompanyingPeriodParticipation|null find($id, $lockMode = null, $lockVersion = null)
- * @method AccompanyingPeriodParticipation|null findOneBy(array $criteria, array $orderBy = null)
- * @method AccompanyingPeriodParticipation[] findAll()
- * @method AccompanyingPeriodParticipation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class AccompanyingPeriodParticipationRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php
index 07aa0a55f..c2a8299fc 100644
--- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodRepository.php
@@ -26,12 +26,6 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method AccompanyingPeriod|null find($id, $lockMode = null, $lockVersion = null)
- * @method AccompanyingPeriod|null findOneBy(array $criteria, array $orderBy = null)
- * @method AccompanyingPeriod[] findAll()
- * @method AccompanyingPeriod[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class AccompanyingPeriodRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php
index b11d3d93a..1a634f451 100644
--- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdMembersRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\Household\HouseholdMembers;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method HouseholdMembers|null find($id, $lockMode = null, $lockVersion = null)
- * @method HouseholdMembers|null findOneBy(array $criteria, array $orderBy = null)
- * @method HouseholdMembers[] findAll()
- * @method HouseholdMembers[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class HouseholdMembersRepository
{
private EntityRepository $repository;
@@ -20,33 +14,4 @@ final class HouseholdMembersRepository
{
$this->repository = $entityManager->getRepository(HouseholdMembers::class);
}
-
- // /**
- // * @return HouseholdMembers[] Returns an array of HouseholdMembers objects
- // */
- /*
- public function findByExampleField($value)
- {
- return $this->createQueryBuilder('h')
- ->andWhere('h.exampleField = :val')
- ->setParameter('val', $value)
- ->orderBy('h.id', 'ASC')
- ->setMaxResults(10)
- ->getQuery()
- ->getResult()
- ;
- }
- */
-
- /*
- public function findOneBySomeField($value): ?HouseholdMembers
- {
- return $this->createQueryBuilder('h')
- ->andWhere('h.exampleField = :val')
- ->setParameter('val', $value)
- ->getQuery()
- ->getOneOrNullResult()
- ;
- }
- */
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
index 78a68f56d..b7a8816b3 100644
--- a/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/Household/HouseholdRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\Household\Household;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Household|null find($id, $lockMode = null, $lockVersion = null)
- * @method Household|null findOneBy(array $criteria, array $orderBy = null)
- * @method Household[] findAll()
- * @method Household[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class HouseholdRepository
{
private EntityRepository $repository;
@@ -20,33 +14,4 @@ final class HouseholdRepository
{
$this->repository = $entityManager->getRepository(Household::class);
}
-
- // /**
- // * @return Household[] Returns an array of Household objects
- // */
- /*
- public function findByExampleField($value)
- {
- return $this->createQueryBuilder('h')
- ->andWhere('h.exampleField = :val')
- ->setParameter('val', $value)
- ->orderBy('h.id', 'ASC')
- ->setMaxResults(10)
- ->getQuery()
- ->getResult()
- ;
- }
- */
-
- /*
- public function findOneBySomeField($value): ?Household
- {
- return $this->createQueryBuilder('h')
- ->andWhere('h.exampleField = :val')
- ->setParameter('val', $value)
- ->getQuery()
- ->getOneOrNullResult()
- ;
- }
- */
}
diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php
index c5dea689a..eed330c8a 100644
--- a/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/PersonAltNameRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\PersonAltName;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * PersonAltNameRepository
- *
- * This class was generated by the Doctrine ORM. Add your own custom
- * repository methods below.
- */
final class PersonAltNameRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php
index 989baaeec..b899f06c1 100644
--- a/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/PersonNotDuplicateRepository.php
@@ -7,11 +7,6 @@ use Chill\PersonBundle\Entity\PersonNotDuplicate;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * Class PersonNotDuplicateRepository
- *
- * @package Chill\PersonBundle\Repository
- */
final class PersonNotDuplicateRepository
{
private EntityRepository $repository;
@@ -21,12 +16,7 @@ final class PersonNotDuplicateRepository
$this->repository = $entityManager->getRepository(PersonNotDuplicate::class);
}
- /**
- * @param \Chill\PersonBundle\Entity\Person $person
- *
- * @return array
- */
- public function findNotDuplicatePerson(Person $person)
+ public function findNotDuplicatePerson(Person $person): array
{
$qb = $this->repository->createQueryBuilder('pnd');
$qb->select('pnd')
@@ -36,6 +26,7 @@ final class PersonNotDuplicateRepository
$result = $qb->getQuery()->getResult();
$persons = [];
+
foreach ($result as $row) {
if ($row->getPerson1() === $person) {
$persons[] = $row->getPerson2();
diff --git a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
index 12733a668..fdd0f054e 100644
--- a/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/PersonRepository.php
@@ -32,105 +32,88 @@ final class PersonRepository
$this->repository = $entityManager->getRepository(Person::class);
}
- public function find($id, $lockMode = null, $lockVersion = null)
+ public function find($id, $lockMode = null, $lockVersion = null): ?Person
{
return $this->repository->find($id, $lockMode, $lockVersion);
}
/**
- * @param string $phonenumber
* @param $centers
* @param $firstResult
* @param $maxResults
- * @param array $only
* @return mixed
* @throws \Exception
*/
public function findByPhone(
- string $phonenumber,
- $centers,
+ string $phonenumber,
+ $centers,
$firstResult,
$maxResults,
array $only = ['mobile', 'phone']
) {
$qb = $this->repository->createQueryBuilder('p');
$qb->select('p');
-
+
$this->addByCenters($qb, $centers);
$this->addPhoneNumber($qb, $phonenumber, $only);
-
+
$qb->setFirstResult($firstResult)
->setMaxResults($maxResults)
;
-
+
return $qb->getQuery()->getResult();
}
-
+
/**
- * @param string $phonenumber
* @param $centers
- * @param array $only
- * @return int
* @throws \Doctrine\ORM\NoResultException
* @throws \Doctrine\ORM\NonUniqueResultException
*/
public function countByPhone(
- string $phonenumber,
- $centers,
+ string $phonenumber,
+ $centers,
array $only = ['mobile', 'phone']
- ): int
- {
+ ): int {
$qb = $this->repository->createQueryBuilder('p');
$qb->select('COUNT(p)');
-
+
$this->addByCenters($qb, $centers);
$this->addPhoneNumber($qb, $phonenumber, $only);
-
+
return $qb->getQuery()->getSingleScalarResult();
}
-
+
/**
- * @param QueryBuilder $qb
- * @param string $phonenumber
- * @param array $only
* @throws \Exception
*/
- protected function addPhoneNumber(QueryBuilder $qb, string $phonenumber, array $only)
+ protected function addPhoneNumber(QueryBuilder $qb, string $phonenumber, array $only): void
{
if (count($only) === 0) {
throw new \Exception("No array field to search");
}
-
+
$phonenumber = $this->parsePhoneNumber($phonenumber);
-
+
$orX = $qb->expr()->orX();
-
+
if (\in_array('mobile', $only)) {
$orX->add($qb->expr()->like("REPLACE(p.mobilenumber, ' ', '')", ':phonenumber'));
}
if (\in_array('phone', $only)) {
$orX->add($qb->expr()->like("REPLACE(p.phonenumber, ' ', '')", ':phonenumber'));
}
-
+
$qb->andWhere($orX);
-
+
$qb->setParameter('phonenumber', '%'.$phonenumber.'%');
}
-
- /**
- * @param $phonenumber
- * @return string
- */
- protected function parsePhoneNumber($phonenumber): string
+
+ protected function parsePhoneNumber(string $phonenumber): string
{
return \str_replace(' ', '', $phonenumber);
}
-
- /**
- * @param QueryBuilder $qb
- * @param array $centers
- */
- protected function addByCenters(QueryBuilder $qb, array $centers)
+
+ protected function addByCenters(QueryBuilder $qb, array $centers): void
{
if (count($centers) > 0) {
$qb->andWhere($qb->expr()->in('p.center', ':centers'));
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php
index c9ab3c931..f554e4e8c 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/EvaluationRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Evaluation|null find($id, $lockMode = null, $lockVersion = null)
- * @method Evaluation|null findOneBy(array $criteria, array $orderBy = null)
- * @method Evaluation[] findAll()
- * @method Evaluation[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class EvaluationRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
index 30576b4ed..bd7c6a738 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/GoalRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Goal;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Goal|null find($id, $lockMode = null, $lockVersion = null)
- * @method Goal|null findOneBy(array $criteria, array $orderBy = null)
- * @method Goal[] findAll()
- * @method Goal[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class GoalRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
index 004a2f82c..1c4d8d013 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/ResultRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\Result;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method Result|null find($id, $lockMode = null, $lockVersion = null)
- * @method Result|null findOneBy(array $criteria, array $orderBy = null)
- * @method Result[] findAll()
- * @method Result[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class ResultRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php
index cfa9adbd7..3c86d2397 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialActionRepository.php
@@ -6,12 +6,6 @@ use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method SocialAction|null find($id, $lockMode = null, $lockVersion = null)
- * @method SocialAction|null findOneBy(array $criteria, array $orderBy = null)
- * @method SocialAction[] findAll()
- * @method SocialAction[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class SocialActionRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
index 2f6eb3ba1..1100d8136 100644
--- a/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
+++ b/src/Bundle/ChillPersonBundle/Repository/SocialWork/SocialIssueRepository.php
@@ -7,12 +7,6 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
-/**
- * @method SocialIssue|null find($id, $lockMode = null, $lockVersion = null)
- * @method SocialIssue|null findOneBy(array $criteria, array $orderBy = null)
- * @method SocialIssue[] findAll()
- * @method SocialIssue[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
- */
final class SocialIssueRepository
{
private EntityRepository $repository;
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/index.js b/src/Bundle/ChillPersonBundle/Resources/public/index.js
index f4bcba7fb..e3563b4ff 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/index.js
@@ -1 +1,2 @@
-require('./sass/person.scss');
\ No newline at end of file
+require('./sass/person.scss');
+require('./sass/person_with_period.scss');
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/index.js b/src/Bundle/ChillPersonBundle/Resources/public/sass/index.js
index 35945c7ff..89e749e5c 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/sass/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/sass/index.js
@@ -1,5 +1,5 @@
require('./phone-alt-solid.svg');
require('./mobile-alt-solid.svg');
require('./person_by_phonenumber.scss');
-
+require('./person_with_period.scss');
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/sass/person_with_period.scss b/src/Bundle/ChillPersonBundle/Resources/public/sass/person_with_period.scss
new file mode 100644
index 000000000..6f52d2cae
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/public/sass/person_with_period.scss
@@ -0,0 +1,50 @@
+/// complete and overwrite flex-table in chillmain.scss
+div.list-with-period {
+ div.person {
+ ul.record_actions {
+ li {
+ margin-right: 0 !important;
+ }
+ }
+ }
+ div.periods {
+ div.header,
+ div.list-content {
+ width: calc(100% - 40px);
+ margin-left: 40px;
+ }
+ div.header {
+ position: relative;
+ a.sc-button {
+ position: absolute;
+ width: 30px;
+ height: 30px;
+ top: 10px;
+ left: -40px;
+ padding: 0;
+ i {
+ padding: 5px;
+ }
+ }
+ abbr.referrer {
+ font-size: 70%;
+ }
+ span.user {
+ margin-left: 1em;
+ }
+ }
+ div.list-content {
+ span.more {
+ font-style: italic;
+ }
+ }
+ }
+}
+
+.chill-entity__person {
+ .chill-entity__person__first-name,
+ .chill-entity__person__last-name {
+ font-size: 1.3em;
+ font-weight: 700;
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue
index 758b49313..8dd66d0f2 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/App.vue
@@ -1,19 +1,24 @@
-
+
+
+
+ {{ $t('course.title.draft') }}
+ {{ $t('course.title.active') }}
+
-
-
-
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js
index 5e3210536..70b2ba56e 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/api.js
@@ -36,6 +36,33 @@ const patchAccompanyingCourse = (id, body) => {
});
};
+/*
+* Endpoint to change 'DRAFT' step to 'CONFIRMED'
+*/
+const confirmAccompanyingCourse = (id) => {
+ const url = `/api/1.0/person/accompanying-course/${id}/confirm.json`
+ return fetch(url, {
+ method: 'POST',
+ headers: {'Content-Type': 'application/json;charset=utf-8'}
+ })
+ .then(response => {
+ if (response.ok) { return response.json(); }
+ throw Error('Error with request resource response');
+ });
+};
+
+/*
+* Endpoint
+*/
+const getSocialIssues = () => {
+ const url = `/api/1.0/person/social-work/social-issue.json`;
+ return fetch(url)
+ .then(response => {
+ if (response.ok) { return response.json(); }
+ throw Error('Error with request resource response');
+ });
+};
+
/*
* Endpoint v.2 chill_api_single_accompanying_course_participation,
* method POST/DELETE, add/close a participation to the accompanyingCourse
@@ -119,10 +146,32 @@ const postResource = (id, payload, method) => {
});
};
+/*
+* Endpoint to Add/remove SocialIssue
+*/
+const postSocialIssue = (id, body, method) => {
+ //console.log('api body and method', body, method);
+ const url = `/api/1.0/person/accompanying-course/${id}/socialissue.json`;
+ return fetch(url, {
+ method: method,
+ headers: {
+ 'Content-Type': 'application/json;charset=utf-8'
+ },
+ body: JSON.stringify(body)
+ })
+ .then(response => {
+ if (response.ok) { return response.json(); }
+ throw Error('Error with request resource response');
+ });
+};
+
export {
getAccompanyingCourse,
patchAccompanyingCourse,
+ confirmAccompanyingCourse,
+ getSocialIssues,
postParticipation,
postRequestor,
postResource,
+ postSocialIssue
};
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/AccompanyingCourse.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/AccompanyingCourse.vue
deleted file mode 100644
index b94d73338..000000000
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/AccompanyingCourse.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
{{ $t('course.title') }}
-
- {{ $t('course.id') }}
- {{ accompanyingCourse.id }}
-
-
-
-
-
-
-
-
-
-
- {{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}
-
-
- {{ $t('course.by') }}{{ accompanyingCourse.user.username }}
-
-
-
-
-
-
-
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue
new file mode 100644
index 000000000..7a91e39c3
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner.vue
@@ -0,0 +1,92 @@
+
+
+
+
+ {{ $t('course.id') }}
+ {{ accompanyingCourse.id }}
+
+
+ {{ $t('course.closing_date') }}
+ {{ $d(accompanyingCourse.closingDate.datetime, 'short') }}
+
+ {{ $t('course.closing_motive') }}
+ {{ accompanyingCourse.closingMotive.name.fr }}
+
+
+
+
+
+
+
+
+
+
+ {{ $t('course.step.draft') }}
+
+
+
+
+
+ {{ $t('course.step.active') }}
+
+
+
+
+ {{ $t('course.open_at') }}{{ $d(accompanyingCourse.openingDate.datetime, 'text') }}
+
+
+
+ {{ $t('course.by') }}{{ accompanyingCourse.user.username }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/SocialIssue.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/SocialIssue.vue
new file mode 100644
index 000000000..7ed78355d
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/SocialIssue.vue
@@ -0,0 +1,20 @@
+
+ {{ issue.text }}
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ToggleFlags.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/ToggleFlags.vue
similarity index 62%
rename from src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ToggleFlags.vue
rename to src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/ToggleFlags.vue
index ac5960d19..67ef8c193 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/ToggleFlags.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Banner/ToggleFlags.vue
@@ -1,24 +1,20 @@
-
-
+
+
+
+
{{ $t('course.emergency') }}
-
-
+
{{ $t('course.confidential') }}
-
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue
index 2aaced056..858d6d04e 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Comment.vue
@@ -1,44 +1,48 @@
-
{{ $t('comment.title') }}
+
{{ $t('comment.title') }}
-
+
+
+
-
- créé par {{ initialComment.creator.text }}
- le {{ $d(initialComment.createdAt.datetime, 'long') }}
-
- modifié par {{ initialComment.updatedBy.text }}
- le {{ $d(initialComment.updatedAt.datetime, 'long') }}
-
-
-
-
-
-
-
-
- {{ $t('action.save') }}
-
-
-
-
-
-
-
- {{ $t('action.delete') }}
-
-
@@ -82,9 +86,14 @@ export default {
}
/*
* TODO
-* - patch endpoint to update Content
-* - delete/reset button ?
-* - manage flash messages => specific component ?
-* - ckeditor
+* - [x] delete button in ul record_actions, but not in form
+* - [ ] display updatedAt => initialComment fetch PATCH content changes MUST NOT change object id !!
+* - [ ] ckeditor integration
*/
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue
index 83f2c4c90..c2143b72a 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Confirm.vue
@@ -1,42 +1,63 @@
-
-
- {{ $t('confirm.title') }}
-
- {{ $t('course.step.active') }}
-
-
- {{ $t('course.step.draft') }}
-
-
-
-
- {{ $t('confirm.text_draft') }}
-
-
-
- {{ $t('course.closing_date') }}
- {{ $d(accompanyingCourse.closingDate.datetime, 'short') }}
-
- {{ $t('course.closing_motive') }}
- {{ accompanyingCourse.closingMotive.name.fr }}
-
-
-
-
-
- {{ $t('confirm.ok') }}
-
-
-
-
+
+
+ {{ $t('confirm.title') }}
+
+
+
+
+ {{ $t('confirm.text_draft') }}
+ {{ $t('course.step.draft') }}
+
+
+ {{ $t('confirm.text_active') }}
+ {{ $t('course.step.active') }}
+
+
+
+
+
+ {{ $t('confirm.ok') }}
+
+
+
+
+
+
+
+
+ {{ $t('confirm.sure') }}
+
+
+ {{ $t('confirm.sure_description') }}
+
+
+
+ {{ $t('confirm.ok') }}
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
index a01e4dc33..7c61b066c 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/PersonsAssociated.vue
@@ -1,8 +1,12 @@
-
{{ $t('persons_associated.title')}}
-
{{ $tc('persons_associated.counter', counter) }}
-
+ {{ $t('persons_associated.title')}}
+
+
+ {{ $tc('persons_associated.counter', counter) }}
+
+
+
{{ $t('persons_associated.firstname') }}
@@ -23,21 +27,23 @@
-
-
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue
index 96860b048..32fbb86c2 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Requestor.vue
@@ -1,64 +1,76 @@
-
{{ $t('requestor.title') }}
+
{{ $t('requestor.title') }}
-
+
+
{{ $t('requestor.is_anonymous') }}
-
{{ $t('requestor.type') }}
-
{{ accompanyingCourse.requestor.type }}
-
{{ $t('requestor.text') }}
-
{{ accompanyingCourse.requestor.text }}
-
{{ $t('requestor.is_anonymous') }}
-
{{ accompanyingCourse.requestorAnonymous }}
+
+
+ {{ accompanyingCourse.requestor.type }}
+ {{ accompanyingCourse.requestor.text }}
+
-
-
{{ $t('requestor.person_id') }}
-
{{ accompanyingCourse.requestor.person_id }}
-
{{ $t('requestor.birthdate') }}
-
{{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}
-
{{ $t('requestor.center') }}
-
{{ accompanyingCourse.requestor.center.name }}
-
{{ $t('requestor.firstName') }}
-
{{ accompanyingCourse.requestor.firstName }}
-
{{ $t('requestor.lastName') }}
-
{{ accompanyingCourse.requestor.lastName }}
-
{{ $t('requestor.phonenumber') }}
-
{{ accompanyingCourse.requestor.phonenumber }}
-
{{ $t('requestor.mobilenumber') }}
-
{{ accompanyingCourse.requestor.mobilenumber }}
-
{{ $t('requestor.altNames') }}
-
{{ accompanyingCourse.requestor.altNames }}
+
+
+ {{ $t('requestor.birthdate') }}
+ {{ $d(accompanyingCourse.requestor.birthdate.datetime, 'short') }}
+
+ {{ $t('requestor.center') }}
+ {{ accompanyingCourse.requestor.center.name }}
+
+ {{ $t('requestor.phonenumber') }}
+ {{ accompanyingCourse.requestor.phonenumber }}
+ {{ $t('requestor.mobilenumber') }}
+ {{ accompanyingCourse.requestor.mobilenumber }}
+
+
+
+
+ {{ $t('requestor.address') }}
+ {{ accompanyingCourse.requestor.address.text }}
+
+ {{ $t('requestor.location') }}
+ {{ accompanyingCourse.requestor.address.postcode.name }}
+
+
+
+
+
+
+
+ {{ $t('action.remove') }}
+
+
+
-
-
{{ $t('requestor.person_id') }}
- {{ accompanyingCourse.requestor.thirdparty_id }}
- {{ $t('requestor.address') }}
- {{ accompanyingCourse.requestor.address.text }}
- {{ $t('requestor.location') }}
- {{ accompanyingCourse.requestor.address.postcode.name }}
-
+
+
+ {{ $t('requestor.counter') }}
+
+
+
-
-
-
-
-
-
@@ -95,6 +107,13 @@ export default {
get() {
return this.$store.state.accompanyingCourse.requestorAnonymous;
}
+ },
+ url() {
+ return (this.accompanyingCourse.requestor.type === 'person') ? {
+ show: `/fr/person/${this.accompanyingCourse.requestor.id}/general`,
+ } : {
+ show: `/fr/thirdparty/thirdparty/${this.accompanyingCourse.requestor.id}/show`,
+ }
}
},
methods: {
@@ -111,3 +130,28 @@ export default {
}
}
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue
index 07e808691..596da7483 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources.vue
@@ -1,10 +1,13 @@
-
{{ $t('resources.title')}}
+
{{ $t('resources.title')}}
-
{{ $tc('resources.counter', counter) }}
-
+
+ {{ $tc('resources.counter', counter) }}
+
+
+
{{ $t('resources.text') }}
@@ -22,14 +25,16 @@
-
-
+
@@ -37,7 +42,7 @@
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue
new file mode 100644
index 000000000..3bc1ea33a
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav.vue
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue
new file mode 100644
index 000000000..413f216cc
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/StickyNav/Item.vue
@@ -0,0 +1,30 @@
+
+
+
+ {{ item.key }}
+
+
+
+ {{ item.key }}
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue
index 7f3a49f1c..a72902b25 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Test.vue
@@ -1,6 +1,6 @@
-
Tests
+
Tests
@@ -19,7 +19,7 @@
- Le titre de ma modale
+ Le titre de ma modale
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus luctus facilisis suscipit. Cras pulvinar, purus sagittis pulvinar porta, enim ex posuere lacus, in pulvinar lectus magna in odio. Nullam iaculis congue lorem ac suscipit. Proin ut rutrum augue. Ut vehicula risus nec hendrerit ullamcorper. Ut volutpat eu mi eget viverra. Morbi dictum placerat suscipit.
@@ -39,7 +39,7 @@
- Une autre modale
+ Une autre modale
modal 2
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js
index 66b6d6683..2a7f19d61 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/index.js
@@ -4,20 +4,47 @@ import { appMessages } from './js/i18n'
import { initPromise } from './store'
import App from './App.vue';
+import Banner from './components/Banner.vue';
-initPromise.then(store => {
+const root = window.vueRootComponent;
- //console.log('store in create_store', store);
- //console.log('store accompanyingCourse', store.state.accompanyingCourse);
-
- const i18n = _createI18n(appMessages);
-
- const app = createApp({
- template: ` `,
- })
- .use(store)
- .use(i18n)
- .component('app', App)
- .mount('#accompanying-course');
+/*
+* Load all App component, for AccompanyingCourse edition page
+*/
+if (root === 'app') {
-});
+ initPromise.then(store => {
+
+ const i18n = _createI18n(appMessages);
+
+ const app = createApp({
+ template: ` `,
+ })
+ .use(store)
+ .use(i18n)
+ .component('app', App)
+ .mount('#accompanying-course');
+
+ });
+}
+
+/*
+* Load only Banner sub-component, for all others AccompanyingCourse page
+*/
+if (root === 'banner') {
+
+ initPromise.then(store => {
+
+ const i18n = _createI18n(appMessages);
+
+ const app = createApp({
+ template: ` `,
+ })
+ .use(store)
+ .use(i18n)
+ .component('banner', Banner)
+ .mount('#accompanying-course');
+
+ });
+
+}
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js
index 4058e179a..242d48b8f 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/js/i18n.js
@@ -4,7 +4,10 @@ const appMessages = {
fr: {
course: {
id: "id",
- title: "Parcours",
+ title: {
+ draft: "Création d'un nouveau parcours",
+ active: "Modification du parcours"
+ },
opening_date: "Date d'ouverture",
closing_date: "Date de clôture",
remark: "Commentaire",
@@ -14,7 +17,6 @@ const appMessages = {
status: "État",
step: {
draft: "Brouillon",
- open: "Ouvert",
active: "En file active"
},
open_at: "ouvert le ",
@@ -26,7 +28,7 @@ const appMessages = {
},
persons_associated: {
title: "Usagers concernés",
- counter: "Pas d'usager | 1 usager | {count} usagers",
+ counter: "Il n'y a pas encore d'usager | 1 usager | {count} usagers",
firstname: "Prénom",
lastname: "Nom",
startdate: "Date d'entrée",
@@ -37,6 +39,7 @@ const appMessages = {
title: "Demandeur",
add_requestor: "Ajouter un demandeur",
is_anonymous: "Le demandeur est anonyme",
+ counter: "Il n'y a pas encore de demandeur",
type: "Type",
person_id: "id",
text: "Dénomination",
@@ -52,25 +55,34 @@ const appMessages = {
},
social_issue: {
title: "Problématiques sociales",
+ label: "Choisir les problématiques sociales",
},
referrer: {
- title: "Référent",
+ title: "Référent du parcours",
+ label: "Vous pouvez choisir un TMS ou vous assigner directement comme référent",
+ placeholder: "Choisir un TMS",
+ assign_me: "M'assigner comme référent",
},
resources: {
title: "Interlocuteurs privilégiés",
- counter: "Pas d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
+ counter: "Il n'y a pas encore d'interlocuteur | 1 interlocuteur | {count} interlocuteurs",
text: "Dénomination",
description: "Description",
add_resources: "Ajouter des interlocuteurs",
},
comment: {
- title: "Ajout d'une note",
- content: "Rédigez une première note..."
+ title: "Observations",
+ label: "Ajout d'une note",
+ content: "Rédigez une première note...",
+ created_by: "créé par {0}, le {1}"
},
confirm: {
title: "Confirmation",
- text_draft: "Le parcours est actuellement au statut de brouillon. En validant cette étape, vous lui donnez le statut actif.",
- ok: "Activer le parcours"
+ text_draft: "Le parcours est actuellement à l'état de ",
+ text_active: "En validant cette étape, vous lui donnez le statut ",
+ sure: "Êtes-vous sûr ?",
+ sure_description: "Une fois le changement confirmé, il n'est plus possible de le remettre à l'état de brouillon !",
+ ok: "Confirmer le parcours"
},
}
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
index 9efdd8d81..279bfc2a4 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
@@ -1,10 +1,12 @@
import 'es6-promise/auto';
import { createStore } from 'vuex';
import { getAccompanyingCourse,
- patchAccompanyingCourse,
+ patchAccompanyingCourse,
+ confirmAccompanyingCourse,
postParticipation,
postRequestor,
- postResource } from '../api';
+ postResource,
+ postSocialIssue } from '../api';
const debug = process.env.NODE_ENV !== 'production';
const id = window.accompanyingCourseId;
@@ -73,8 +75,15 @@ let initPromise = getAccompanyingCourse(id)
state.accompanyingCourse.confidential = value;
},
postFirstComment(state, comment) {
- console.log('### mutation: postFirstComment', comment);
+ //console.log('### mutation: postFirstComment', comment);
state.accompanyingCourse.initialComment = comment;
+ },
+ updateSocialIssues(state, value) {
+ state.accompanyingCourse.socialIssues = value;
+ },
+ confirmAccompanyingCourse(state, response) {
+ //console.log('### mutation: confirmAccompanyingCourse: response', response);
+ state.accompanyingCourse.step = response.step;
}
},
actions: {
@@ -140,7 +149,7 @@ let initPromise = getAccompanyingCourse(id)
})).catch((error) => { commit('catchError', error) });
},
toggleIntensity({ commit }, payload) {
- console.log(payload);
+ //console.log(payload);
patchAccompanyingCourse(id, { type: "accompanying_period", intensity: payload })
.then(course => new Promise((resolve, reject) => {
commit('toggleIntensity', course.intensity);
@@ -162,12 +171,31 @@ let initPromise = getAccompanyingCourse(id)
})).catch((error) => { commit('catchError', error) });
},
postFirstComment({ commit }, payload) {
- console.log('## action: postFirstComment: payload', payload);
+ //console.log('## action: postFirstComment: payload', payload);
patchAccompanyingCourse(id, { type: "accompanying_period", initialComment: payload })
.then(course => new Promise((resolve, reject) => {
commit('postFirstComment', course.initialComment);
resolve();
})).catch((error) => { commit('catchError', error) });
+ },
+ updateSocialIssues({ commit }, { payload, body, method }) {
+ //console.log('## action: payload', { payload, body, method });
+ postSocialIssue(id, body, method)
+ .then(response => new Promise((resolve, reject) => {
+ //console.log('response', response);
+ commit('updateSocialIssues', payload);
+ resolve();
+ })).catch((error) => { commit('catchError', error) });
+ },
+ confirmAccompanyingCourse({ commit }) {
+ //console.log('## action: confirmAccompanyingCourse');
+ confirmAccompanyingCourse(id)
+ .then(response => new Promise((resolve, reject) => {
+ window.location.replace(`/fr/parcours/${id}`);
+ console.log('fetch resolve');
+ commit('confirmAccompanyingCourse', response);
+ resolve();
+ })).catch((error) => { commit('catchError', error) });
}
}
});
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue
index 83143f1b5..a37f93e7e 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons.vue
@@ -1,7 +1,11 @@
-
- {{ $t(buttonTitle) }}
-
+
+
+
+ {{ $t(buttonTitle) }}
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
index d71fce599..3846f7b39 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/AddPersons/PersonSuggestion.vue
@@ -7,7 +7,7 @@
v-model="selected"
name="item"
v-bind:id="item"
- v-bind:value="setValueIfType(item, type)" />
+ v-bind:value="setValueByType(item, type)" />
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig
index 94663e2f0..3c1d0dadc 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/banner.html.twig
@@ -2,39 +2,24 @@