mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
cs: Enable a couple of risky rules.
This commit is contained in:
@@ -141,7 +141,7 @@ class HouseholdApiController extends ApiController
|
||||
|
||||
foreach ($allHouseholds as $h) {
|
||||
if ($h !== $currentHouseholdPerson) {
|
||||
array_push($households, $h);
|
||||
$households[] = $h;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -192,7 +192,7 @@ class HouseholdController extends AbstractController
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() and $form->isValid()) {
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
$this->addFlash('success', $this->translator->trans('household.data_saved'));
|
||||
|
@@ -190,7 +190,7 @@ class PersonAddressController extends AbstractController
|
||||
$form = $this->createEditForm($person, $address);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() and $form->isValid()) {
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$validatePersonErrors = $this->validatePerson($person);
|
||||
|
||||
if (count($validatePersonErrors) !== 0) {
|
||||
|
@@ -599,7 +599,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
public function checkAccompanyingPeriodsAreNotCollapsing()
|
||||
{
|
||||
$periods = $this->getAccompanyingPeriodsOrdered();
|
||||
$periodsNbr = sizeof($periods);
|
||||
$periodsNbr = count($periods);
|
||||
$i = 0;
|
||||
|
||||
while ($periodsNbr - 1 > $i) {
|
||||
|
@@ -310,7 +310,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
foreach ($this->getCustomFields() as $cf) {
|
||||
$cfType = $this->customFieldProvider->getCustomFieldByType($cf->getType());
|
||||
|
||||
if ($cfType instanceof CustomFieldChoice and $cfType->isMultiple($cf)) {
|
||||
if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) {
|
||||
foreach ($cfType->getChoices($cf) as $choiceSlug => $label) {
|
||||
$slug = $this->slugToDQL($cf->getSlug(), 'choice', ['choiceSlug' => $choiceSlug]);
|
||||
$qb->addSelect(
|
||||
@@ -426,7 +426,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
->render(json_decode($value, true), $cf, 'csv');
|
||||
};
|
||||
|
||||
if ($cfType instanceof CustomFieldChoice and $cfType->isMultiple($cf)) {
|
||||
if ($cfType instanceof CustomFieldChoice && $cfType->isMultiple($cf)) {
|
||||
return function ($value) use ($cf, $cfType, $key) {
|
||||
$slugChoice = $this->extractInfosFromSlug($key)['additionnalInfos']['choiceSlug'];
|
||||
$decoded = \json_decode($value, true);
|
||||
@@ -438,7 +438,7 @@ class ListPerson implements ListInterface, ExportElementValidatedInterface
|
||||
. ' | ' . $label;
|
||||
}
|
||||
|
||||
if ('_other' === $slugChoice and $cfType->isChecked($cf, $choiceSlug, $decoded)) {
|
||||
if ('_other' === $slugChoice && $cfType->isChecked($cf, $choiceSlug, $decoded)) {
|
||||
return $cfType->extractOtherValue($cf, $decoded);
|
||||
}
|
||||
|
||||
|
@@ -167,23 +167,23 @@ class ListPersonDuplicate implements DirectExportInterface, ExportElementValidat
|
||||
SIMILARITY(p.fullnamecanonical, p2.fullnamecanonical) AS "similarity nom + prenom",
|
||||
SIMILARITY(p.lastname, p2.lastname) AS "similarity nom",
|
||||
SIMILARITY(p.firstname, p2.firstname) AS "similarity prenom"
|
||||
FROM chill_person_person AS p
|
||||
JOIN chill_person_person AS p2
|
||||
ON p.id != p2.id
|
||||
AND (SIMILARITY(p.fullnamecanonical, p2.fullnamecanonical) > :precision
|
||||
FROM chill_person_person AS p
|
||||
JOIN chill_person_person AS p2
|
||||
ON p.id != p2.id
|
||||
AND (SIMILARITY(p.fullnamecanonical, p2.fullnamecanonical) > :precision
|
||||
AND p.id < p2.id)
|
||||
OR (UNACCENT(LOWER(p.firstname)) = UNACCENT(LOWER(p2.lastname))
|
||||
AND UNACCENT(LOWER(p.lastname)) = UNACCENT(LOWER(p2.firstname)))
|
||||
JOIN centers AS p1center
|
||||
JOIN centers AS p1center
|
||||
ON p1center.id = p.center_id
|
||||
JOIN centers AS p2center
|
||||
JOIN centers AS p2center
|
||||
ON p2center.id = p2.center_id
|
||||
WHERE NOT EXISTS (
|
||||
SELECT id
|
||||
FROM chill_person_not_duplicate as pnd
|
||||
WHERE (pnd.person1_id = p.id
|
||||
SELECT id
|
||||
FROM chill_person_not_duplicate as pnd
|
||||
WHERE (pnd.person1_id = p.id
|
||||
AND pnd.person2_id = p2.id)
|
||||
OR (pnd.person2_id = p.id
|
||||
OR (pnd.person2_id = p.id
|
||||
AND pnd.person1_id = p2.id)
|
||||
)
|
||||
ORDER BY p.fullnamecanonical, p.id, p2.id';
|
||||
|
@@ -64,8 +64,8 @@ class AccompanyingPeriodType extends AbstractType
|
||||
|
||||
if (
|
||||
('close' === $options['period_action'])
|
||||
or ('create' === $options['period_action'])
|
||||
or ('update' === $options['period_action'] and !$accompanyingPeriod->isOpen())
|
||||
|| ('create' === $options['period_action'])
|
||||
|| ('update' === $options['period_action'] && !$accompanyingPeriod->isOpen())
|
||||
) {
|
||||
$builder->add('closingDate', DateType::class, [
|
||||
'required' => true,
|
||||
|
@@ -25,10 +25,10 @@ final class HouseholdRepository implements ObjectRepository
|
||||
FROM chill_person_accompanying_period_participation AS part
|
||||
WHERE person_id = ?),
|
||||
other_participants AS (
|
||||
SELECT person_id, startDate, endDate
|
||||
SELECT person_id, startDate, endDate
|
||||
FROM chill_person_accompanying_period_participation
|
||||
JOIN participations USING (accompanyingperiod_id)
|
||||
WHERE person_id != ?
|
||||
WHERE person_id != ?
|
||||
),
|
||||
households AS (SELECT DISTINCT household.*
|
||||
FROM chill_person_household_members AS hmembers
|
||||
|
@@ -226,8 +226,8 @@ class PersonControllerUpdateTest extends WebTestCase
|
||||
'a element .success is shown'
|
||||
);
|
||||
|
||||
if ('birthdate' == $field or 'memo' == $field or 'countryOfBirth' == $field or 'nationality' == $field
|
||||
or 'gender' == $field) {
|
||||
if ('birthdate' == $field || 'memo' == $field || 'countryOfBirth' == $field || 'nationality' == $field
|
||||
|| 'gender' == $field) {
|
||||
// we do not perform test on the web page contents.
|
||||
} else {
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("' . $value . '")')->count());
|
||||
|
@@ -160,8 +160,8 @@ class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
|
||||
'a element .success is shown'
|
||||
);
|
||||
|
||||
if ('birthdate' == $field or 'memo' == $field or 'countryOfBirth' == $field or 'nationality' == $field
|
||||
or 'gender' == $field) {
|
||||
if ('birthdate' == $field || 'memo' == $field || 'countryOfBirth' == $field || 'nationality' == $field
|
||||
|| 'gender' == $field) {
|
||||
// we do not perform test on the web page contents.
|
||||
} else {
|
||||
$this->assertGreaterThan(0, $crawler->filter('html:contains("' . $value . '")')->count());
|
||||
@@ -216,7 +216,7 @@ class PersonControllerUpdateWithHiddenFieldsTest extends WebTestCase
|
||||
private function getVeryLongText()
|
||||
{
|
||||
return <<<'EOT'
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse molestie at enim id auctor. Vivamus malesuada elit ipsum, ac mollis ex facilisis sit amet. Phasellus accumsan, quam ut aliquet accumsan, augue ligula consequat erat, condimentum iaculis orci magna egestas eros. In vel blandit sapien. Duis ut dui vitae tortor iaculis malesuada vitae vitae lorem. Morbi efficitur dolor orci, a rhoncus urna blandit quis. Aenean at placerat dui, ut tincidunt nulla. In ultricies tempus ligula ac rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce urna nibh, placerat vel auctor sed, maximus quis magna. Vivamus quam ante, consectetur vel feugiat quis, aliquet id ante. Integer gravida erat dignissim ante commodo mollis. Donec imperdiet mauris elit, nec blandit dolor feugiat ut. Proin iaculis enim ut tortor pretium commodo. Etiam aliquet hendrerit dolor sed fringilla. Vestibulum facilisis nibh tincidunt dui egestas, vitae congue mi imperdiet. Duis vulputate ultricies lectus id cursus. Fusce bibendum sem dignissim, bibendum purus quis, mollis ex. Cras ac est justo. Duis congue mattis ipsum, vitae sagittis justo dictum sit amet. Duis aliquam pharetra sem, non laoreet ante laoreet ac. Mauris ornare mi tempus rutrum consequat.
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse molestie at enim id auctor. Vivamus malesuada elit ipsum, ac mollis ex facilisis sit amet. Phasellus accumsan, quam ut aliquet accumsan, augue ligula consequat erat, condimentum iaculis orci magna egestas eros. In vel blandit sapien. Duis ut dui vitae tortor iaculis malesuada vitae vitae lorem. Morbi efficitur dolor orci, a rhoncus urna blandit quis. Aenean at placerat dui, ut tincidunt nulla. In ultricies tempus ligula ac rutrum. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Fusce urna nibh, placerat vel auctor sed, maximus quis magna. Vivamus quam ante, consectetur vel feugiat quis, aliquet id ante. Integer gravida erat dignissim ante commodo mollis. Donec imperdiet mauris elit, nec blandit dolor feugiat ut. Proin iaculis enim ut tortor pretium commodo. Etiam aliquet hendrerit dolor sed fringilla. Vestibulum facilisis nibh tincidunt dui egestas, vitae congue mi imperdiet. Duis vulputate ultricies lectus id cursus. Fusce bibendum sem dignissim, bibendum purus quis, mollis ex. Cras ac est justo. Duis congue mattis ipsum, vitae sagittis justo dictum sit amet. Duis aliquam pharetra sem, non laoreet ante laoreet ac. Mauris ornare mi tempus rutrum consequat.
|
||||
EOT;
|
||||
}
|
||||
}
|
||||
|
@@ -36,7 +36,7 @@ class Version20160422000000 extends AbstractMigration
|
||||
}
|
||||
|
||||
$this->abortIf(
|
||||
sizeof($personWithTwoAddressWithSameValidFrom) != 0,
|
||||
count($personWithTwoAddressWithSameValidFrom) != 0,
|
||||
'There exists some person with multiple adress with the same validFrom'
|
||||
);
|
||||
}
|
||||
|
@@ -62,19 +62,19 @@ class Version20170117131924 extends AbstractMigration
|
||||
before_date date)
|
||||
RETURNS TABLE(
|
||||
person_id integer,
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
streetaddress2 varchar(255),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
postcode_id integer,
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
postcode_id integer,
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
country_id integer)
|
||||
AS
|
||||
$BODY$
|
||||
SELECT
|
||||
SELECT
|
||||
pid AS person_id,
|
||||
chill_main_address.id AS address_id,
|
||||
chill_main_address.streetaddress1,
|
||||
@@ -88,11 +88,11 @@ class Version20170117131924 extends AbstractMigration
|
||||
country.id AS country_id
|
||||
FROM chill_main_address
|
||||
JOIN (
|
||||
SELECT
|
||||
SELECT
|
||||
chill_main_address.id AS address_id,
|
||||
validfrom,
|
||||
rank() OVER (PARTITION BY person_id ORDER BY validfrom DESC) as pos
|
||||
FROM chill_person_persons_to_addresses
|
||||
FROM chill_person_persons_to_addresses
|
||||
JOIN chill_main_address ON chill_person_persons_to_addresses.address_id = chill_main_address.id
|
||||
WHERE person_id = pid
|
||||
AND chill_main_address.validfrom <= before_date
|
||||
|
@@ -30,19 +30,19 @@ final class Version20200422125935 extends AbstractMigration
|
||||
before_date date)
|
||||
RETURNS TABLE(
|
||||
person_id integer,
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
streetaddress2 varchar(255),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
postcode_id integer,
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
postcode_id integer,
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
country_id integer)
|
||||
AS
|
||||
$BODY$
|
||||
SELECT
|
||||
SELECT
|
||||
pid AS person_id,
|
||||
chill_main_address.id AS address_id,
|
||||
chill_main_address.streetaddress1,
|
||||
@@ -56,11 +56,11 @@ final class Version20200422125935 extends AbstractMigration
|
||||
country.id AS country_id
|
||||
FROM chill_main_address
|
||||
JOIN (
|
||||
SELECT
|
||||
SELECT
|
||||
chill_main_address.id AS address_id,
|
||||
validfrom,
|
||||
rank() OVER (PARTITION BY person_id ORDER BY validfrom DESC) as pos
|
||||
FROM chill_person_persons_to_addresses
|
||||
FROM chill_person_persons_to_addresses
|
||||
JOIN chill_main_address ON chill_person_persons_to_addresses.address_id = chill_main_address.id
|
||||
WHERE person_id = pid
|
||||
AND chill_main_address.validfrom <= before_date
|
||||
@@ -85,20 +85,20 @@ final class Version20200422125935 extends AbstractMigration
|
||||
before_date date)
|
||||
RETURNS TABLE(
|
||||
person_id integer,
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
address_id integer,
|
||||
streetaddress1 varchar(255),
|
||||
streetaddress2 varchar(255),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
validfrom date,
|
||||
postcode_label varchar(255),
|
||||
postcode_code varchar(100),
|
||||
postcode_id integer,
|
||||
isnoaddress boolean,
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
country_name json,
|
||||
country_code varchar(3),
|
||||
country_id integer)
|
||||
AS
|
||||
$BODY$
|
||||
SELECT
|
||||
SELECT
|
||||
pid AS person_id,
|
||||
chill_main_address.id AS address_id,
|
||||
chill_main_address.streetaddress1,
|
||||
@@ -113,11 +113,11 @@ final class Version20200422125935 extends AbstractMigration
|
||||
country.id AS country_id
|
||||
FROM chill_main_address
|
||||
JOIN (
|
||||
SELECT
|
||||
SELECT
|
||||
chill_main_address.id AS address_id,
|
||||
validfrom,
|
||||
rank() OVER (PARTITION BY person_id ORDER BY validfrom DESC) as pos
|
||||
FROM chill_person_persons_to_addresses
|
||||
FROM chill_person_persons_to_addresses
|
||||
JOIN chill_main_address ON chill_person_persons_to_addresses.address_id = chill_main_address.id
|
||||
WHERE person_id = pid
|
||||
AND chill_main_address.validfrom <= before_date
|
||||
|
Reference in New Issue
Block a user