From 6a0948110571568ba50813b970fa79828a781392 Mon Sep 17 00:00:00 2001 From: bach Date: Tue, 25 Apr 2023 15:01:20 +0200 Subject: [PATCH] =?UTF-8?q?concernement=20added=20possibility=20to=20add?= =?UTF-8?q?=20existing=20entit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...display.paragraph.entite_concernement.default.yml | 3 ++- .../custom/ouatminimal_theme/ouatminimal.theme | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/config/sync/core.entity_form_display.paragraph.entite_concernement.default.yml b/src/config/sync/core.entity_form_display.paragraph.entite_concernement.default.yml index ce900d2..64cf892 100644 --- a/src/config/sync/core.entity_form_display.paragraph.entite_concernement.default.yml +++ b/src/config/sync/core.entity_form_display.paragraph.entite_concernement.default.yml @@ -39,12 +39,13 @@ content: label_singular: '' label_plural: '' allow_new: true - allow_existing: false + allow_existing: true match_operator: CONTAINS allow_duplicate: false collapsible: false collapsed: false revision: false + removed_reference: optional third_party_settings: { } field_menace_maintien_degres: type: number diff --git a/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme b/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme index 5a5f2d5..697174f 100644 --- a/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme +++ b/src/web/themes/custom/ouatminimal_theme/ouatminimal.theme @@ -148,7 +148,19 @@ function ouatminimal_preprocess_input(&$variables) { // rename entité reference in paragraphe "add node" to "editer entité" if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add$/', $name)) { $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Editer l'entité"; + } + // rename entité reference in paragraphe "Ajouter un node existant" to "ajouyer entite existante" + // "ief-field_entite-0-subform-field_entite-form-add" + if (preg_match('/^ief-field_entite-\d+-subform-field_entite-form-add-existing$/', $name)) { + $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter une entité éxistante"; } + + // rename entité reference in paragraphe "Ajout de node" to "Ajouter" + // "ief-reference-submit-field_entite-7-subform-field_entite-form" + if (preg_match('/^ief-reference-submit-field_entite-\d+-subform-field_entite-form$/', $name)) { + $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Ajouter"; + } + // rename remove (paragraphe) to "supprimer" if (preg_match('/field_entite_\d+_remove/', $name)) { $element['#value'] = $element['#attributes']['value'] = $variables['attributes']['value'] = "Supprimer";