Subversion Repositories Applications.referentiel

Rev

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

Rev 271 Rev 276
Line 14... Line 14...
14
 */
14
 */
15
class Informations extends AppliControleur {
15
class Informations extends AppliControleur {
Line 16... Line 16...
16
	
16
	
17
	private $referentiel = null;
17
	private $referentiel = null;
-
 
18
	private $referentielDao = null;
-
 
19
	private $traitementDao = null;
Line 18... Line 20...
18
	private $referentielDao = null;
20
	private $resultatDao = null;
19
	
21
	
Line 20... Line 22...
20
	public function __construct()  {
22
	public function __construct()  {
21
		parent::__construct();
23
		parent::__construct();
22
		
24
		
23
		// Récupération de paramêtres
25
		// Récupération de paramêtres
Line 24... Line 26...
24
		if (isset($_GET['ref'])) { // code du projet courrant
26
		if (isset($_GET['ref'])) { // code du projet courrant
-
 
27
			$this->referentiel = strtolower(strip_tags($_GET['ref']));
-
 
28
		}
25
			$this->referentiel = strtolower(strip_tags($_GET['ref']));
29
		
26
		}
30
		// Chargement des DAO nécessaires
Line 27... Line 31...
27
		
31
		$this->resultatDao = new ResultatDao();
28
		// Chargement des DAO nécessaires
32
		$this->traitementDao = new TraitementDao();
Line 35... Line 39...
35
	 * Fonction d'affichage par défaut
39
	 * Fonction d'affichage par défaut
36
	 */
40
	 */
37
	public function executerActionParDefaut() {
41
	public function executerActionParDefaut() {
38
		return $this->afficherDetail();
42
		return $this->afficherDetail();
39
	}
43
	}
40
	
-
 
Line 41... Line -...
41
 
-
 
42
	
44
 
43
	/**
45
	/**
44
	 * Affiche le détail d'un référentiel et la liste des actions possibles
46
	 * Affiche le détail d'un référentiel et la liste des actions possibles
45
	 */
47
	 */
46
	public function afficherDetail() {
48
	public function afficherDetail() {
Line 55... Line 57...
55
			$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
57
			$donnees['nom_referentiel'] = $this->referentielDao->getNom($this->referentiel);
56
			$donnees['url_menu_test'] = $this->obtenirUrlMenuTest($this->referentiel);
58
			$donnees['url_menu_test'] = $this->obtenirUrlMenuTest($this->referentiel);
57
			$donnees['url_menu_versionnage'] = $this->obtenirUrlMenuVersionnage($this->referentiel);
59
			$donnees['url_menu_versionnage'] = $this->obtenirUrlMenuVersionnage($this->referentiel);
58
			$donnees['url_menu_consultation'] = $this->obtenirUrlMenuConsultation($this->referentiel);
60
			$donnees['url_menu_consultation'] = $this->obtenirUrlMenuConsultation($this->referentiel);
Line -... Line 61...
-
 
61
			
59
			
62
			$donnees['infos_telechargements'] = $this->afficherTelechargementsReferentiels();
60
		} else {
63
		} else {
61
			$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
64
			$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdtfx).");
Line 62... Line 65...
62
		}
65
		}
63
		
66
		
64
		$donnees['messages'] = $this->getMessages();
67
		$donnees['messages'] = $this->getMessages();
65
		$this->traiterEsperluette($donnees);
68
		$this->traiterEsperluette($donnees);
Line -... Line 69...
-
 
69
		$this->setSortie(self::RENDU_CORPS, $this->getVue('detail_referentiel', $donnees), false);
-
 
70
	}
-
 
71
	
-
 
72
	private function afficherTelechargementsReferentiels() {
-
 
73
		$infos_telechargements = array();
-
 
74
		// Recherche des traitements déjà effectué
-
 
75
		$resultat = $this->traitementDao->getTraitementsTermines($this->referentiel, 'versionnage');
-
 
76
		if (is_array($resultat)) {
-
 
77
			foreach ($resultat as &$traitement) {
-
 
78
				$infos_traitement = $this->traitementDao->getInfos($traitement['id_traitement']);
-
 
79
				if ($infos_traitement != false) {
-
 
80
					// Recherche des fichiers disponibles
-
 
81
					$infos_zip = $this->obtenirUrlsZipPourTraitement($infos_traitement);
-
 
82
					$infos_telechargements[] = array(
-
 
83
								'infos_traitement' => $traitement,
-
 
84
								'description' => $this->creerDescriptionTelechargement($traitement),
-
 
85
								'urls_zip' => $infos_zip);
-
 
86
				}
-
 
87
			}
-
 
88
		}
-
 
89
		return $infos_telechargements;
-
 
90
	}
-
 
91
		
-
 
92
	private function creerDescriptionTelechargement($traitement) {
66
		$this->setSortie(self::RENDU_CORPS, $this->getVue('detail_referentiel', $donnees), false);
93
		return strftime('%e %B %Y', strtotime($traitement['meta_date_creation'])).' ('.$this->referentielDao->getNom($this->referentiel).') ';
67
	}
94
	}
68
	
95