mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Add private comment to rendez-vous
This commit is contained in:
parent
79fa030323
commit
171cc79a4a
@ -70,6 +70,12 @@ class Calendar
|
||||
*/
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Embedded(class=CommentEmbeddable::class, columnPrefix="prcomment_")
|
||||
* @Serializer\Groups({"calendar:read"})
|
||||
*/
|
||||
private CommentEmbeddable $privateComment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
* @Serializer\Groups({"calendar:read"})
|
||||
@ -151,6 +157,7 @@ class Calendar
|
||||
public function __construct()
|
||||
{
|
||||
$this->comment = new CommentEmbeddable();
|
||||
$this->privateComment = new CommentEmbeddable();
|
||||
$this->persons = new ArrayCollection();
|
||||
$this->professionals = new ArrayCollection();
|
||||
$this->invites = new ArrayCollection();
|
||||
@ -208,6 +215,11 @@ class Calendar
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
public function getPrivateComment(): CommentEmbeddable
|
||||
{
|
||||
return $this->privateComment;
|
||||
}
|
||||
|
||||
public function getEndDate(): ?DateTimeImmutable
|
||||
{
|
||||
return $this->endDate;
|
||||
@ -386,6 +398,13 @@ class Calendar
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPrivateComment(CommentEmbeddable $privateComment): self
|
||||
{
|
||||
$this->privateComment = $privateComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setEndDate(DateTimeImmutable $endDate): self
|
||||
{
|
||||
$this->endDate = $endDate;
|
||||
|
@ -18,6 +18,7 @@ use Chill\CalendarBundle\Entity\Invite;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Chill\MainBundle\Form\Type\PrivateCommentType;
|
||||
use Chill\MainBundle\Templating\TranslatableStringHelper;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdParty;
|
||||
@ -51,6 +52,10 @@ class CalendarType extends AbstractType
|
||||
->add('comment', CommentType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('privateComment', PrivateCommentType::class, [
|
||||
'required' => false,
|
||||
'label' => 'private comment'
|
||||
])
|
||||
// ->add('cancelReason', EntityType::class, [
|
||||
// 'required' => false,
|
||||
// 'class' => CancelReason::class,
|
||||
|
@ -47,6 +47,10 @@
|
||||
{{ form_row(form.comment) }}
|
||||
{% endif %}
|
||||
|
||||
{%- if form.privateComment is defined -%}
|
||||
{{ form_row(form.privateComment) }}
|
||||
{% endif %}
|
||||
|
||||
{%- if form.sendSMS is defined -%}
|
||||
{{ form_row(form.sendSMS) }}
|
||||
{% endif %}
|
||||
|
@ -43,6 +43,10 @@
|
||||
{{ form_row(form.comment) }}
|
||||
{% endif %}
|
||||
|
||||
{%- if form.privateComment is defined -%}
|
||||
{{ form_row(form.privateComment) }}
|
||||
{% endif %}
|
||||
|
||||
{%- if form.sendSMS is defined -%}
|
||||
{{ form_row(form.sendSMS) }}
|
||||
{% endif %}
|
||||
|
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Calendar;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20220425131140 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add private comment to calendar';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ADD prcomment_comment TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ADD prcomment_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ADD prcomment_userId INT DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar DROP prcomment_comment');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar DROP prcomment_date');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar DROP prcomment_userId');
|
||||
}
|
||||
}
|
@ -26,3 +26,4 @@ The calendar item has been successfully removed.: Le rendez-vous a été supprim
|
||||
From the day: Du
|
||||
to the day: au
|
||||
Transform to activity: Transformer en échange
|
||||
private comment: Commentaire privé
|
Loading…
x
Reference in New Issue
Block a user