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 @@