59 lines
1.6 KiB
PHP
59 lines
1.6 KiB
PHP
<?php
|
|
/**
|
|
* Déclarations relatives à la base de données
|
|
*
|
|
*/
|
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) {
|
|
return;
|
|
}
|
|
|
|
/**
|
|
* Interfaces de la table messages
|
|
*
|
|
* @param array $interfaces
|
|
* @return array
|
|
*/
|
|
function gamucontact_declarer_tables_interfaces($interfaces) {
|
|
$interfaces['table_des_tables']['messages'] = 'messages';
|
|
|
|
return $interfaces;
|
|
}
|
|
|
|
/**
|
|
* Declaration des champs de la table messages
|
|
*
|
|
* @param array $tables
|
|
* @return array
|
|
*/
|
|
function gamucontact_declarer_tables_objets_sql($tables) {
|
|
$tables['spip_messages'] = [
|
|
'principale' => 'oui',
|
|
'field'=> [
|
|
'id_message' => 'bigint(21) NOT NULL',
|
|
'titre' => 'text NOT NULL',
|
|
'objet' => "varchar(255) NOT NULL",
|
|
'texte' => 'longtext NOT NULL',
|
|
'nom' => "varchar(255) NOT NULL",
|
|
'telephone' => "varchar(55) NOT NULL",
|
|
'email_contact' => "varchar(255) NOT NULL",
|
|
'type' => "varchar(6) NOT NULL DEFAULT ''",
|
|
'date_heure' => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
|
|
'date_fin' => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
|
|
'rv' => "varchar(3) NOT NULL DEFAULT ''",
|
|
'statut' => "varchar(6) NOT NULL DEFAULT '0'",
|
|
'id_auteur' => "bigint(21) NOT NULL DEFAULT '0'",
|
|
'destinataires' => 'text NOT NULL',
|
|
'ip' => "varchar(50) NOT NULL DEFAULT '0'",
|
|
'maj' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
|
|
],
|
|
'key' => array(
|
|
'PRIMARY KEY' => 'id_message',
|
|
'KEY statut' => 'statut',
|
|
'KEY id_auteur' => 'id_auteur',
|
|
)
|
|
];
|
|
|
|
return $tables;
|
|
}
|
|
|