Subversion Repositories eFlore/Applications.cel

Rev

Rev 743 | Rev 813 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 743 Rev 790
Line 26... Line 26...
26
	private $parametres_origines = null;
26
	private $parametres_origines = null;
27
	private $format = null;
27
	private $format = null;
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 $auteurs = array();
31
	private $flux = array();
32
	private $flux = array();
32
	private $criteres = array(
33
	private $criteres = array(
33
		'utilisateur' => 'identifiant', 
34
		'utilisateur' => 'identifiant', 
34
		'commune' => 'location', 
35
		'commune' => 'location', 
35
		'dept' => 'id_location',
36
		'dept' => 'id_location',
Line 442... Line 443...
442
	private function executerService($elements) {
443
	private function executerService($elements) {
443
		$contenu = '';
444
		$contenu = '';
444
		if (is_array($elements)) {
445
		if (is_array($elements)) {
445
			// Prétraitement des données
446
			// Prétraitement des données
446
			$donnees = $this->construireDonneesCommunesAuFlux($elements);
447
			$donnees = $this->construireDonneesCommunesAuFlux($elements);
-
 
448
			foreach ($elements as $element) {
-
 
449
				$identifiants[$element['identifiant']] = $element['identifiant'];
447
			
450
			}
-
 
451
			$this->auteurs = $this->creerAuteurs($identifiants);
448
			foreach ($elements as $element) {
452
			foreach ($elements as $element) {
449
				$donnees['items'][] = $this->construireDonneesCommunesAuxItems($element);
453
				$donnees['items'][] = $this->construireDonneesCommunesAuxItems($element);
450
			}
454
			}
Line 451... Line 455...
451
			
455
			
Line 487... Line 491...
487
		$item['guid'] = $this->creerGuidItem($observation);
491
		$item['guid'] = $this->creerGuidItem($observation);
488
		$item['lien'] = $this->creerLienItem($observation);
492
		$item['lien'] = $this->creerLienItem($observation);
489
		$item['categorie'] = $this->creerCategorie($item);
493
		$item['categorie'] = $this->creerCategorie($item);
490
		$item['description'] = $this->creerDescription($this->protegerCaracteresHtmlDansChamps($observation), $item);
494
		$item['description'] = $this->creerDescription($this->protegerCaracteresHtmlDansChamps($observation), $item);
491
		$item['description_encodee'] = htmlspecialchars($this->creerDescription($observation, $item));
495
		$item['description_encodee'] = htmlspecialchars($this->creerDescription($observation, $item));
492
		$item['modifier_par'] = $this->creerAuteur($observation['identifiant'], $this->etreFluxAdmin());
496
		$item['modifier_par'] = $this->auteurs[$observation['identifiant']];
493
		return $item;
497
		return $item;
494
	}
498
	}
Line 495... Line 499...
495
	
499
	
496
	private function creerTitre($obs) {
500
	private function creerTitre($obs) {
497
		$nom_plante = $obs['nom_sel'].' [nn'.$obs['num_nom_sel'].']';
501
		$nom_plante = $obs['nom_sel'].' [nn'.$obs['num_nom_sel'].']';
498
		$lieu = $obs['location'].' ('.$obs['id_location'].')';
502
		$lieu = $obs['location'].' ('.$obs['id_location'].')';
499
		$utilisateur = $this->creerAuteur($obs['identifiant'], $this->etreFluxAdmin());
503
		$utilisateur = $this->auteurs[$obs['identifiant']];
500
		$titre = "$nom_plante à $lieu par $utilisateur";
504
		$titre = "$nom_plante à $lieu par $utilisateur";
501
		$titre = $this->nettoyerTexte($titre);
505
		$titre = $this->nettoyerTexte($titre);
502
		return $titre;
506
		return $titre;
Line 518... Line 522...
518
	private function creerDescription($obs, $item) {
522
	private function creerDescription($obs, $item) {
519
		$id_obs = $obs['id'];
523
		$id_obs = $obs['id'];
520
		$famille = $obs['famille'];
524
		$famille = $obs['famille'];
521
		$nom_saisi = $obs['nom_sel'];
525
		$nom_saisi = $obs['nom_sel'];
522
		$nom_retenu = $obs['nom_ret'];
526
		$nom_retenu = $obs['nom_ret'];
523
		$auteur = $this->creerAuteur($obs['identifiant'], $this->etreFluxAdmin());
527
		$auteur = $this->auteurs[$obs['identifiant']];
524
		$mots_cles_obs = $this->decoderMotsClesObs($obs['identifiant'], $obs['mots_cles']);
528
		$mots_cles_obs = $this->decoderMotsClesObs($obs['identifiant'], $obs['mots_cles']);
525
		$lien_correction = sprintf($this->config['settings']['phpEditUrlTpl'], $obs['id']);
529
		$lien_correction = sprintf($this->config['settings']['phpEditUrlTpl'], $obs['id']);
526
		$lieu = $obs['location'].' ('.$obs['id_location'].') > '.$obs['lieudit'].' > '.$obs['station'];
530
		$lieu = $obs['location'].' ('.$obs['id_location'].') > '.$obs['lieudit'].' > '.$obs['station'];
527
		$milieu = $obs['milieu'];
531
		$milieu = $obs['milieu'];
528
		$coordonnees = ($this->etreNull($obs['coord_x']) && $this->etreNull($obs['coord_y'])) ? '' : $obs['coord_x'].'/'.$obs['coord_y'];
532
		$coordonnees = ($this->etreNull($obs['coord_x']) && $this->etreNull($obs['coord_y'])) ? '' : $obs['coord_x'].'/'.$obs['coord_y'];