Subversion Repositories Applications.referentiel

Rev

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

Rev 37 Rev 38
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe Controleur du module Versionnage.
4
 * Classe Controleur du module Versionnage.
5
 * Permet de publier une nouvelle version d'un référentiel de travail. 
5
 * Permet de publier une nouvelle version d'un référentiel de travail. 
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 Versionnage extends AppliControleur {
15
class Versionnage extends AppliControleur {
-
 
16
	
16
	
17
	private $manuel = null;
17
	private $referentiel = null;
18
	private $referentiel = null;
18
	
19
	
19
	public function __construct()  {
20
	public function __construct()  {
20
		parent::__construct();
21
		parent::__construct();
21
		
22
		
22
		// Récupération de paramêtres
23
		// Récupération de paramêtres
23
		if (isset($_GET['ref'])) { // code du projet courrant
24
		if (isset($_GET['ref'])) { // code du projet courrant
24
			$this->referentiel = strtolower($_GET['ref']);
25
			$this->referentiel = strtolower($_GET['ref']);
25
		}
26
		}
-
 
27
		
-
 
28
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v2.1.ini');
26
	}
29
	}
27
	
30
	
28
	//+----------------------------------------------------------------------------------------------------------------+
31
	//+----------------------------------------------------------------------------------------------------------------+
29
	// Méthodes
32
	// Méthodes
30
	/**
33
	/**
31
	 * Fonction d'affichage par défaut
34
	 * Fonction d'affichage par défaut
32
	 */
35
	 */
33
	public function executerActionParDefaut() {
36
	public function executerActionParDefaut() {
-
 
37
		return $this->afficherInterface();
-
 
38
	}
-
 
39
 
-
 
40
	/**
-
 
41
	 * Affiche le formulaire de demande de versionnage
-
 
42
	 */
-
 
43
	public function afficherInterface() {
-
 
44
		$donnees = array();
-
 
45
		// Paramêtres pour l'url du formulaire
-
 
46
		$this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
-
 
47
		$donnees['url_form'] = $this->url->getUrl();
-
 
48
		$donnees['url_module'] = 'Versionnage';
-
 
49
		$donnees['url_action_demande'] = 'demanderTraitement';
-
 
50
		$donnees['url_action_rafraichir'] = 'afficherInterface';
-
 
51
		
-
 
52
		// Date de production de la version
-
 
53
		$donnees['date_prod'] = date('Y-m-d');
-
 
54
		 
-
 
55
		// Récupération des paramètres de configuration du manuel des référentiels
-
 
56
		$donnees['domaine_geo'] = explode(';', $this->manuel['domaine_geo']);
-
 
57
		$donnees['domaine_taxo'] = explode(';', $this->manuel['domaine_taxo']);
-
 
58
		$donnees['domaine_code'] = explode(';', $this->manuel['domaine_code']);
-
 
59
		$licences = explode(';', $this->manuel['licences']);
-
 
60
		foreach ($licences as $licence) {
-
 
61
			if (preg_match('/^([^<]+)<([^>]+)>/', $licence, $match)) {
-
 
62
				$info_licence = array();
-
 
63
				$info_licence['nom'] = $match[1];
-
 
64
				$info_licence['url'] = $match[2];
-
 
65
				$donnees['licences'][] = $info_licence;
-
 
66
			}
-
 
67
		}
-
 
68
		
-
 
69
		$this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
34
		$this->construireMenu($this->referentiel);
70
		$this->construireMenu($this->referentiel);
35
		$this->construireFilAriane($this->referentiel);
71
		$this->construireFilAriane($this->referentiel);
36
		$this->setSortie(self::RENDU_CORPS, '<p>En cours de réalisation...</p>', false);
-
 
37
	}	
72
	}
38
}
73
}
39
?>
74
?>