1 | <?php |
---|
2 | |
---|
3 | // Declaration des tables pourles nouveaux objets de Relecture: |
---|
4 | // - relecture : table spip_relectures |
---|
5 | // - commentaire : table spip_commentaires |
---|
6 | // |
---|
7 | function relecture_declarer_tables_objets_sql($tables) { |
---|
8 | include_spip('inc/config'); |
---|
9 | |
---|
10 | $tables['spip_relectures'] = array( |
---|
11 | // Base de donnees |
---|
12 | 'table_objet' => 'relectures', |
---|
13 | 'type' => 'relecture', |
---|
14 | 'field' => array( |
---|
15 | "id_relecture" => "bigint(21) NOT NULL", |
---|
16 | "periode_debut" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
17 | "periode_fin" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
18 | "relecteurs" => "text DEFAULT '' NOT NULL", //tableau serialise des id d'auteurs |
---|
19 | "description" => "text DEFAULT '' NOT NULL", |
---|
20 | "id_article" => "bigint(21) NOT NULL", |
---|
21 | "rev_ouverture" => "bigint(21) NOT NULL", |
---|
22 | "article_descr" => "text DEFAULT '' NOT NULL", |
---|
23 | "article_chapo" => "mediumtext DEFAULT '' NOT NULL", |
---|
24 | "article_texte" => "longtext DEFAULT '' NOT NULL", |
---|
25 | "article_ps" => "mediumtext DEFAULT '' NOT NULL", |
---|
26 | "statut" => "varchar(10) DEFAULT '' NOT NULL", |
---|
27 | "date_cloture" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
28 | "rev_cloture" => "bigint(21) NOT NULL", |
---|
29 | "maj" => "timestamp"), |
---|
30 | 'key' => array( |
---|
31 | "PRIMARY KEY" => "id_relecture", |
---|
32 | "KEY id_article" => "id_article"), |
---|
33 | 'principale' => 'oui', |
---|
34 | |
---|
35 | // Titre, date et gestion du statut |
---|
36 | 'titre' => "concat('Relecture ', id_relecture) AS titre, '' AS lang", |
---|
37 | 'date' => 'periode_fin', |
---|
38 | 'texte_changer_statut' => 'relecture:texte_instituer_relecture', |
---|
39 | 'aide_changer_statut' => '', |
---|
40 | 'statut_titres' => array( |
---|
41 | 'ouverte' => 'relecture:titre_relecture_ouverte', |
---|
42 | 'fermee' => 'relecture:titre_relecture_fermee' |
---|
43 | ), |
---|
44 | 'statut_textes_instituer' => array( |
---|
45 | 'ouverte' => 'relecture:texte_relecture_ouverte', |
---|
46 | 'fermee' => 'relecture:texte_relecture_fermee' |
---|
47 | ), |
---|
48 | 'statut_images' => array( |
---|
49 | 'ouverte'=>'puce-preparer-8.png', |
---|
50 | 'fermee'=>'puce-publier-8.png', |
---|
51 | ), |
---|
52 | |
---|
53 | // Edition, affichage et recherche |
---|
54 | 'page' => 'relecture', |
---|
55 | 'url_voir' => 'relecture', |
---|
56 | 'url_edit' => 'relecture_edit', |
---|
57 | 'editable' => 'oui', |
---|
58 | 'champs_editables' => array('description'), |
---|
59 | 'rechercher_champs' => array(), |
---|
60 | 'rechercher_jointures' => array(), |
---|
61 | 'icone_objet' => 'relecture', |
---|
62 | |
---|
63 | // Textes standard |
---|
64 | 'texte_retour' => 'icone_retour', |
---|
65 | 'texte_modifier' => 'relecture:bouton_modifier_relecture', |
---|
66 | 'texte_creer' => '', |
---|
67 | 'texte_creer_associer' => '', |
---|
68 | 'texte_signale_edition' => '', |
---|
69 | 'texte_objet' => 'relecture:titre_relecture', |
---|
70 | 'texte_objets' => 'relecture:titre_relectures', |
---|
71 | 'info_aucun_objet' => 'relecture:info_aucun_relecture', |
---|
72 | 'info_1_objet' => 'relecture:info_1_relecture', |
---|
73 | 'info_nb_objets' => 'relecture:info_nb_relectures', |
---|
74 | 'texte_logo_objet' => '', |
---|
75 | ); |
---|
76 | |
---|
77 | $tables['spip_commentaires'] = array( |
---|
78 | // Base de donnees |
---|
79 | 'table_objet' => 'commentaires', |
---|
80 | 'type' => 'commentaire', |
---|
81 | 'field' => array( |
---|
82 | "id_commentaire"=> "bigint(21) NOT NULL", |
---|
83 | "id_relecture" => "bigint(21) NOT NULL", |
---|
84 | "id_emetteur" => "bigint(21) NOT NULL", |
---|
85 | "repere" => "varchar(32) DEFAULT '' NOT NULL", |
---|
86 | "texte" => "text DEFAULT '' NOT NULL", |
---|
87 | "reponse" => "text DEFAULT '' NOT NULL", |
---|
88 | "date_crea" => "bigint(21) NOT NULL", |
---|
89 | "date_modif" => "bigint(21) NOT NULL", |
---|
90 | "date_cloture" => "datetime DEFAULT '0000-00-00 00:00:00' NOT NULL", |
---|
91 | "statut" => "varchar(10) DEFAULT '' NOT NULL", |
---|
92 | "maj" => "timestamp"), |
---|
93 | 'key' => array( |
---|
94 | "PRIMARY KEY" => "id_commentaire", |
---|
95 | "KEY id_article" => "id_relecture"), |
---|
96 | 'principale' => 'oui', |
---|
97 | |
---|
98 | // Titre, date et gestion du statut |
---|
99 | 'titre' => "id_commentaire AS titre, '' AS lang", |
---|
100 | |
---|
101 | // Edition, affichage et recherche |
---|
102 | 'page' => '', |
---|
103 | 'url_voir' => '', |
---|
104 | 'editable' => 'non', |
---|
105 | 'champs_editables' => array(), |
---|
106 | 'rechercher_champs' => array(), |
---|
107 | 'rechercher_jointures' => array(), |
---|
108 | 'icone_objet' => '', |
---|
109 | |
---|
110 | // Textes standard |
---|
111 | 'texte_retour' => '', |
---|
112 | 'texte_modifier' => '', |
---|
113 | 'texte_creer' => '', |
---|
114 | 'texte_creer_associer' => '', |
---|
115 | 'texte_signale_edition' => '', |
---|
116 | 'texte_objet' => 'relecture:titre_commentaire', |
---|
117 | 'texte_objets' => 'relecture:titre_commentaires', |
---|
118 | 'info_aucun_objet' => 'relecture:info_aucun_commentaire', |
---|
119 | 'info_1_objet' => 'relecture:info_1_commentaire', |
---|
120 | 'info_nb_objets' => 'relecture:info_nb_commentaires', |
---|
121 | 'texte_logo_objet' => '', |
---|
122 | ); |
---|
123 | |
---|
124 | return $tables; |
---|
125 | } |
---|
126 | |
---|
127 | |
---|
128 | function relecture_declarer_tables_auxiliaires($tables_auxiliaires) { |
---|
129 | |
---|
130 | return $tables_auxiliaires; |
---|
131 | } |
---|
132 | |
---|
133 | |
---|
134 | function relecture_declarer_tables_interfaces($interface) { |
---|
135 | // Les tables : permet d'appeler une boucle avec le *type* de la table uniquement |
---|
136 | $interface['table_des_tables']['relectures'] = 'relectures'; |
---|
137 | $interface['table_des_tables']['commentaires'] = 'commentaires'; |
---|
138 | |
---|
139 | // Les traitements |
---|
140 | // - table spip_relectures |
---|
141 | $interface['table_des_traitements']['DESCRIPTION']['relectures'] = _TRAITEMENT_RACCOURCIS; |
---|
142 | // - table spip_commentaires |
---|
143 | $interface['table_des_traitements']['TEXTE']['commentaires'] = _TRAITEMENT_RACCOURCIS; |
---|
144 | $interface['table_des_traitements']['REPONSE']['commentaires'] = _TRAITEMENT_RACCOURCIS; |
---|
145 | |
---|
146 | return $interface; |
---|
147 | } |
---|
148 | |
---|
149 | ?> |
---|