mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge remote-tracking branch 'origin/master' into issue533_notification_for_workflow_bug
This commit is contained in:
commit
7a0234adb2
@ -67,7 +67,7 @@ and this project adheres to
|
|||||||
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
|
* [social_action] Translation changed in evaluation section (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/512)
|
||||||
* [filiation] Possible to add person (or create onthefly) to add to filiation graph + add relation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/519)
|
* [filiation] Possible to add person (or create onthefly) to add to filiation graph + add relation (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/519)
|
||||||
* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560)
|
* [household] Within parcours listing page of household add create button (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/560)
|
||||||
* [person_resource] bugfix when adding thirdparty or freetext resource (no issue)
|
* [person_resource] bugfix when adding thirdparty or freetext resource + prevent personOwner themselves to be added. (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/526)
|
||||||
* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529)
|
* [aside_activity] style correction + sticky-form create button (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/529)
|
||||||
|
|
||||||
## Test releases
|
## Test releases
|
||||||
|
@ -145,30 +145,16 @@ final class PersonResourceController extends AbstractController
|
|||||||
public function newAction(Request $request, $person_id)
|
public function newAction(Request $request, $person_id)
|
||||||
{
|
{
|
||||||
$personOwner = $this->personRepository->find($person_id);
|
$personOwner = $this->personRepository->find($person_id);
|
||||||
|
$personResource = new PersonResource();
|
||||||
|
$personResource->setPersonOwner($personOwner);
|
||||||
|
|
||||||
$form = $this->createForm(PersonResourceType::class);
|
$form = $this->createForm(PersonResourceType::class, $personResource);
|
||||||
|
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
|
|
||||||
if ($form->isSubmitted() && $form->isValid()) {
|
if ($form->isSubmitted() && $form->isValid()) {
|
||||||
$this->denyAccessUnlessGranted(PersonVoter::CREATE, $personOwner);
|
$this->denyAccessUnlessGranted(PersonVoter::CREATE, $personOwner);
|
||||||
|
|
||||||
$personResource = new PersonResource();
|
|
||||||
|
|
||||||
$person = $form['person']->getData();
|
|
||||||
$thirdparty = $form['thirdparty']->getData();
|
|
||||||
$freetext = $form['freetext']->getData();
|
|
||||||
$comment = $form['comment']->getData();
|
|
||||||
$kind = $form['kind']->getData();
|
|
||||||
|
|
||||||
$personResource->setKind($kind);
|
|
||||||
$personResource->setPerson($person);
|
|
||||||
$personResource->setThirdParty($thirdparty);
|
|
||||||
$personResource->setFreeText($freetext);
|
|
||||||
$personResource->setComment($comment);
|
|
||||||
|
|
||||||
$personResource->setPersonOwner($personOwner);
|
|
||||||
|
|
||||||
$this->em->persist($personResource);
|
$this->em->persist($personResource);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
|
||||||
|
@ -232,6 +232,7 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $this->person && $this->person === $this->personOwner) {
|
if (null !== $this->person && $this->person === $this->personOwner) {
|
||||||
|
|
||||||
$context->buildViolation('You cannot associate a resource with the same person')
|
$context->buildViolation('You cannot associate a resource with the same person')
|
||||||
->addViolation();
|
->addViolation();
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,8 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
final class PersonResourceType extends AbstractType
|
final class PersonResourceType extends AbstractType
|
||||||
{
|
{
|
||||||
private PersonRenderInterface $personRender;
|
|
||||||
|
|
||||||
private ResourceKindRender $resourceKindRender;
|
private ResourceKindRender $resourceKindRender;
|
||||||
|
|
||||||
private ThirdPartyRender $thirdPartyRender;
|
|
||||||
|
|
||||||
private TranslatorInterface $translator;
|
private TranslatorInterface $translator;
|
||||||
|
|
||||||
public function __construct(ResourceKindRender $resourceKindRender, PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
|
public function __construct(ResourceKindRender $resourceKindRender, PersonRenderInterface $personRender, ThirdPartyRender $thirdPartyRender, TranslatorInterface $translator)
|
||||||
|
@ -57,3 +57,4 @@ Only the referrer can change the confidentiality of a parcours: 'Seul le référ
|
|||||||
|
|
||||||
# resource
|
# resource
|
||||||
You must associate at least one entity: Associez un usager, un tiers ou indiquez une description libre
|
You must associate at least one entity: Associez un usager, un tiers ou indiquez une description libre
|
||||||
|
You cannot associate a resource with the same person: Vous ne pouvez pas ajouter la personne elle-même en tant que ressource.
|
Loading…
x
Reference in New Issue
Block a user