From 30995316ae4b5fc7a8c0186168aad5c5c0828ba8 Mon Sep 17 00:00:00 2001 From: ewandor Date: Wed, 5 Jul 2023 16:18:57 +0200 Subject: [PATCH] Adding a column for community work penalties on Criminal Documents --- migrations/Version20230705133033.php | 29 +++++++++++++++++++++ src/Entity/Criminal.php | 18 +++++++++++++ src/Form/CriminalType.php | 1 + templates/_cells/documentTable.html.twig | 4 +++ templates/document/types/Criminal.html.twig | 1 + translations/messages+intl-icu.en.yaml | 3 +++ translations/messages+intl-icu.fr.yaml | 3 +++ 7 files changed, 59 insertions(+) create mode 100644 migrations/Version20230705133033.php diff --git a/migrations/Version20230705133033.php b/migrations/Version20230705133033.php new file mode 100644 index 0000000..2c8381f --- /dev/null +++ b/migrations/Version20230705133033.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE criminal ADD amount_community_work INT AFTER amount_time'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE criminal DROP amount_community_work'); + } +} diff --git a/src/Entity/Criminal.php b/src/Entity/Criminal.php index 5478f62..a6ac31e 100644 --- a/src/Entity/Criminal.php +++ b/src/Entity/Criminal.php @@ -31,6 +31,12 @@ class Criminal extends Document */ private $amountTime; + /** + * @ORM\Column(type="integer", nullable=true) + * @Gedmo\Versioned + */ + private $amountCommunityWork; + /** * @ORM\Column(type="text", length=4294967295, nullable=true) * @Gedmo\Versioned @@ -83,6 +89,18 @@ class Criminal extends Document return $this; } + public function getAmountCommunityWork(): ?int + { + return $this->amountCommunityWork; + } + + public function setAmountCommunityWork(?int $amountCommunityWork): self + { + $this->amountCommunityWork = $amountCommunityWork; + + return $this; + } + public function getContent(): ?string { return $this->content; diff --git a/src/Form/CriminalType.php b/src/Form/CriminalType.php index e187441..f1f78a4 100644 --- a/src/Form/CriminalType.php +++ b/src/Form/CriminalType.php @@ -20,6 +20,7 @@ class CriminalType extends DocumentType ->add('content', ContentType::class, ['label' => 'form_label_informations' ]) ->add('amountMoney', null, ['label' => 'form_label_amount', 'help' => 'form_help_amount']) ->add('amountTime', null, ['label' => 'form_label_time', 'help' => 'form_help_time']) + ->add('amountCommunityWork', null, ['label' => 'form_label_community_work', 'help' => 'form_help_community_work']) ; } diff --git a/templates/_cells/documentTable.html.twig b/templates/_cells/documentTable.html.twig index 22f6ee1..7f75a08 100644 --- a/templates/_cells/documentTable.html.twig +++ b/templates/_cells/documentTable.html.twig @@ -84,6 +84,10 @@
{% trans %}title_hours{% endtrans %}: {{ i.amountTime ? i.amountTime ~ ' h' :'value_no_value'|trans}} {% endif %} + {% if i.amountCommunityWork is defined %} +
{% trans %}title_community_work{% endtrans %}: + {{ i.amountCommunityWork ? i.amountCommunityWork ~ ' h' :'value_no_value'|trans}} + {% endif %} {% if i.accessorySentence is defined and i.accessorySentence is not null %}
{% trans %}title_accessorySentence{% endtrans %} : {{ 'value_yes'|trans}} {% endif %} diff --git a/templates/document/types/Criminal.html.twig b/templates/document/types/Criminal.html.twig index 2126759..cc053fd 100644 --- a/templates/document/types/Criminal.html.twig +++ b/templates/document/types/Criminal.html.twig @@ -7,4 +7,5 @@ \ No newline at end of file diff --git a/translations/messages+intl-icu.en.yaml b/translations/messages+intl-icu.en.yaml index 76680f1..adb5f87 100644 --- a/translations/messages+intl-icu.en.yaml +++ b/translations/messages+intl-icu.en.yaml @@ -257,6 +257,7 @@ form_help_cant_edit_lastname: You cannot edit your first last name form_help_checkbox_adminmode: Check the box to switch the user to admin mode form_help_checkbox_isdesactivated: Check the box to prevent the user from using their account, without deleting it form_help_checkbox_isverified: This box is automatically checked when the user validates his email address. +form_help_community_work: Indicate the duration of community work retained on the criminal record form_help_firstname: First name form_help_gang: Select an associated group form_help_gender: Indicate the person's gender @@ -297,6 +298,7 @@ form_label_checkbox_adminmode: Admin Mode form_label_checkbox_isdesactivated: account Disabled form_label_checkbox_isverified: Email verified form_label_color: Color +form_label_community_work: Total Community Work Duration form_label_complaint_status: Complaint status form_label_content: Content form_label_dead: Deceased @@ -651,6 +653,7 @@ title_comment_add: Add a comment title_comment_belong_document: This belong to title_comment_edition: Edit a comment title_comments: Comments +title_community_work: Hours of Community Work title_complaint: Complaint title_complaints: Complaints title_count: total number diff --git a/translations/messages+intl-icu.fr.yaml b/translations/messages+intl-icu.fr.yaml index d063134..2b89cef 100644 --- a/translations/messages+intl-icu.fr.yaml +++ b/translations/messages+intl-icu.fr.yaml @@ -257,6 +257,7 @@ form_help_cant_edit_lastname: Vous ne pouvez pas éditer votre nom form_help_checkbox_adminmode: Cochez la case pour passer l'utilisateur en mode admin form_help_checkbox_isdesactivated: Cochez la case pour empêcher l'utilisateur d'utiliser son compte, sans l'effacer form_help_checkbox_isverified: Cette case est cochée automatiquement lorsque l'utilisateur valide son adresse email +form_help_community_work: Indiquez le durée des travaux d'intérêt général retenus sur le casier form_help_firstname: Prénom form_help_gang: Séléctionnez un groupe associé a cette personne form_help_gender: Indiquez le genre de la personne @@ -297,6 +298,7 @@ form_label_checkbox_adminmode: Mode Admin form_label_checkbox_isdesactivated: Compte désactivé form_label_checkbox_isverified: Email vérifié form_label_color: Couleur +form_label_community_work: Durée totale TIG form_label_complaint_status: Etat de la plainte form_label_content: Contenu form_label_dead: Individu décédé @@ -650,6 +652,7 @@ title_comment_add: Ajouter un commentaire title_comment_belong_document: Ce document appartient title_comment_edition: Éditer un commentaire title_comments: Commentaires +title_community_work: Heures de TIG title_complaint: Plainte title_complaints: Plaintes title_count: Nombre total