3 * Déclarations relatives à la base de données
9 * @package SPIP\Import_ics\Pipelines
12 if (!defined('_ECRIRE_INC_VERSION')) return;
14 * Déclaration des alias de tables et filtres automatiques de champs
16 * @pipeline declarer_tables_interfaces
17 * @param array $interfaces
18 * Déclarations d'interface pour le compilateur
20 * Déclarations d'interface pour le compilateur
22 function import_ics_declarer_tables_interfaces($interfaces) {
24 $interfaces['table_des_tables']['almanachs'] = 'almanachs';
31 * Déclaration des objets éditoriaux
33 * @pipeline declarer_tables_objets_sql
34 * @param array $tables
35 * Description des tables
37 * Description complétée des tables
39 function import_ics_declarer_tables_objets_sql($tables) {
41 $tables['spip_almanachs'] = array(
43 'principale' => "oui",
45 "id_almanach" => "bigint(21) NOT NULL",
46 "titre" => "text NOT NULL DEFAULT ''",
47 "url" => "text NOT NULL DEFAULT ''",
48 "id_article" => "bigint(21) NOT NULL DEFAULT 0",
49 "id_mot" => "bigint(21) NOT NULL DEFAULT 0",
50 "id_ressource" => "bigint(21) NOT NULL DEFAULT 0",
51 "date" => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
52 "statut" => "varchar(20) DEFAULT '0' NOT NULL",
54 "statut_maj" => "varchar(20) DEFAULT '0' NOT NULL"
57 "PRIMARY KEY" => "id_almanach",
58 "KEY statut" => "statut",
60 'titre' => "titre AS titre, '' AS lang",
62 'champs_editables' => array('titre', 'url', 'id_article', 'id_mot', 'id_ressource'),
63 'champs_versionnes' => array('titre', 'url', 'id_article', 'id_mot', 'id_ressource'),
64 'rechercher_champs' => array(),
65 'tables_jointures' => array('spip_almanachs_liens'),
66 'statut_textes_instituer' => array(
67 'prepa' => 'texte_statut_en_cours_redaction',
68 'prop' => 'texte_statut_propose_evaluation',
69 'publie' => 'texte_statut_publie',
70 'refuse' => 'texte_statut_refuse',
71 'poubelle' => 'texte_statut_poubelle',
77 'previsu' => 'publie,prop,prepa',
78 'post_date' => 'date',
79 'exception' => array('statut','tout')
82 'texte_changer_statut' => 'almanach:texte_changer_statut_almanach',
92 * Déclaration des tables secondaires (liaisons)
94 * @pipeline declarer_tables_auxiliaires
95 * @param array $tables
96 * Description des tables
98 * Description complétée des tables
100 function import_ics_declarer_tables_auxiliaires($tables) {
102 $tables['spip_almanachs_liens'] = array(
104 "id_almanach" => "bigint(21) DEFAULT '0' NOT NULL",
105 "id_objet" => "bigint(21) DEFAULT '0' NOT NULL",
106 "objet" => "VARCHAR(25) DEFAULT '' NOT NULL",
107 "vu" => "VARCHAR(6) DEFAULT 'non' NOT NULL"
110 "PRIMARY KEY" => "id_almanach,id_objet,objet",
111 "KEY id_almanach" => "id_almanach"