89aa1cb43afff846758011af4bdf9547c4ad1e94
3 if (!defined("_ECRIRE_INC_VERSION")) return;
5 function gis_declarer_tables_interfaces($interface){
6 $interface['table_des_tables']['gis'] = 'gis';
7 $interface['table_des_tables']['gis_liens'] = 'gis_liens';
9 // Traitements typo et raccourcis
10 $interface['table_des_traitements']['TITRE_GIS'][] = 'typo(extraire_multi(%s))';
11 $interface['table_des_traitements']['DESCRIPTIF_GIS'][] = _TRAITEMENT_RACCOURCIS
;
12 $interface['table_des_traitements']['VILLE_GIS'][] = 'typo(extraire_multi(%s))';
13 $interface['table_des_traitements']['PAYS_GIS'][] = 'typo(extraire_multi(%s))';
14 $interface['table_des_traitements']['REGION_GIS'][] = 'typo(extraire_multi(%s))';
15 $interface['table_des_traitements']['DEPARTEMENT_GIS'][] = 'typo(extraire_multi(%s))';
16 $interface['table_des_traitements']['VILLE'][] = 'typo(extraire_multi(%s))';
17 $interface['table_des_traitements']['PAYS'][] = 'typo(extraire_multi(%s))';
18 $interface['table_des_traitements']['REGION'][] = 'typo(extraire_multi(%s))';
19 $interface['table_des_traitements']['DEPARTEMENT'][] = 'typo(extraire_multi(%s))';
24 function gis_declarer_tables_objets_sql($tables){
25 /* Declaration de la table de points gis */
26 $tables['spip_gis'] = array(
27 /* Declarations principales */
28 'table_objet' => 'gis',
29 'table_objet_surnoms' => array('gis'),
31 'type_surnoms' => array('gi'),
35 "id_gis" => "bigint(21) NOT NULL",
36 "titre" => "text NOT NULL DEFAULT ''",
37 "descriptif" => "text NOT NULL DEFAULT ''",
38 "lat" => "double NULL NULL",
39 "lon" => "double NULL NULL",
40 "zoom" => "tinyint(4) NULL NULL",
41 "adresse" => "text NOT NULL DEFAULT ''",
42 "pays" => "text NOT NULL DEFAULT ''",
43 "code_pays" => "varchar(255) NOT NULL DEFAULT ''",
44 "region" => "text NOT NULL DEFAULT ''",
45 "departement" => "text NOT NULL DEFAULT ''",
46 "ville" => "text NOT NULL DEFAULT ''",
47 "code_postal" => "varchar(255) NOT NULL DEFAULT ''"
50 "PRIMARY KEY" => "id_gis",
53 'KEY pays' => 'pays(500)',
54 'KEY code_pays' => 'code_pays',
55 'KEY region' => 'region(500)',
56 'KEY departement' => 'departement(500)',
57 'KEY ville' => 'ville(500)',
58 'KEY code_postal' => 'code_postal',
63 'principale' => 'oui',
64 'modeles' => array('carte_gis', 'carte_gis_preview'),
66 /* Le titre, la date et la gestion du statut */
67 'titre' => "titre, '' AS lang",
69 /* L'édition, l'affichage et la recherche */
72 'url_edit' => 'gis_edit',
74 'champs_editables' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
75 'champs_versionnes' => array('lat', 'lon', 'zoom', 'titre', 'descriptif', 'adresse', 'code_postal', 'ville', 'region', 'departement', 'pays', 'code_pays'),
76 'icone_objet' => 'gis',
77 'rechercher_champs' => array(
87 /* Les textes standard */
88 'texte_ajouter' => 'gis:texte_ajouter_gis',
89 'texte_retour' => 'icone_retour',
90 'texte_modifier' => 'gis:texte_modifier_gis',
91 'texte_creer' => 'gis:texte_creer_gis',
92 'texte_creer_associer' => 'gis:texte_creer_associer_gis',
93 'texte_objet' => 'gis:gis_singulier',
94 'texte_objets' => 'gis:gis_pluriel',
95 'info_aucun_objet' => 'gis:info_aucun_gis',
96 'info_1_objet' => 'gis:info_1_gis',
97 'info_nb_objets' => 'gis:info_nb_gis',
98 'texte_logo_objet' => 'gis:libelle_logo_gis',
101 $tables[]['tables_jointures'][]= 'gis_liens';
102 $tables[]['champs_versionnes'][] = 'jointure_gis';
104 // recherche jointe sur les points gis pour tous les objets
105 $tables[]['rechercher_jointures']['gis'] = array(
118 function gis_declarer_tables_auxiliaires($tables_auxiliaires){
119 $spip_gis_liens = array(
120 "id_gis" => "bigint(21) NOT NULL",
121 "objet" => "VARCHAR (25) DEFAULT '' NOT NULL",
122 "id_objet" => "bigint(21) NOT NULL");
124 $spip_gis_liens_key = array(
125 "PRIMARY KEY" => "id_gis,id_objet,objet",
126 "KEY id_gis" => "id_gis",
127 "KEY id_objet" => "id_objet",
128 "KEY objet" => "objet"
131 $tables_auxiliaires['spip_gis_liens'] = array(
132 'field' => &$spip_gis_liens,
133 'key' => &$spip_gis_liens_key);
135 return $tables_auxiliaires;