mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
php csfixes
This commit is contained in:
@@ -87,12 +87,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
*/
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
|
||||
* @Groups({"docgen:read"})
|
||||
*/
|
||||
private PrivateCommentEmbeddable $privateComment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime")
|
||||
* @Groups({"docgen:read"})
|
||||
@@ -141,6 +135,12 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
*/
|
||||
private ?Collection $persons = null;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
|
||||
* @Groups({"docgen:read"})
|
||||
*/
|
||||
private PrivateCommentEmbeddable $privateComment;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
|
||||
* @Groups({"docgen:read"})
|
||||
@@ -321,11 +321,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function getPrivateComment(): PrivateCommentEmbeddable
|
||||
{
|
||||
return $this->privateComment;
|
||||
}
|
||||
|
||||
public function getDate(): DateTime
|
||||
{
|
||||
return $this->date;
|
||||
@@ -413,6 +408,11 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getPrivateComment(): PrivateCommentEmbeddable
|
||||
{
|
||||
return $this->privateComment;
|
||||
}
|
||||
|
||||
public function getReasons(): Collection
|
||||
{
|
||||
return $this->reasons;
|
||||
@@ -550,13 +550,6 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
|
||||
{
|
||||
$this->privateComment = $privateComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDate(DateTime $date): self
|
||||
{
|
||||
$this->date = $date;
|
||||
@@ -606,6 +599,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
|
||||
{
|
||||
$this->privateComment = $privateComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setReasons(?ArrayCollection $reasons): self
|
||||
{
|
||||
$this->reasons = $reasons;
|
||||
|
@@ -76,16 +76,6 @@ class ActivityType
|
||||
*/
|
||||
private int $commentVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||
*/
|
||||
private string $privateCommentLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||
*/
|
||||
private int $privateCommentVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||
*/
|
||||
@@ -177,6 +167,16 @@ class ActivityType
|
||||
*/
|
||||
private int $personVisible = self::FIELD_REQUIRED;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||
*/
|
||||
private string $privateCommentLabel = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="smallint", nullable=false, options={"default": 1})
|
||||
*/
|
||||
private int $privateCommentVisible = self::FIELD_OPTIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", nullable=false, options={"default": ""})
|
||||
*/
|
||||
@@ -324,16 +324,6 @@ class ActivityType
|
||||
return $this->commentVisible;
|
||||
}
|
||||
|
||||
public function getPrivateCommentLabel(): string
|
||||
{
|
||||
return $this->privateCommentLabel;
|
||||
}
|
||||
|
||||
public function getPrivateCommentVisible(): int
|
||||
{
|
||||
return $this->privateCommentVisible;
|
||||
}
|
||||
|
||||
public function getDateLabel(): string
|
||||
{
|
||||
return $this->dateLabel;
|
||||
@@ -436,6 +426,16 @@ class ActivityType
|
||||
return $this->personVisible;
|
||||
}
|
||||
|
||||
public function getPrivateCommentLabel(): string
|
||||
{
|
||||
return $this->privateCommentLabel;
|
||||
}
|
||||
|
||||
public function getPrivateCommentVisible(): int
|
||||
{
|
||||
return $this->privateCommentVisible;
|
||||
}
|
||||
|
||||
public function getReasonsLabel(): string
|
||||
{
|
||||
return $this->reasonsLabel;
|
||||
@@ -593,20 +593,6 @@ class ActivityType
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateCommentLabel(string $privateCommentLabel): self
|
||||
{
|
||||
$this->privateCommentLabel = $privateCommentLabel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateCommentVisible(int $privateCommentVisible): self
|
||||
{
|
||||
$this->privateCommentVisible = $privateCommentVisible;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDateLabel(string $dateLabel): self
|
||||
{
|
||||
$this->dateLabel = $dateLabel;
|
||||
@@ -722,6 +708,20 @@ class ActivityType
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateCommentLabel(string $privateCommentLabel): self
|
||||
{
|
||||
$this->privateCommentLabel = $privateCommentLabel;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateCommentVisible(int $privateCommentVisible): self
|
||||
{
|
||||
$this->privateCommentVisible = $privateCommentVisible;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setReasonsLabel(string $reasonsLabel): self
|
||||
{
|
||||
$this->reasonsLabel = $reasonsLabel;
|
||||
|
@@ -252,10 +252,10 @@ class ActivityType extends AbstractType
|
||||
]);
|
||||
}
|
||||
|
||||
if($activityType->isVisible('privateComment')) {
|
||||
if ($activityType->isVisible('privateComment')) {
|
||||
$builder->add('privateComment', PrivateCommentType::class, [
|
||||
'label' => empty($activityType->getLabel('privateComment')) ? 'activity.private comment' : $activityType->getPrivateCommentLabel(),
|
||||
'required' => false
|
||||
'required' => false,
|
||||
]);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,12 @@
|
||||
<?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;
|
||||
@@ -12,6 +19,13 @@ use Doctrine\Migrations\AbstractMigration;
|
||||
*/
|
||||
final class Version20220425133027 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentLabel');
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentVisible');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'add private comment option to activity types';
|
||||
@@ -23,11 +37,4 @@ final class Version20220425133027 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE activitytype ADD privateCommentLabel VARCHAR(255) DEFAULT \'\' NOT NULL');
|
||||
$this->addSql('ALTER TABLE activitytype ADD privateCommentVisible SMALLINT DEFAULT 1 NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentLabel');
|
||||
$this->addSql('ALTER TABLE activitytype DROP privateCommentVisible');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user