From ca1af41839907cd6b80032a0e88d40608862ffc4 Mon Sep 17 00:00:00 2001 From: Xbird Date: Wed, 15 Jun 2022 17:53:51 +0000 Subject: [PATCH] Add medical infos --- migrations/Version20220615174010.php | 39 +++++++++++++++++++ package.json | 2 +- src/Entity/Directory.php | 34 ++++++++++++++++ src/Form/DirectoryType.php | 18 +++++++++ .../_cells/directoryCardMedical.html.twig | 8 ++++ translations/messages+intl-icu.en.yaml | 6 +++ translations/messages+intl-icu.fr.yaml | 6 +++ 7 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 migrations/Version20220615174010.php diff --git a/migrations/Version20220615174010.php b/migrations/Version20220615174010.php new file mode 100644 index 0000000..404785c --- /dev/null +++ b/migrations/Version20220615174010.php @@ -0,0 +1,39 @@ +addSql('ALTER TABLE directory ADD medical_contact LONGTEXT DEFAULT NULL, ADD medicaltrusted LONGTEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE licencewithdrawal DROP FOREIGN KEY FK_CE2562292C94069F'); + $this->addSql('DROP INDEX idx_ce2562292c94069f ON licencewithdrawal'); + $this->addSql('CREATE INDEX IDX_94E8823A2C94069F ON licencewithdrawal (directory_id)'); + $this->addSql('ALTER TABLE licencewithdrawal ADD CONSTRAINT FK_CE2562292C94069F FOREIGN KEY (directory_id) REFERENCES directory (id)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('ALTER TABLE directory DROP medical_contact, DROP medicaltrusted'); + $this->addSql('ALTER TABLE licencewithdrawal DROP FOREIGN KEY FK_94E8823A2C94069F'); + $this->addSql('DROP INDEX idx_94e8823a2c94069f ON licencewithdrawal'); + $this->addSql('CREATE INDEX IDX_CE2562292C94069F ON licencewithdrawal (directory_id)'); + $this->addSql('ALTER TABLE licencewithdrawal ADD CONSTRAINT FK_94E8823A2C94069F FOREIGN KEY (directory_id) REFERENCES directory (id)'); + } +} diff --git a/package.json b/package.json index b7938ce..183ede9 100644 --- a/package.json +++ b/package.json @@ -1,3 +1,3 @@ { - "version": "0.2.1" + "version": "0.2.2" } diff --git a/src/Entity/Directory.php b/src/Entity/Directory.php index 4a311a8..0f852c7 100644 --- a/src/Entity/Directory.php +++ b/src/Entity/Directory.php @@ -467,6 +467,16 @@ class Directory */ private $hasNoPapers = false; + /** + * @ORM\Column(type="text", nullable=true) + */ + private $medicalContact; + + /** + * @ORM\Column(type="text", nullable=true) + */ + private $medicaltrusted; + public function __construct() { @@ -1472,4 +1482,28 @@ class Directory return $this; } + + public function getMedicalContact(): ?string + { + return $this->medicalContact; + } + + public function setMedicalContact(?string $medicalContact): self + { + $this->medicalContact = $medicalContact; + + return $this; + } + + public function getMedicaltrusted(): ?string + { + return $this->medicaltrusted; + } + + public function setMedicaltrusted(?string $medicaltrusted): self + { + $this->medicaltrusted = $medicaltrusted; + + return $this; + } } diff --git a/src/Form/DirectoryType.php b/src/Form/DirectoryType.php index 2cc1da1..9e0558c 100644 --- a/src/Form/DirectoryType.php +++ b/src/Form/DirectoryType.php @@ -73,6 +73,24 @@ class DirectoryType extends AbstractType if ($user->getAdminMode() || in_array('general_medical_view', $userPermissions)) { $builder ->add('dead', null, ['label' => 'form_label_dead', 'help' => 'form_help_wanted']) + ->add( + 'medicalContact', + ContentType::class, + ['label' => 'form_label_medical_contact', + 'help' => 'form_help_medical_contact', + 'required' => false, + 'attr' => ['style' => 'height: 400px;'] + ] + ) + ->add( + 'medicalTrusted', + ContentType::class, + ['label' => 'form_label_medical_trusted', + 'help' => 'form_help_medical_trusted', + 'required' => false, + 'attr' => ['style' => 'height: 400px;'] + ] + ) ->add( 'medicalFamilyHistory', ContentType::class, diff --git a/templates/_cells/directoryCardMedical.html.twig b/templates/_cells/directoryCardMedical.html.twig index 6d632f6..ff4d6f6 100644 --- a/templates/_cells/directoryCardMedical.html.twig +++ b/templates/_cells/directoryCardMedical.html.twig @@ -6,6 +6,14 @@ {% endif %}
+
+

{% trans %}title_medical_contact{% endtrans %}


+ {{ directory.medicalContact | raw }} +
+
+

{% trans %}title_medical_trusted{% endtrans %}


+ {{ directory.medicalTrusted | raw }} +

{% trans %}title_medical_family_history{% endtrans %}


{{ directory.medicalFamilyHistory | raw }} diff --git a/translations/messages+intl-icu.en.yaml b/translations/messages+intl-icu.en.yaml index 3a7eb48..95015aa 100644 --- a/translations/messages+intl-icu.en.yaml +++ b/translations/messages+intl-icu.en.yaml @@ -259,10 +259,12 @@ form_help_lastname: Last name form_help_medical_alcohol: Medical information on alcohol form_help_medical_allergies: Medical information on allergies form_help_medical_blood_group: Medical information on blood group +form_help_medical_contact: name and number of people contacted in emergency case form_help_medical_drugs: Medical information on drugs form_help_medical_family_history: Family medical history medical information form_help_medical_history: Medical history information form_help_medical_treatment: Medical information on current treatmentss +form_help_medical_trusted: Name and numbers of trusted people form_help_phone: Enter the phone number form_help_power: The power determines the level for the permissions (the higher the power, the more important it is) form_help_search: Indicate the subject of your research. For a date, use the format DD / MM / YYYY @@ -311,10 +313,12 @@ form_label_locale: Locale form_label_medical_alcohol: Alcohol form_label_medical_allergies: Allergies form_label_medical_blood_group: Blood Group +form_label_medical_contact: Emergency contact form_label_medical_drugs: Drugs form_label_medical_family_history: Family history form_label_medical_history: Medical background form_label_medical_treatment: Ongoing treatments +form_label_medical_trusted: Trusted people form_label_model: Template form_label_motd: M.O.T.D. form_label_name: Name @@ -742,11 +746,13 @@ title_management: Management title_medical_alcohol: Alcohol title_medical_allergies: Allergies title_medical_blood: Blood group +title_medical_contact: Emergency contact title_medical_drugs: Drugs title_medical_family_history: Family history title_medical_history: Medical history title_medical_informations: Medical Informations title_medical_treatment: Medical Treatment +title_medical_trusted: Trusted people title_medicals: Medical visits title_members: Members title_merge_directory: Merges directories diff --git a/translations/messages+intl-icu.fr.yaml b/translations/messages+intl-icu.fr.yaml index 74ccce1..ef32374 100644 --- a/translations/messages+intl-icu.fr.yaml +++ b/translations/messages+intl-icu.fr.yaml @@ -259,10 +259,12 @@ form_help_lastname: Nom de Famille form_help_medical_alcohol: Informations médicales sur l'alcool form_help_medical_allergies: Informations médicales sur les allergies form_help_medical_blood_group: Informations médicales sur le groupe sanguin +form_help_medical_contact: Indiquer les personens à prevenir en cas d'urgence form_help_medical_drugs: Informations médicales sur les drogues form_help_medical_family_history: Informations médicales sur les antécédents médicaux familiaux form_help_medical_history: Informations médicales sur les antécédents médicaux form_help_medical_treatment: Informations médicales sur les traitements en cours +form_help_medical_trusted: Indiquez les nom et numeros des personnes de confiance form_help_phone: Indiquez le numéro de téléphone form_help_power: Le power détermine le niveau pour les permissions (plus le power est haut, plus il est important) form_help_search: Indiquez le sujet de votre recherche. Pour une date, utilisez le format JJ/MM/AAAA @@ -311,10 +313,12 @@ form_label_locale: Langue form_label_medical_alcohol: Alcool form_label_medical_allergies: Allergies form_label_medical_blood_group: Groupe Sanguin +form_label_medical_contact: Contact en cas d'urgence form_label_medical_drugs: Drogues form_label_medical_family_history: Antécédents Familiaux form_label_medical_history: Antécédents Médicaux form_label_medical_treatment: Traitements en cours +form_label_medical_trusted: Personnes de confiance form_label_model: Modèle form_label_motd: M.O.T.D. form_label_name: Nom @@ -741,11 +745,13 @@ title_management: Gestion title_medical_alcohol: Alcool title_medical_allergies: Allergies title_medical_blood: Groupe Sanguin +title_medical_contact: Contact en cas d'urgence title_medical_drugs: Drogues title_medical_family_history: Antécédents Familiaux title_medical_history: Antécédents Médicaux title_medical_informations: Informations médicales title_medical_treatment: Traitements +title_medical_trusted: Personnes de confiance title_medicals: Visites médicales title_members: Membres title_merge_directory: Fusionner les fiches