mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
cs: Enable a couple of risky rules.
This commit is contained in:
@@ -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';
|
||||
|
Reference in New Issue
Block a user