diff --git a/.env b/.env index 0106286..d293315 100644 --- a/.env +++ b/.env @@ -1,6 +1,6 @@ APP_ENV=prod DEFAULT_LOCALE=en -APP_SECRET=e80d9c53871bdaa0a1ff5357c695ba6d +APP_SECRET=CHANGEME TZ=America/New_York ###> symfony/lock ### # Choose one of the stores below diff --git a/dotEnvDemo b/dotEnvDemo deleted file mode 100644 index 0de8aee..0000000 --- a/dotEnvDemo +++ /dev/null @@ -1,17 +0,0 @@ -###> symfony/framework-bundle ### -APP_ENV=prod -APP_SECRET={some random chars, maybe use a random generator} -DEFAULT_LOCALE=en -TZ={Timezone, ex : Europe/Paris} -###< symfony/framework-bundle ### - -###> symfony/mailer ### -MAILER_DSN=smtp://{mail}:{password}@{host}:{port} -### ex with docker maildev : MAILER_DSN=smtp://localhost:25 -MAILER_SENDER={your_mail} -###< symfony/mailer ### - -###> doctrine/doctrine-bundle ### -DATABASE_URL="mysql://{user}:{password}@{host}/{database}?charset=utf8" -### ex with docker mariadb : DATABASE_URL="mysql://root:password@127.0.0.1:3306/vision?sslmode=disable&charset=utf8mb4" -###< doctrine/doctrine-bundle ### \ No newline at end of file diff --git a/migrations/Version20220428231327.php b/migrations/Version20220428231327.php new file mode 100644 index 0000000..220d8cf --- /dev/null +++ b/migrations/Version20220428231327.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE licence_withdrawal RENAME licencewithdrawal;'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE licencewithdrawal RENAME licence_withdrawal;'); + } +} diff --git a/package.json b/package.json index 23efdfb..10e64e0 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,3 @@ { - "version": "0.1.5" + "version": "0.2.0" } diff --git a/src/Command/AddGroupCommand.php b/src/Command/AddGroupCommand.php index b2c3a30..08c255a 100644 --- a/src/Command/AddGroupCommand.php +++ b/src/Command/AddGroupCommand.php @@ -5,7 +5,6 @@ namespace App\Command; use App\Entity\Group; use Doctrine\ORM\EntityManagerInterface; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Question\Question; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Console\Attribute\AsCommand; diff --git a/src/Controller/DirectoryController.php b/src/Controller/DirectoryController.php index 7f7d6c6..a74e7ed 100644 --- a/src/Controller/DirectoryController.php +++ b/src/Controller/DirectoryController.php @@ -76,7 +76,7 @@ class DirectoryController extends AbstractController $DocumentList = [ 'Certificate', 'Complaint', - 'LicenceWithdrawal', + 'Licencewithdrawal', 'Infringement', 'Jail', 'Bracelet', diff --git a/src/Entity/Directory.php b/src/Entity/Directory.php index 710a95e..4a311a8 100644 --- a/src/Entity/Directory.php +++ b/src/Entity/Directory.php @@ -356,10 +356,10 @@ class Directory private $complaints; /** - * @ORM\OneToMany(targetEntity=LicenceWithdrawal::class, mappedBy="directory", orphanRemoval=true) + * @ORM\OneToMany(targetEntity=Licencewithdrawal::class, mappedBy="directory", orphanRemoval=true) * @ORM\OrderBy({"createdAt" = "DESC"}) */ - private $licenceWithdrawals; + private $licencewithdrawals; /** * @ORM\Column(type="text", nullable=true) @@ -477,7 +477,7 @@ class Directory $this->bracelets = new ArrayCollection(); $this->criminals = new ArrayCollection(); $this->complaints = new ArrayCollection(); - $this->licenceWithdrawals = new ArrayCollection(); + $this->licencewithdrawals = new ArrayCollection(); $this->infringements = new ArrayCollection(); $this->folders = new ArrayCollection(); } @@ -1183,29 +1183,29 @@ class Directory } /** - * @return Collection|LicenceWithdrawal[] + * @return Collection|Licencewithdrawal[] */ - public function getLicenceWithdrawals(): Collection + public function getLicencewithdrawals(): Collection { - return $this->licenceWithdrawals; + return $this->licencewithdrawals; } - public function addLicenceWithdrawal(LicenceWithdrawal $licenceWithdrawal): self + public function addLicencewithdrawal(Licencewithdrawal $licencewithdrawal): self { - if (!$this->licenceWithdrawals->contains($licenceWithdrawal)) { - $this->licenceWithdrawals[] = $licenceWithdrawal; - $licenceWithdrawal->setDirectory($this); + if (!$this->licencewithdrawals->contains($licencewithdrawal)) { + $this->licencewithdrawals[] = $licencewithdrawal; + $licencewithdrawal->setDirectory($this); } return $this; } - public function removeLicenceWithdrawal(LicenceWithdrawal $licenceWithdrawal): self + public function removeLicencewithdrawal(Licencewithdrawal $licencewithdrawal): self { - if ($this->licenceWithdrawals->removeElement($licenceWithdrawal)) { + if ($this->licencewithdrawals->removeElement($licencewithdrawal)) { // set the owning side to null (unless already changed) - if ($licenceWithdrawal->getDirectory() === $this) { - $licenceWithdrawal->setDirectory(null); + if ($licencewithdrawal->getDirectory() === $this) { + $licencewithdrawal->setDirectory(null); } } diff --git a/src/Entity/LicenceWithdrawal.php b/src/Entity/Licencewithdrawal.php similarity index 85% rename from src/Entity/LicenceWithdrawal.php rename to src/Entity/Licencewithdrawal.php index 72a9c6d..de174d1 100644 --- a/src/Entity/LicenceWithdrawal.php +++ b/src/Entity/Licencewithdrawal.php @@ -2,16 +2,18 @@ namespace App\Entity; +use App\Entity\User; use DateTimeImmutable; use App\Entity\Document; +use App\Entity\Directory; use Doctrine\ORM\Mapping as ORM; use Gedmo\Mapping\Annotation as Gedmo; -use App\Repository\LicenceWithdrawalRepository; +use App\Repository\LicencewithdrawalRepository; /** - * @ORM\Entity(repositoryClass=LicenceWithdrawalRepository::class) + * @ORM\Entity(repositoryClass=LicencewithdrawalRepository::class) */ -class LicenceWithdrawal extends Document +class Licencewithdrawal extends Document { /** * @ORM\Column(type="string", length=255) @@ -26,7 +28,7 @@ class LicenceWithdrawal extends Document private $until; /** - * @ORM\ManyToOne(targetEntity=Directory::class, inversedBy="licenceWithdrawals") + * @ORM\ManyToOne(targetEntity=Directory::class, inversedBy="licencewithdrawals") * @ORM\JoinColumn(nullable=false) */ private $directory; diff --git a/src/Form/LicencewithdrawalType.php b/src/Form/LicencewithdrawalType.php index bf3db55..8248340 100644 --- a/src/Form/LicencewithdrawalType.php +++ b/src/Form/LicencewithdrawalType.php @@ -4,7 +4,7 @@ namespace App\Form; use App\Form\DocumentType; use App\Form\Type\VehicleType; -use App\Entity\LicenceWithdrawal; +use App\Entity\Licencewithdrawal; use App\Form\Type\DateTimeVisionType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -30,7 +30,7 @@ class LicencewithdrawalType extends DocumentType public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ - 'data_class' => LicenceWithdrawal::class, + 'data_class' => Licencewithdrawal::class, ]); } } diff --git a/src/Repository/LicenceWithdrawalRepository.php b/src/Repository/LicenceWithdrawalRepository.php deleted file mode 100644 index 3277ba8..0000000 --- a/src/Repository/LicenceWithdrawalRepository.php +++ /dev/null @@ -1,22 +0,0 @@ -fields = ['type']; //with title, list fields we can search in - } -} diff --git a/src/Repository/LicencewithdrawalRepository.php b/src/Repository/LicencewithdrawalRepository.php new file mode 100644 index 0000000..0a554f3 --- /dev/null +++ b/src/Repository/LicencewithdrawalRepository.php @@ -0,0 +1,22 @@ +fields = ['type']; //with title, list fields we can search in + } +} diff --git a/templates/directory/view.html.twig b/templates/directory/view.html.twig index 0e9d4ae..90adc92 100644 --- a/templates/directory/view.html.twig +++ b/templates/directory/view.html.twig @@ -14,8 +14,8 @@ {% include '_cells/documentTable.html.twig' with {'documents': Complaint, notype: true, limit: 3, nodirectoryinfo: true} %}
-

{% trans %}title_licencewithdrawals{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.licenceWithdrawals.typeClass, app.user)) %} {% trans %}button_create{% endtrans %} {% endif %}

- {% include '_cells/documentTable.html.twig' with {'documents': LicenceWithdrawal, notype: true, limit: 3, nodirectoryinfo: true} %} +

{% trans %}title_licencewithdrawals{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.licencewithdrawals.typeClass, app.user)) %} {% trans %}button_create{% endtrans %} {% endif %}

+ {% include '_cells/documentTable.html.twig' with {'documents': Licencewithdrawal, notype: true, limit: 3, nodirectoryinfo: true} %}

{% trans %}title_infringements{% endtrans %} {% if is_granted('create', classMetadataToEntity(directory.infringements.typeClass, app.user)) %} {% trans %}button_create{% endtrans %} {% endif %}

diff --git a/templates/document/types/LicenceWithdrawal.html.twig b/templates/document/types/Licencewithdrawal.html.twig similarity index 100% rename from templates/document/types/LicenceWithdrawal.html.twig rename to templates/document/types/Licencewithdrawal.html.twig diff --git a/translations/messages+intl-icu.en.yaml b/translations/messages+intl-icu.en.yaml index bf2ae78..3a7eb48 100644 --- a/translations/messages+intl-icu.en.yaml +++ b/translations/messages+intl-icu.en.yaml @@ -118,8 +118,8 @@ breadcrumb_Infringement: Infringement breadcrumb_Infringements: Infringements breadcrumb_Jail: Jail breadcrumb_Jails: Jails -breadcrumb_LicenceWithdrawal: Licence Withdrawal -breadcrumb_LicenceWithdrawals: Licence Withdrawals +breadcrumb_Licencewithdrawal: Licence Withdrawal +breadcrumb_Licencewithdrawals: Licence Withdrawals breadcrumb_list: List breadcrumb_listDirectories: Directories breadcrumb_listDocuments: Documents @@ -186,7 +186,7 @@ documentType_Folder: Folder documentType_Gang: Gang documentType_Infringement: Infringement documentType_Jail: Jail -documentType_LicenceWithdrawal: Licence Withdrawal +documentType_Licencewithdrawal: Licence Withdrawal documentType_Medical: Medical Visit documentType_Report: Report documentType_Sanction: Sanction @@ -278,6 +278,7 @@ form_label_allowedgroups: Authorized groups form_label_allowedsubgroups: Allowed subgroups form_label_allowShare: Check this box to allow public sharing form_label_amount: Total Amount +form_label_archive: Archives form_label_arrested_at: Arrest form_label_asked_for_lawyer: Request for a lawyer form_label_asked_for_medic: Request for a doctor @@ -333,6 +334,7 @@ form_label_status: Status form_label_subgroups: Speciality form_label_time: Total Duration form_label_title: Title +form_label_type: Type form_label_until: until form_label_upload_backpicture: Back picture form_label_upload_boatlicence: Maritime Permit diff --git a/translations/messages+intl-icu.fr.yaml b/translations/messages+intl-icu.fr.yaml index 69287a8..74ccce1 100644 --- a/translations/messages+intl-icu.fr.yaml +++ b/translations/messages+intl-icu.fr.yaml @@ -118,8 +118,8 @@ breadcrumb_Infringement: Infraction breadcrumb_Infringements: Infractions breadcrumb_Jail: PV de GAV breadcrumb_Jails: PVs de GAV -breadcrumb_LicenceWithdrawal: Retrait de permis -breadcrumb_LicenceWithdrawals: Retraits de permis +breadcrumb_Licencewithdrawal: Retrait de permis +breadcrumb_Licencewithdrawals: Retraits de permis breadcrumb_list: Liste breadcrumb_listDirectories: Fiches breadcrumb_listDocuments: Documents @@ -186,7 +186,7 @@ documentType_Folder: Dossier documentType_Gang: Gang documentType_Infringement: Infraction documentType_Jail: PV de GAV -documentType_LicenceWithdrawal: Retrait de permis +documentType_Licencewithdrawal: Retrait de permis documentType_Medical: Visite Médicale documentType_Report: Rapport documentType_Sanction: Sanction @@ -278,6 +278,7 @@ form_label_allowedgroups: Groupes autorisés form_label_allowedsubgroups: Specialitées autorisées en acces form_label_allowShare: Cochez cette case pour autoriser le partage public form_label_amount: Montant total +form_label_archive: Archives form_label_arrested_at: Arrestation form_label_asked_for_lawyer: Demande d'un avocat form_label_asked_for_medic: Demande d'un médecin @@ -333,6 +334,7 @@ form_label_status: Statut form_label_subgroups: Spécialités form_label_time: Durée totale form_label_title: Titre +form_label_type: Type form_label_until: Jusqu'à form_label_upload_backpicture: Photo de Dos form_label_upload_boatlicence: Permis Maritime