From 37b395ee5221ec9060ec0fd59cc94cbdcaa38ca8 Mon Sep 17 00:00:00 2001 From: Jean-Francois Monfort Date: Thu, 8 Apr 2021 16:10:04 +0200 Subject: [PATCH] ActivityType add new fields --- .../Entity/ActivityType.php | 518 ++++++++++++++++-- .../Entity/ActivityTypeCategory.php | 2 - .../Form/ActivityTypeType.php | 43 +- .../Form/Type/ActivityFieldPresence.php | 29 + .../config/services/form.yaml | 13 +- .../migrations/Version20210408122329.php | 93 ++++ 6 files changed, 658 insertions(+), 40 deletions(-) create mode 100644 src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php create mode 100644 src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index 25854d385..ca492fbf4 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -1,19 +1,19 @@ - * + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. - * + * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ @@ -32,6 +32,10 @@ use Doctrine\ORM\Mapping as ORM; */ class ActivityType { + const FIELD_INVISIBLE = 0; + const FIELD_OPTIONAL = 1; + const FIELD_REQUIRED = 2; + /** * @var integer * @@ -39,38 +43,185 @@ class ActivityType * @ORM\Column(name="id", type="integer") * @ORM\GeneratedValue(strategy="AUTO") */ - private $id; + private ?int $id; /** - * @var array * @ORM\Column(type="json_array") */ - private $name; - + private array $name = []; + /** - * @var bool * @ORM\Column(type="boolean") */ - private $active = true; + private bool $active = true; + /** + * ORM\ManyToOne(targetEntity="Chill\ActivityBundle\Entity\ActivityTypeCategory") + */ + private ?ActivityTypeCategory $category = null; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=2}) + */ + private int $personVisible = self::FIELD_REQUIRED; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $personLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=2}) + */ + private int $userVisible = self::FIELD_REQUIRED; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $userLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=2}) + */ + private int $dateVisible = self::FIELD_REQUIRED; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $dateLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $placeVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $placeLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $personsVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $personsLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $thirdpartyVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $thirdpartyLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $durationTimeVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $durationTimeLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $attendeeVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $attendeeLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $reasonsVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $reasonsLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $commentVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $commentLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $sentReceivedVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $sentReceivedLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $documentVisible = self::FIELD_OPTIONAL; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $documentLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $emergencyVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $emergencyLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $accompanyingPeriodVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $accompanyingPeriodLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default"=1}) + */ + private int $socialDataVisible = self::FIELD_INVISIBLE; + + /** + * @ORM\Column(type="string", nullable=false, options={"default"=""}) + */ + private string $socialDataLabel = ''; /** * Get id - * - * @return integer */ - public function getId() + public function getId(): int { return $this->id; } /** * Set name - * - * @param array $name - * @return ActivityType */ - public function setName($name) + public function setName(string $name): self { $this->name = $name; @@ -82,7 +233,7 @@ class ActivityType * * @return array | string */ - public function getName($locale = null) + public function getName(?string $locale = null) { if ($locale) { if (isset($this->name[$locale])) { @@ -99,38 +250,343 @@ class ActivityType return $this->name; } } - + /** * Get active * return true if the type is active. - * - * @return boolean */ - public function getActive() { + public function getActive(): bool + { return $this->active; } - + /** * Is active * return true if the type is active - * - * @return boolean */ - public function isActive() { + public function isActive(): bool + { return $this->getActive(); } /** * Set active * set to true if the type is active - * - * @param boolean $active - * @return ActivityType */ - public function setActive($active) { + public function setActive(bool $active): self + { $this->active = $active; + return $this; } -} + public function getCategory(): ?ActivityTypeCategory + { + return $this->category; + } + public function setCategory(?ActivityTypeCategory $category): void + { + $this->category = $category; + } + + public function getPersonVisible(): int + { + return $this->personVisible; + } + + public function setPersonVisible(int $personVisible): void + { + $this->personVisible = $personVisible; + } + + public function getPersonLabel(): string + { + return $this->personLabel; + } + + public function setPersonLabel(string $personLabel): void + { + $this->personLabel = $personLabel; + } + + public function getUserVisible(): int + { + return $this->userVisible; + } + + public function setUserVisible(int $userVisible): void + { + $this->userVisible = $userVisible; + } + + public function getUserLabel(): string + { + return $this->userLabel; + } + + public function setUserLabel(string $userLabel): void + { + $this->userLabel = $userLabel; + } + + public function getDateVisible(): int + { + return $this->dateVisible; + } + + public function setDateVisible(int $dateVisible): void + { + $this->dateVisible = $dateVisible; + } + + public function getDateLabel(): string + { + return $this->dateLabel; + } + + public function setDateLabel(string $dateLabel): void + { + $this->dateLabel = $dateLabel; + } + + public function getPlaceVisible(): int + { + return $this->placeVisible; + } + + public function setPlaceVisible(int $placeVisible): void + { + $this->placeVisible = $placeVisible; + } + + public function getPlaceLabel(): string + { + return $this->placeLabel; + } + + public function setPlaceLabel(string $placeLabel): void + { + $this->placeLabel = $placeLabel; + } + + public function getPersonsVisible(): int + { + return $this->personsVisible; + } + + public function setPersonsVisible(int $personsVisible): void + { + $this->personsVisible = $personsVisible; + } + + public function getPersonsLabel(): string + { + return $this->personsLabel; + } + + public function setPersonsLabel(string $personsLabel): void + { + $this->personsLabel = $personsLabel; + } + + public function getThirdpartyVisible(): int + { + return $this->thirdpartyVisible; + } + + public function setThirdpartyVisible(int $thirdpartyVisible): void + { + $this->thirdpartyVisible = $thirdpartyVisible; + } + + public function getThirdpartyLabel(): string + { + return $this->thirdpartyLabel; + } + + public function setThirdpartyLabel(string $thirdpartyLabel): void + { + $this->thirdpartyLabel = $thirdpartyLabel; + } + + public function getDurationTimeVisible(): int + { + return $this->durationTimeVisible; + } + + public function setDurationTimeVisible(int $durationTimeVisible): void + { + $this->durationTimeVisible = $durationTimeVisible; + } + + public function getDurationTimeLabel(): string + { + return $this->durationTimeLabel; + } + + public function setDurationTimeLabel(string $durationTimeLabel): void + { + $this->durationTimeLabel = $durationTimeLabel; + } + + public function getAttendeeVisible(): int + { + return $this->attendeeVisible; + } + + public function setAttendeeVisible(int $attendeeVisible): void + { + $this->attendeeVisible = $attendeeVisible; + } + + public function getAttendeeLabel(): string + { + return $this->attendeeLabel; + } + + public function setAttendeeLabel(string $attendeeLabel): void + { + $this->attendeeLabel = $attendeeLabel; + } + + public function getReasonsVisible(): int + { + return $this->reasonsVisible; + } + + public function setReasonsVisible(int $reasonsVisible): void + { + $this->reasonsVisible = $reasonsVisible; + } + + public function getReasonsLabel(): string + { + return $this->reasonsLabel; + } + + public function setReasonsLabel(string $reasonsLabel): void + { + $this->reasonsLabel = $reasonsLabel; + } + + public function getCommentVisible(): int + { + return $this->commentVisible; + } + + public function setCommentVisible(int $commentVisible): void + { + $this->commentVisible = $commentVisible; + } + + public function getCommentLabel(): string + { + return $this->commentLabel; + } + + public function setCommentLabel(string $commentLabel): void + { + $this->commentLabel = $commentLabel; + } + + public function getSentReceivedVisible(): int + { + return $this->sentReceivedVisible; + } + + public function setSentReceivedVisible(int $sentReceivedVisible): void + { + $this->sentReceivedVisible = $sentReceivedVisible; + } + + public function getSentReceivedLabel(): string + { + return $this->sentReceivedLabel; + } + + public function setSentReceivedLabel(string $sentReceivedLabel): void + { + $this->sentReceivedLabel = $sentReceivedLabel; + } + + public function getDocumentVisible(): int + { + return $this->documentVisible; + } + + public function setDocumentVisible(int $documentVisible): void + { + $this->documentVisible = $documentVisible; + } + + public function getDocumentLabel(): string + { + return $this->documentLabel; + } + + public function setDocumentLabel(string $documentLabel): void + { + $this->documentLabel = $documentLabel; + } + + public function getEmergencyVisible(): int + { + return $this->emergencyVisible; + } + + public function setEmergencyVisible(int $emergencyVisible): void + { + $this->emergencyVisible = $emergencyVisible; + } + + public function getEmergencyLabel(): string + { + return $this->emergencyLabel; + } + + public function setEmergencyLabel(string $emergencyLabel): void + { + $this->emergencyLabel = $emergencyLabel; + } + + public function getAccompanyingPeriodVisible(): int + { + return $this->accompanyingPeriodVisible; + } + + public function setAccompanyingPeriodVisible(int $accompanyingPeriodVisible): void + { + $this->accompanyingPeriodVisible = $accompanyingPeriodVisible; + } + + public function getAccompanyingPeriodLabel(): string + { + return $this->accompanyingPeriodLabel; + } + + public function setAccompanyingPeriodLabel(string $accompanyingPeriodLabel): void + { + $this->accompanyingPeriodLabel = $accompanyingPeriodLabel; + } + + public function getSocialDataVisible(): int + { + return $this->socialDataVisible; + } + + public function setSocialDataVisible(int $socialDataVisible): void + { + $this->socialDataVisible = $socialDataVisible; + } + + public function getSocialDataLabel(): string + { + return $this->socialDataLabel; + } + + public function setSocialDataLabel(string $socialDataLabel): void + { + $this->socialDataLabel = $socialDataLabel; + } +} diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php index 006a50c28..eaf347cb4 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityTypeCategory.php @@ -51,8 +51,6 @@ class ActivityTypeCategory /** * Get id - * - * @return integer */ public function getId(): int { diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index f241509ef..bf587c5d8 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -2,7 +2,12 @@ namespace Chill\ActivityBundle\Form; +use Chill\ActivityBundle\Entity\ActivityTypeCategory; +use Chill\ActivityBundle\Form\Type\ActivityFieldPresence; +use Chill\MainBundle\Templating\TranslatableStringHelper; +use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; @@ -10,6 +15,13 @@ use Chill\MainBundle\Form\Type\TranslatableStringFormType; class ActivityTypeType extends AbstractType { + private TranslatableStringHelper $translatableStringHelper; + + public function __construct(TranslatableStringHelper $translatableStringHelper) + { + $this->translatableStringHelper = $translatableStringHelper; + } + /** * @param FormBuilderInterface $builder * @param array $options @@ -18,13 +30,36 @@ class ActivityTypeType extends AbstractType { $builder ->add('name', TranslatableStringFormType::class) - ->add('active', ChoiceType::class, array( - 'choices' => array( + ->add('active', ChoiceType::class, [ + 'choices' => [ 'Yes' => true, 'No' => false - ), + ], 'expanded' => true - )); + ]) + ->add('category', EntityType::class, [ + 'class' => ActivityTypeCategory::class, + 'choice_label' => function (ActivityTypeCategory $activityTypeCategory) { + return $this->translatableStringHelper->localize($activityTypeCategory->getName()); + }, + ]) + ; + + $fields = [ + 'person', 'user', 'date', 'place', 'persons', + 'thirdparty', 'durationTime', 'attendee', + 'reasons', 'comment', 'sentReceived', 'document', + 'emergency', 'accompanyingPeriod', 'socialData' + ]; + + foreach ($fields as $field) { + $builder + ->add($field.'Visible', ActivityFieldPresence::class) + ->add($field.'Label', TextType::class, [ + 'required' => false, + 'empty_data' => '', + ]); + } } /** diff --git a/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php b/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php new file mode 100644 index 000000000..8de67b546 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/Form/Type/ActivityFieldPresence.php @@ -0,0 +1,29 @@ +setDefaults( + array( + 'choices' => [ + 'Invisible' => ActivityType::FIELD_INVISIBLE, + 'Optional' => ActivityType::FIELD_OPTIONAL, + 'Required' => ActivityType::FIELD_REQUIRED, + ], + ) + ); + } +} diff --git a/src/Bundle/ChillActivityBundle/config/services/form.yaml b/src/Bundle/ChillActivityBundle/config/services/form.yaml index e9f81c14e..106ee5cf8 100644 --- a/src/Bundle/ChillActivityBundle/config/services/form.yaml +++ b/src/Bundle/ChillActivityBundle/config/services/form.yaml @@ -6,7 +6,7 @@ services: - "@request_stack" tags: - { name: form.type, alias: translatable_activity_reason_category } - + chill.activity.form.type.translatableactivityreason: class: Chill\ActivityBundle\Form\Type\TranslatableActivityReason arguments: @@ -14,7 +14,7 @@ services: $reasonRender: '@Chill\ActivityBundle\Templating\Entity\ActivityReasonRender' tags: - { name: form.type, alias: translatable_activity_reason } - + chill.activity.form.type.translatableactivitytype: class: Chill\ActivityBundle\Form\Type\TranslatableActivityType arguments: @@ -22,7 +22,7 @@ services: - "@chill_activity.repository.activity_type" tags: - { name: form.type, alias: translatable_activity_type } - + chill.activity.form.type.activity: class: Chill\ActivityBundle\Form\ActivityType arguments: @@ -33,3 +33,10 @@ services: - "%chill_activity.form.time_duration%" tags: - { name: form.type, alias: chill_activitybundle_activity } + + chill.activity.form.type.activityTypeType: + class: Chill\ActivityBundle\Form\ActivityTypeType + arguments: + - "@chill.main.helper.translatable_string" + tags: + - { name: form.type, alias: translatable_activity_type } diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php b/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php new file mode 100644 index 000000000..53a5219bd --- /dev/null +++ b/src/Bundle/ChillActivityBundle/migrations/Version20210408122329.php @@ -0,0 +1,93 @@ +addSql('ALTER TABLE activitytype ADD personVisible SMALLINT DEFAULT 2 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD personLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD userVisible SMALLINT DEFAULT 2 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD userLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD dateVisible SMALLINT DEFAULT 2 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD dateLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD placeVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD placeLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD personsVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD personsLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD thirdpartyVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD thirdpartyLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD durationTimeVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD durationTimeLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD attendeeVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD attendeeLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD reasonsVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD reasonsLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD commentVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD commentLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD sentReceivedVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD sentReceivedLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD documentVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD documentLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD emergencyVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD emergencyLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD accompanyingPeriodVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD accompanyingPeriodLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD socialDataVisible SMALLINT DEFAULT 1 NOT NULL'); + $this->addSql('ALTER TABLE activitytype ADD socialDataLabel VARCHAR(255) DEFAULT \'\' NOT NULL'); + $this->addSql('ALTER TABLE activitytype ALTER name SET NOT NULL'); + $this->addSql('ALTER TABLE activitytype ALTER active DROP DEFAULT'); + $this->addSql('COMMENT ON COLUMN activitytype.name IS \'(DC2Type:json_array)\''); + } + + public function down(Schema $schema) : void + { + $this->addSql('ALTER TABLE activitytype DROP personVisible'); + $this->addSql('ALTER TABLE activitytype DROP personLabel'); + $this->addSql('ALTER TABLE activitytype DROP userVisible'); + $this->addSql('ALTER TABLE activitytype DROP userLabel'); + $this->addSql('ALTER TABLE activitytype DROP dateVisible'); + $this->addSql('ALTER TABLE activitytype DROP dateLabel'); + $this->addSql('ALTER TABLE activitytype DROP placeVisible'); + $this->addSql('ALTER TABLE activitytype DROP placeLabel'); + $this->addSql('ALTER TABLE activitytype DROP personsVisible'); + $this->addSql('ALTER TABLE activitytype DROP personsLabel'); + $this->addSql('ALTER TABLE activitytype DROP thirdpartyVisible'); + $this->addSql('ALTER TABLE activitytype DROP thirdpartyLabel'); + $this->addSql('ALTER TABLE activitytype DROP durationTimeVisible'); + $this->addSql('ALTER TABLE activitytype DROP durationTimeLabel'); + $this->addSql('ALTER TABLE activitytype DROP attendeeVisible'); + $this->addSql('ALTER TABLE activitytype DROP attendeeLabel'); + $this->addSql('ALTER TABLE activitytype DROP reasonsVisible'); + $this->addSql('ALTER TABLE activitytype DROP reasonsLabel'); + $this->addSql('ALTER TABLE activitytype DROP commentVisible'); + $this->addSql('ALTER TABLE activitytype DROP commentLabel'); + $this->addSql('ALTER TABLE activitytype DROP sentReceivedVisible'); + $this->addSql('ALTER TABLE activitytype DROP sentReceivedLabel'); + $this->addSql('ALTER TABLE activitytype DROP documentVisible'); + $this->addSql('ALTER TABLE activitytype DROP documentLabel'); + $this->addSql('ALTER TABLE activitytype DROP emergencyVisible'); + $this->addSql('ALTER TABLE activitytype DROP emergencyLabel'); + $this->addSql('ALTER TABLE activitytype DROP accompanyingPeriodVisible'); + $this->addSql('ALTER TABLE activitytype DROP accompanyingPeriodLabel'); + $this->addSql('ALTER TABLE activitytype DROP socialDataVisible'); + $this->addSql('ALTER TABLE activitytype DROP socialDataLabel'); + $this->addSql('ALTER TABLE activitytype ALTER name DROP NOT NULL'); + $this->addSql('ALTER TABLE activitytype ALTER active SET DEFAULT \'true\''); + $this->addSql('COMMENT ON COLUMN activitytype.name IS NULL'); + } +}