Subversion Repositories Applications.referentiel

Rev

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

<?php
// declare(encoding='UTF-8');
/**
 * Classe Controleur du module Versionnage.
 * Permet de publier une nouvelle version d'un référentiel de travail. 
 * 
 * @package             Referentiel
 * @category    Php5.2
 * @author              Jean-Pascal MILCENT <jpm@tela-botanica.org>
 * @copyright   2010 Tela-Botanica
 * @license             http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
 * @license             http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
 * @version             SVN: $Id$
 */
class Versionnage extends AppliControleur {
        
        private $manuel = null;
        private $referentiel = null;
        
        public function __construct()  {
                parent::__construct();
                
                // Récupération de paramêtres
                if (isset($_GET['ref'])) { // code du projet courrant
                        $this->referentiel = strtolower($_GET['ref']);
                }
                
                $this->manuel = parse_ini_file(Config::get('chemin_appli').DS.'..'.DS.'configurations'.DS.'referentiel_v2.1.ini');
        }
        
        //+----------------------------------------------------------------------------------------------------------------+
        // Méthodes
        /**
         * Fonction d'affichage par défaut
         */
        public function executerActionParDefaut() {
                return $this->afficherInterface();
        }

        /**
         * Affiche le formulaire de demande de versionnage
         */
        public function afficherInterface() {
                $donnees = array();
                // Paramêtres pour l'url du formulaire
                $this->url->unsetVariablesRequete(array('module', 'action', 'ref'));
                $donnees['url_form'] = $this->url->getUrl();
                $donnees['url_module'] = 'Versionnage';
                $donnees['url_action_demande'] = 'demanderTraitement';
                $donnees['url_action_rafraichir'] = 'afficherInterface';
                
                // Date de production de la version
                $donnees['date_prod'] = date('Y-m-d');
                 
                // Récupération des paramètres de configuration du manuel des référentiels
                $donnees['domaine_geo'] = explode(';', $this->manuel['domaine_geo']);
                $donnees['domaine_taxo'] = explode(';', $this->manuel['domaine_taxo']);
                $donnees['domaine_code'] = explode(';', $this->manuel['domaine_code']);
                $licences = explode(';', $this->manuel['licences']);
                foreach ($licences as $licence) {
                        if (preg_match('/^([^<]+)<([^>]+)>/', $licence, $match)) {
                                $info_licence = array();
                                $info_licence['nom'] = $match[1];
                                $info_licence['url'] = $match[2];
                                $donnees['licences'][] = $info_licence;
                        }
                }
                
                $this->setSortie(self::RENDU_CORPS, $this->getVue('form_version', $donnees), false);
                $this->construireMenu($this->referentiel);
                $this->construireFilAriane($this->referentiel);
        }
}
?>