From e3c2ddcaf5078c19983cb98f07522c413cfa62a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr> Date: Tue, 5 May 2020 17:24:48 +0200 Subject: [PATCH] =?UTF-8?q?Initialisation=20des=20donn=C3=A9es=20des=20tab?= =?UTF-8?q?les=20pour=20les=20champs=20autres=20du=20nouveau=20dossier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/DataGen.php | 12 +++++++++++- data/ddl/table/DOSSIER_CHAMP_AUTRE.php | 4 ++-- data/nomenclatures.php | 27 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/admin/src/DataGen.php b/admin/src/DataGen.php index 4fc1e58cbb..c76b77eb6f 100644 --- a/admin/src/DataGen.php +++ b/admin/src/DataGen.php @@ -154,7 +154,11 @@ class DataGen 'key' => 'CODE', 'options' => ['update' => false, 'delete' => false], ], - + [ + 'table' => 'DOSSIER_CHAMP_AUTRE_TYPE', + 'context' => ['install', 'update'], + 'key' => 'CODE', + ], /* Nomenclatures partiellement paramétrables (certaines colonnes) */ [ @@ -169,6 +173,12 @@ class DataGen 'key' => ['TYPE_VOLUME_HORAIRE_ID', 'TYPE_INTERVENANT_ID'], 'options' => ['update-ignore-cols' => ['PRIORITE']], ], + [ + 'table' => 'DOSSIER_CHAMP_AUTRE', + 'context' => ['install', 'update'], + 'key' => 'ID', + 'options' => ['update-ignore-cols' => ['LIBELLE', 'DOSSIER_CHAMP_AUTRE_TYPE_ID', 'CONTENU', 'DESCRIPTION']], + ], /* Tables avec paramétrages pré-configurés (certaines colonnes + nouveaux enregistrements) */ diff --git a/data/ddl/table/DOSSIER_CHAMP_AUTRE.php b/data/ddl/table/DOSSIER_CHAMP_AUTRE.php index 05e3055ff2..f285ac20c9 100644 --- a/data/ddl/table/DOSSIER_CHAMP_AUTRE.php +++ b/data/ddl/table/DOSSIER_CHAMP_AUTRE.php @@ -40,8 +40,8 @@ return [ 'length' => 0, 'scale' => NULL, 'precision' => NULL, - 'nullable' => TRUE, - 'default' => NULL, + 'nullable' => FALSE, + 'default' => '1', 'position' => 3, 'commentaire' => NULL, ], diff --git a/data/nomenclatures.php b/data/nomenclatures.php index 6b33a260cb..07c7387386 100644 --- a/data/nomenclatures.php +++ b/data/nomenclatures.php @@ -80,6 +80,33 @@ return [ ], ], + 'DOSSIER_CHAMP_AUTRE_TYPE' => [ + [ + 'ID' => 1, + 'CODE' => 'texte', + 'LIBELLE' => 'Champ texte simple', + ], + [ + 'ID' => 2, + 'CODE' => 'select-fixe', + 'LIBELLE' => 'Liste déroulante à valeurs constantes', + ], + [ + 'ID' => 3, + 'CODE' => 'select-sql', + 'LIBELLE' => 'Liste déroulante basée sur une requête SQL', + ], + ], + + 'DOSSIER_CHAMP_AUTRE' => [ + ['ID' => 1, 'DOSSIER_CHAMP_AUTRE_TYPE_ID' => 1], + ['ID' => 2, 'DOSSIER_CHAMP_AUTRE_TYPE_ID' => 1], + ['ID' => 3, 'DOSSIER_CHAMP_AUTRE_TYPE_ID' => 1], + ['ID' => 4, 'DOSSIER_CHAMP_AUTRE_TYPE_ID' => 1], + ['ID' => 5, 'DOSSIER_CHAMP_AUTRE_TYPE_ID' => 1], + ], + + 'ETAT_VOLUME_HORAIRE' => [ [ 'ID' => 1, -- GitLab