Subversion Repositories Applications.referentiel

Rev

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

Rev 38 Rev 39
Line 12... Line 12...
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 Versionnage extends AppliControleur {
15
class Versionnage extends AppliControleur {
Line -... Line 16...
-
 
16
	
-
 
17
	const SCRIPT_A_LANCER = 'versionnage';
16
	
18
	
17
	private $manuel = null;
19
	private $manuel = null;
-
 
20
	private $referentiel = null;
Line 18... Line 21...
18
	private $referentiel = null;
21
	private $traitementDao = null;
19
	
22
	
Line 20... Line 23...
20
	public function __construct()  {
23
	public function __construct()  {
21
		parent::__construct();
24
		parent::__construct();
22
		
25
		
23
		// Récupération de paramêtres
26
		// Récupération de paramêtres
24
		if (isset($_GET['ref'])) { // code du projet courrant
-
 
-
 
27
		if (isset($_GET['ref'])) { // code du projet courrant
25
			$this->referentiel = strtolower($_GET['ref']);
28
			$this->referentiel = strtolower($_GET['ref']);
-
 
29
		}
-
 
30
		// Chargement des infos du manuel technique des référentiels
-
 
31
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v2.1.ini');
26
		}
32
		
Line 27... Line 33...
27
		
33
		// Chargement des DAO nécessaires
28
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v2.1.ini');
34
		$this->traitementDao = new TraitementDao();
29
	}
35
	}
Line 40... Line 46...
40
	/**
46
	/**
41
	 * Affiche le formulaire de demande de versionnage
47
	 * Affiche le formulaire de demande de versionnage
42
	 */
48
	 */
43
	public function afficherInterface() {
49
	public function afficherInterface() {
44
		$donnees = array();
50
		$donnees = array();
-
 
51
		
45
		// Paramêtres pour l'url du formulaire
52
		// Paramêtres pour l'url du formulaire
46
		$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
53
		$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
47
		$donnees['url_form'] = $this->url->getUrl();
54
		$donnees['url_form'] = $this->url->getUrl();
48
		$donnees['url_module'] = 'Versionnage';
55
		$donnees['url_module'] = 'Versionnage';
49
		$donnees['url_action_demande'] = 'demanderTraitement';
56
		$donnees['url_action_demande'] = 'demanderTraitement';
Line 64... Line 71...
64
				$info_licence['url'] = $match[2];
71
				$info_licence['url'] = $match[2];
65
				$donnees['licences'][] = $info_licence;
72
				$donnees['licences'][] = $info_licence;
66
			}
73
			}
67
		}
74
		}
Line -... Line 75...
-
 
75
		
-
 
76
		// Traitement de l'info sur le code du référentiel
-
 
77
		if (isset($this->referentiel)) {
-
 
78
			// Récupération du référentiel courrant
-
 
79
			$donnees['ref'] = $this->referentiel;
-
 
80
			
-
 
81
			// Recherche des traitements en attente
-
 
82
			$donnees['traitements_en_attente'] = $this->traitementDao->getTraitementsEnAttente($this->referentiel, self::SCRIPT_A_LANCER);
-
 
83
			
-
 
84
			// Recherche des traitements en cours d'éxecution
-
 
85
			$donnees['traitements_en_cours'] = $this->traitementDao->getTraitementsEnCours($this->referentiel, self::SCRIPT_A_LANCER);
-
 
86
			
-
 
87
			// Recherche des traitements déjà effectué
-
 
88
			$resultat = $this->traitementDao->getTraitementsTermines($this->referentiel, self::SCRIPT_A_LANCER);
-
 
89
			if (is_array($resultat)) {
-
 
90
				// Ajout de l'url vers la fiche du traitement
-
 
91
				foreach ($resultat as &$traitement) {
-
 
92
					$traitement['url'] = $this->obtenirUrlFicheTraitement($this->referentiel, $traitement['id_traitement']);
-
 
93
				}
-
 
94
				$donnees['traitements_termines'] = $resultat;
-
 
95
			}
-
 
96
		} else {
-
 
97
			$this->addMessage("Aucun code de projet de référentiel n'est indiqué (Ex. bdnff).");
-
 
98
		}
68
		
99
		
69
		$this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
100
		$this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
70
		$this->construireMenu($this->referentiel);
101
		$this->construireMenu($this->referentiel);
71
		$this->construireFilAriane($this->referentiel);
102
		$this->construireFilAriane($this->referentiel);
-
 
103
	}
-
 
104
	
-
 
105
	/**
-
 
106
	 * Lance l'ajout d'un traitement
-
 
107
	 */
-
 
108
	public function demanderTraitement() {
-
 
109
		$this->ajouterTraitement($this->referentiel, self::SCRIPT_A_LANCER);
-
 
110
		$this->afficherInterface();
72
	}
111
	}
73
}
112
}
74
?>
113
?>