[ActivityType] remove placeLabel/visible, replace by

locationLabel/visible
This commit is contained in:
Julien Fastré 2021-12-07 16:38:43 +01:00
parent ebd817f61e
commit aa68ae0b25
5 changed files with 39 additions and 39 deletions

View File

@ -163,16 +163,6 @@ class ActivityType
*/ */
private int $personVisible = self::FIELD_REQUIRED; 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": ""}) * @ORM\Column(type="string", nullable=false, options={"default": ""})
*/ */
@ -406,16 +396,6 @@ class ActivityType
return $this->personVisible; return $this->personVisible;
} }
public function getPlaceLabel(): string
{
return $this->placeLabel;
}
public function getPlaceVisible(): int
{
return $this->placeVisible;
}
public function getReasonsLabel(): string public function getReasonsLabel(): string
{ {
return $this->reasonsLabel; return $this->reasonsLabel;
@ -688,20 +668,6 @@ class ActivityType
return $this; 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 public function setReasonsLabel(string $reasonsLabel): self
{ {
$this->reasonsLabel = $reasonsLabel; $this->reasonsLabel = $reasonsLabel;

View File

@ -143,7 +143,7 @@ class ActivityType extends AbstractType
return array_map( return array_map(
fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]), 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( return array_map(
fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]), fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', (string) $socialActionsAsString) explode(',', $socialActionsAsString)
); );
} }
)); ));

View File

@ -55,7 +55,7 @@ class ActivityTypeType extends AbstractType
]); ]);
$fields = [ $fields = [
'persons', 'user', 'date', 'place', 'persons', 'persons', 'user', 'date', 'location', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee', 'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents', 'reasons', 'comment', 'sentReceived', 'documents',
'emergency', 'socialIssues', 'socialActions', 'users', 'emergency', 'socialIssues', 'socialActions', 'users',

View File

@ -0,0 +1,34 @@
<?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\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20211207152023 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->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');
}
}

View File

@ -146,8 +146,8 @@ User visible: Visibilité du champ Utilisateur
User label: Libellé du champ Utilisateur User label: Libellé du champ Utilisateur
Date visible: Visibilité du champ Date Date visible: Visibilité du champ Date
Date label: Libellé du champ Date Date label: Libellé du champ Date
Place visible: Visibilité du champ Lieu Location visible: Visibilité du champ Lieu
Place label: Libellé du champ Lieu Location label: Libellé du champ Lieu
Third parties visible: Visibilité du champ Tiers Third parties visible: Visibilité du champ Tiers
Third parties label: Libellé du champ Tiers Third parties label: Libellé du champ Tiers
Duration time visible: Visibilité du champ Durée Duration time visible: Visibilité du champ Durée