Ajout d'un champ 'limite' dans la table souscription_campagne.
[spip_souscriptions.git] / base / souscription.php
index 0b34005..d0fc1db 100644 (file)
@@ -22,7 +22,7 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  *     Déclarations d'interface pour le compilateur
  */
 function souscription_declarer_tables_interfaces($interfaces) {
-  $interfaces['table_des_tables']['souscription_dons'] = 'souscription_dons';
+  $interfaces['table_des_tables']['souscriptions'] = 'souscriptions';
   $interfaces['table_des_tables']['souscription_campagnes'] = 'souscription_campagnes';
 
   return $interfaces;
@@ -40,11 +40,11 @@ function souscription_declarer_tables_interfaces($interfaces) {
  */
 function souscription_declarer_tables_objets_sql($tables) {
 
-  $tables['spip_souscription_dons'] =
-    array('type' => 'souscription_don',
+  $tables['spip_souscriptions'] =
+    array('type' => 'souscription',
           'principale' => "oui",
-          'table_objet_surnoms' => array('souscriptiondon'), // table_objet('souscription_don') => 'souscription_dons'
-          'field'=> array("id_souscription_don" => "bigint(21) NOT NULL",
+          'table_objet_surnoms' => array('souscription'), // table_objet('souscription') => 'souscription'
+          'field'=> array("id_souscription" => "bigint(21) NOT NULL",
                           "id_transaction"      => "bigint(21) NOT NULL DEFAULT 0",
                           "id_souscription_campagne" => "bigint(21) NOT NULL DEFAULT 0",
                           "courriel"            => "text NOT NULL DEFAULT ''",
@@ -53,22 +53,24 @@ function souscription_declarer_tables_objets_sql($tables) {
                           "code_postal"         => "text NOT NULL DEFAULT ''",
                           "adresse"             => "text NOT NULL DEFAULT ''",
                           "ville"               => "text NOT NULL DEFAULT ''",
-                          "recu_fiscal"         => "varchar(3) NOT NULL DEFAULT 0",
+                          "pays"                => "text NOT NULL DEFAULT ''",
+                          "telephone"           => "text NOT NULL DEFAULT ''",
+                          "recu_fiscal"         => "varchar(3) NOT NULL DEFAULT ''",
+                          "type_souscription"   => "varchar(255) NOT NULL DEFAULT ''",
+                          "informer_comite_local" => "varchar(3) NOT NULL DEFAULT ''",
                           "envoyer_info"        => "varchar(3) NOT NULL DEFAULT ''",
                           "date_souscription "  => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
                           "maj"                 => "TIMESTAMP"
                           ),
-          'key' => array("PRIMARY KEY"          => "id_souscription_don",
+          'key' => array("PRIMARY KEY"          => "id_souscription",
                          "KEY id_transaction"   => "id_transaction",
                          "KEY id_souscription_campagne" => "id_souscription_campagne"),
           'titre' => "nom AS titre, '' AS lang",
           'date' => "date_souscription",
-          'champs_editables'  => array('courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'recu_fiscal', 'envoyer_info'),
-          'champs_versionnes' => array('courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'recu_fiscal', 'envoyer_info'),
+          'champs_editables'  => array('courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'pays', 'recu_fiscal', 'envoyer_info'),
+          'champs_versionnes' => array('courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'pays', 'recu_fiscal', 'envoyer_info'),
           'rechercher_champs' => array(),
           'join' => array("id_transaction" => "id_transaction"),
-          /* 'join' => array("id_souscription_campagne" => "id_souscription_campagne"), */
-          /* 'tables_jointures'  => array('souscription_campagnes'), */
           'tables_jointures'  => array('spip_transactions'),
           );
 
@@ -83,6 +85,7 @@ function souscription_declarer_tables_objets_sql($tables) {
                           "titre"                    => "text NOT NULL DEFAULT ''",
                           "texte"                    => "longtext NOT NULL DEFAULT ''",
                           "statut"                   => "varchar(255) NOT NULL DEFAULT 0",
+                          "limite"                   => "bigint(21) NOT NULL DEFAULT 0",
                           "date"                     => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
                           "maj"                      => "TIMESTAMP"
                           ),
@@ -94,7 +97,6 @@ function souscription_declarer_tables_objets_sql($tables) {
           'champs_editables'  => array('objectif', 'titre', 'texte', 'objectif_initial', 'type_objectif'),
           'champs_versionnes' => array('objectif', 'titre', 'texte', 'objectif_initial', 'type_objectif'),
           'rechercher_champs' => array(),
-          /* 'tables_jointures'  => array('spip_souscription_campagnes'), */
           );
 
   return $tables;