mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-30 18:39:43 +00:00
Compare commits
1 Commits
refactorin
...
3-remove-p
Author | SHA1 | Date | |
---|---|---|---|
|
e19f242137 |
@@ -13,7 +13,7 @@
|
|||||||
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
|
"Chill\\EventBundle\\": "src/Bundle/ChillEventBundle",
|
||||||
"Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle",
|
"Chill\\FamilyMemberBundle\\": "src/Bundle/ChillFamilyMemberBundle",
|
||||||
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
|
"Chill\\MainBundle\\": "src/Bundle/ChillMainBundle",
|
||||||
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle/src",
|
"Chill\\PersonBundle\\": "src/Bundle/ChillPersonBundle",
|
||||||
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
|
"Chill\\ReportBundle\\": "src/Bundle/ChillReportBundle",
|
||||||
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
"Chill\\TaskBundle\\": "src/Bundle/ChillTaskBundle",
|
||||||
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle"
|
"Chill\\ThirdPartyBundle\\": "src/Bundle/ChillThirdPartyBundle"
|
||||||
|
@@ -27,7 +27,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
|
use Chill\MainBundle\Form\Type\DataTransformer\ObjectToIdTransformer;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends choice to allow adding select2 library on widget
|
* Extends choice to allow adding select2 library on widget
|
||||||
@@ -42,26 +41,15 @@ class Select2CountryType extends AbstractType
|
|||||||
*/
|
*/
|
||||||
private $requestStack;
|
private $requestStack;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var TranslatableStringHelper
|
|
||||||
*/
|
|
||||||
protected $translatableStringHelper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ObjectManager
|
* @var ObjectManager
|
||||||
*/
|
*/
|
||||||
private $em;
|
private $em;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(RequestStack $requestStack,ObjectManager $em)
|
||||||
RequestStack $requestStack,
|
|
||||||
ObjectManager $em,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$this->requestStack = $requestStack;
|
$this->requestStack = $requestStack;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
@@ -87,7 +75,7 @@ class Select2CountryType extends AbstractType
|
|||||||
$choices = array();
|
$choices = array();
|
||||||
|
|
||||||
foreach ($countries as $c) {
|
foreach ($countries as $c) {
|
||||||
$choices[$c->getId()] = $this->translatableStringHelper->localize($c->getName());
|
$choices[$c->getId()] = $c->getName()[$locale];
|
||||||
}
|
}
|
||||||
|
|
||||||
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
||||||
|
@@ -27,7 +27,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
|||||||
use Chill\MainBundle\Form\Type\DataTransformer\MultipleObjectsToIdTransformer;
|
use Chill\MainBundle\Form\Type\DataTransformer\MultipleObjectsToIdTransformer;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
use Chill\MainBundle\Form\Type\Select2ChoiceType;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extends choice to allow adding select2 library on widget for languages (multiple)
|
* Extends choice to allow adding select2 library on widget for languages (multiple)
|
||||||
@@ -44,21 +43,10 @@ class Select2LanguageType extends AbstractType
|
|||||||
*/
|
*/
|
||||||
private $em;
|
private $em;
|
||||||
|
|
||||||
/**
|
public function __construct(RequestStack $requestStack,ObjectManager $em)
|
||||||
*
|
|
||||||
* @var TranslatableStringHelper
|
|
||||||
*/
|
|
||||||
protected $translatableStringHelper;
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
RequestStack $requestStack,
|
|
||||||
ObjectManager $em,
|
|
||||||
TranslatableStringHelper $translatableStringHelper
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$this->requestStack = $requestStack;
|
$this->requestStack = $requestStack;
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockPrefix()
|
public function getBlockPrefix()
|
||||||
@@ -84,7 +72,7 @@ class Select2LanguageType extends AbstractType
|
|||||||
$choices = array();
|
$choices = array();
|
||||||
|
|
||||||
foreach ($languages as $l) {
|
foreach ($languages as $l) {
|
||||||
$choices[$l->getId()] = $this->translatableStringHelper->localize($l->getName());
|
$choices[$l->getId()] = $l->getName()[$locale];
|
||||||
}
|
}
|
||||||
|
|
||||||
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
asort($choices, SORT_STRING | SORT_FLAG_CASE);
|
||||||
|
@@ -38,7 +38,7 @@ use Chill\MainBundle\Entity\RoleScope;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class AuthorizationHelper implements AuthorizationHelperInterface
|
class AuthorizationHelper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@@ -1,87 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Chill\MainBundle\Security\Authorization;
|
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\User;
|
|
||||||
use Chill\MainBundle\Entity\Center;
|
|
||||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
|
||||||
use Chill\MainBundle\Entity\Scope;
|
|
||||||
|
|
||||||
interface AuthorizationHelperInterface
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines if a user is active on this center
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
* @param Center $center
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public function userCanReachCenter(User $user, Center $center);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* Determines if the user has access to the given entity.
|
|
||||||
*
|
|
||||||
* if the entity implements Chill\MainBundle\Entity\HasScopeInterface,
|
|
||||||
* the scope is taken into account.
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
* @param HasCenterInterface $entity the entity may also implement HasScopeInterface
|
|
||||||
* @param string|Role $attribute
|
|
||||||
* @return boolean true if the user has access
|
|
||||||
*/
|
|
||||||
public function userHasAccess(User $user, HasCenterInterface $entity, $attribute);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get reachable Centers for the given user, role,
|
|
||||||
* and optionnaly Scope
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
* @param Role $role
|
|
||||||
* @param null|Scope $scope
|
|
||||||
* @return Center[]
|
|
||||||
*/
|
|
||||||
public function getReachableCenters(User $user, Role $role, Scope $scope = null);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all reachable scope for a given user, center and role
|
|
||||||
*
|
|
||||||
* @deprecated Use getReachableCircles
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
* @param Role $role
|
|
||||||
* @param Center $center
|
|
||||||
* @return Scope[]
|
|
||||||
*/
|
|
||||||
public function getReachableScopes(User $user, Role $role, Center $center);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all reachable circle for a given user, center and role
|
|
||||||
*
|
|
||||||
* @param User $user
|
|
||||||
* @param Role $role
|
|
||||||
* @param Center $center
|
|
||||||
* @return Scope[]
|
|
||||||
*/
|
|
||||||
public function getReachableCircles(User $user, Role $role, Center $center);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param Role $role
|
|
||||||
* @param Center $center
|
|
||||||
* @param Scope $circle
|
|
||||||
* @return Users
|
|
||||||
*/
|
|
||||||
public function findUsersReaching(Role $role, Center $center, Scope $circle = null);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all the role which give access to the given role. Only the role
|
|
||||||
* which are registered into Chill are taken into account.
|
|
||||||
*
|
|
||||||
* @param Role $role
|
|
||||||
* @return Role[] the role which give access to the given $role
|
|
||||||
*/
|
|
||||||
public function getParentRoles(Role $role);
|
|
||||||
}
|
|
@@ -28,7 +28,7 @@ use Twig\TwigFilter;
|
|||||||
*
|
*
|
||||||
* @package Chill\MainBundle\Templating\Entity
|
* @package Chill\MainBundle\Templating\Entity
|
||||||
*/
|
*/
|
||||||
class ChillEntityRenderExtension extends AbstractExtension implements ChillEntityRenderExtensionInterface
|
class ChillEntityRenderExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var ChillEntityRenderInterface
|
* @var ChillEntityRenderInterface
|
||||||
|
@@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Chill\MainBundle\Templating\Entity;
|
|
||||||
|
|
||||||
use Twig\Extension\ExtensionInterface;
|
|
||||||
use Twig\TwigFilter;
|
|
||||||
|
|
||||||
interface ChillEntityRenderExtensionInterface extends ExtensionInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return array|TwigFilter[]
|
|
||||||
*/
|
|
||||||
public function getFilters();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $entity
|
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function renderString($entity, array $options = []): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $entity
|
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function renderBox($entity, array $options = []): string;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param ChillEntityRenderInterface $render
|
|
||||||
*/
|
|
||||||
public function addRender(ChillEntityRenderInterface $render);
|
|
||||||
}
|
|
@@ -29,7 +29,7 @@ use Symfony\Component\Translation\Translator;
|
|||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class TranslatableStringHelper implements TranslatableStringHelperInterface
|
class TranslatableStringHelper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Chill\MainBundle\Templating;
|
|
||||||
|
|
||||||
interface TranslatableStringHelperInterface
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* return the string in current locale if it exists.
|
|
||||||
*
|
|
||||||
* If it does not exists; return the name in the first language available.
|
|
||||||
*
|
|
||||||
* Return a blank string if any strings are available.
|
|
||||||
* Return NULL if $translatableString is NULL
|
|
||||||
*
|
|
||||||
* @param array $translatableStrings
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function localize(array $translatableStrings);
|
|
||||||
}
|
|
@@ -29,7 +29,7 @@ use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
|||||||
*
|
*
|
||||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||||
*/
|
*/
|
||||||
class TimelineBuilder implements ContainerAwareInterface, TimelineBuilderInterface
|
class TimelineBuilder implements ContainerAwareInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
use \Symfony\Component\DependencyInjection\ContainerAwareTrait;
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2015 Champs-Libres Coopérative <info@champs-libres.coop>
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Chill\MainBundle\Timeline;
|
|
||||||
|
|
||||||
interface TimelineBuilderInterface
|
|
||||||
{
|
|
||||||
}
|
|
@@ -28,7 +28,7 @@ chill_password:
|
|||||||
|
|
||||||
chill_password_recover:
|
chill_password_recover:
|
||||||
resource: "@ChillMainBundle/config/routes/password_recover.yaml"
|
resource: "@ChillMainBundle/config/routes/password_recover.yaml"
|
||||||
prefix: "public/{_locale}/password"
|
prefix: "{_locale}/password"
|
||||||
|
|
||||||
chill_crud:
|
chill_crud:
|
||||||
resource: "@ChillMainBundle"
|
resource: "@ChillMainBundle"
|
||||||
@@ -86,3 +86,7 @@ login_check:
|
|||||||
|
|
||||||
logout:
|
logout:
|
||||||
path: /logout
|
path: /logout
|
||||||
|
|
||||||
|
chill_main_test:
|
||||||
|
path: /{_locale}/main/test
|
||||||
|
controller: Chill\MainBundle\Controller\DefaultController::testAction
|
||||||
|
@@ -10,7 +10,6 @@ services:
|
|||||||
- "@translator.default"
|
- "@translator.default"
|
||||||
|
|
||||||
Chill\MainBundle\Templating\TranslatableStringHelper: '@chill.main.helper.translatable_string'
|
Chill\MainBundle\Templating\TranslatableStringHelper: '@chill.main.helper.translatable_string'
|
||||||
Chill\MainBundle\Templating\TranslatableStringHelperInterface: Chill\MainBundle\Templating\TranslatableStringHelper
|
|
||||||
|
|
||||||
chill.main.twig.translatable_string:
|
chill.main.twig.translatable_string:
|
||||||
class: Chill\MainBundle\Templating\TranslatableStringTwig
|
class: Chill\MainBundle\Templating\TranslatableStringTwig
|
||||||
|
@@ -23,7 +23,6 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
- "@request_stack"
|
- "@request_stack"
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@chill.main.helper.translatable_string"
|
|
||||||
tags:
|
tags:
|
||||||
- { name: form.type, alias: select2_chill_country }
|
- { name: form.type, alias: select2_chill_country }
|
||||||
|
|
||||||
@@ -32,7 +31,6 @@ services:
|
|||||||
arguments:
|
arguments:
|
||||||
- "@request_stack"
|
- "@request_stack"
|
||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
- "@chill.main.helper.translatable_string"
|
|
||||||
tags:
|
tags:
|
||||||
- { name: form.type, alias: select2_chill_language }
|
- { name: form.type, alias: select2_chill_language }
|
||||||
|
|
||||||
|
@@ -6,7 +6,6 @@ services:
|
|||||||
$hierarchy: "%security.role_hierarchy.roles%"
|
$hierarchy: "%security.role_hierarchy.roles%"
|
||||||
$em: '@Doctrine\ORM\EntityManagerInterface'
|
$em: '@Doctrine\ORM\EntityManagerInterface'
|
||||||
Chill\MainBundle\Security\Authorization\AuthorizationHelper: '@chill.main.security.authorization.helper'
|
Chill\MainBundle\Security\Authorization\AuthorizationHelper: '@chill.main.security.authorization.helper'
|
||||||
Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface: Chill\MainBundle\Security\Authorization\AuthorizationHelper
|
|
||||||
|
|
||||||
chill.main.role_provider:
|
chill.main.role_provider:
|
||||||
class: Chill\MainBundle\Security\RoleProvider
|
class: Chill\MainBundle\Security\RoleProvider
|
||||||
|
@@ -30,7 +30,6 @@ services:
|
|||||||
Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension:
|
Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension:
|
||||||
tags:
|
tags:
|
||||||
- { name: twig.extension }
|
- { name: twig.extension }
|
||||||
Chill\MainBundle\Templating\Entity\ChillEntityRenderExtensionInterface: Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension
|
|
||||||
|
|
||||||
Chill\MainBundle\Templating\Entity\CommentRender:
|
Chill\MainBundle\Templating\Entity\CommentRender:
|
||||||
arguments:
|
arguments:
|
||||||
|
@@ -5,5 +5,3 @@ services:
|
|||||||
- "@doctrine.orm.entity_manager"
|
- "@doctrine.orm.entity_manager"
|
||||||
calls:
|
calls:
|
||||||
- [ setContainer, ["@service_container"]]
|
- [ setContainer, ["@service_container"]]
|
||||||
|
|
||||||
Chill\MainBundle\Timeline\TimelineBuilderInterface: "@chill_main.timeline_builder"
|
|
||||||
|
@@ -17,14 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
namespace Chill\PersonBundle\Actions;
|
namespace Chill\PersonBundle\Actions;
|
||||||
|
|
||||||
use Symfony\Contracts\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Event triggered when an entity attached to a person is removed.
|
* Event triggered when an entity attached to a person is removed.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ActionEvent implements Event
|
class ActionEvent extends Event
|
||||||
{
|
{
|
||||||
const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
const DELETE = 'CHILL_PERSON.DELETE_ASSOCIATED_ENTITY';
|
||||||
const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
const MOVE = 'CHILL_PERSON.MOVE_ASSOCIATED_ENTITY';
|
@@ -40,7 +40,6 @@ use Symfony\Component\Console\Question\ConfirmationQuestion;
|
|||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\EventDispatcher\Event;
|
use Symfony\Component\EventDispatcher\Event;
|
||||||
use Symfony\Component\Form\FormFactory;
|
use Symfony\Component\Form\FormFactory;
|
||||||
use Symfony\Component\Form\FormFactoryInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ImportPeopleFromCSVCommand
|
* Class ImportPeopleFromCSVCommand
|
||||||
@@ -131,7 +130,7 @@ class ImportPeopleFromCSVCommand extends Command
|
|||||||
protected static $defaultDateInterpreter = "%d/%m/%Y|%e/%m/%y|%d/%m/%Y|%e/%m/%Y";
|
protected static $defaultDateInterpreter = "%d/%m/%Y|%e/%m/%y|%d/%m/%Y|%e/%m/%Y";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var FormFactoryInterface
|
* @var FormFactory
|
||||||
*/
|
*/
|
||||||
protected $formFactory;
|
protected $formFactory;
|
||||||
|
|
||||||
@@ -143,7 +142,7 @@ class ImportPeopleFromCSVCommand extends Command
|
|||||||
* @param EntityManagerInterface $em
|
* @param EntityManagerInterface $em
|
||||||
* @param CustomFieldProvider $customFieldProvider
|
* @param CustomFieldProvider $customFieldProvider
|
||||||
* @param EventDispatcherInterface $eventDispatcher
|
* @param EventDispatcherInterface $eventDispatcher
|
||||||
* @param FormFactoryInterface $formFactory
|
* @param FormFactory $formFactory
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
LoggerInterface $logger,
|
LoggerInterface $logger,
|
||||||
@@ -151,7 +150,7 @@ class ImportPeopleFromCSVCommand extends Command
|
|||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
CustomFieldProvider $customFieldProvider,
|
CustomFieldProvider $customFieldProvider,
|
||||||
EventDispatcherInterface $eventDispatcher,
|
EventDispatcherInterface $eventDispatcher,
|
||||||
FormFactoryInterface $formFactory
|
FormFactory $formFactory
|
||||||
) {
|
) {
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
$this->helper = $helper;
|
$this->helper = $helper;
|
@@ -8,7 +8,7 @@ namespace Chill\PersonBundle\Config;
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class ConfigPersonAltNamesHelper implements ConfigPersonAltNamesHelperInterface
|
class ConfigPersonAltNamesHelper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* the raw config, directly from the container parameter
|
* the raw config, directly from the container parameter
|
@@ -26,7 +26,7 @@ use Chill\PersonBundle\Privacy\PrivacyEvent;
|
|||||||
use Doctrine\DBAL\Exception;
|
use Doctrine\DBAL\Exception;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Chill\PersonBundle\Form\Type\AccompanyingPeriodType;
|
use Chill\PersonBundle\Form\AccompanyingPeriodType;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Doctrine\Common\Collections\Criteria;
|
use Doctrine\Common\Collections\Criteria;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
@@ -65,12 +65,6 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_accompanying_period_list",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function listAction(int $person_id): Response
|
public function listAction(int $person_id): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@@ -87,12 +81,6 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_accompanying_period_create",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period/create"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function createAction(int $person_id, Request $request): Response
|
public function createAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@@ -151,10 +139,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @throws Exception
|
||||||
* name="chill_person_accompanying_period_update",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period/{period_id}/update"
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
public function updateAction(int $person_id, int $period_id, Request $request): Response
|
public function updateAction(int $person_id, int $period_id, Request $request): Response
|
||||||
{
|
{
|
||||||
@@ -221,10 +206,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @throws \Exception
|
||||||
* name="chill_person_accompanying_period_close",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period/close"
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
public function closeAction(int $person_id, Request $request): Response
|
public function closeAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
@@ -326,12 +308,6 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_accompanying_period_open",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period/open"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function openAction(int $person_id, Request $request): Response
|
public function openAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@@ -409,12 +385,6 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_accompanying_period_re_open",
|
|
||||||
* path="/{_locale}/person/{person_id}/accompanying-period/re-open"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function reOpenAction(int $person_id, int $period_id, Request $request): Response
|
public function reOpenAction(int $person_id, int $period_id, Request $request): Response
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
@@ -13,10 +13,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||||||
class AdminController extends AbstractController
|
class AdminController extends AbstractController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @param $_locale
|
||||||
* name="chill_person_admin",
|
* @return \Symfony\Component\HttpFoundation\Response
|
||||||
* path="/{_locale}/admin/person"
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
public function indexAction($_locale)
|
public function indexAction($_locale)
|
||||||
{
|
{
|
||||||
@@ -24,18 +22,7 @@ class AdminController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @return \Symfony\Component\HttpFoundation\RedirectResponse
|
||||||
* name="chill_person_admin_redirect_to_admin_index",
|
|
||||||
* path="/{_locale}/admin/person_redirect_to_main",
|
|
||||||
* options={
|
|
||||||
* menus={
|
|
||||||
* admin_person={
|
|
||||||
* order="0",
|
|
||||||
* label="Main admin menu"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* )
|
|
||||||
*/
|
*/
|
||||||
public function redirectToAdminIndexAction()
|
public function redirectToAdminIndexAction()
|
||||||
{
|
{
|
@@ -30,7 +30,6 @@ use Chill\MainBundle\Entity\Address;
|
|||||||
use Doctrine\Common\Collections\Criteria;
|
use Doctrine\Common\Collections\Criteria;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PersonAddressController
|
* Class PersonAddressController
|
||||||
@@ -57,12 +56,6 @@ class PersonAddressController extends AbstractController
|
|||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_address_list",
|
|
||||||
* path="/{_locale}/person/{person_id}/address/list"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function listAction($person_id)
|
public function listAction($person_id)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()->getManager()
|
$person = $this->getDoctrine()->getManager()
|
||||||
@@ -85,13 +78,6 @@ class PersonAddressController extends AbstractController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_address_create",
|
|
||||||
* path="/{_locale}/person/{person_id}/address/create",
|
|
||||||
* methods={"POST"}
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function newAction($person_id)
|
public function newAction($person_id)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()->getManager()
|
$person = $this->getDoctrine()->getManager()
|
||||||
@@ -119,12 +105,6 @@ class PersonAddressController extends AbstractController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_address_new",
|
|
||||||
* path="/{_locale}/person/{person_id}/address/new"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function createAction($person_id, Request $request)
|
public function createAction($person_id, Request $request)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()->getManager()
|
$person = $this->getDoctrine()->getManager()
|
||||||
@@ -181,12 +161,6 @@ class PersonAddressController extends AbstractController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_address_edit",
|
|
||||||
* path="/{_locale}/person/{person_id}/address/{address_id}/edit"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function editAction($person_id, $address_id)
|
public function editAction($person_id, $address_id)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()->getManager()
|
$person = $this->getDoctrine()->getManager()
|
||||||
@@ -215,12 +189,6 @@ class PersonAddressController extends AbstractController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_address_update",
|
|
||||||
* path="/{_locale}/person/{person_id}/address/{address_id}/update"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function updateAction($person_id, $address_id, Request $request)
|
public function updateAction($person_id, $address_id, Request $request)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()->getManager()
|
$person = $this->getDoctrine()->getManager()
|
@@ -34,14 +34,12 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
||||||
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Chill\MainBundle\Search\SearchProvider;
|
use Chill\MainBundle\Search\SearchProvider;
|
||||||
use Chill\PersonBundle\Repository\PersonRepository;
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||||
use Chill\PersonBundle\Repository\PersonNotDuplicateRepository;
|
|
||||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
||||||
|
|
||||||
final class PersonController extends AbstractController
|
final class PersonController extends AbstractController
|
||||||
{
|
{
|
||||||
@@ -119,12 +117,6 @@ final class PersonController extends AbstractController
|
|||||||
return $cFGroup;
|
return $cFGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_view",
|
|
||||||
* path="/{_locale}/person/{person_id}/general"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function viewAction($person_id)
|
public function viewAction($person_id)
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@@ -148,12 +140,6 @@ final class PersonController extends AbstractController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_general_edit",
|
|
||||||
* path="/{_locale}/person/{person_id}/general/edit"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function editAction($person_id)
|
public function editAction($person_id)
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@@ -177,13 +163,7 @@ final class PersonController extends AbstractController
|
|||||||
array('person' => $person, 'form' => $form->createView()));
|
array('person' => $person, 'form' => $form->createView()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function updateAction($person_id, Request $request)
|
||||||
* @Route(
|
|
||||||
* name="chill_person_general_update",
|
|
||||||
* path="/{_locale}/person/{person_id}/general/update"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function updateAction($person_id, Request $request, TranslatorInterface $translator)
|
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
|
|
||||||
@@ -212,7 +192,7 @@ final class PersonController extends AbstractController
|
|||||||
|
|
||||||
$this->get('session')->getFlashBag()
|
$this->get('session')->getFlashBag()
|
||||||
->add('success',
|
->add('success',
|
||||||
$translator
|
$this->get('translator')
|
||||||
->trans('The person data has been updated')
|
->trans('The person data has been updated')
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -226,12 +206,6 @@ final class PersonController extends AbstractController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_new",
|
|
||||||
* path="/{_locale}/person/new"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function newAction()
|
public function newAction()
|
||||||
{
|
{
|
||||||
// this is a dummy default center.
|
// this is a dummy default center.
|
||||||
@@ -316,13 +290,7 @@ final class PersonController extends AbstractController
|
|||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function reviewAction(Request $request)
|
||||||
* @Route(
|
|
||||||
* name="chill_person_review",
|
|
||||||
* path="/{_locale}/person/review"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function reviewAction(Request $request, PersonNotDuplicateRepository $personNotDuplicateRepository)
|
|
||||||
{
|
{
|
||||||
if ($request->getMethod() !== 'POST') {
|
if ($request->getMethod() !== 'POST') {
|
||||||
$r = new Response("You must send something to review the creation of a new Person");
|
$r = new Response("You must send something to review the creation of a new Person");
|
||||||
@@ -374,7 +342,8 @@ final class PersonController extends AbstractController
|
|||||||
|
|
||||||
$this->em->persist($person);
|
$this->em->persist($person);
|
||||||
|
|
||||||
$alternatePersons = $this->similarPersonMatcher->matchPerson($person, $personNotDuplicateRepository);
|
$alternatePersons = $this->similarPersonMatcher
|
||||||
|
->matchPerson($person);
|
||||||
|
|
||||||
if (count($alternatePersons) === 0) {
|
if (count($alternatePersons) === 0) {
|
||||||
return $this->forward('ChillPersonBundle:Person:create');
|
return $this->forward('ChillPersonBundle:Person:create');
|
||||||
@@ -398,12 +367,6 @@ final class PersonController extends AbstractController
|
|||||||
'form' => $form->createView()));
|
'form' => $form->createView()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_create",
|
|
||||||
* path="/{_locale}/person/create"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function createAction(Request $request)
|
public function createAction(Request $request)
|
||||||
{
|
{
|
||||||
|
|
@@ -12,17 +12,16 @@ use Chill\PersonBundle\Privacy\PrivacyEvent;
|
|||||||
use Chill\PersonBundle\Repository\PersonRepository;
|
use Chill\PersonBundle\Repository\PersonRepository;
|
||||||
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
||||||
use http\Exception\InvalidArgumentException;
|
use http\Exception\InvalidArgumentException;
|
||||||
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
use Chill\ActivityBundle\Entity\Activity;
|
use Chill\ActivityBundle\Entity\Activity;
|
||||||
use Chill\DocStoreBundle\Entity\PersonDocument;
|
use Chill\DocStoreBundle\Entity\PersonDocument;
|
||||||
use Chill\EventBundle\Entity\Participation;
|
use Chill\EventBundle\Entity\Participation;
|
||||||
use Chill\PersonBundle\Repository\PersonNotDuplicateRepository;
|
|
||||||
use Chill\TaskBundle\Entity\SingleTask;
|
use Chill\TaskBundle\Entity\SingleTask;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
|
||||||
|
|
||||||
class PersonDuplicateController extends AbstractController
|
class PersonDuplicateController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Chill\PersonBundle\Search\SimilarPersonMatcher
|
* @var \Chill\PersonBundle\Search\SimilarPersonMatcher
|
||||||
@@ -63,13 +62,7 @@ class PersonDuplicateController extends AbstractController
|
|||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function viewAction($person_id)
|
||||||
* @Route(
|
|
||||||
* name="chill_person_duplicate_view",
|
|
||||||
* path="/{_locale}/person/{person_id}/duplicate/view"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function viewAction($person_id, PersonNotDuplicateRepository $personNotDuplicateRepository)
|
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
if ($person === null) {
|
if ($person === null) {
|
||||||
@@ -83,7 +76,8 @@ class PersonDuplicateController extends AbstractController
|
|||||||
$duplicatePersons = $this->similarPersonMatcher->
|
$duplicatePersons = $this->similarPersonMatcher->
|
||||||
matchPerson($person, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL);
|
matchPerson($person, 0.5, SimilarPersonMatcher::SIMILAR_SEARCH_ORDER_BY_ALPHABETICAL);
|
||||||
|
|
||||||
$notDuplicatePersons = $personNotDuplicateRepository->findNotDuplicatePerson($person);
|
$notDuplicatePersons = $this->getDoctrine()->getRepository(PersonNotDuplicate::class)
|
||||||
|
->findNotDuplicatePerson($person);
|
||||||
|
|
||||||
return $this->render('ChillPersonBundle:PersonDuplicate:view.html.twig', [
|
return $this->render('ChillPersonBundle:PersonDuplicate:view.html.twig', [
|
||||||
'person' => $person,
|
'person' => $person,
|
||||||
@@ -92,12 +86,6 @@ class PersonDuplicateController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_duplicate_confirm",
|
|
||||||
* path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/confirm"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function confirmAction($person1_id, $person2_id, Request $request)
|
public function confirmAction($person1_id, $person2_id, Request $request)
|
||||||
{
|
{
|
||||||
if ($person1_id === $person2_id) {
|
if ($person1_id === $person2_id) {
|
||||||
@@ -155,12 +143,6 @@ class PersonDuplicateController extends AbstractController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_duplicate_not_duplicate",
|
|
||||||
* path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/not-duplicate"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function notDuplicateAction($person1_id, $person2_id)
|
public function notDuplicateAction($person1_id, $person2_id)
|
||||||
{
|
{
|
||||||
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
|
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
|
||||||
@@ -184,12 +166,6 @@ class PersonDuplicateController extends AbstractController
|
|||||||
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
|
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_remove_duplicate_not_duplicate",
|
|
||||||
* path="/{_locale}/person/{person1_id}/duplicate/{person2_id}/remove-not-duplicate"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function removeNotDuplicateAction($person1_id, $person2_id)
|
public function removeNotDuplicateAction($person1_id, $person2_id)
|
||||||
{
|
{
|
||||||
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
|
[$person1, $person2] = $this->_getPersonsByPriority($person1_id, $person2_id);
|
||||||
@@ -208,12 +184,6 @@ class PersonDuplicateController extends AbstractController
|
|||||||
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
|
return $this->redirectToRoute('chill_person_duplicate_view', ['person_id' => $person1->getId()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_find_manually_duplicate",
|
|
||||||
* path="/{_locale}/person/{person_id}/find-manually"
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function findManuallyDuplicateAction($person_id, Request $request)
|
public function findManuallyDuplicateAction($person_id, Request $request)
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
@@ -26,9 +26,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Chill\MainBundle\Timeline\TimelineBuilder;
|
use Chill\MainBundle\Timeline\TimelineBuilder;
|
||||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||||
use Chill\MainBundle\Timeline\TimelineBuilderInterface;
|
|
||||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TimelinePersonController
|
* Class TimelinePersonController
|
||||||
@@ -46,7 +44,7 @@ class TimelinePersonController extends AbstractController
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var TimelineBuilderInterface
|
* @var TimelineBuilder
|
||||||
*/
|
*/
|
||||||
protected $timelineBuilder;
|
protected $timelineBuilder;
|
||||||
|
|
||||||
@@ -63,7 +61,7 @@ class TimelinePersonController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EventDispatcherInterface $eventDispatcher,
|
EventDispatcherInterface $eventDispatcher,
|
||||||
TimelineBuilderInterface $timelineBuilder,
|
TimelineBuilder $timelineBuilder,
|
||||||
PaginatorFactory $paginatorFactory
|
PaginatorFactory $paginatorFactory
|
||||||
) {
|
) {
|
||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
@@ -71,20 +69,7 @@ class TimelinePersonController extends AbstractController
|
|||||||
$this->paginatorFactory = $paginatorFactory;
|
$this->paginatorFactory = $paginatorFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Route(
|
|
||||||
* name="chill_person_timeline",
|
|
||||||
* path="/{_locale}/person/{person_id}/timeline",
|
|
||||||
* options={
|
|
||||||
* menus={
|
|
||||||
* person={
|
|
||||||
* order="60",
|
|
||||||
* label="Timeline"
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* }
|
|
||||||
* )
|
|
||||||
*/
|
|
||||||
public function personAction(Request $request, $person_id)
|
public function personAction(Request $request, $person_id)
|
||||||
{
|
{
|
||||||
$person = $this->getDoctrine()
|
$person = $this->getDoctrine()
|
@@ -60,14 +60,20 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
$container->setParameter('chill_person.allow_multiple_simultaneous_accompanying_periods',
|
$container->setParameter('chill_person.allow_multiple_simultaneous_accompanying_periods',
|
||||||
$config['allow_multiple_simultaneous_accompanying_periods']);
|
$config['allow_multiple_simultaneous_accompanying_periods']);
|
||||||
|
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(dirname(__DIR__, 2).'/config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||||
$loader->load('services.yaml');
|
$loader->load('services.yaml');
|
||||||
$loader->load('services/widgets.yaml');
|
$loader->load('services/widgets.yaml');
|
||||||
$loader->load('services/exports.yaml');
|
$loader->load('services/exports.yaml');
|
||||||
$loader->load('services/fixtures.yaml');
|
$loader->load('services/fixtures.yaml');
|
||||||
|
$loader->load('services/controller.yaml');
|
||||||
$loader->load('services/search.yaml');
|
$loader->load('services/search.yaml');
|
||||||
|
$loader->load('services/menu.yaml');
|
||||||
|
$loader->load('services/privacyEvent.yaml');
|
||||||
$loader->load('services/command.yaml');
|
$loader->load('services/command.yaml');
|
||||||
|
$loader->load('services/actions.yaml');
|
||||||
$loader->load('services/form.yaml');
|
$loader->load('services/form.yaml');
|
||||||
|
$loader->load('services/repository.yaml');
|
||||||
|
$loader->load('services/templating.yaml');
|
||||||
$loader->load('services/alt_names.yaml');
|
$loader->load('services/alt_names.yaml');
|
||||||
$loader->load('services/serializer.yaml');
|
$loader->load('services/serializer.yaml');
|
||||||
|
|
||||||
@@ -179,7 +185,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
|
|||||||
$container->prependExtensionConfig('chill_main', array(
|
$container->prependExtensionConfig('chill_main', array(
|
||||||
'routing' => array(
|
'routing' => array(
|
||||||
'resources' => array(
|
'resources' => array(
|
||||||
dirname(__DIR__, 2) . '/config/routes.yaml'
|
'@ChillPersonBundle/config/routes.yaml'
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
));
|
));
|
@@ -37,7 +37,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
/**
|
/**
|
||||||
* AccompanyingPeriod Class
|
* AccompanyingPeriod Class
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="Chill\PersonBundle\Repository\AccompanyingPeriodRepository")
|
||||||
* @ORM\Table(name="chill_person_accompanying_period")
|
* @ORM\Table(name="chill_person_accompanying_period")
|
||||||
*/
|
*/
|
||||||
class AccompanyingPeriod
|
class AccompanyingPeriod
|
@@ -4,6 +4,7 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|||||||
|
|
||||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||||
@@ -12,7 +13,7 @@ use Doctrine\Common\Collections\Collection;
|
|||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=AccompanyingPeriodWorkRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_work")
|
* @ORM\Table(name="chill_person_accompanying_period_work")
|
||||||
*/
|
*/
|
||||||
class AccompanyingPeriodWork
|
class AccompanyingPeriodWork
|
@@ -4,12 +4,13 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|||||||
|
|
||||||
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
use Chill\PersonBundle\Entity\SocialWork\Goal;
|
||||||
use Chill\PersonBundle\Entity\SocialWork\Result;
|
use Chill\PersonBundle\Entity\SocialWork\Result;
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkGoalRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=AccompanyingPeriodWorkGoalRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_work_goal")
|
* @ORM\Table(name="chill_person_accompanying_period_work_goal")
|
||||||
*/
|
*/
|
||||||
class AccompanyingPeriodWorkGoal
|
class AccompanyingPeriodWorkGoal
|
@@ -29,7 +29,8 @@ use Doctrine\Common\Collections\ArrayCollection;
|
|||||||
/**
|
/**
|
||||||
* ClosingMotive give an explanation why we closed the Accompanying period
|
* ClosingMotive give an explanation why we closed the Accompanying period
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity(
|
||||||
|
* repositoryClass="Chill\PersonBundle\Repository\AccompanyingPeriod\ClosingMotiveRepository")
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_closingmotive")
|
* @ORM\Table(name="chill_person_accompanying_period_closingmotive")
|
||||||
*/
|
*/
|
||||||
class ClosingMotive
|
class ClosingMotive
|
@@ -22,12 +22,13 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\CommentRepository;
|
||||||
use Chill\MainBundle\Entity\User;
|
use Chill\MainBundle\Entity\User;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=CommentRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_comment")
|
* @ORM\Table(name="chill_person_accompanying_period_comment")
|
||||||
*/
|
*/
|
||||||
class Comment
|
class Comment
|
@@ -22,10 +22,11 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\OriginRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=OriginRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_origin")
|
* @ORM\Table(name="chill_person_accompanying_period_origin")
|
||||||
*/
|
*/
|
||||||
class Origin
|
class Origin
|
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
namespace Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\ResourceRepository;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\Comment;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
@@ -29,7 +30,7 @@ use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
|||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=ResourceRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_resource")
|
* @ORM\Table(name="chill_person_accompanying_period_resource")
|
||||||
*/
|
*/
|
||||||
class Resource
|
class Resource
|
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity;
|
namespace Chill\PersonBundle\Entity;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriodParticipationRepository;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@@ -30,7 +31,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* AccompanyingPeriodParticipation Class
|
* AccompanyingPeriodParticipation Class
|
||||||
*
|
*
|
||||||
* @package Chill\PersonBundle\Entity
|
* @package Chill\PersonBundle\Entity
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=AccompanyingPeriodParticipationRepository::class)
|
||||||
* @ORM\Table(name="chill_person_accompanying_period_participation")
|
* @ORM\Table(name="chill_person_accompanying_period_participation")
|
||||||
*/
|
*/
|
||||||
class AccompanyingPeriodParticipation
|
class AccompanyingPeriodParticipation
|
@@ -25,7 +25,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* MaritalStatus
|
* MaritalStatus
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity()
|
||||||
* @ORM\Table(name="chill_person_marital_status")
|
* @ORM\Table(name="chill_person_marital_status")
|
||||||
* @ORM\HasLifecycleCallbacks()
|
* @ORM\HasLifecycleCallbacks()
|
||||||
*/
|
*/
|
@@ -22,23 +22,21 @@ namespace Chill\PersonBundle\Entity;
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use ArrayIterator;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Doctrine\Common\Collections\Collection;
|
||||||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
|
use Doctrine\Common\Collections\Criteria;
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Entity\Country;
|
use Chill\MainBundle\Entity\Country;
|
||||||
use Chill\PersonBundle\Entity\MaritalStatus;
|
use Chill\PersonBundle\Entity\MaritalStatus;
|
||||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||||
use Chill\MainBundle\Entity\Address;
|
use Chill\MainBundle\Entity\Address;
|
||||||
use DateTime;
|
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
|
||||||
use Doctrine\Common\Collections\Collection;
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
|
||||||
use Doctrine\Common\Collections\Criteria;
|
|
||||||
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
use Symfony\Component\Validator\Context\ExecutionContextInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Person Class
|
* Person Class
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="Chill\PersonBundle\Repository\PersonRepository")
|
||||||
* @ORM\Table(name="chill_person_person",
|
* @ORM\Table(name="chill_person_person",
|
||||||
* indexes={@ORM\Index(
|
* indexes={@ORM\Index(
|
||||||
* name="person_names",
|
* name="person_names",
|
||||||
@@ -1010,28 +1008,32 @@ class Person implements HasCenterInterface
|
|||||||
/**
|
/**
|
||||||
* By default, the addresses are ordered by date, descending (the most
|
* By default, the addresses are ordered by date, descending (the most
|
||||||
* recent first)
|
* recent first)
|
||||||
|
*
|
||||||
|
* @return \Chill\MainBundle\Entity\Address[]
|
||||||
*/
|
*/
|
||||||
public function getAddresses(): Collection
|
public function getAddresses()
|
||||||
{
|
{
|
||||||
return $this->addresses;
|
return $this->addresses;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLastAddress(DateTime $from = null)
|
/**
|
||||||
|
* @param \DateTime|null $date
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
public function getLastAddress(\DateTime $date = null)
|
||||||
{
|
{
|
||||||
$from ??= new DateTime('now');
|
if ($date === null) {
|
||||||
|
$date = new \DateTime('now');
|
||||||
|
}
|
||||||
|
|
||||||
/** @var ArrayIterator $addressesIterator */
|
$addresses = $this->getAddresses();
|
||||||
$addressesIterator = $this->getAddresses()
|
|
||||||
->filter(static fn (Address $address): bool => $address->getValidFrom() <= $from)
|
|
||||||
->getIterator();
|
|
||||||
|
|
||||||
$addressesIterator->uasort(
|
if ($addresses == null) {
|
||||||
static fn (Address $left, Address $right): int => $right->getValidFrom() <=> $left->getValidFrom()
|
|
||||||
);
|
|
||||||
|
|
||||||
return [] === ($addresses = iterator_to_array($addressesIterator)) ?
|
return null;
|
||||||
null :
|
}
|
||||||
current($addresses);
|
|
||||||
|
return $addresses->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
* PersonAltName
|
* PersonAltName
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="chill_person_alt_name")
|
* @ORM\Table(name="chill_person_alt_name")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="Chill\PersonBundle\Repository\PersonAltNameRepository")
|
||||||
*/
|
*/
|
||||||
class PersonAltName
|
class PersonAltName
|
||||||
{
|
{
|
@@ -9,7 +9,7 @@ use Chill\MainBundle\Entity\User;
|
|||||||
* PersonNotDuplicate
|
* PersonNotDuplicate
|
||||||
*
|
*
|
||||||
* @ORM\Table(name="chill_person_not_duplicate")
|
* @ORM\Table(name="chill_person_not_duplicate")
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass="Chill\PersonBundle\Repository\PersonNotDuplicateRepository")
|
||||||
*/
|
*/
|
||||||
class PersonNotDuplicate
|
class PersonNotDuplicate
|
||||||
{
|
{
|
@@ -8,7 +8,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||||||
/**
|
/**
|
||||||
* Person Phones
|
* Person Phones
|
||||||
*
|
*
|
||||||
* @ORM\Entity
|
* @ORM\Entity()
|
||||||
* @ORM\Table(name="chill_person_phone")
|
* @ORM\Table(name="chill_person_phone")
|
||||||
*/
|
*/
|
||||||
class PersonPhone
|
class PersonPhone
|
@@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\SocialWork\EvaluationRepository;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=EvaluationRepository::class)
|
||||||
* @ORM\Table(name="chill_person_social_work_evaluation")
|
* @ORM\Table(name="chill_person_social_work_evaluation")
|
||||||
*/
|
*/
|
||||||
class Evaluation
|
class Evaluation
|
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\SocialWork\GoalRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=GoalRepository::class)
|
||||||
* @ORM\Table(name="chill_person_social_work_goal")
|
* @ORM\Table(name="chill_person_social_work_goal")
|
||||||
*/
|
*/
|
||||||
class Goal
|
class Goal
|
@@ -4,12 +4,13 @@ namespace Chill\PersonBundle\Entity\SocialWork;
|
|||||||
|
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkGoal;
|
||||||
|
use Chill\PersonBundle\Repository\SocialWork\ResultRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=ResultRepository::class)
|
||||||
* @ORM\Table(name="chill_person_social_work_result")
|
* @ORM\Table(name="chill_person_social_work_result")
|
||||||
*/
|
*/
|
||||||
class Result
|
class Result
|
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\SocialWork\SocialActionRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=SocialActionRepository::class)
|
||||||
* @ORM\Table(name="chill_person_social_action")
|
* @ORM\Table(name="chill_person_social_action")
|
||||||
*/
|
*/
|
||||||
class SocialAction
|
class SocialAction
|
@@ -1,12 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
namespace Chill\PersonBundle\Entity\SocialWork;
|
namespace Chill\PersonBundle\Entity\SocialWork;
|
||||||
|
|
||||||
|
|
||||||
|
use Chill\PersonBundle\Repository\SocialWork\SocialIssueRepository;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\Common\Collections\Collection;
|
use Doctrine\Common\Collections\Collection;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity
|
* @ORM\Entity(repositoryClass=SocialIssueRepository::class)
|
||||||
* @ORM\Table(name="chill_person_social_issue")
|
* @ORM\Table(name="chill_person_social_issue")
|
||||||
*/
|
*/
|
||||||
class SocialIssue
|
class SocialIssue
|
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Chill\PersonBundle\Form\Type;
|
namespace Chill\PersonBundle\Form;
|
||||||
|
|
||||||
use Chill\MainBundle\Entity\Center;
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
@@ -14,10 +14,12 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
|||||||
use Chill\MainBundle\Form\Type\UserPickerType;
|
use Chill\MainBundle\Form\Type\UserPickerType;
|
||||||
use Symfony\Component\Security\Core\Role\Role;
|
use Symfony\Component\Security\Core\Role\Role;
|
||||||
use Chill\PersonBundle\Form\Type\ClosingMotivePickerType;
|
use Chill\PersonBundle\Form\Type\ClosingMotivePickerType;
|
||||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class AccompanyingPeriodType
|
* Class AccompanyingPeriodType
|
||||||
|
*
|
||||||
|
* @package Chill\PersonBundle\Form
|
||||||
*/
|
*/
|
||||||
class AccompanyingPeriodType extends AbstractType
|
class AccompanyingPeriodType extends AbstractType
|
||||||
{
|
{
|
||||||
@@ -31,9 +33,13 @@ class AccompanyingPeriodType extends AbstractType
|
|||||||
*/
|
*/
|
||||||
protected $config = [];
|
protected $config = [];
|
||||||
|
|
||||||
public function __construct(ParameterBagInterface $parameterBag)
|
/**
|
||||||
|
*
|
||||||
|
* @param string[] $config configuration of visibility of some fields
|
||||||
|
*/
|
||||||
|
public function __construct(array $config)
|
||||||
{
|
{
|
||||||
$this->config = $parameterBag->get('chill_person.accompanying_period_fields');
|
$this->config = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@@ -3,11 +3,13 @@
|
|||||||
namespace Chill\PersonBundle\Form\Type;
|
namespace Chill\PersonBundle\Form\Type;
|
||||||
|
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||||
|
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive;
|
||||||
use Chill\MainBundle\Templating\Entity\ChillEntityRenderExtensionInterface;
|
use Chill\MainBundle\Templating\Entity\ChillEntityRenderExtension;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
|
||||||
use Symfony\Component\OptionsResolver\Options;
|
use Symfony\Component\OptionsResolver\Options;
|
||||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\ClosingMotiveRepository;
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\ClosingMotiveRepository;
|
||||||
|
|
||||||
@@ -21,12 +23,12 @@ class ClosingMotivePickerType extends AbstractType
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var TranslatableStringHelperInterface
|
* @var TranslatableStringHelper
|
||||||
*/
|
*/
|
||||||
protected $translatableStringHelper;
|
protected $translatableStringHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ChillEntityRenderExtensionInterface
|
* @var ChillEntityRenderExtension
|
||||||
*/
|
*/
|
||||||
protected $entityRenderExtension;
|
protected $entityRenderExtension;
|
||||||
|
|
||||||
@@ -38,13 +40,13 @@ class ClosingMotivePickerType extends AbstractType
|
|||||||
/**
|
/**
|
||||||
* ClosingMotivePickerType constructor.
|
* ClosingMotivePickerType constructor.
|
||||||
*
|
*
|
||||||
* @param TranslatableStringHelperInterface $translatableStringHelper
|
* @param TranslatableStringHelper $translatableStringHelper
|
||||||
* @param ChillEntityRenderExtensionInterface $chillEntityRenderExtension
|
* @param ChillEntityRenderExtension $chillEntityRenderExtension
|
||||||
* @param ClosingMotiveRepository $closingMotiveRepository
|
* @param ClosingMotiveRepository $closingMotiveRepository
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
TranslatableStringHelperInterface $translatableStringHelper,
|
TranslatableStringHelper $translatableStringHelper,
|
||||||
ChillEntityRenderExtensionInterface $chillEntityRenderExtension,
|
ChillEntityRenderExtension $chillEntityRenderExtension,
|
||||||
ClosingMotiveRepository $closingMotiveRepository
|
ClosingMotiveRepository $closingMotiveRepository
|
||||||
) {
|
) {
|
||||||
$this->translatableStringHelper = $translatableStringHelper;
|
$this->translatableStringHelper = $translatableStringHelper;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user