Subversion Repositories Applications.referentiel

Rev

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

Rev 182 Rev 271
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe Controleur du module Accueil.
4
 * Classe Controleur du module Accueil.
5
 * Affichage les infos sur l'ensemble des référentiels disponibles.
5
 * Affichage les infos sur l'ensemble des référentiels disponibles.
6
 * 
6
 * 
7
 * @package		Referentiel
7
 * @package		Referentiel
8
 * @category	Php5.2
8
 * @category	Php5.2
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @copyright	2010 Tela-Botanica
10
 * @copyright	2010 Tela-Botanica
11
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
13
 * @version		SVN: $Id$
13
 * @version		SVN: $Id$
14
 */
14
 */
15
class Accueil extends AppliControleur {
15
class Accueil extends AppliControleur {
16
	
16
	
17
	private $referentiel = null;
17
	private $referentiel = null;
18
	private $referentielDao = null;
18
	private $referentielDao = null;
19
	
19
	
20
	public function __construct()  {
20
	public function __construct()  {
21
		parent::__construct();
21
		parent::__construct();
22
		
22
		
23
		// Récupération de paramêtres
23
		// Récupération de paramêtres
24
		if (isset($_GET['ref'])) { // code du projet courrant
24
		if (isset($_GET['ref'])) { // code du projet courrant
25
			$this->referentiel = strtolower(strip_tags($_GET['ref']));
25
			$this->referentiel = strtolower(strip_tags($_GET['ref']));
26
		}
26
		}
27
		
27
		
28
		// Chargement des DAO nécessaires
28
		// Chargement des DAO nécessaires
29
		$this->referentielDao = new ReferentielDao();
29
		$this->referentielDao = new ReferentielDao();
30
	}
30
	}
31
	
31
	
32
	//+----------------------------------------------------------------------------------------------------------------+
32
	//+----------------------------------------------------------------------------------------------------------------+
33
	// Méthodes
33
	// Méthodes
34
	/**
34
	/**
35
	 * Fonction d'affichage par défaut
35
	 * Fonction d'affichage par défaut
36
	 */
36
	 */
37
	public function executerActionParDefaut() {
37
	public function executerActionParDefaut() {
38
		return $this->afficherAccueil();
38
		return $this->afficherAccueil();
39
	}
39
	}
40
	
40
	
41
	/**
41
	/**
42
	 * Affiche la liste des référentiels
42
	 * Affiche la liste des référentiels
43
	 */
43
	 */
44
	public function afficherAccueil() {
44
	public function afficherAccueil() {
45
		$donnees = array();
45
		$donnees = array();
46
		$this->initialiserModulePrincipal();
46
		$this->initialiserModulePrincipal();
47
		
47
		
48
		$infos = $this->referentielDao->getReferentielsDispo();
48
		$infos = $this->referentielDao->getReferentielsDispo();
49
		if ($infos != false) {
49
		if ($infos != false) {
50
			$referentiel = array();
50
			$referentiel = array();
51
			foreach ($infos as $info) {
51
			foreach ($infos as $info) {
52
				$referentiel['nom'] = $info;
52
				$referentiel['nom'] = $info;
53
				$referentiel['titre'] = $this->referentielDao->getNom($info);
53
				$referentiel['titre'] = $this->referentielDao->getNom($info);
54
				$referentiel['url'] = $this->obtenirUrlDetailReferentiel($info);
54
				$referentiel['url'] = $this->obtenirUrlMenuConsultation($info);
55
				$donnees['referentiels'][] = $referentiel;
55
				$donnees['referentiels'][] = $referentiel;
56
			}
56
			}
57
		} else {
57
		} else {
58
			$this->addMessage("Aucun référentiel n'est disponible.");
58
			$this->addMessage("Aucun référentiel n'est disponible.");
59
		}
59
		}
60
		
60
		
61
		$donnees['messages'] = $this->getMessages();
61
		$donnees['messages'] = $this->getMessages();
62
		$this->traiterEsperluette($donnees);
62
		$this->traiterEsperluette($donnees);
63
		$this->setSortie(self::RENDU_CORPS, $this->getVue('accueil', $donnees), false);
63
		$this->setSortie(self::RENDU_CORPS, $this->getVue('accueil', $donnees), false);
64
		$this->construireFilAriane();
64
		$this->construireFilAriane();
65
	}
65
	}
66
	
-
 
67
	/**
-
 
68
	 * Affiche le détail d'un référentiel et la liste des actions possibles
-
 
69
	 */
-
 
70
	public function afficherDetail() {
-
 
71
		$donnees = array();
-
 
72
		$this->definirCommeModulePrincipal('Accueil');
-
 
73
		
-
 
74
		// Traitement de l'info sur le code du référentiel
-
 
75
		if (isset($this->referentiel)) {
-
 
76
			$this->construireMenu($this->referentiel);
-
 
77
			$this->construireFilAriane($this->referentiel);
-
 
78
			$donnees['referentiel'] = $this->referentiel;
-
 
79
			$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
-
 
80
			$donnees['url_menu_test'] = $this->obtenirUrlMenuTest($this->referentiel);
-
 
81
			$donnees['url_menu_versionnage'] = $this->obtenirUrlMenuVersionnage($this->referentiel);
-
 
82
			$donnees['url_menu_consultation'] = $this->obtenirUrlMenuConsultation($this->referentiel);
-
 
83
			
-
 
84
		} else {
-
 
85
			$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
-
 
86
		}
-
 
87
		
-
 
88
		$donnees['messages'] = $this->getMessages();
-
 
89
		$this->traiterEsperluette($donnees);
-
 
90
		$this->setSortie(self::RENDU_CORPS, $this->getVue('detail_referentiel', $donnees), false);
-
 
91
	}
-
 
92
	
-
 
93
}
66
}
94
?>
67
?>