From aa68ae0b2567a10434f88ec6d37b9dac9caffd83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 7 Dec 2021 16:38:43 +0100 Subject: [PATCH 1/2] [ActivityType] remove placeLabel/visible, replace by locationLabel/visible --- .../Entity/ActivityType.php | 34 ------------------- .../ChillActivityBundle/Form/ActivityType.php | 4 +-- .../Form/ActivityTypeType.php | 2 +- .../migrations/Version20211207152023.php | 34 +++++++++++++++++++ .../translations/messages.fr.yml | 4 +-- 5 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index f0e412a8c..5ad692bf4 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -163,16 +163,6 @@ class ActivityType */ private int $personVisible = self::FIELD_REQUIRED; - /** - * @ORM\Column(type="string", nullable=false, options={"default": ""}) - */ - private string $placeLabel = ''; - - /** - * @ORM\Column(type="smallint", nullable=false, options={"default": 1}) - */ - private int $placeVisible = self::FIELD_OPTIONAL; - /** * @ORM\Column(type="string", nullable=false, options={"default": ""}) */ @@ -406,16 +396,6 @@ class ActivityType return $this->personVisible; } - public function getPlaceLabel(): string - { - return $this->placeLabel; - } - - public function getPlaceVisible(): int - { - return $this->placeVisible; - } - public function getReasonsLabel(): string { return $this->reasonsLabel; @@ -688,20 +668,6 @@ class ActivityType return $this; } - public function setPlaceLabel(string $placeLabel): self - { - $this->placeLabel = $placeLabel; - - return $this; - } - - public function setPlaceVisible(int $placeVisible): self - { - $this->placeVisible = $placeVisible; - - return $this; - } - public function setReasonsLabel(string $reasonsLabel): self { $this->reasonsLabel = $reasonsLabel; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 7ed80ab00..3fb5193d6 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -143,7 +143,7 @@ class ActivityType extends AbstractType return array_map( fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]), - explode(',', (string) $socialIssuesAsString) + explode(',', $socialIssuesAsString) ); } )); @@ -169,7 +169,7 @@ class ActivityType extends AbstractType return array_map( fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]), - explode(',', (string) $socialActionsAsString) + explode(',', $socialActionsAsString) ); } )); diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 26148c340..28947d72b 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -55,7 +55,7 @@ class ActivityTypeType extends AbstractType ]); $fields = [ - 'persons', 'user', 'date', 'place', 'persons', + 'persons', 'user', 'date', 'location', 'persons', 'thirdParties', 'durationTime', 'travelTime', 'attendee', 'reasons', 'comment', 'sentReceived', 'documents', 'emergency', 'socialIssues', 'socialActions', 'users', diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php b/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php new file mode 100644 index 000000000..034fee71a --- /dev/null +++ b/src/Bundle/ChillActivityBundle/migrations/Version20211207152023.php @@ -0,0 +1,34 @@ +throwIrreversibleMigrationException('placevisible and placelabel could not be created'); + } + + public function getDescription(): string + { + return 'DROP place visible and place label, which are replaced by location'; + } + + public function up(Schema $schema): void + { + $this->addSql('ALTER TABLE activitytype DROP placevisible'); + $this->addSql('ALTER TABLE activitytype DROP placelabel'); + } +} diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index 3de1cc600..00715d283 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -146,8 +146,8 @@ User visible: Visibilité du champ Utilisateur User label: Libellé du champ Utilisateur Date visible: Visibilité du champ Date Date label: Libellé du champ Date -Place visible: Visibilité du champ Lieu -Place label: Libellé du champ Lieu +Location visible: Visibilité du champ Lieu +Location label: Libellé du champ Lieu Third parties visible: Visibilité du champ Tiers Third parties label: Libellé du champ Tiers Duration time visible: Visibilité du champ Durée From 5b4388eae603274dc51e12e4c227786de72f391d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 7 Dec 2021 16:42:34 +0100 Subject: [PATCH 2/2] update changelog [ci-skip] --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1e32cbb..5938be0a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [activity] fix visibility for location ## Test releases