créer la table spip_messages si besoin (SPIP 4 : organiseur absent)
This commit is contained in:
parent
b2c90febf4
commit
336aada63f
6 changed files with 66 additions and 19 deletions
58
base/gamucontact.php
Normal file
58
base/gamucontact.php
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?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',
|
||||
'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;
|
||||
}
|
||||
|
|
@ -27,7 +27,7 @@ function gamucontact_upgrade($nom_meta_base_version, $version_cible) {
|
|||
$maj = array();
|
||||
|
||||
$maj['create'] = array(array('maj_tables', array('spip_messages')));
|
||||
$maj['1.0.4'] = array(array('maj_tables', array('spip_messages')));
|
||||
$maj['1.0.5'] = array(array('maj_tables', array('spip_messages')));
|
||||
|
||||
include_spip('base/upgrade');
|
||||
maj_plugin($nom_meta_base_version, $version_cible, $maj);
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
/**
|
||||
* Définit les autorisations du plugin GamuContact
|
||||
*
|
||||
zsh:1: command not found: qa
|
||||
* @copyright 2021
|
||||
* @author tofulm
|
||||
* @licence GNU/GPL
|
||||
|
|
|
@ -57,13 +57,3 @@ $GLOBALS['gamucontact'] = [
|
|||
],
|
||||
];
|
||||
|
||||
|
||||
function gamucontact_declarer_tables_objets_sql($tables) {
|
||||
|
||||
$tables['spip_messages']['field']['telephone'] = "varchar(55) NOT NULL";
|
||||
$tables['spip_messages']['field']['nom'] = "varchar(255) NOT NULL";
|
||||
$tables['spip_messages']['field']['objet'] = "varchar(255) NOT NULL";
|
||||
$tables['spip_messages']['field']['email_contact'] = "varchar(255) NOT NULL";
|
||||
|
||||
return $tables;
|
||||
}
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
[<img src="(#LOGO_SITE_SPIP|image_reduire{200}|extraire_attribut{src}|url_absolue)" >]
|
||||
<br>
|
||||
<br>
|
||||
<h1><:gamucontact:formulaire_contact:></h1>
|
||||
<BOUCLE_message(MESSAGES){id_message}{statut?}{tout}>
|
||||
<h1>#NOM_SITE_SPIP : <:gamucontact:formulaire_contact:></h1>
|
||||
<BOUCLE_message(MESSAGES){id_message}>
|
||||
<div class="message">
|
||||
[<strong><:gamucontact:nom:> : </strong> (#NOM)<br>]
|
||||
[<strong><:gamucontact:email:> : </strong> (#EMAIL_CONTACT)<br>]
|
||||
|
|
10
paquet.xml
10
paquet.xml
|
@ -1,12 +1,12 @@
|
|||
<paquet
|
||||
prefix="gamucontact"
|
||||
categorie="communication"
|
||||
version="1.0.2"
|
||||
version="1.0.3"
|
||||
etat="dev"
|
||||
compatibilite="[3.3.0-dev;4.0.*]"
|
||||
compatibilite="[3.2.10;4.0.*]"
|
||||
logo="./gamucontact-xx.svg"
|
||||
documentation=""
|
||||
schema="1.0.4"
|
||||
schema="1.0.5"
|
||||
>
|
||||
|
||||
<nom>GamuContact</nom>
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
<pipeline nom="autoriser" inclure="gamucontact_autorisations.php" />
|
||||
|
||||
<pipeline nom="declarer_tables_objets_sql" inclure="gamucontact_options.php" />
|
||||
|
||||
<pipeline nom="declarer_tables_objets_sql" inclure="base/gamucontact.php" />
|
||||
<pipeline nom="declarer_tables_interfaces" inclure="base/gamucontact.php" />
|
||||
|
||||
</paquet>
|
||||
|
|
Loading…
Add table
Reference in a new issue