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..0f73df4 100644 --- a/translations/messages+intl-icu.en.yaml +++ b/translations/messages+intl-icu.en.yaml @@ -297,6 +297,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 +652,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..c69494b 100644 --- a/translations/messages+intl-icu.fr.yaml +++ b/translations/messages+intl-icu.fr.yaml @@ -297,6 +297,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 +651,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