| Line 28... |
Line 28... |
| 28 |
private $service = null;
|
28 |
private $service = null;
|
| 29 |
private $squelette = null;
|
29 |
private $squelette = null;
|
| 30 |
private $squelette_dossier = null;
|
30 |
private $squelette_dossier = null;
|
| 31 |
private $flux = array();
|
31 |
private $flux = array();
|
| Line -... |
Line 32... |
| - |
|
32 |
|
| - |
|
33 |
private $tri = 'oo_date_modification';
|
| - |
|
34 |
private $tri_dir = "DESC";
|
| 32 |
|
35 |
|
| Line 33... |
Line 36... |
| 33 |
private $mode = 'normal';
|
36 |
private $mode = 'normal';
|
| 34 |
|
37 |
|
| 35 |
/**
|
38 |
/**
|
| Line 44... |
Line 47... |
| 44 |
if (! $this->etreFluxAdmin() || $this->authentifier()) {
|
47 |
if (! $this->etreFluxAdmin() || $this->authentifier()) {
|
| 45 |
// Pré traitement des paramêtres
|
48 |
// Pré traitement des paramêtres
|
| 46 |
$pour_bdd = false;
|
49 |
$pour_bdd = false;
|
| 47 |
$p = $this->traiterParametres(array('service', 'format'), $params, $pour_bdd);
|
50 |
$p = $this->traiterParametres(array('service', 'format'), $params, $pour_bdd);
|
| 48 |
extract($p);
|
51 |
extract($p);
|
| - |
|
52 |
$this->traiterParametresTri();
|
| 49 |
$this->parametres = $params;
|
53 |
$this->parametres = $params;
|
| 50 |
$this->squelette_dossier = dirname(__FILE__).DIRECTORY_SEPARATOR.'squelettes'.DIRECTORY_SEPARATOR;
|
54 |
$this->squelette_dossier = dirname(__FILE__).DIRECTORY_SEPARATOR.'squelettes'.DIRECTORY_SEPARATOR;
|
| Line 51... |
Line 55... |
| 51 |
|
55 |
|
| 52 |
// Récupération de la liste des flux
|
56 |
// Récupération de la liste des flux
|
| Line 88... |
Line 92... |
| 88 |
$mime = $this->getTypeMime();
|
92 |
$mime = $this->getTypeMime();
|
| 89 |
$formatage_json = $this->getFormatageJson();
|
93 |
$formatage_json = $this->getFormatageJson();
|
| 90 |
$this->envoyer($contenu, $mime, $encodage, $formatage_json);
|
94 |
$this->envoyer($contenu, $mime, $encodage, $formatage_json);
|
| 91 |
}
|
95 |
}
|
| Line -... |
Line 96... |
| - |
|
96 |
|
| - |
|
97 |
private function traiterParametresTri() {
|
| - |
|
98 |
$tris_possibles = array('oo_date_modification', 'oo_date_saisie', 'oo_date');
|
| - |
|
99 |
$tris_dirs_possibles = array('ASC', 'DESC');
|
| - |
|
100 |
|
| - |
|
101 |
$this->tri = !empty($_GET['tri']) && in_array($_GET['tri'], $tris_possibles) ? $_GET['tri'] : 'oo_date_modification';
|
| - |
|
102 |
$this->tri_dir = !empty($_GET['tri_dir']) && in_array($_GET['tri_dir'], $tris_dirs_possibles) ? $_GET['tri_dir'] : 'DESC';
|
| - |
|
103 |
|
| - |
|
104 |
unset($_GET['tri']);
|
| - |
|
105 |
unset($_GET['tri_dir']);
|
| - |
|
106 |
}
|
| 92 |
|
107 |
|
| 93 |
private function getUrlBase() {
|
108 |
private function getUrlBase() {
|
| 94 |
$url_base = sprintf($this->config['settings']['baseURLAbsoluDyn'], get_class($this).'/');
|
109 |
$url_base = sprintf($this->config['settings']['baseURLAbsoluDyn'], get_class($this).'/');
|
| 95 |
return $url_base;
|
110 |
return $url_base;
|
| Line 196... |
Line 211... |
| 196 |
'ON oe.oe_espece_active = 1 '.
|
211 |
'ON oe.oe_espece_active = 1 '.
|
| 197 |
'AND oi.oi_ce_espece = oe.oe_id_espece '.
|
212 |
'AND oi.oi_ce_espece = oe.oe_id_espece '.
|
| 198 |
'WHERE oo_ce_participant != '.$this->config['appli']['id_participant_demo'].' '.
|
213 |
'WHERE oo_ce_participant != '.$this->config['appli']['id_participant_demo'].' '.
|
| 199 |
'AND oo_ce_participant != '.$this->config['appli']['id_participant_admin'].' '.
|
214 |
'AND oo_ce_participant != '.$this->config['appli']['id_participant_admin'].' '.
|
| 200 |
'AND DAY(oo_date) != "00" '.
|
215 |
'AND DAY(oo_date) != "00" '.
|
| 201 |
'ORDER BY oo_date_modification DESC '.
|
216 |
'ORDER BY '.$this->tri.' '.$this->tri_dir.' '.
|
| 202 |
"LIMIT $this->start,$this->limit ";
|
217 |
"LIMIT $this->start,$this->limit ";
|
| Line 203... |
Line 218... |
| 203 |
|
218 |
|
| Line 204... |
Line 219... |
| 204 |
$elements = $this->executerRequete($requete);
|
219 |
$elements = $this->executerRequete($requete);
|
| Line 223... |
Line 238... |
| 223 |
'LEFT JOIN ods_stations os '.
|
238 |
'LEFT JOIN ods_stations os '.
|
| 224 |
'ON oi.oi_ce_station = os.os_id_station '.
|
239 |
'ON oi.oi_ce_station = os.os_id_station '.
|
| 225 |
'WHERE oo_ce_participant != '.$this->config['appli']['id_participant_demo'].' '.
|
240 |
'WHERE oo_ce_participant != '.$this->config['appli']['id_participant_demo'].' '.
|
| 226 |
'AND oo_ce_participant != '.$this->config['appli']['id_participant_admin'].' '.
|
241 |
'AND oo_ce_participant != '.$this->config['appli']['id_participant_admin'].' '.
|
| 227 |
'AND oo_date_saisie != oo_date_modification '.
|
242 |
'AND oo_date_saisie != oo_date_modification '.
|
| 228 |
'ORDER BY oo_date_modification DESC '.
|
243 |
'ORDER BY '.$this->tri.' '.$this->tri_dir.' '.
|
| 229 |
"LIMIT $this->start,$this->limit ";
|
244 |
"LIMIT $this->start,$this->limit ";
|
| Line 230... |
Line 245... |
| 230 |
|
245 |
|
| Line 231... |
Line 246... |
| 231 |
$elements = $this->executerRequete($requete);
|
246 |
$elements = $this->executerRequete($requete);
|
| Line 313... |
Line 328... |
| 313 |
$description = 'Flux rss de l\'observatoire des saisons';
|
328 |
$description = 'Flux rss de l\'observatoire des saisons';
|
| 314 |
}
|
329 |
}
|
| 315 |
return $description;
|
330 |
return $description;
|
| 316 |
}
|
331 |
}
|
| Line 317... |
Line 332... |
| 317 |
|
332 |
|
| - |
|
333 |
private function creerTitre($obs) {
|
| - |
|
334 |
$date_saisie = date("d/m/Y", strtotime($obs['oo_date']));
|
| Line 318... |
Line 335... |
| 318 |
private function creerTitre($obs) {
|
335 |
$date_modif = date("d/m/Y", strtotime($obs['oo_date_modification']));
|
| 319 |
|
336 |
|
| 320 |
$stade_obs = $this->obtenirValeurTripleParId($obs['oo_ce_evenement']);
|
337 |
$stade_obs = $this->obtenirValeurTripleParId($obs['oo_ce_evenement']);
|
| 321 |
$nom_plante = $this->obtenirNomEspecePourIdIndividu($obs['oo_ce_individu']);
|
338 |
$nom_plante = $this->obtenirNomEspecePourIdIndividu($obs['oo_ce_individu']);
|
| 322 |
$utilisateur = $this->creerAuteur($obs['oo_ce_participant'], $this->etreFluxAdmin());
|
339 |
$utilisateur = $this->creerAuteur($obs['oo_ce_participant'], $this->etreFluxAdmin());
|
| 323 |
$titre = "$stade_obs pour $nom_plante par $utilisateur";
|
340 |
$titre = "$stade_obs pour $nom_plante par $utilisateur saisie le $date_saisie, observée le $date_modif";
|
| 324 |
$titre = $this->nettoyerTexte($titre);
|
341 |
$titre = $this->nettoyerTexte($titre);
|
| Line 325... |
Line 342... |
| 325 |
return $titre;
|
342 |
return $titre;
|
| Line 357... |
Line 374... |
| 357 |
$requete_selection_auteur = 'SELECT * FROM drupal_users '.
|
374 |
$requete_selection_auteur = 'SELECT * FROM drupal_users '.
|
| 358 |
'WHERE uid = '.$this->proteger($element);
|
375 |
'WHERE uid = '.$this->proteger($element);
|
| Line 359... |
Line 376... |
| 359 |
|
376 |
|
| Line 360... |
Line 377... |
| 360 |
$resultat_auteur = $this->executerRequete($requete_selection_auteur);
|
377 |
$resultat_auteur = $this->executerRequete($requete_selection_auteur);
|
| Line 361... |
Line 378... |
| 361 |
|
378 |
|
| 362 |
$nom_auteur = $resultat_auteur[0]['name'];
|
379 |
$nom_auteur = !empty($resultat_auteur[0]['name']) ? $resultat_auteur[0]['name'] : "";
|
| 363 |
|
380 |
|