Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 768 Rev 985
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;
-
 
17
	private $nomCourant = null;
-
 
18
	private $wikini = null;
-
 
19
	private $statuts = null;
-
 
20
	private $referentiel = null;
-
 
21
	
-
 
22
	
16
	public function __construct(Conteneur $conteneur) {
23
	public function __construct(Conteneur $conteneur) {
17
		$this->conteneur = $conteneur;
24
		$this->conteneur = $conteneur;
18
		$this->nomCourant = $this->conteneur->getNomCourant();
25
		$this->nomCourant = $this->conteneur->getNomCourant();
19
		$this->wikini = $this->conteneur->getApiWikini();
26
		$this->wikini = $this->conteneur->getApiWikini();
20
		$this->statuts = $this->conteneur->getApiStatuts();
27
		$this->statuts = $this->conteneur->getApiStatuts();
-
 
28
		$this->referentiel = $this->conteneur->getParametre('referentiel');
21
	}
29
	}
22
	
30
	
23
	public function getBloc() {
31
	public function getBloc() {
24
		$donnees = array();
32
		$donnees = array();
25
		$donnees['statuts'] = $this->getStatutsZoneGeo();
33
		$donnees['statuts'] = $this->getStatutsZoneGeo();
26
		if(empty($statuts)) {
34
		if(empty($statuts)) {
27
			$donnees['wikini'] = $this->getWikini();
35
			$donnees['wikini'] = $this->getWikini();
28
		}
36
		}
29
		return $donnees;
37
		return $donnees;
30
	}
38
	}
31
	
39
	
32
	public function obtenirDonnees() {
40
	public function obtenirDonnees() {
33
		$donnees = array();
41
		$donnees = array();
34
		$donnees['wikini'] = $this->getWikini();
42
		$donnees['wikini'] = $this->getWikini();
35
		$donnees['statuts'] = $this->getStatuts();
43
		$donnees['statuts'] = $this->getStatuts();
36
		return $donnees;
44
		return $donnees;
37
	}
45
	}
38
	
46
	
39
	private function getStatuts() {
47
	private function getStatuts() {
-
 
48
		$statuts = "";
-
 
49
		$projet = Config::get($this->referentiel.'.baseStatuts');
-
 
50
		if ($projet != "") {
40
		$nnr = $this->nomCourant->getNnr();
51
			$nnr = $this->nomCourant->getNnr();
41
		$statuts = $this->statuts->getStatuts($nnr);
52
			$statuts = $this->statuts->getStatuts($projet, $nnr);
-
 
53
		}
42
		return $statuts;
54
		return $statuts;
43
	}
55
	}
44
	
56
	
45
	private function getStatutsZoneGeo() {
57
	private function getStatutsZoneGeo() {
-
 
58
		$statuts = "";
-
 
59
		$projet = Config::get($this->referentiel.'.baseStatuts');
-
 
60
		if ($projet != "") {
46
		$nnr = $this->nomCourant->getNnr();
61
			$nnr = $this->nomCourant->getNnr();
47
		$statuts = $this->statuts->getStatutsZoneGeo($nnr);
62
			$statuts = $this->statuts->getStatutsZoneGeo($projet, $nnr);
-
 
63
		}
48
		return $statuts;
64
		return $statuts;
49
	}
65
	}
50
	
66
	
51
	private function getWikini() {
67
	private function getWikini() {
52
		$wikini = array();
68
		$wikini = array();
53
		$wikini['titre'] = 'Wikini';
69
		$wikini['titre'] = 'Wikini';
54
		$referentiel = $this->conteneur->getParametre('referentiel');
70
		$referentiel = $this->conteneur->getParametre('referentiel');
55
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
71
		$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique');
56
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
72
		$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax);
57
		$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
73
		$wikini['statuts_de_protection'] = $this->wikini->getTexteFormate($page_wiki, 'statuts de protection');
58
		return $wikini;
74
		return $wikini;
59
	}
75
	}
60
}
76
}
61
?>
77
?>