Subversion Repositories Applications.referentiel

Rev

Rev 37 | Rev 39 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
37 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe Controleur du module Versionnage.
5
 * Permet de publier une nouvelle version d'un référentiel de travail.
6
 *
7
 * @package		Referentiel
8
 * @category	Php5.2
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @copyright	2010 Tela-Botanica
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
13
 * @version		SVN: $Id$
14
 */
15
class Versionnage extends AppliControleur {
16
 
38 jpm 17
	private $manuel = null;
37 jpm 18
	private $referentiel = null;
19
 
20
	public function __construct()  {
21
		parent::__construct();
22
 
23
		// Récupération de paramêtres
24
		if (isset($_GET['ref'])) { // code du projet courrant
25
			$this->referentiel = strtolower($_GET['ref']);
26
		}
38 jpm 27
 
28
		$this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v2.1.ini');
37 jpm 29
	}
30
 
31
	//+----------------------------------------------------------------------------------------------------------------+
32
	// Méthodes
33
	/**
34
	 * Fonction d'affichage par défaut
35
	 */
36
	public function executerActionParDefaut() {
38 jpm 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);
37 jpm 70
		$this->construireMenu($this->referentiel);
71
		$this->construireFilAriane($this->referentiel);
38 jpm 72
	}
37 jpm 73
}
74
?>