Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 985 | Rev 1139 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 985 Rev 1130
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe mère du module Liste.
4
 * Classe mère du module Liste.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Statut extends aControleur {
15
class Statut extends aControleur {
16
	private $conteneur = null;
16
	private $conteneur = null;
17
	private $nomCourant = null;
17
	private $nomCourant = null;
18
	private $wikini = null;
18
	private $wikini = null;
19
	private $statuts = null;
19
	private $statuts = null;
-
 
20
	private $meta;
20
	private $referentiel = null;
21
	private $referentiel = null;
21
	
-
 
-
 
22
	private $appUrls;
22
	
23
	
23
	public function __construct(Conteneur $conteneur) {
24
	public function __construct(Conteneur $conteneur) {
24
		$this->conteneur = $conteneur;
25
		$this->conteneur = $conteneur;
25
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->nomCourant = $this->conteneur->getNomCourant();
26
		$this->wikini = $this->conteneur->getApiWikini();
27
		$this->wikini = $this->conteneur->getApiWikini();
27
		$this->statuts = $this->conteneur->getApiStatuts();
28
		$this->statuts = $this->conteneur->getApiStatuts();
-
 
29
		$this->meta = $this->conteneur->getApiMetaDonnees();
28
		$this->referentiel = $this->conteneur->getParametre('referentiel');
30
		$this->referentiel = $this->conteneur->getParametre('referentiel');
-
 
31
		$this->appUrls = $this->conteneur->getAppUrls();
29
	}
32
	}
30
	
33
	
31
	public function getBloc() {
34
	public function getBloc() {
32
		$donnees = array();
35
		$donnees = array();
33
		$donnees['statuts'] = $this->getStatutsZoneGeo();
36
		$donnees['statuts'] = $this->getStatutsZoneGeo();
34
		if(empty($statuts)) {
37
		if(empty($statuts)) {
35
			$donnees['wikini'] = $this->getWikini();
38
			$donnees['wikini'] = $this->getWikini();
36
		}
39
		}
37
		return $donnees;
40
		return $donnees;
38
	}
41
	}
39
	
42
	
40
	public function obtenirDonnees() {
43
	public function obtenirDonnees() {
41
		$donnees = array();
44
		$donnees = array();
42
		$donnees['wikini'] = $this->getWikini();
45
		$donnees['wikini'] = $this->getWikini();
43
		$donnees['statuts'] = $this->getStatuts();
46
		$donnees['statuts'] = $this->getStatuts();
44
		return $donnees;
47
		return $donnees;
45
	}
48
	}
46
	
49
	
47
	private function getStatuts() {
50
	private function getStatuts() {
48
		$statuts = "";
51
		$statuts = "";
49
		$projet = Config::get($this->referentiel.'.baseStatuts');
52
		$projet = Config::get($this->referentiel.'.baseStatuts');
50
		if ($projet != "") {
53
		if ($projet != "") {
51
			$nnr = $this->nomCourant->getNnr();
54
			$nnr = $this->nomCourant->getNnr();
52
			$statuts = $this->statuts->getStatuts($projet, $nnr);
55
			$statuts = $this->statuts->getStatuts($projet, $nnr);
-
 
56
			$this->meta->setProjet($projet);
-
 
57
			$meta = $this->meta->getMetaDonnees();
-
 
58
			$statuts['meta'] = $meta[0];
-
 
59
			$statuts['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
53
		}
60
		}
54
		return $statuts;
61
		return $statuts;
55
	}
62
	}
56
	
63
	
57
	private function getStatutsZoneGeo() {
64
	private function getStatutsZoneGeo() {
58
		$statuts = "";
65
		$statuts = "";
59
		$projet = Config::get($this->referentiel.'.baseStatuts');
66
		$projet = Config::get($this->referentiel.'.baseStatuts');
60
		if ($projet != "") {
67
		if ($projet != "") {
61
			$nnr = $this->nomCourant->getNnr();
68
			$nnr = $this->nomCourant->getNnr();
62
			$statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
69
			$statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
-
 
70
			$this->meta->setProjet($projet);
-
 
71
			$meta = $this->meta->getMetaDonnees();
-
 
72
			$statuts['meta'] = $meta[0];
-
 
73
			$statuts['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees($projet);
63
		}
74
		}
64
		return $statuts;
75
		return $statuts;
65
	}
76
	}
66
	
77
	
67
	private function getWikini() {
78
	private function getWikini() {
68
		$wikini = array();
79
		$wikini = array();
69
		$wikini['titre'] = 'Wikini';
80
		$wikini['titre'] = 'Wikini';
70
		$referentiel = $this->conteneur->getParametre('referentiel');
81
		$referentiel = $this->conteneur->getParametre('referentiel');
71
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
82
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
72
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
83
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
73
		$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
84
		$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
74
		return $wikini;
85
		return $wikini;
75
	}
86
	}
76
}
87
}
77
?>
88
?>