777bc9c14de542177fb841b4315169c7c85ad629
[lhc/web/www.git] / www / plugins-dist / organiseur / base / organiseur.php
1 <?php
2
3 /***************************************************************************\
4 * SPIP, Systeme de publication pour l'internet *
5 * *
6 * Copyright (c) 2001-2016 *
7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
8 * *
9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
11 \***************************************************************************/
12
13 if (!defined('_ECRIRE_INC_VERSION')) {
14 return;
15 }
16
17
18 /**
19 * Declaration des champs complementaires sur la table auteurs, pour les clients
20 *
21 * @param array $tables
22 * @return array
23 */
24 function organiseur_declarer_tables_objets_sql($tables) {
25
26 $tables['spip_auteurs']['field']['imessage'] = 'VARCHAR(3)';
27 $tables['spip_auteurs']['field']['messagerie'] = 'VARCHAR(3)';
28
29 $tables['spip_messages'] = array(
30 'page' => false,
31 'texte_modifier' => 'icone_modifier_message',
32 'texte_creer' => 'icone_ecrire_nouveau_message',
33 'texte_objets' => 'organiseur:messages',
34 'texte_objet' => 'organiseur:message',
35 'info_aucun_objet' => 'info_aucun_message',
36 'info_1_objet' => 'info_1_message',
37 'info_nb_objets' => 'info_nb_messages',
38
39 'principale' => 'oui',
40 'champs_editables' => array(
41 'titre', 'texte', 'type', 'date_heure', 'date_fin', 'rv', 'id_auteur', 'destinataires'
42 ),
43 'field' => array(
44 'id_message' => 'bigint(21) NOT NULL',
45 'titre' => "text DEFAULT '' NOT NULL",
46 'texte' => "longtext DEFAULT '' NOT NULL",
47 // normal,
48 // pb (pense bete)
49 // affich (annonce publique)
50 'type' => "varchar(6) DEFAULT '' NOT NULL",
51 'date_heure' => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
52 'date_fin' => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL",
53 'rv' => "varchar(3) DEFAULT '' NOT NULL",
54 'statut' => "varchar(6) DEFAULT '0' NOT NULL",
55 'id_auteur' => 'bigint(21) DEFAULT 0 NOT NULL',
56 'destinataires' => "text DEFAULT '' NOT NULL",
57 'maj' => 'TIMESTAMP'
58 ),
59 'key' => array(
60 'PRIMARY KEY' => 'id_message',
61 'KEY id_auteur' => 'id_auteur'
62 ),
63 'titre' => "titre, '' AS lang",
64 'date' => 'date_heure',
65 'statut' => array(
66 array(
67 'champ' => 'statut',
68 'publie' => 'publie',
69 'previsu' => '!',
70 'exception' => array('statut', 'tout')
71 ),
72 ),
73 'rechercher_champs' => array(
74 'titre' => 8,
75 'texte' => 1
76 ),
77
78 );
79
80 return $tables;
81 }
82
83 /**
84 * Interfaces des tables agenda et messagerie
85 *
86 * @param array $interfaces
87 * @return array
88 */
89 function organiseur_declarer_tables_interfaces($interfaces) {
90 $interfaces['table_des_tables']['messages'] = 'messages';
91
92 return $interfaces;
93 }