mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge remote-tracking branch 'origin/master' into issue589_private_comments
This commit is contained in:
@@ -247,7 +247,7 @@ final class AccompanyingCourseApiController extends ApiController
|
||||
}
|
||||
|
||||
if (null === $requestor) {
|
||||
throw new BadRequestHttpException('Could not find any person or thirdparty', 0, null);
|
||||
throw new BadRequestHttpException('Could not find any person or thirdparty');
|
||||
}
|
||||
|
||||
$accompanyingPeriod->setRequestor($requestor);
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
/**
|
||||
* Class AdminController.
|
||||
@@ -19,13 +20,35 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
class AdminController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @param $_locale
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
* @Route("/{_locale}/admin/accompanying-course", name="chill_accompanying-course_admin_index")
|
||||
*/
|
||||
public function indexAction($_locale)
|
||||
public function indexAccompanyingCourseAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:layout.html.twig', []);
|
||||
return $this->render('ChillPersonBundle:Admin:indexAccompanyingCourse.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/household", name="chill_household_admin_index")
|
||||
*/
|
||||
public function indexHouseholdAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexHousehold.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/person", name="chill_person_admin_index")
|
||||
*/
|
||||
public function indexPersonAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexPerson.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/{_locale}/admin/social-work", name="chill_social-work_admin_index")
|
||||
*/
|
||||
public function indexSocialWorkAdminAction()
|
||||
{
|
||||
return $this->render('ChillPersonBundle:Admin:indexSocialWork.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminMaritalStatusController.
|
||||
*/
|
||||
class AdminMaritalStatusController extends CRUDController
|
||||
{
|
||||
// for minimal cases, nothing is required here !
|
||||
}
|
@@ -16,13 +16,13 @@ use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Class AdminClosingMotiveController
|
||||
* Class ClosingMotiveController
|
||||
* Controller for closing motives.
|
||||
*/
|
||||
class AdminClosingMotiveController extends CRUDController
|
||||
class ClosingMotiveController extends CRUDController
|
||||
{
|
||||
/**
|
||||
* @param \Chill\MainBundle\CRUD\Controller\string|string $action
|
||||
* @param string $action
|
||||
*/
|
||||
protected function createEntity($action, Request $request): object
|
||||
{
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class HouseholdPositionController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class MaritalStatusController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
26
src/Bundle/ChillPersonBundle/Controller/OriginController.php
Normal file
26
src/Bundle/ChillPersonBundle/Controller/OriginController.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class OriginController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -12,12 +12,15 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Form\CreationPersonType;
|
||||
use Chill\PersonBundle\Form\PersonType;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||
@@ -31,8 +34,8 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use function count;
|
||||
use function hash;
|
||||
use function implode;
|
||||
@@ -248,6 +251,31 @@ final class PersonController extends AbstractController
|
||||
$this->em->flush();
|
||||
$this->lastPostDataReset();
|
||||
|
||||
$address = $form->get('address')->getData();
|
||||
$addressForm = (bool) $form->get('addressForm')->getData();
|
||||
|
||||
if (null !== $address && $addressForm) {
|
||||
$household = new Household();
|
||||
|
||||
$member = new HouseholdMember();
|
||||
$member->setPerson($person);
|
||||
$member->setStartDate(new DateTimeImmutable());
|
||||
|
||||
$household->addMember($member);
|
||||
$household->setForceAddress($address);
|
||||
|
||||
$this->em->persist($member);
|
||||
$this->em->persist($household);
|
||||
$this->em->flush();
|
||||
|
||||
if ($form->get('createHousehold')->isClicked()) {
|
||||
return $this->redirectToRoute('chill_person_household_members_editor', [
|
||||
'persons' => [$person->getId()],
|
||||
'household' => $household->getId(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if ($form->get('createPeriod')->isClicked()) {
|
||||
return $this->redirectToRoute('chill_person_accompanying_course_new', [
|
||||
'person_id' => [$person->getId()],
|
||||
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class PersonResourceKindController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class RelationController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminSocialIssueController
|
||||
* Controller for social issues.
|
||||
*/
|
||||
class AdminEvaluationController extends CRUDController
|
||||
{
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminSocialIssueController
|
||||
* Controller for social issues.
|
||||
*/
|
||||
class AdminGoalController extends CRUDController
|
||||
{
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminSocialIssueController
|
||||
* Controller for social issues.
|
||||
*/
|
||||
class AdminResultController extends CRUDController
|
||||
{
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminSocialIssueController
|
||||
* Controller for social issues.
|
||||
*/
|
||||
class AdminSocialActionController extends CRUDController
|
||||
{
|
||||
}
|
@@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
/**
|
||||
* Class AdminSocialIssueController
|
||||
* Controller for social issues.
|
||||
*/
|
||||
class AdminSocialIssueController extends CRUDController
|
||||
{
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class EvaluationController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class GoalController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class ResultController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class SocialActionController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.ordering', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Controller\SocialWork;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class SocialIssueController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.ordering', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@@ -146,13 +146,13 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class,
|
||||
'name' => 'closing_motive',
|
||||
'base_path' => '/admin/closing-motive',
|
||||
'base_path' => '/admin/person/closing-motive',
|
||||
'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\AdminClosingMotiveController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\ClosingMotiveController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'template' => '@ChillPerson/ClosingMotive/index.html.twig',
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/ClosingMotive/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -164,12 +164,33 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
|
||||
'name' => 'origin',
|
||||
'base_path' => '/admin/person/origin',
|
||||
'form_class' => \Chill\PersonBundle\Form\OriginType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\OriginController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Origin/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Origin/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Origin/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\MaritalStatus::class,
|
||||
'name' => 'marital_status',
|
||||
'base_path' => '/admin/marital-status',
|
||||
'name' => 'person_marital-status',
|
||||
'base_path' => '/admin/person/marital-status',
|
||||
'form_class' => \Chill\PersonBundle\Form\MaritalStatusType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\AdminMaritalStatusController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\MaritalStatusController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -185,12 +206,75 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\Household\Position::class,
|
||||
'name' => 'person_household_position',
|
||||
'base_path' => '/admin/person/household/position',
|
||||
'form_class' => \Chill\PersonBundle\Form\HouseholdPositionType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\HouseholdPositionController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/HouseholdPosition/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/HouseholdPosition/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/HouseholdPosition/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\Relationships\Relation::class,
|
||||
'name' => 'person_relation',
|
||||
'base_path' => '/admin/person/relation',
|
||||
'form_class' => \Chill\PersonBundle\Form\RelationType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\RelationController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Relation/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Relation/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/Relation/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\Person\PersonResourceKind::class,
|
||||
'name' => 'person_resource-kind',
|
||||
'base_path' => '/admin/person/resource-kind',
|
||||
'form_class' => \Chill\PersonBundle\Form\PersonResourceKindType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\PersonResourceKindController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/PersonResourceKind/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/PersonResourceKind/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/PersonResourceKind/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class,
|
||||
'name' => 'social_issue',
|
||||
'base_path' => '/admin/social-work/social-issue',
|
||||
'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialIssueType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialIssueController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialIssueController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -202,7 +286,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/SocialWork/edit.html.twig',
|
||||
'template' => '@ChillPerson/SocialWork/SocialIssue/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -211,7 +295,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'name' => 'social_action',
|
||||
'base_path' => '/admin/social-work/social-action',
|
||||
'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialActionType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialActionController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialActionController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -223,7 +307,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillPerson/SocialWork/edit.html.twig',
|
||||
'template' => '@ChillPerson/SocialWork/SocialAction/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
@@ -232,7 +316,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'name' => 'social_goal',
|
||||
'base_path' => '/admin/social-work/goal',
|
||||
'form_class' => \Chill\PersonBundle\Form\SocialWork\GoalType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminGoalController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\GoalController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -253,7 +337,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'name' => 'social_result',
|
||||
'base_path' => '/admin/social-work/result',
|
||||
'form_class' => \Chill\PersonBundle\Form\SocialWork\ResultType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminResultController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\ResultController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -274,7 +358,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'name' => 'social_evaluation',
|
||||
'base_path' => '/admin/social-work/evaluation',
|
||||
'form_class' => \Chill\PersonBundle\Form\SocialWork\EvaluationType::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminEvaluationController::class,
|
||||
'controller' => \Chill\PersonBundle\Controller\SocialWork\EvaluationController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
@@ -555,6 +639,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
||||
'methods' => [
|
||||
Request::METHOD_GET => true,
|
||||
Request::METHOD_HEAD => true,
|
||||
Request::METHOD_POST => true,
|
||||
],
|
||||
],
|
||||
'suggestHouseholdByAccompanyingPeriodParticipation' => [
|
||||
|
@@ -35,7 +35,7 @@ class HouseholdMember
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
* @Assert\GreaterThan(
|
||||
* @Assert\GreaterThanOrEqual(
|
||||
* propertyPath="startDate",
|
||||
* message="household_membership.The end date must be after start date",
|
||||
* groups={"household_memberships"}
|
||||
@@ -82,14 +82,13 @@ class HouseholdMember
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=Position::class)
|
||||
* @Serializer\Groups({"read", "docgen:read"})
|
||||
* @Assert\NotNull(groups={"household_memberships_created"})
|
||||
*/
|
||||
private ?Position $position = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="boolean", name="sharedhousehold")
|
||||
*/
|
||||
private bool $shareHousehold = false;
|
||||
private bool $shareHousehold = true;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
|
||||
@@ -201,15 +200,18 @@ class HouseholdMember
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPosition(Position $position): self
|
||||
public function setPosition(?Position $position): self
|
||||
{
|
||||
if ($this->position instanceof Position) {
|
||||
if ($this->position instanceof Position && $this->position !== $position) {
|
||||
throw new LogicException('The position is already set. You cannot change ' .
|
||||
'a position of a membership');
|
||||
}
|
||||
|
||||
$this->position = $position;
|
||||
$this->shareHousehold = $position->getShareHousehold();
|
||||
|
||||
if (null !== $position) {
|
||||
$this->shareHousehold = $position->getShareHousehold();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@@ -121,14 +121,14 @@ class Evaluation
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDelay(DateInterval $delay): self
|
||||
public function setDelay(?DateInterval $delay): self
|
||||
{
|
||||
$this->delay = $delay;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setNotificationDelay(DateInterval $notificationDelay): self
|
||||
public function setNotificationDelay(?DateInterval $notificationDelay): self
|
||||
{
|
||||
$this->notificationDelay = $notificationDelay;
|
||||
|
||||
|
@@ -45,7 +45,7 @@ class Result
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
private DateTime $desactivationDate;
|
||||
private ?DateTime $desactivationDate;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results")
|
||||
|
@@ -11,10 +11,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Form\Event\CustomizeFormEvent;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\ChillPhoneNumberType;
|
||||
use Chill\MainBundle\Form\Type\PickAddressType;
|
||||
use Chill\MainBundle\Form\Type\PickCenterType;
|
||||
use Chill\MainBundle\Form\Type\PickCivilityType;
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\PersonBundle\Form\Type\GenderType;
|
||||
@@ -24,9 +27,12 @@ use libphonenumber\PhoneNumberType;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\Callback;
|
||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||
|
||||
final class CreationPersonType extends AbstractType
|
||||
{
|
||||
@@ -55,6 +61,11 @@ final class CreationPersonType extends AbstractType
|
||||
$builder
|
||||
->add('firstName')
|
||||
->add('lastName')
|
||||
->add('civility', PickCivilityType::class, [
|
||||
'required' => false,
|
||||
'label' => 'Civility',
|
||||
'placeholder' => 'choose civility',
|
||||
])
|
||||
->add('gender', GenderType::class, [
|
||||
'required' => true, 'placeholder' => null,
|
||||
])
|
||||
@@ -71,6 +82,17 @@ final class CreationPersonType extends AbstractType
|
||||
])
|
||||
->add('email', EmailType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('addressForm', CheckboxType::class, [
|
||||
'label' => 'Create a household and add an address',
|
||||
'required' => false,
|
||||
'mapped' => false,
|
||||
'help' => 'A new household will be created. The person will be member of this household.',
|
||||
])
|
||||
->add('address', PickAddressType::class, [
|
||||
'required' => false,
|
||||
'mapped' => false,
|
||||
'label' => false,
|
||||
]);
|
||||
|
||||
if ($this->askCenters) {
|
||||
@@ -97,6 +119,9 @@ final class CreationPersonType extends AbstractType
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Person::class,
|
||||
'constraints' => [
|
||||
new Callback([$this, 'validateCheckedAddress']),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -107,4 +132,18 @@ final class CreationPersonType extends AbstractType
|
||||
{
|
||||
return self::NAME;
|
||||
}
|
||||
|
||||
public function validateCheckedAddress($data, ExecutionContextInterface $context, $payload): void
|
||||
{
|
||||
/** @var bool $addressFrom */
|
||||
$addressFrom = $context->getObject()->get('addressForm')->getData();
|
||||
/** @var ?Address $address */
|
||||
$address = $context->getObject()->get('address')->getData();
|
||||
|
||||
if ($addressFrom && null === $address) {
|
||||
$context->buildViolation('person_creation.If you want to create an household, an address is required')
|
||||
->atPath('addressForm')
|
||||
->addViolation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,12 +26,15 @@ class HouseholdMemberType extends AbstractType
|
||||
'input' => 'datetime_immutable',
|
||||
]);
|
||||
|
||||
if (!$options['data']->getPosition()->getShareHousehold()) {
|
||||
$builder->add('endDate', ChillDateType::class, [
|
||||
'label' => 'household.End date',
|
||||
'input' => 'datetime_immutable',
|
||||
]);
|
||||
if (null !== $options['data']->getPosition()) {
|
||||
if (!$options['data']->getPosition()->getShareHousehold()) {
|
||||
$builder->add('endDate', ChillDateType::class, [
|
||||
'label' => 'household.End date',
|
||||
'input' => 'datetime_immutable',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$builder
|
||||
->add('comment', ChillTextareaType::class, [
|
||||
'label' => 'household.Comment',
|
||||
|
47
src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php
Normal file
47
src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\PersonBundle\Entity\Household\Position;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class HouseholdPositionType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('label', TranslatableStringFormType::class)
|
||||
->add('allowHolder', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'household.allowHolder',
|
||||
])
|
||||
->add('shareHousehold', CheckboxType::class, [
|
||||
'required' => false,
|
||||
'label' => 'household.shareHousehold',
|
||||
])
|
||||
->add('ordering', NumberType::class, [
|
||||
'required' => true,
|
||||
'scale' => 5,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Position::class);
|
||||
}
|
||||
}
|
39
src/Bundle/ChillPersonBundle/Form/OriginType.php
Normal file
39
src/Bundle/ChillPersonBundle/Form/OriginType.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Origin;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class OriginType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('label', TranslatableStringFormType::class)
|
||||
->add('noActiveAfter', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'input' => 'datetime_immutable',
|
||||
'label' => 'origin.noActiveAfter',
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Origin::class);
|
||||
}
|
||||
}
|
40
src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php
Normal file
40
src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\PersonBundle\Entity\Person\PersonResourceKind;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PersonResourceKindType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('title', TranslatableStringFormType::class)
|
||||
->add('isActive', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'Active' => true,
|
||||
'Inactive' => false,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', PersonResourceKind::class);
|
||||
}
|
||||
}
|
42
src/Bundle/ChillPersonBundle/Form/RelationType.php
Normal file
42
src/Bundle/ChillPersonBundle/Form/RelationType.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\PersonBundle\Entity\Relationships\Relation;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class RelationType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder
|
||||
->add('title', TranslatableStringFormType::class, [
|
||||
'label' => 'relation.title',
|
||||
])
|
||||
->add('reverseTitle', TranslatableStringFormType::class, [
|
||||
'label' => 'relation.reverseTitle',
|
||||
])
|
||||
->add('isActive', CheckboxType::class, [
|
||||
'required' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver
|
||||
->setDefault('class', Relation::class);
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form\SocialWork;
|
||||
|
||||
use Chill\MainBundle\Form\Type\DateIntervalType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
|
||||
@@ -39,9 +40,14 @@ class EvaluationType extends AbstractType
|
||||
->add('title', TranslatableStringFormType::class, [
|
||||
'label' => 'Nom',
|
||||
])
|
||||
->add('delay')
|
||||
|
||||
->add('notificationDelay');
|
||||
->add('delay', DateIntervalType::class, [
|
||||
'label' => 'evaluation.delay',
|
||||
'required' => false,
|
||||
])
|
||||
->add('notificationDelay', DateIntervalType::class, [
|
||||
'label' => 'evaluation.notificationDelay',
|
||||
'required' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
|
@@ -11,13 +11,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form\SocialWork;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -52,11 +53,18 @@ class GoalType extends AbstractType
|
||||
},
|
||||
])
|
||||
|
||||
->add('desactivationDate', DateType::class, [
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
->add('results', EntityType::class, [
|
||||
'class' => Result::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'choice_label' => function (Result $r) {
|
||||
return $this->translatableStringHelper->localize($r->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('desactivationDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => 'goal.desactivationDate',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -11,11 +11,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form\SocialWork;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -40,13 +40,10 @@ class ResultType extends AbstractType
|
||||
->add('title', TranslatableStringFormType::class, [
|
||||
'label' => 'Nom',
|
||||
])
|
||||
->add('accompanyingPeriodWorks')
|
||||
->add('accompanyingPeriodWorkGoals')
|
||||
->add('desactivationDate', DateType::class, [
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
|
||||
->add('desactivationDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => 'goal.desactivationDate',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -11,13 +11,18 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form\SocialWork;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\DateIntervalType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -44,6 +49,7 @@ class SocialActionType extends AbstractType
|
||||
])
|
||||
->add('issue', EntityType::class, [
|
||||
'class' => SocialIssue::class,
|
||||
'label' => 'socialAction.socialIssue',
|
||||
'choice_label' => function (SocialIssue $issue) {
|
||||
return $this->translatableStringHelper->localize($issue->getTitle());
|
||||
},
|
||||
@@ -55,12 +61,47 @@ class SocialActionType extends AbstractType
|
||||
return $this->translatableStringHelper->localize($issue->getTitle());
|
||||
},
|
||||
])
|
||||
->add('defaultNotificationDelay')
|
||||
->add('desactivationDate', DateType::class, [
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
->add('ordering', NumberType::class, [
|
||||
'required' => true,
|
||||
'scale' => 6,
|
||||
])
|
||||
->add('results', EntityType::class, [
|
||||
'class' => Result::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'choice_label' => function (Result $r) {
|
||||
return $this->translatableStringHelper->localize($r->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('goals', EntityType::class, [
|
||||
'class' => Goal::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'choice_label' => function (Goal $g) {
|
||||
return $this->translatableStringHelper->localize($g->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('evaluations', EntityType::class, [
|
||||
'class' => Evaluation::class,
|
||||
'required' => false,
|
||||
'multiple' => true,
|
||||
'attr' => ['class' => 'select2'],
|
||||
'choice_label' => function (Evaluation $e) {
|
||||
return $this->translatableStringHelper->localize($e->getTitle());
|
||||
},
|
||||
])
|
||||
|
||||
->add('defaultNotificationDelay', DateIntervalType::class, [
|
||||
'label' => 'socialAction.defaultNotificationDelay',
|
||||
'required' => false,
|
||||
])
|
||||
->add('desactivationDate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
'label' => 'goal.desactivationDate',
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -11,12 +11,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Form\SocialWork;
|
||||
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@@ -41,10 +42,12 @@ class SocialIssueType extends AbstractType
|
||||
'required' => false,
|
||||
'choice_label' => fn (SocialIssue $issue): ?string => $this->translatableStringHelper->localize($issue->getTitle()),
|
||||
])
|
||||
->add('desactivationDate', DateType::class, [
|
||||
'attr' => ['class' => 'datepicker'],
|
||||
'widget' => 'single_text',
|
||||
'format' => 'dd-MM-yyyy',
|
||||
->add('ordering', NumberType::class, [
|
||||
'required' => true,
|
||||
'scale' => 6,
|
||||
])
|
||||
->add('desactivationDate', ChillDateType::class, [
|
||||
'label' => 'goal.desactivationDate',
|
||||
'required' => false,
|
||||
]);
|
||||
}
|
||||
|
@@ -55,7 +55,7 @@ class MembersEditor
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
public function addMovement(DateTimeImmutable $date, Person $person, Position $position, ?bool $holder = false, ?string $comment = null): self
|
||||
public function addMovement(DateTimeImmutable $date, Person $person, ?Position $position, ?bool $holder = false, ?string $comment = null): self
|
||||
{
|
||||
if (null === $this->household) {
|
||||
throw new LogicException('You must define a household first');
|
||||
@@ -69,68 +69,70 @@ class MembersEditor
|
||||
->setComment($comment);
|
||||
$this->household->addMember($membership);
|
||||
|
||||
if ($position->getShareHousehold()) {
|
||||
// launch event only if moving to a "share household" position,
|
||||
// and if the destination household is different than the previous one
|
||||
$event = new PersonAddressMoveEvent($person);
|
||||
$event->setNextMembership($membership);
|
||||
if (null !== $position) {
|
||||
if ($position->getShareHousehold()) {
|
||||
// launch event only if moving to a "share household" position,
|
||||
// and if the destination household is different than the previous one
|
||||
$event = new PersonAddressMoveEvent($person);
|
||||
$event->setNextMembership($membership);
|
||||
|
||||
$counter = 0;
|
||||
$counter = 0;
|
||||
|
||||
foreach ($person->getHouseholdParticipationsShareHousehold() as $participation) {
|
||||
if ($participation === $membership) {
|
||||
continue;
|
||||
}
|
||||
foreach ($person->getHouseholdParticipationsShareHousehold() as $participation) {
|
||||
if ($participation === $membership) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($participation->getStartDate() > $membership->getStartDate()) {
|
||||
continue;
|
||||
}
|
||||
if ($participation->getStartDate() > $membership->getStartDate()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
++$counter;
|
||||
++$counter;
|
||||
|
||||
if ($participation->getEndDate() === null || $participation->getEndDate() > $date) {
|
||||
$participation->setEndDate($date);
|
||||
$this->membershipsAffected[] = $participation;
|
||||
$this->oldMembershipsHashes[] = spl_object_hash($participation);
|
||||
if ($participation->getEndDate() === null || $participation->getEndDate() > $date) {
|
||||
$participation->setEndDate($date);
|
||||
$this->membershipsAffected[] = $participation;
|
||||
$this->oldMembershipsHashes[] = spl_object_hash($participation);
|
||||
|
||||
if ($participation->getHousehold() !== $this->household) {
|
||||
$event->setPreviousMembership($participation);
|
||||
$this->events[] = $event;
|
||||
if ($participation->getHousehold() !== $this->household) {
|
||||
$event->setPreviousMembership($participation);
|
||||
$this->events[] = $event;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// send also the event if there was no participation before
|
||||
if (0 === $counter) {
|
||||
$this->events[] = $event;
|
||||
}
|
||||
|
||||
foreach ($person->getHouseholdParticipationsNotShareHousehold() as $participation) {
|
||||
if ($participation->getHousehold() === $this->household
|
||||
&& $participation->getEndDate() === null || $participation->getEndDate() > $membership->getStartDate()
|
||||
&& $participation->getStartDate() <= $membership->getStartDate()
|
||||
) {
|
||||
$participation->setEndDate($membership->getStartDate());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if a members is moved to the same household than the one he belongs to,
|
||||
// we should make it leave the household
|
||||
if ($person->getCurrentHousehold($date) === $this->household) {
|
||||
$this->leaveMovement($date, $person);
|
||||
}
|
||||
|
||||
// if there are multiple belongings not sharing household, close the others
|
||||
foreach ($person->getHouseholdParticipationsNotShareHousehold() as $participation) {
|
||||
if ($participation === $membership) {
|
||||
continue;
|
||||
// send also the event if there was no participation before
|
||||
if (0 === $counter) {
|
||||
$this->events[] = $event;
|
||||
}
|
||||
|
||||
if ($participation->getHousehold() === $this->household
|
||||
&& ($participation->getEndDate() === null || $participation->getEndDate() > $membership->getStartDate())
|
||||
&& $participation->getStartDate() <= $membership->getStartDate()
|
||||
) {
|
||||
$participation->setEndDate($membership->getStartDate());
|
||||
foreach ($person->getHouseholdParticipationsNotShareHousehold() as $participation) {
|
||||
if ($participation->getHousehold() === $this->household
|
||||
&& $participation->getEndDate() === null || $participation->getEndDate() > $membership->getStartDate()
|
||||
&& $participation->getStartDate() <= $membership->getStartDate()
|
||||
) {
|
||||
$participation->setEndDate($membership->getStartDate());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if a members is moved to the same household than the one he belongs to,
|
||||
// we should make it leave the household
|
||||
if ($person->getCurrentHousehold($date) === $this->household) {
|
||||
$this->leaveMovement($date, $person);
|
||||
}
|
||||
|
||||
// if there are multiple belongings not sharing household, close the others
|
||||
foreach ($person->getHouseholdParticipationsNotShareHousehold() as $participation) {
|
||||
if ($participation === $membership) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($participation->getHousehold() === $this->household
|
||||
&& ($participation->getEndDate() === null || $participation->getEndDate() > $membership->getStartDate())
|
||||
&& $participation->getStartDate() <= $membership->getStartDate()
|
||||
) {
|
||||
$participation->setEndDate($membership->getStartDate());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminAccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('person_admin.accompanying_period', [
|
||||
'route' => 'chill_accompanying-course_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2200,
|
||||
'icons' => ['random'],
|
||||
]);
|
||||
|
||||
$menu->addChild('person_admin.closing motives', [
|
||||
'route' => 'chill_crud_closing_motive_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
|
||||
$menu->addChild('person_admin.origin', [
|
||||
'route' => 'chill_crud_origin_index',
|
||||
])->setExtras(['order' => 2210]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_accompanying_course'];
|
||||
}
|
||||
}
|
@@ -15,7 +15,7 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
class AdminHouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
@@ -33,16 +33,26 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Person', [
|
||||
'route' => 'chill_person_admin',
|
||||
$menu->addChild('Household', [
|
||||
'route' => 'chill_household_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 20,
|
||||
'order' => 2100,
|
||||
'icons' => ['home'],
|
||||
]);
|
||||
|
||||
$menu->addChild('Position', [
|
||||
'route' => 'chill_crud_person_household_position_index',
|
||||
])->setExtras(['order' => 2110]);
|
||||
|
||||
$menu->addChild('person_admin.relation', [
|
||||
'route' => 'chill_crud_person_relation_index',
|
||||
])->setExtras(['order' => 2120]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section'];
|
||||
return ['admin_section', 'admin_household'];
|
||||
}
|
||||
}
|
62
src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php
Normal file
62
src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminPersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('Person', [
|
||||
'route' => 'chill_person_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2000,
|
||||
'icons' => ['child'],
|
||||
]);
|
||||
|
||||
$menu->addChild('Civility', [
|
||||
'route' => 'chill_crud_main_civility_index',
|
||||
])->setExtras(['order' => 2010]);
|
||||
|
||||
$menu->addChild('Marital status', [
|
||||
'route' => 'chill_crud_person_marital-status_index',
|
||||
])->setExtras(['order' => 2020]);
|
||||
|
||||
$menu->addChild('person_admin.person_resource_kind', [
|
||||
'route' => 'chill_crud_person_resource-kind_index',
|
||||
])->setExtras(['order' => 2030]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_person'];
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
|
||||
class AdminSocialWorkMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
/**
|
||||
* @var AuthorizationCheckerInterface
|
||||
*/
|
||||
protected $authorizationChecker;
|
||||
|
||||
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
|
||||
{
|
||||
$this->authorizationChecker = $authorizationChecker;
|
||||
}
|
||||
|
||||
public function buildMenu($menuId, MenuItem $menu, array $parameters)
|
||||
{
|
||||
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu->addChild('person_admin.social_work', [
|
||||
'route' => 'chill_social-work_admin_index',
|
||||
])
|
||||
->setAttribute('class', 'list-group-item-header')
|
||||
->setExtras([
|
||||
'order' => 2300,
|
||||
'icons' => ['handshake-o'],
|
||||
]);
|
||||
|
||||
$menu->addChild('person_admin.social_action', [
|
||||
'route' => 'chill_crud_social_action_index',
|
||||
])->setExtras(['order' => 2301]);
|
||||
|
||||
$menu->addChild('person_admin.social_issue', [
|
||||
'route' => 'chill_crud_social_issue_index',
|
||||
])->setExtras(['order' => 2302]);
|
||||
|
||||
$menu->addChild('person_admin.social_goal', [
|
||||
'route' => 'chill_crud_social_goal_index',
|
||||
])->setExtras(['order' => 2310]);
|
||||
|
||||
$menu->addChild('person_admin.social_evaluation', [
|
||||
'route' => 'chill_crud_social_evaluation_index',
|
||||
])->setExtras(['order' => 2320]);
|
||||
|
||||
$menu->addChild('person_admin.social_result', [
|
||||
'route' => 'chill_crud_social_result_index',
|
||||
])->setExtras(['order' => 2330]);
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
{
|
||||
return ['admin_section', 'admin_social_work'];
|
||||
}
|
||||
}
|
@@ -0,0 +1,18 @@
|
||||
import { ShowHide } from 'ShowHide';
|
||||
|
||||
const addressForm = document.getElementById("addressForm");
|
||||
const address = document.getElementById("address");
|
||||
|
||||
new ShowHide({
|
||||
froms: [addressForm],
|
||||
container: [address],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
return input.checked;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
event_name: 'change'
|
||||
});
|
@@ -123,6 +123,7 @@ export default {
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
if (payload.data.civility !== null) { body.civility = {id: payload.data.civility.id, type: payload.data.civility.type }; }
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
|
@@ -150,6 +150,7 @@ export default {
|
||||
body.email = payload.data.email;
|
||||
body.altNames = payload.data.altNames;
|
||||
body.gender = payload.data.gender;
|
||||
if (payload.data.civility !== null) { body.civility = {id: payload.data.civility.id, type: payload.data.civility.type}; }
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/person/person/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
|
@@ -14,8 +14,13 @@ const getPersonAltNames = () =>
|
||||
fetch('/api/1.0/person/config/alt_names.json').then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});;
|
||||
});
|
||||
|
||||
const getCivilities = () =>
|
||||
fetch('/api/1.0/main/civility.json').then(response => {
|
||||
if (response.ok) { return response.json(); }
|
||||
throw Error('Error with request resource response');
|
||||
});
|
||||
|
||||
/*
|
||||
* POST a new person
|
||||
@@ -56,6 +61,7 @@ const patchPerson = (id, body) => {
|
||||
export {
|
||||
getPerson,
|
||||
getPersonAltNames,
|
||||
getCivilities,
|
||||
postPerson,
|
||||
patchPerson
|
||||
};
|
||||
|
@@ -277,12 +277,79 @@ export default {
|
||||
}
|
||||
},
|
||||
saveFormOnTheFly({ type, data }) {
|
||||
// console.log('saveFormOnTheFly from addPersons, type', type, ', data', data);
|
||||
console.log('saveFormOnTheFly from addPersons, type', type, ', data', data);
|
||||
if (type === 'person') {
|
||||
|
||||
makeFetch('POST', '/api/1.0/person/person.json', data)
|
||||
.then(response => {
|
||||
this.newPriorSuggestion(response);
|
||||
.then(responsePerson => {
|
||||
|
||||
this.newPriorSuggestion(responsePerson);
|
||||
this.$refs.onTheFly.closeModal();
|
||||
|
||||
if (null !== data.addressId) {
|
||||
const household = {
|
||||
'type': 'household'
|
||||
};
|
||||
const address = {
|
||||
'id': data.addressId
|
||||
};
|
||||
makeFetch('POST', '/api/1.0/person/household.json', household)
|
||||
.then(responseHousehold => {
|
||||
const member = {
|
||||
'concerned': [
|
||||
{
|
||||
'person': {
|
||||
'type': 'person',
|
||||
'id': responsePerson.id
|
||||
},
|
||||
'start_date': {
|
||||
// TODO: use date.js methods (low priority)
|
||||
'datetime': `${new Date().toISOString().split('T')[0]}T00:00:00+02:00`
|
||||
},
|
||||
'holder': false,
|
||||
'comment': null
|
||||
}
|
||||
],
|
||||
'destination': {
|
||||
'type': 'household',
|
||||
'id': responseHousehold.id
|
||||
},
|
||||
'composition': null
|
||||
};
|
||||
return makeFetch('POST', '/api/1.0/person/household/members/move.json', member)
|
||||
.then(_response => {
|
||||
makeFetch('POST', `/api/1.0/person/household/${responseHousehold.id}/address.json`, address)
|
||||
.then(_response => {})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
for (let v of error.violations) {
|
||||
this.$toast.open({message: v });
|
||||
}
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
if (error.name === 'ValidationException') {
|
||||
@@ -292,7 +359,8 @@ export default {
|
||||
} else {
|
||||
this.$toast.open({message: 'An error occurred'});
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
}
|
||||
else if (type === 'thirdparty') {
|
||||
makeFetch('POST', '/api/1.0/thirdparty/thirdparty.json', data)
|
||||
|
@@ -87,6 +87,20 @@
|
||||
<label>{{ $t('person.gender.title') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<select
|
||||
class="form-select form-select-lg"
|
||||
id="civility"
|
||||
v-model="civility"
|
||||
>
|
||||
<option selected disabled >{{ $t('person.civility.placeholder') }}</option>
|
||||
<option v-for="c in config.civilities" :value="c.id" :key="c.id">
|
||||
{{ c.name.fr }}
|
||||
</option>
|
||||
</select>
|
||||
<label>{{ $t('person.civility.title') }}</label>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3">
|
||||
<span class="input-group-text" id="birthdate"><i class="fa fa-fw fa-birthday-cake"></i></span>
|
||||
<input type="date"
|
||||
@@ -124,6 +138,24 @@
|
||||
aria-describedby="email" />
|
||||
</div>
|
||||
|
||||
<div v-if="action === 'create'" class="input-group mb-3 form-check">
|
||||
<input class="form-check-input"
|
||||
type='checkbox'
|
||||
v-model="showAddressForm"
|
||||
name='showAddressForm'/>
|
||||
<label class="form-check-label">{{ $t('person.address.show_address_form') }}</label>
|
||||
</div>
|
||||
<div v-if="action === 'create' && showAddressFormValue" class="form-floating mb-3">
|
||||
<p>{{ $t('person.address.warning') }}</p>
|
||||
<add-address
|
||||
:context="addAddress.context"
|
||||
:options="addAddress.options"
|
||||
:addressChangedCallback="submitNewAddress"
|
||||
ref="addAddress">
|
||||
</add-address>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="alert alert-warning" v-if="errors.length">
|
||||
<ul>
|
||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
||||
@@ -134,24 +166,43 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPerson, getPersonAltNames } from '../../_api/OnTheFly';
|
||||
import { getCivilities, getPerson, getPersonAltNames } from '../../_api/OnTheFly';
|
||||
import PersonRenderBox from '../Entity/PersonRenderBox.vue';
|
||||
import AddAddress from "ChillMainAssets/vuejs/Address/components/AddAddress.vue";
|
||||
|
||||
export default {
|
||||
name: "OnTheFlyPerson",
|
||||
props: ['id', 'type', 'action', 'query'],
|
||||
//emits: ['createAction'],
|
||||
components: {
|
||||
PersonRenderBox
|
||||
PersonRenderBox,
|
||||
AddAddress
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
person: {
|
||||
type: 'person',
|
||||
altNames: []
|
||||
altNames: [],
|
||||
addressId: null
|
||||
},
|
||||
config: {
|
||||
altNames: []
|
||||
altNames: [],
|
||||
civilities: []
|
||||
},
|
||||
showAddressFormValue: false,
|
||||
addAddress: {
|
||||
options: {
|
||||
button: {
|
||||
text: { create: 'person.address.create_address' },
|
||||
size: 'btn-sm'
|
||||
},
|
||||
title: { create: 'person.address.create_address' },
|
||||
},
|
||||
context: {
|
||||
target: {}, // boilerplate for getting the address id
|
||||
edit: false,
|
||||
addressId: null
|
||||
}
|
||||
},
|
||||
errors: []
|
||||
}
|
||||
@@ -171,6 +222,10 @@ export default {
|
||||
set(value) { this.person.gender = value; },
|
||||
get() { return this.person.gender; }
|
||||
},
|
||||
civility: {
|
||||
set(value) { this.person.civility = {id: value, type: 'chill_main_civility'}; },
|
||||
get() { return this.person.civility ? this.person.civility.id : null; }
|
||||
},
|
||||
birthDate: {
|
||||
set(value) {
|
||||
if (this.person.birthdate) {
|
||||
@@ -195,6 +250,10 @@ export default {
|
||||
set(value) { this.person.email = value; },
|
||||
get() { return this.person.email; }
|
||||
},
|
||||
showAddressForm: {
|
||||
set(value) { this.showAddressFormValue = value; },
|
||||
get() { return this.showAddressFormValue; }
|
||||
},
|
||||
genderClass() {
|
||||
switch (this.person.gender) {
|
||||
case 'woman':
|
||||
@@ -230,6 +289,13 @@ export default {
|
||||
.then(altNames => {
|
||||
this.config.altNames = altNames;
|
||||
});
|
||||
getCivilities()
|
||||
.then(civilities => {
|
||||
if ('results' in civilities) {
|
||||
this.config.civilities = civilities.results;
|
||||
}
|
||||
});
|
||||
|
||||
if (this.action !== 'create') {
|
||||
this.loadData();
|
||||
}
|
||||
@@ -273,6 +339,9 @@ export default {
|
||||
this.person.firstName = queryItem;
|
||||
break;
|
||||
}
|
||||
},
|
||||
submitNewAddress(payload) {
|
||||
this.person.addressId = payload.addressId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,4 +362,9 @@ dl {
|
||||
margin-left: 1em;
|
||||
}
|
||||
}
|
||||
div.form-check {
|
||||
label {
|
||||
margin-left: 0.5em!important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -38,6 +38,15 @@ const personMessages = {
|
||||
man: "Masculin",
|
||||
neuter: "Neutre, non binaire",
|
||||
undefined: "Non renseigné"
|
||||
},
|
||||
civility: {
|
||||
title: "Civilité",
|
||||
placeholder: "Choisissez la civilité",
|
||||
},
|
||||
address: {
|
||||
create_address: "Ajouter une adresse",
|
||||
show_address_form: "Créer un ménage et ajouter une adresse",
|
||||
warning: "Un nouveau ménage va être créé. L'usager sera membre de ce ménage."
|
||||
}
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !"
|
||||
|
@@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_accompanying_course', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Accompanying course configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_household', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Household configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_person', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Person configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_social_work', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Social work configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
@@ -1,12 +1,11 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_view %}{% endblock %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -1,6 +1,6 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Ordering'|trans }}</th>
|
||||
@@ -36,5 +36,11 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -1,11 +1,12 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
||||
|
@@ -0,0 +1,11 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -0,0 +1,49 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Label'|trans }}</th>
|
||||
<th>{{ 'household.allowHolder'|trans }}</th>
|
||||
<th>{{ 'household.shareHousehold'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.label|localize_translatable_string }}</td>
|
||||
<td style="text-align:center;">
|
||||
{%- if entity.allowHolder -%}
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
{%- else -%}
|
||||
<i class="fa fa-square-o"></i>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td style="text-align:center;">
|
||||
{%- if entity.shareHousehold -%}
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
{%- else -%}
|
||||
<i class="fa fa-square-o"></i>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_person_household_position_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -0,0 +1,12 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
@@ -1,12 +1,11 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_view %}{% endblock %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -1,6 +1,6 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
@@ -9,19 +9,25 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.name|localize_translatable_string }}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_marital_status_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.name|localize_translatable_string }}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_person_marital-status_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -1,11 +1,12 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
||||
|
@@ -0,0 +1,11 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -0,0 +1,35 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Label'|trans }}</th>
|
||||
<th>{{ 'origin.noActiveAfter'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.label|localize_translatable_string }}</td>
|
||||
<td>{% if entity.noActiveAfter %}{{ entity.noActiveAfter|date('Y-m-d') }}{% endif %}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_origin_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -0,0 +1,12 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
@@ -93,6 +93,8 @@
|
||||
|
||||
{{ form_row(form.gender, { 'label' : 'Gender'|trans }) }}
|
||||
|
||||
{{ form_row(form.civility, { 'label' : 'Civility'|trans }) }}
|
||||
|
||||
{{ form_row(form.birthdate, { 'label' : 'Date of birth'|trans }) }}
|
||||
|
||||
{{ form_row(form.phonenumber, { 'label' : 'Phonenumber'|trans }) }}
|
||||
@@ -105,6 +107,13 @@
|
||||
{{ form_row(form.center) }}
|
||||
{% endif %}
|
||||
|
||||
<div id=addressForm>
|
||||
{{ form_row(form.addressForm) }}
|
||||
</div>
|
||||
<div id=address>
|
||||
{{ form_row(form.address) }}
|
||||
</div>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="dropdown">
|
||||
<a class="btn btn-create dropdown-toggle"
|
||||
@@ -132,4 +141,10 @@
|
||||
|
||||
{% block js %}
|
||||
{{ encore_entry_script_tags('page_suggest_names') }}
|
||||
{{ encore_entry_script_tags('page_create_person') }}
|
||||
{{ encore_entry_script_tags('mod_input_address') }}
|
||||
{% endblock js %}
|
||||
|
||||
{% block css %}
|
||||
{{ encore_entry_link_tags('mod_input_address') }}
|
||||
{% endblock %}
|
||||
|
@@ -48,7 +48,9 @@
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="item">
|
||||
{{ p.position.label|localize_translatable_string }}
|
||||
{% if p.position %}
|
||||
{{ p.position.label|localize_translatable_string }}
|
||||
{% endif %}
|
||||
{% if p.holder %}
|
||||
<span class="fa-stack fa-holder" title="{{ 'houshold.holder'|trans|e('html_attr') }}">
|
||||
<i class="fa fa-circle fa-stack-1x text-success"></i>
|
||||
|
@@ -0,0 +1,11 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -0,0 +1,41 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'Active'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td style="text-align:center;">
|
||||
{%- if entity.isActive -%}
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
{%- else -%}
|
||||
<i class="fa fa-square-o"></i>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_person_resource-kind_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -0,0 +1,12 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
@@ -0,0 +1,11 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -0,0 +1,41 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'Active'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }} - {{ entity.reverseTitle|localize_translatable_string }}</td>
|
||||
<td style="text-align:center;">
|
||||
{%- if entity.isActive -%}
|
||||
<i class="fa fa-check-square-o"></i>
|
||||
{%- else -%}
|
||||
<i class="fa fa-square-o"></i>
|
||||
{%- endif -%}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_person_relation_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -0,0 +1,12 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
@@ -1,27 +1,61 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'evaluation.delay'|trans }}</th>
|
||||
<th>{{ 'evaluation.notificationDelay'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
{% block table_entities_tbody %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_evaluation_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>
|
||||
{% if entity.delay is not null %}
|
||||
{% if entity.delay.d > 0 %}
|
||||
{{ entity.delay.d }} {{'days'|trans}}
|
||||
{% endif %}
|
||||
{% if entity.delay.m > 0 %}
|
||||
{{ entity.delay.m }} {{'months'|trans}}
|
||||
{% endif %}
|
||||
{% if entity.delay.y > 0 %}
|
||||
{{ entity.delay.y }} {{'years'|trans}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if entity.notificationDelay is not null %}
|
||||
{% if entity.notificationDelay.d > 0 %}
|
||||
{{ entity.notificationDelay.d }} {{'days'|trans}}
|
||||
{% endif %}
|
||||
{% if entity.notificationDelay.m > 0 %}
|
||||
{{ entity.notificationDelay.m }} {{'months'|trans}}
|
||||
{% endif %}
|
||||
{% if entity.notificationDelay.y > 0 %}
|
||||
{{ entity.notificationDelay.y }} {{'years'|trans}}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_evaluation_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
|
@@ -1,10 +1,13 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'Social actions'|trans }}</th>
|
||||
<th>{{ 'goal.results'|trans }}</th>
|
||||
<th>{{ 'goal.desactivationDate'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
@@ -13,15 +16,36 @@
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>
|
||||
{% for sa in entity.socialActions %}
|
||||
{{ sa.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% for sa in entity.results %}
|
||||
{{ sa.title|localize_translatable_string }}{% if not loop.last %},{% else %}.{% endif %}
|
||||
{% endfor %}
|
||||
</td>
|
||||
<td>
|
||||
{% if entity.desactivationDate is not null %}
|
||||
{{ entity.desactivationDate|date('Y-m-d') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_goal_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_goal_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
|
@@ -1,10 +1,11 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'goal.desactivationDate'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
@@ -13,15 +14,26 @@
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>
|
||||
{% if entity.desactivationDate is not null %}
|
||||
{{ entity.desactivationDate|date('Y-m-d') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_result_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_result_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
|
@@ -0,0 +1,22 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
|
||||
{% block crud_content_form_rows %}
|
||||
{% for f in form %}
|
||||
{% if f.vars.name == 'parent' or f.vars.name == 'issue' %}
|
||||
{{ form_row(f, { 'attr':{'disabled':'disabled'}}) }}
|
||||
{% else %}
|
||||
{{ form_row(f) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock crud_content_form_rows %}
|
||||
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -1,10 +1,13 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'Social issue'|trans }}</th>
|
||||
<th>{{ 'Ordering'|trans }}</th>
|
||||
<th>{{ 'goal.desactivationDate'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
@@ -12,16 +15,29 @@
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>{{ entity|chill_entity_render_box }}</td>
|
||||
<td>{{ entity.issue|chill_entity_render_box }}</td>
|
||||
<td>{{ entity.ordering }}</td>
|
||||
<td>
|
||||
{% if entity.desactivationDate is not null %}
|
||||
{{ entity.desactivationDate|date('Y-m-d') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_action_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_action_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
|
@@ -0,0 +1,22 @@
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
|
||||
{% block crud_content_form_rows %}
|
||||
{% for f in form %}
|
||||
{% if f.vars.name == 'parent' %}
|
||||
{{ form_row(f, { 'attr':{'disabled':'disabled'}}) }}
|
||||
{% else %}
|
||||
{{ form_row(f) }}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endblock crud_content_form_rows %}
|
||||
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -1,10 +1,12 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% block table_entities_thead_tr %}
|
||||
<th>{{ 'Id'|trans }}</th>
|
||||
<th>{{ 'Title'|trans }}</th>
|
||||
<th>{{ 'Ordering'|trans }}</th>
|
||||
<th>{{ 'goal.desactivationDate'|trans }}</th>
|
||||
<th> </th>
|
||||
{% endblock %}
|
||||
|
||||
@@ -12,16 +14,30 @@
|
||||
{% for entity in entities %}
|
||||
<tr>
|
||||
<td>{{ entity.id }}</td>
|
||||
<td>{{ entity.title|localize_translatable_string }}</td>
|
||||
<td>
|
||||
{{ entity|chill_entity_render_box }}
|
||||
</td>
|
||||
<td>{{ entity.ordering }}</td>
|
||||
<td>
|
||||
{% if entity.desactivationDate is not null %}
|
||||
{{ entity.desactivationDate|date('Y-m-d') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_issue_edit', { 'id': entity.id }) }}" class="sc-button bt-edit"></a>
|
||||
<a href="{{ chill_path_add_return_path('chill_crud_social_issue_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
{% block actions_before %}
|
||||
<li class='cancel'>
|
||||
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
|
||||
</li>
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
|
@@ -1,12 +1,11 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_view %}{% endblock %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
@@ -1,11 +1,13 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
|
||||
|
||||
{% block title %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
||||
{% block admin_content %}
|
||||
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
|
||||
{% block content_form_actions_save_and_show %}{% endblock %}
|
||||
{% endembed %}
|
||||
{% endblock admin_content %}
|
||||
|
||||
|
||||
|
@@ -116,12 +116,18 @@ class MembersEditorNormalizer implements DenormalizerAwareInterface, Denormalize
|
||||
$format,
|
||||
$context
|
||||
);
|
||||
$position = $this->denormalizer->denormalize(
|
||||
$concerned['position'] ?? null,
|
||||
Position::class,
|
||||
$format,
|
||||
$context
|
||||
);
|
||||
|
||||
if (array_key_exists('position', $concerned)) {
|
||||
$position = $this->denormalizer->denormalize(
|
||||
$concerned['position'] ?? null,
|
||||
Position::class,
|
||||
$format,
|
||||
$context
|
||||
);
|
||||
} else {
|
||||
$position = null;
|
||||
}
|
||||
|
||||
$startDate = $this->denormalizer->denormalize(
|
||||
$concerned['start_date'] ?? null,
|
||||
DateTimeImmutable::class,
|
||||
|
@@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Civility;
|
||||
use Chill\MainBundle\Phonenumber\PhoneNumberHelperInterface;
|
||||
use Chill\MainBundle\Security\Resolver\CenterResolverManagerInterface;
|
||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension;
|
||||
@@ -101,6 +102,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
'center',
|
||||
'altNames',
|
||||
'email',
|
||||
'civility',
|
||||
];
|
||||
|
||||
$fields = array_filter(
|
||||
@@ -176,6 +178,13 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
case 'email':
|
||||
$person->setEmail($data[$item]);
|
||||
|
||||
break;
|
||||
|
||||
case 'civility':
|
||||
$civility = $this->denormalizer->denormalize($data[$item], Civility::class, $format, []);
|
||||
|
||||
$person->setCivility($civility);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -212,6 +221,7 @@ class PersonJsonNormalizer implements DenormalizerAwareInterface, NormalizerAwar
|
||||
'mobilenumber' => $this->normalizer->normalize($person->getMobilenumber(), $format, $context),
|
||||
'email' => $person->getEmail(),
|
||||
'gender' => $person->getGender(),
|
||||
'civility' => $this->normalizer->normalize($person->getCivility(), $format, $context),
|
||||
];
|
||||
|
||||
if (in_array('minimal', $groups, true) && 1 === count($groups)) {
|
||||
|
@@ -1139,7 +1139,7 @@ paths:
|
||||
200:
|
||||
description: "OK"
|
||||
400:
|
||||
description: "transition cannot be applyed"
|
||||
description: "transition cannot be applied"
|
||||
|
||||
/1.0/person/accompanying-course/{id}/confidential.json:
|
||||
post:
|
||||
@@ -1329,6 +1329,28 @@ paths:
|
||||
responses:
|
||||
200:
|
||||
description: "ok"
|
||||
post:
|
||||
tags:
|
||||
- household
|
||||
requestBody:
|
||||
description: "A household"
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/Household"
|
||||
summary: Post a new household
|
||||
responses:
|
||||
401:
|
||||
description: "Unauthorized"
|
||||
404:
|
||||
description: "Not found"
|
||||
200:
|
||||
description: "OK"
|
||||
422:
|
||||
description: "Unprocessable entity (validation errors)"
|
||||
400:
|
||||
description: "transition cannot be applied"
|
||||
|
||||
/1.0/person/household/{id}.json:
|
||||
get:
|
||||
@@ -1509,7 +1531,7 @@ paths:
|
||||
422:
|
||||
description: "Unprocessable entity (validation errors)"
|
||||
400:
|
||||
description: "transition cannot be applyed"
|
||||
description: "transition cannot be applied"
|
||||
|
||||
/1.0/person/household/{id}/address.json:
|
||||
post:
|
||||
@@ -1545,7 +1567,7 @@ paths:
|
||||
422:
|
||||
description: "Unprocessable entity (validation errors)"
|
||||
400:
|
||||
description: "transition cannot be applyed"
|
||||
description: "transition cannot be applied"
|
||||
|
||||
/1.0/person/social/social-action.json:
|
||||
get:
|
||||
|
@@ -22,4 +22,5 @@ module.exports = function(encore, entries)
|
||||
encore.addEntry('page_accompanying_course_index_masonry', __dirname + '/Resources/public/page/accompanying_course_index/masonry.js');
|
||||
encore.addEntry('page_person_resource_showhide_input', __dirname + '/Resources/public/page/person_resource/showhide-input.js');
|
||||
encore.addEntry('page_suggest_names', __dirname + '/Resources/public/page/person/suggest-names.js');
|
||||
encore.addEntry('page_create_person', __dirname + '/Resources/public/page/person/create-person.js');
|
||||
};
|
||||
|
@@ -96,10 +96,6 @@ chill_person_timeline:
|
||||
path: /{_locale}/person/{person_id}/timeline
|
||||
controller: Chill\PersonBundle\Controller\TimelinePersonController::personAction
|
||||
|
||||
chill_person_admin:
|
||||
path: "/{_locale}/admin/person"
|
||||
controller: Chill\PersonBundle\Controller\AdminController::indexAction
|
||||
|
||||
chill_person_duplicate_view:
|
||||
path: /{_locale}/person/{person_id}/duplicate/view
|
||||
controller: Chill\PersonBundle\Controller\PersonDuplicateController::viewAction
|
||||
@@ -129,72 +125,6 @@ chill_person_admin_redirect_to_admin_index:
|
||||
order: 0
|
||||
label: Main admin menu
|
||||
|
||||
chill_person_closingmotive_admin:
|
||||
path: /{_locale}/admin/closing-motive
|
||||
controller: cscrud_closing_motive_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 90
|
||||
label: 'person_admin.closing motives'
|
||||
|
||||
chill_person_maritalstatus_admin:
|
||||
path: /{_locale}/admin/marital-status
|
||||
controller: cscrud_marital_status_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 120
|
||||
label: 'person_admin.marital status'
|
||||
|
||||
chill_person_socialissue_admin:
|
||||
path: /{_locale}/admin/social-work/social-issue
|
||||
controller: cscrud_social_issue_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 150
|
||||
label: 'person_admin.social_issue'
|
||||
|
||||
chill_person_socialaction_admin:
|
||||
path: /{_locale}/admin/social-work/social-action
|
||||
controller: cscrud_social_action_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 160
|
||||
label: 'person_admin.social_action'
|
||||
|
||||
|
||||
chill_person_social_evaluation_admin:
|
||||
path: /{_locale}/admin/social-work/evaluation
|
||||
controller: cscrud_social_evaluation_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 170
|
||||
label: 'person_admin.social_evaluation'
|
||||
|
||||
chill_person_social_goal_admin:
|
||||
path: /{_locale}/admin/social-work/goal
|
||||
controller: cscrud_social_goal_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 180
|
||||
label: 'person_admin.social_goal'
|
||||
|
||||
chill_person_social_result_admin:
|
||||
path: /{_locale}/admin/social-work/result
|
||||
controller: cscrud_social_result_controller:index
|
||||
options:
|
||||
menus:
|
||||
admin_person:
|
||||
order: 190
|
||||
label: 'person_admin.social_result'
|
||||
|
||||
|
||||
|
||||
chill_person_controllers:
|
||||
resource: "@ChillPersonBundle/Controller"
|
||||
type: annotation
|
||||
|
@@ -12,12 +12,6 @@ services:
|
||||
# tags:
|
||||
# - { name: 'chill.menu_builder' }
|
||||
#
|
||||
# Chill\PersonBundle\Menu\AdminMenuBuilder:
|
||||
# arguments:
|
||||
# $authorizationChecker: '@Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface'
|
||||
# tags:
|
||||
# - { name: 'chill.menu_builder' }
|
||||
#
|
||||
Chill\PersonBundle\Menu\PersonMenuBuilder:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
@@ -86,6 +86,8 @@ Civility: Civilité
|
||||
choose civility: --
|
||||
All genders: tous les genres
|
||||
Any person selected: Aucune personne sélectionnée
|
||||
Create a household and add an address: Créer un ménage et ajouter une adresse
|
||||
A new household will be created. The person will be member of this household.: Un nouveau ménage va être créé. L'usager sera membre de ce ménage.
|
||||
|
||||
# dédoublonnage
|
||||
Old person: Doublon
|
||||
@@ -381,12 +383,36 @@ crud:
|
||||
add_new: Ajouter un nouveau
|
||||
title_new: Nouveau motif de clotûre
|
||||
title_edit: Modifier le motif de clotûre
|
||||
marital_status:
|
||||
origin:
|
||||
index:
|
||||
title: Liste des origines de parcours
|
||||
add_new: Ajouter une nouvelle
|
||||
title_new: Nouvelle origine
|
||||
title_edit: Modifier l'origine
|
||||
person_marital-status:
|
||||
index:
|
||||
title: Liste des états civils
|
||||
add_new: Ajouter un nouveau
|
||||
title_new: Nouvel état civil
|
||||
title_edit: Modifier l'état civil
|
||||
person_resource-kind:
|
||||
index:
|
||||
title: Types de personnes-ressources
|
||||
add_new: Ajouter un nouveau
|
||||
title_new: Nouveau type de personne-ressource
|
||||
title_edit: Modifier le type de personne-ressource
|
||||
person_household_position:
|
||||
index:
|
||||
title: Position
|
||||
add_new: Ajouter un nouveau
|
||||
title_new: Nouvelle position
|
||||
title_edit: Modifier la position
|
||||
person_relation:
|
||||
index:
|
||||
title: Relations de filiations
|
||||
add_new: Ajouter un nouveau
|
||||
title_new: Nouvelle relation de filiation
|
||||
title_edit: Modifier la relation de filiation
|
||||
social_issue:
|
||||
index:
|
||||
title: Liste des problématiques sociales
|
||||
@@ -396,46 +422,84 @@ crud:
|
||||
social_action:
|
||||
index:
|
||||
title: Liste des actions d'accompagnements
|
||||
add_new: Ajouter une nouvelle action d'accompagnements
|
||||
title_new: Nouvelle action d'accompagnements
|
||||
title_edit: Modifier l'action d'accompagnements
|
||||
add_new: Ajouter une nouvelle action d'accompagnement
|
||||
title_new: Nouvelle action d'accompagnement
|
||||
title_edit: Modifier l'action d'accompagnement
|
||||
title_link: Voir l'action d'accompagnement
|
||||
social_evaluation:
|
||||
index:
|
||||
title: Liste des évaluations
|
||||
add_new: Ajouter une nouvelle évaluation
|
||||
title_new: Nouvelle évaluation
|
||||
title_edit: Modifier l'évaluation
|
||||
social_goal:
|
||||
index:
|
||||
title: Liste des objectifs d'action d'accompagnements
|
||||
add_new: Ajouter un nouvel objectif d'action d'accompagnements
|
||||
add_new: Ajouter un nouvel objectif d'action d'accompagnement
|
||||
title_new: Nouvel objectif
|
||||
title_edit: Modifier l'objectif
|
||||
social_result:
|
||||
index:
|
||||
title: Liste des résultats d'action d'accompagnements
|
||||
add_new: Ajouter un nouveau résultat d'action d'accompagnements
|
||||
add_new: Ajouter un nouveau résultat d'action d'accompagnement
|
||||
title_new: Nouveau résultat
|
||||
title_edit: Modifier le résultat
|
||||
|
||||
origin:
|
||||
noActiveAfter: désactivé après
|
||||
|
||||
evaluation:
|
||||
delay: Délai
|
||||
notificationDelay: Délai de notification
|
||||
|
||||
goal:
|
||||
desactivationDate: Date de désactivation
|
||||
results: Résultats
|
||||
|
||||
socialAction:
|
||||
defaultNotificationDelay: Délai de notification par défaut
|
||||
socialIssue: Problématique sociale
|
||||
|
||||
household:
|
||||
allowHolder: Peut être titulaire
|
||||
shareHousehold: Membre du ménage
|
||||
|
||||
relation:
|
||||
title: Premier membre
|
||||
reverseTitle: Deuxième membre
|
||||
|
||||
days: jours
|
||||
months: mois
|
||||
years: années
|
||||
|
||||
# specific to closing motive
|
||||
closing_motive:
|
||||
any parent: Aucun parent
|
||||
new child: Nouvel enfant
|
||||
|
||||
Person configuration: Configuration du module "Personnes"
|
||||
Configuration of person bundle: Configuration du module "Personnes"
|
||||
person_admin:
|
||||
accompanying_period: Parcours d'accompagnement
|
||||
What would you like to configure ?: Que souhaitez-vous configurer ?
|
||||
closing motives: Motifs de clotûre
|
||||
closing motives list: Liste des motifs de clotûre
|
||||
closing motive explanation: >
|
||||
Les motifs de clotûre donnent des indications sur la fermeture
|
||||
d'une période d'accompagnement.
|
||||
origin: Origines
|
||||
marital status: États civils
|
||||
marital status list: Liste des états civils
|
||||
marital status explanation: >
|
||||
Configurer la liste des états civils.
|
||||
person_resource_kind: Type de personne ressource
|
||||
social_issue: Problématiques sociales
|
||||
social_action: Actions d'accompagnement
|
||||
social_goal: Buts
|
||||
social_goal: Objectifs
|
||||
social_result: Résultats
|
||||
social_evaluation: Évaluations
|
||||
social_work: Accompagnement social
|
||||
relation: Relations de filiations
|
||||
|
||||
# specific to accompanying period
|
||||
accompanying_period:
|
||||
@@ -477,7 +541,9 @@ accompanying_course:
|
||||
comment is unpinned: Le commentaire est désépinglé
|
||||
show: Montrer
|
||||
hide: Masquer
|
||||
closed periods: parcours clôturer
|
||||
closed periods: parcours clôturés
|
||||
Accompanying course configuration: Gestion des parcours d'accompagnement
|
||||
Social work configuration: Gestion des actions d'accompagnement social
|
||||
|
||||
# Accompanying Course comments
|
||||
Accompanying Course Comment: Commentaire
|
||||
@@ -514,6 +580,7 @@ Budget: Budget
|
||||
The composition has been successfully removed.: La composition a été supprimée.
|
||||
edit address valid from: Modifier la date du déménagement
|
||||
Edit household address valid from: Modifier la date du déménagement
|
||||
Household configuration: Gestion des ménages
|
||||
|
||||
|
||||
# accompanying course work
|
||||
|
@@ -65,4 +65,7 @@ The person where the course is located must be associated to the course. Change
|
||||
|
||||
#relationship
|
||||
relationship:
|
||||
duplicate: Une relation de filiation existe déjà entre ces 2 personnes
|
||||
duplicate: Une relation de filiation existe déjà entre ces 2 personnes
|
||||
|
||||
person_creation:
|
||||
If you want to create an household, an address is required: Pour la création d'un ménage, une adresse est requise
|
||||
|
Reference in New Issue
Block a user