mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix cs
This commit is contained in:
parent
c99a967fb9
commit
e68c12e0e7
@ -126,7 +126,7 @@ class ActivityType extends AbstractType
|
||||
|
||||
if ($activityType->isVisible('socialIssues') && $accompanyingPeriod) {
|
||||
$builder->add('socialIssues', HiddenType::class, [
|
||||
'required' => $activityType->getSocialIssuesVisible() === 2
|
||||
'required' => $activityType->getSocialIssuesVisible() === 2,
|
||||
]);
|
||||
$builder->get('socialIssues')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
@ -154,7 +154,7 @@ class ActivityType extends AbstractType
|
||||
|
||||
if ($activityType->isVisible('socialActions') && $accompanyingPeriod) {
|
||||
$builder->add('socialActions', HiddenType::class, [
|
||||
'required' => $activityType->getSocialActionsVisible() === 2
|
||||
'required' => $activityType->getSocialActionsVisible() === 2,
|
||||
]);
|
||||
$builder->get('socialActions')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
@ -344,8 +344,8 @@ class ActivityType extends AbstractType
|
||||
|
||||
if ($activityType->isVisible('location')) {
|
||||
$builder->add('location', HiddenType::class, [
|
||||
'required' => $activityType->getLocationVisible() === 2
|
||||
])
|
||||
'required' => $activityType->getLocationVisible() === 2,
|
||||
])
|
||||
->get('location')
|
||||
->addModelTransformer(new CallbackTransformer(
|
||||
static function (?Location $location): string {
|
||||
|
@ -48,7 +48,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
], ])
|
||||
->setExtras(['order' => 35]);
|
||||
*/
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -232,7 +232,6 @@ class PersonResource implements TrackCreationInterface, TrackUpdateInterface
|
||||
}
|
||||
|
||||
if (null !== $this->person && $this->person === $this->personOwner) {
|
||||
|
||||
$context->buildViolation('You cannot associate a resource with the same person')
|
||||
->addViolation();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
'route' => 'chill_person_accompanying_course_close',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
],])
|
||||
], ])
|
||||
->setExtras(['order' => 99999]);
|
||||
}
|
||||
}
|
||||
@ -113,10 +113,9 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
||||
'route' => 'chill_person_accompanying_course_reopen',
|
||||
'routeParameters' => [
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
],])
|
||||
], ])
|
||||
->setExtras(['order' => 99998]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function getMenuIds(): array
|
||||
|
@ -40,7 +40,7 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
public const CREATE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE';
|
||||
|
||||
/**
|
||||
* role to DELETE the course
|
||||
* role to DELETE the course.
|
||||
*
|
||||
* Will be true only for the creator, and if the course is still at DRAFT step.
|
||||
*/
|
||||
@ -58,6 +58,14 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
*/
|
||||
public const FULL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_FULL';
|
||||
|
||||
/**
|
||||
* Reopen a closed course.
|
||||
*
|
||||
* This forward to the EDIT role, without taking into account that the course
|
||||
* is closed
|
||||
*/
|
||||
public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN';
|
||||
|
||||
public const SEE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE';
|
||||
|
||||
/**
|
||||
@ -67,14 +75,6 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
*/
|
||||
public const SEE_DETAILS = 'CHILL_PERSON_ACCOMPANYING_PERIOD_SEE_DETAILS';
|
||||
|
||||
/**
|
||||
* Reopen a closed course.
|
||||
*
|
||||
* This forward to the EDIT role, without taking into account that the course
|
||||
* is closed
|
||||
*/
|
||||
public const RE_OPEN_COURSE = 'CHILL_PERSON_ACCOMPANYING_PERIOD_REOPEN';
|
||||
|
||||
public const TOGGLE_CONFIDENTIAL = 'CHILL_PERSON_ACCOMPANYING_PERIOD_TOGGLE_CONFIDENTIAL';
|
||||
|
||||
/**
|
||||
@ -154,8 +154,8 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
}
|
||||
|
||||
if (in_array($attribute, [
|
||||
self::SEE, self::SEE_DETAILS, self::EDIT
|
||||
])) {
|
||||
self::SEE, self::SEE_DETAILS, self::EDIT,
|
||||
], true)) {
|
||||
if ($subject->getUser() === $token->getUser()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -198,7 +198,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(name="firstname", type="text", options={"default":""})
|
||||
* @ORM\Column(name="firstname", type="text", options={"default": ""})
|
||||
* @Groups({"read", "write", "docgen:read", "docgen:read:3party:parent"})
|
||||
*/
|
||||
private string $firstname = '';
|
||||
|
@ -1,5 +1,12 @@
|
||||
<?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\Migrations\ThirdParty;
|
||||
@ -9,6 +16,45 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220324175549 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql("
|
||||
CREATE OR REPLACE FUNCTION chill_3party.canonicalize() RETURNS TRIGGER
|
||||
LANGUAGE plpgsql
|
||||
AS
|
||||
$$
|
||||
BEGIN
|
||||
NEW.canonicalized =
|
||||
UNACCENT(
|
||||
LOWER(
|
||||
NEW.name ||
|
||||
CASE WHEN COALESCE(NEW.name_company, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(NEW.name_company, '') ||
|
||||
CASE WHEN COALESCE(NEW.acronym, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(NEW.acronym, '')
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
return NEW;
|
||||
END
|
||||
$$
|
||||
");
|
||||
$this->addSql("
|
||||
UPDATE chill_3party.third_party
|
||||
SET canonicalized =
|
||||
UNACCENT(
|
||||
LOWER(
|
||||
name ||
|
||||
CASE WHEN COALESCE(name_company, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(name_company, '') ||
|
||||
CASE WHEN COALESCE(acronym, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(acronym, '')
|
||||
)
|
||||
)
|
||||
");
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'indexing of firstname on third parties';
|
||||
@ -55,45 +101,5 @@ final class Version20220324175549 extends AbstractMigration
|
||||
END
|
||||
$$
|
||||
");
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql("
|
||||
CREATE OR REPLACE FUNCTION chill_3party.canonicalize() RETURNS TRIGGER
|
||||
LANGUAGE plpgsql
|
||||
AS
|
||||
$$
|
||||
BEGIN
|
||||
NEW.canonicalized =
|
||||
UNACCENT(
|
||||
LOWER(
|
||||
NEW.name ||
|
||||
CASE WHEN COALESCE(NEW.name_company, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(NEW.name_company, '') ||
|
||||
CASE WHEN COALESCE(NEW.acronym, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(NEW.acronym, '')
|
||||
)
|
||||
)
|
||||
;
|
||||
|
||||
return NEW;
|
||||
END
|
||||
$$
|
||||
");
|
||||
$this->addSql("
|
||||
UPDATE chill_3party.third_party
|
||||
SET canonicalized =
|
||||
UNACCENT(
|
||||
LOWER(
|
||||
name ||
|
||||
CASE WHEN COALESCE(name_company, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(name_company, '') ||
|
||||
CASE WHEN COALESCE(acronym, '') <> '' THEN ' ' ELSE '' END ||
|
||||
COALESCE(acronym, '')
|
||||
)
|
||||
)
|
||||
");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user