|
@@ -4,16 +4,30 @@ declare(strict_types=1);
|
|
|
namespace App\Entity\Organization;
|
|
namespace App\Entity\Organization;
|
|
|
|
|
|
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
use ApiPlatform\Core\Annotation\ApiResource;
|
|
|
|
|
+use ApiPlatform\Core\Annotation\ApiSubresource;
|
|
|
|
|
+use App\Entity\Access\Access;
|
|
|
use App\Entity\Core\File;
|
|
use App\Entity\Core\File;
|
|
|
use App\Repository\Organization\ParametersRepository;
|
|
use App\Repository\Organization\ParametersRepository;
|
|
|
|
|
+use Doctrine\Common\Collections\ArrayCollection;
|
|
|
|
|
+use Doctrine\Common\Collections\Collection;
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
+use JetBrains\PhpStorm\Pure;
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
|
+use App\Validator\Organization\Parameters as OpentalentAssert;
|
|
|
|
|
|
|
|
#[ApiResource(
|
|
#[ApiResource(
|
|
|
collectionOperations: [],
|
|
collectionOperations: [],
|
|
|
- itemOperations: ['get']
|
|
|
|
|
|
|
+ itemOperations: [
|
|
|
|
|
+ 'get' => [
|
|
|
|
|
+ 'security' => '(is_granted("ROLE_ORGANIZATION_VIEW") or is_granted("ROLE_ORGANIZATION")) and object.getOrganization().getId() == user.getOrganization().getId()'
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'put' => [
|
|
|
|
|
+ 'security' => 'is_granted("ROLE_ORGANIZATION") and object.getOrganization().getId() == user.getOrganization().getId()'
|
|
|
|
|
+ ]
|
|
|
|
|
+ ]
|
|
|
)]
|
|
)]
|
|
|
#[ORM\Entity(repositoryClass: ParametersRepository::class)]
|
|
#[ORM\Entity(repositoryClass: ParametersRepository::class)]
|
|
|
|
|
+#[OpentalentAssert\MobytCredentials]
|
|
|
class Parameters
|
|
class Parameters
|
|
|
{
|
|
{
|
|
|
#[ORM\Id]
|
|
#[ORM\Id]
|
|
@@ -21,6 +35,9 @@ class Parameters
|
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\GeneratedValue]
|
|
|
private ?int $id = null;
|
|
private ?int $id = null;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\OneToOne(mappedBy: 'parameters', targetEntity: Organization::class)]
|
|
|
|
|
+ private Organization $organization;
|
|
|
|
|
+
|
|
|
#[ORM\Column(type: 'date', nullable: true)]
|
|
#[ORM\Column(type: 'date', nullable: true)]
|
|
|
private ?\DateTimeInterface $financialDate = null;
|
|
private ?\DateTimeInterface $financialDate = null;
|
|
|
|
|
|
|
@@ -36,29 +53,39 @@ class Parameters
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
#[ORM\Column(options: ['default' => false])]
|
|
|
private bool $trackingValidation = false;
|
|
private bool $trackingValidation = false;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(options: ['default' => 20])]
|
|
|
|
|
+ #[Assert\GreaterThanOrEqual(0, message: 'greaterThanOrEqual0')]
|
|
|
|
|
+ #[Assert\LessThanOrEqual(100, message: 'lessThanOrEqual100')]
|
|
|
|
|
+ private int $average = 20;
|
|
|
|
|
+
|
|
|
#[ORM\Column(options: ['default' => true])]
|
|
#[ORM\Column(options: ['default' => true])]
|
|
|
private bool $editCriteriaNotationByAdminOnly = true;
|
|
private bool $editCriteriaNotationByAdminOnly = true;
|
|
|
|
|
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
+ #[Assert\Regex('/^[a-zA-Z0-9]+$/i', message: 'smsSenderName_error')]
|
|
|
private ?string $smsSenderName = null;
|
|
private ?string $smsSenderName = null;
|
|
|
|
|
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
#[ORM\Column(options: ['default' => false])]
|
|
|
private bool $logoDonorsMove = false;
|
|
private bool $logoDonorsMove = false;
|
|
|
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
|
|
+ #[ORM\Column(length: 60, nullable: true)]
|
|
|
private ?string $subDomain = null;
|
|
private ?string $subDomain = null;
|
|
|
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
|
|
+ #[ORM\Column(length: 100, nullable: true)]
|
|
|
private ?string $website = null;
|
|
private ?string $website = null;
|
|
|
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
|
|
+ #[ORM\Column(length: 150, nullable: true)]
|
|
|
private ?string $otherWebsite = null;
|
|
private ?string $otherWebsite = null;
|
|
|
|
|
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
#[ORM\Column(options: ['default' => false])]
|
|
|
private bool $desactivateOpentalentSiteWeb = false;
|
|
private bool $desactivateOpentalentSiteWeb = false;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\OneToMany( mappedBy: 'publicationDirector', targetEntity: Access::class)]
|
|
|
|
|
+ #[ApiSubresource]
|
|
|
|
|
+ private Collection $publicationDirectors;
|
|
|
|
|
+
|
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
#[ORM\Column(length: 255, nullable: true)]
|
|
|
- #[Assert\Choice(callback: ['\App\Enum\Organization\OpcBulletinPeriodEnumaEnum', 'toArray'], message: 'invalid-bulletin-period')]
|
|
|
|
|
|
|
+ #[Assert\Choice(callback: ['\App\Enum\Organization\BulletinPeriodEnum', 'toArray'], message: 'invalid-bulletin-period')]
|
|
|
private ?string $bulletinPeriod = null;
|
|
private ?string $bulletinPeriod = null;
|
|
|
|
|
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
#[ORM\Column(options: ['default' => false])]
|
|
@@ -89,12 +116,6 @@ class Parameters
|
|
|
#[Assert\Choice(callback: ['\App\Enum\Organization\BulletinOutputEnum', 'toArray'], message: 'invalid-bulletin-output')]
|
|
#[Assert\Choice(callback: ['\App\Enum\Organization\BulletinOutputEnum', 'toArray'], message: 'invalid-bulletin-output')]
|
|
|
private ?string $bulletinOutput = null;
|
|
private ?string $bulletinOutput = null;
|
|
|
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
- private ?string $usernameSMS = null;
|
|
|
|
|
-
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
- private ?string $passwordSMS = null;
|
|
|
|
|
-
|
|
|
|
|
#[ORM\Column(options: ['default' => true])]
|
|
#[ORM\Column(options: ['default' => true])]
|
|
|
private bool $bulletinEditWithoutEvaluation = true;
|
|
private bool $bulletinEditWithoutEvaluation = true;
|
|
|
|
|
|
|
@@ -102,28 +123,62 @@ class Parameters
|
|
|
#[Assert\Choice(callback: ['\App\Enum\Organization\SendToBulletinEnum', 'toArray'], message: 'invalid-send-to-bulletin')]
|
|
#[Assert\Choice(callback: ['\App\Enum\Organization\SendToBulletinEnum', 'toArray'], message: 'invalid-send-to-bulletin')]
|
|
|
private ?string $bulletinReceiver = null;
|
|
private ?string $bulletinReceiver = null;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
+ private ?string $usernameSMS = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
+ private ?string $passwordSMS = null;
|
|
|
|
|
+
|
|
|
#[ORM\Column(options: ['default' => true])]
|
|
#[ORM\Column(options: ['default' => true])]
|
|
|
private bool $showAdherentList = true;
|
|
private bool $showAdherentList = true;
|
|
|
|
|
|
|
|
#[ORM\Column(options: ['default' => false])]
|
|
#[ORM\Column(options: ['default' => false])]
|
|
|
private bool $studentsAreAdherents = false;
|
|
private bool $studentsAreAdherents = false;
|
|
|
|
|
|
|
|
|
|
+ #[ORM\OneToOne(inversedBy: 'qrCode', targetEntity: File::class, cascade: ['persist'], fetch: 'EAGER')]
|
|
|
|
|
+ #[ORM\JoinColumn(referencedColumnName: 'id', nullable: true, onDelete: 'SET NULL')]
|
|
|
|
|
+ private ?File $qrCode = null;
|
|
|
|
|
+
|
|
|
#[ORM\Column(length: 255, options: ['default' => 'Europe/Paris'])]
|
|
#[ORM\Column(length: 255, options: ['default' => 'Europe/Paris'])]
|
|
|
- #[Assert\Choice(callback: ['\App\Enum\Organization\TimeZoneEnum', 'toArray'], message: 'invalid-timezone')]
|
|
|
|
|
|
|
+ #[Assert\Choice(callback: ['\App\Enum\Core\TimeZoneEnum', 'toArray'], message: 'invalid-timezone')]
|
|
|
private ?string $timezone = "Europe/Paris";
|
|
private ?string $timezone = "Europe/Paris";
|
|
|
|
|
|
|
|
- #[ORM\Column(length: 255, nullable: true)]
|
|
|
|
|
- #[Assert\Choice(callback: ['\App\Enum\Organization\PeriodicityEnum', 'toArray'], message: 'invalid-periodicity')]
|
|
|
|
|
|
|
+ #[ORM\Column(length: 255, nullable: true, options: ['default' => 'ANNUAL'])]
|
|
|
|
|
+ #[Assert\Choice(callback: ['\App\Enum\Education\PeriodicityEnum', 'toArray'], message: 'invalid-periodicity')]
|
|
|
private ?string $educationPeriodicity = null;
|
|
private ?string $educationPeriodicity = null;
|
|
|
|
|
|
|
|
- #[ORM\OneToOne(cascade: ['persist', 'remove'])]
|
|
|
|
|
- private File $qrCode;
|
|
|
|
|
|
|
+ #[ORM\Column(length: 255, nullable: true, options: ['default' => 'BY_EDUCATION'])]
|
|
|
|
|
+ #[Assert\Choice(callback: ['\App\Enum\Education\AdvancedEducationNotationTypeEnum', 'toArray'], message: 'invalid-advanced-education-notation-type')]
|
|
|
|
|
+ private ?string $advancedEducationNotationType = null;
|
|
|
|
|
+
|
|
|
|
|
+ #[ORM\Column(options: ['default' => false])]
|
|
|
|
|
+ private bool $sendAttendanceEmail = false;
|
|
|
|
|
+
|
|
|
|
|
+ #[ORM\Column(options: ['default' => false])]
|
|
|
|
|
+ private bool $sendAttendanceSms = false;
|
|
|
|
|
+
|
|
|
|
|
+ #[Pure] public function __construct()
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->publicationDirectors = new ArrayCollection();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
public function getId(): ?int
|
|
public function getId(): ?int
|
|
|
{
|
|
{
|
|
|
return $this->id;
|
|
return $this->id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getOrganization(): Organization
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->organization;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setOrganization(Organization $organization): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->organization = $organization;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getFinancialDate(): ?\DateTimeInterface
|
|
public function getFinancialDate(): ?\DateTimeInterface
|
|
|
{
|
|
{
|
|
|
return $this->financialDate;
|
|
return $this->financialDate;
|
|
@@ -184,6 +239,18 @@ class Parameters
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getAverage(): int
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->average;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setAverage(int $average)
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->average = $average;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getEditCriteriaNotationByAdminOnly(): bool
|
|
public function getEditCriteriaNotationByAdminOnly(): bool
|
|
|
{
|
|
{
|
|
|
return $this->editCriteriaNotationByAdminOnly;
|
|
return $this->editCriteriaNotationByAdminOnly;
|
|
@@ -280,6 +347,33 @@ class Parameters
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getPublicationDirectors(): Collection
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->publicationDirectors;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function addPublicationDirector(Access $access): self
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!$this->publicationDirectors->contains($access)) {
|
|
|
|
|
+ $this->publicationDirectors[] = $access;
|
|
|
|
|
+ $access->setPublicationDirector($this);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function removePublicationDirector(Access $access): self
|
|
|
|
|
+ {
|
|
|
|
|
+ if ($this->publicationDirectors->removeElement($access)) {
|
|
|
|
|
+ // set the owning side to null (unless already changed)
|
|
|
|
|
+ if ($access->getPublicationDirector() === $this) {
|
|
|
|
|
+ $access->setPublicationDirector(null);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function getBulletinWithTeacher(): bool
|
|
public function getBulletinWithTeacher(): bool
|
|
|
{
|
|
{
|
|
|
return $this->bulletinWithTeacher;
|
|
return $this->bulletinWithTeacher;
|
|
@@ -484,6 +578,53 @@ class Parameters
|
|
|
return $this;
|
|
return $this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function getAdvancedEducationNotationType(): ?string
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->advancedEducationNotationType;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setAdvancedEducationNotationType(?string $advancedEducationNotationType): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->advancedEducationNotationType = $advancedEducationNotationType;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getQrCode(): ?File
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->qrCode;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setQrCode(?File $qrCode): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->qrCode = $qrCode;
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getSendAttendanceSms(): bool
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->sendAttendanceSms;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setSendAttendanceSms(bool $sendAttendanceSms): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->sendAttendanceSms = $sendAttendanceSms;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function getSendAttendanceEmail(): bool
|
|
|
|
|
+ {
|
|
|
|
|
+ return $this->sendAttendanceEmail;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function setSendAttendanceEmail(bool $sendAttendanceEmail): self
|
|
|
|
|
+ {
|
|
|
|
|
+ $this->sendAttendanceEmail = $sendAttendanceEmail;
|
|
|
|
|
+
|
|
|
|
|
+ return $this;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @return File
|
|
* @return File
|
|
|
*/
|
|
*/
|