Subversion Repositories Applications.referentiel

Rev

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

Rev 272 Rev 276
Line 200... Line 200...
200
		$menu['nom'] = 'Versionnage';
200
		$menu['nom'] = 'Versionnage';
201
		$menu['url'] = $this->obtenirUrlMenuVersionnage($referentiel);
201
		$menu['url'] = $this->obtenirUrlMenuVersionnage($referentiel);
202
		$menu['activite'] = (($this->getModulePrincipalCourant() == 'Versionnage') ? 'actif' : 'inactif securise');
202
		$menu['activite'] = (($this->getModulePrincipalCourant() == 'Versionnage') ? 'actif' : 'inactif securise');
203
		$menu['title'] = "Réservé aux coordinateurs. Générer une version de la base.";
203
		$menu['title'] = "Réservé aux coordinateurs. Générer une version de la base.";
204
		$donnees['menus'][] = $menu;
204
		$donnees['menus'][] = $menu;
205
		$menu['nom'] = 'Informations';
205
		$menu['nom'] = 'Informations et téléchargements';
206
		$menu['url'] = $this->obtenirUrlMenuInformations($referentiel);
206
		$menu['url'] = $this->obtenirUrlMenuInformations($referentiel);
207
		$menu['activite'] = (($this->getModulePrincipalCourant() == 'Informations') ? 'actif' : 'inactif');
207
		$menu['activite'] = (($this->getModulePrincipalCourant() == 'Informations') ? 'actif' : 'inactif');
208
		$menu['title'] = "Informations sur le projet.";
208
		$menu['title'] = "Informations sur le projet et téléchargements.";
209
		$donnees['menus'][] = $menu;
209
		$donnees['menus'][] = $menu;
210
		$this->setSortie(self::RENDU_MENU, $this->getVue('menu', $donnees), false);
210
		$this->setSortie(self::RENDU_MENU, $this->getVue('menu', $donnees), false);
211
	}
211
	}
212
	/**
212
	/**
213
	 * Construction du fil d'ariane et stockage dans le conteneur de sortie RENDU_NAVIGATION.
213
	 * Construction du fil d'ariane et stockage dans le conteneur de sortie RENDU_NAVIGATION.
Line 453... Line 453...
453
		$disabled = explode(', ', ini_get('disable_functions'));
453
		$disabled = explode(', ', ini_get('disable_functions'));
454
		return !in_array('exec', $disabled);
454
		return !in_array('exec', $disabled);
455
	}
455
	}
Line 456... Line 456...
456
	
456
	
-
 
457
	//+----------------------------------------------------------------------------------------------------------------+
-
 
458
	// GESTION DES FICHIERS A TELECHARGER
-
 
459
	
-
 
460
	/**
-
 
461
	* Crée la liste d'url des fichiers à télécharger pour un traitement donné
-
 
462
	* @param Array $infos_traitement tableau contenant les informations du traitement
-
 
463
	* 
-
 
464
	* @return Array un tableau contenant la liste des urls des fichiers à télécharger
-
 
465
	*/
-
 
466
	protected function obtenirUrlsZipPourTraitement($infos_traitement) {
-
 
467
		$urls_zip = null;
-
 
468
		if (isset($infos_traitement['script']) && $infos_traitement['script'] == 'versionnage') {
-
 
469
			$meta = unserialize($infos_traitement['script_parametres']);
-
 
470
			$projet = strtolower($infos_traitement['referentiel_code']);
-
 
471
			$version = str_replace('.', '_', $meta['version']);
-
 
472
			$fichier_zip_bdnt = $projet.'_v'.$version.'.zip';
-
 
473
			$url_zip_bdnt = sprintf(Config::get('url_zip_tpl'), $fichier_zip_bdnt);
-
 
474
			if ($this->testerUrl($url_zip_bdnt)) {
-
 
475
				$urls_zip[$fichier_zip_bdnt] = $url_zip_bdnt;
-
 
476
			}
-
 
477
	
-
 
478
			$fichier_zip_partiel_ancien = $projet.'_v'.$version.'_partiel.zip';
-
 
479
			$url_zip_partiel_ancienne = sprintf(Config::get('url_zip_tpl'), $fichier_zip_partiel_ancien);
-
 
480
			$fichier_zip_partiel = $projet.'_v'.$version.$this->manuel['suffixe_partiel'].'.zip';
-
 
481
			$url_zip_partiel = sprintf(Config::get('url_zip_tpl'), $fichier_zip_partiel);
-
 
482
			if ($this->testerUrl($url_zip_partiel)) {
-
 
483
				$urls_zip[$fichier_zip_partiel] = $url_zip_partiel;
-
 
484
			} else if ($this->testerUrl($url_zip_partiel_ancienne)) {
-
 
485
				$urls_zip[$fichier_zip_partiel_ancien] = $url_zip_partiel_ancienne;
-
 
486
			}
-
 
487
	
-
 
488
		}
-
 
489
		return $urls_zip;
-
 
490
	}
-
 
491
	
-
 
492
	/**
-
 
493
	* Teste une url donnée, en tentant de l'ouvrir et de la fermer
-
 
494
	*
-
 
495
	* @return boolean un booléen indiquant le succès ou non de l'opération
-
 
496
	*/
-
 
497
	protected function testerUrl($url) {
-
 
498
		//TODO: voir si on peut inclure cette fonction dans le framework
-
 
499
		ini_set('allow_url_fopen', '1');
-
 
500
		return (@fclose(@fopen($url, 'r'))) ? true : false;
-
 
501
	}
-
 
502
	
457
	//+----------------------------------------------------------------------------------------------------------------+
503
	//+----------------------------------------------------------------------------------------------------------------+
Line 458... Line 504...
458
	// GESTION DU CLIENT REST
504
	// GESTION DU CLIENT REST
459
	
505
	
460
	protected function getRestClient() {
506
	protected function getRestClient() {