From 29ee5a896847997fccd540ed0153e90ad9a84b47 Mon Sep 17 00:00:00 2001 From: tofulm Date: Mon, 30 Mar 2020 15:45:35 +0200 Subject: [PATCH] maj du schema de bdd pour la creation des forms et l'enregistrement des resultats --- base/gamuform.php | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/base/gamuform.php b/base/gamuform.php index 20c2495..b0f6f20 100644 --- a/base/gamuform.php +++ b/base/gamuform.php @@ -48,8 +48,15 @@ function gamuform_declarer_tables_objets_sql($tables) { 'field'=> array( 'id_gamuform' => 'bigint(21) NOT NULL', 'titre' => 'varchar(255) NOT NULL DEFAULT ""', - 'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"', + 'label' => 'varchar(255) NOT NULL DEFAULT ""', + 'type' => 'varchar(255) NOT NULL DEFAULT ""', + 'class_container' => 'varchar(255) NOT NULL DEFAULT ""', + 'class' => 'varchar(255) NOT NULL DEFAULT ""', + 'choix' => "text NOT NULL", + 'defaut' => 'varchar(255) NOT NULL DEFAULT ""', 'statut' => 'varchar(20) DEFAULT "0" NOT NULL', + 'date' => 'datetime NOT NULL DEFAULT "0000-00-00 00:00:00"', + 'rang' => 'tinyint(4) NOT NULL', 'maj' => 'TIMESTAMP' ), 'key' => array( @@ -57,24 +64,20 @@ function gamuform_declarer_tables_objets_sql($tables) { 'KEY statut' => 'statut', ), 'titre' => 'titre AS titre, "" AS lang', - 'date' => 'date', - 'champs_editables' => array('titre'), - 'champs_versionnes' => array('titre'), - 'rechercher_champs' => array(), + 'date' => 'date', + //'champs_editables' => array('titre'), + //'champs_versionnes' => array('titre'), + //'rechercher_champs' => array(), 'tables_jointures' => array('spip_gamuforms_liens'), 'statut_textes_instituer' => array( 'prepa' => 'texte_statut_en_cours_redaction', - 'prop' => 'texte_statut_propose_evaluation', 'publie' => 'texte_statut_publie', - 'refuse' => 'texte_statut_refuse', 'poubelle' => 'texte_statut_poubelle', ), 'statut'=> array( array( 'champ' => 'statut', 'publie' => 'publie', - 'previsu' => 'publie,prop,prepa', - 'post_date' => 'date', 'exception' => array('statut','tout') ) ), @@ -100,13 +103,14 @@ function gamuform_declarer_tables_auxiliaires($tables) { $tables['spip_gamuforms_liens'] = array( 'field' => array( - 'id_gamuform' => 'bigint(21) DEFAULT "0" NOT NULL', - 'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL', - 'objet' => 'VARCHAR(25) DEFAULT "" NOT NULL', - 'vu' => 'VARCHAR(6) DEFAULT "non" NOT NULL', + 'id_gamuform' => 'bigint(21) DEFAULT "0" NOT NULL', + 'id_objet' => 'bigint(21) DEFAULT "0" NOT NULL', + 'objet' => 'VARCHAR(25) DEFAULT "" NOT NULL', + 'type' => 'VARCHAR(6) DEFAULT "form" NOT NULL', + 'valeur' => "text NOT NULL", ), 'key' => array( - 'PRIMARY KEY' => 'id_gamuform,id_objet,objet', + 'PRIMARY KEY' => 'id_gamuform,id_objet,objet,type', 'KEY id_gamuform' => 'id_gamuform', ) );