Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev 152 Rev 169
Line 7... Line 7...
7
 * @package		Collection
7
 * @package		Collection
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: aControleur.php 152 2010-09-06 16:19:12Z jpm $
12
 * @version		SVN: $Id: aControleur.php 169 2011-03-11 09:15:42Z jpm $
13
 */
13
 */
14
abstract class aControleur extends Controleur {
14
abstract class aControleur extends Controleur {
Line 15... Line 15...
15
	
15
	
16
	const FMT_DATE = '%d/%m/%Y';// Supporte les formats de dates non valides (1989-00-00)
16
	const FMT_DATE = '%d/%m/%Y';// Supporte les formats de dates non valides (1989-00-00)
Line 34... Line 34...
34
	
34
	
35
	private $sortie = array();
35
	private $sortie = array();
36
	private $parametres = array();
36
	private $parametres = array();
37
	// FIXME : voir s'il est plus intéressant d'utiliser une méthode dans les classes filles
37
	// FIXME : voir s'il est plus intéressant d'utiliser une méthode dans les classes filles
-
 
38
	protected $url = null;
Line 38... Line 39...
38
	protected $url = null;
39
	protected $registre = array();
39
	
40
	
40
	public function __construct()  {
41
	public function __construct()  {
41
		$registre = Registre::getInstance();
42
		$this->registre = Registre::getInstance();
42
		$this->parametres = $registre->get('parametres');
43
		$this->parametres = $this->registre->get('parametres');
43
		$this->url = $this->parametres['url'];
44
		$this->url = $this->parametres['url'];
Line 44... Line 45...
44
		parent::__construct();
45
		parent::__construct();
Line 366... Line 367...
366
		return $chaineARetourner;
367
		return $chaineARetourner;
367
	}
368
	}
Line 368... Line 369...
368
	
369
	
369
	protected function obtenirUrlRecherche($txt = null) {
370
	protected function obtenirUrlRecherche($txt = null) {
-
 
371
		$this->url->setRequete(false);
-
 
372
		if (!is_null($this->registre->get('contexte'))) {
-
 
373
			$this->url->setVariableRequete('contexte', $this->registre->get('contexte'));
370
		$this->url->setRequete(false);
374
		}
371
		$this->url->setVariableRequete('module', 'Recherche');
375
		$this->url->setVariableRequete('module', 'Recherche');
372
		$this->url->setVariableRequete('action', 'rechercher');
376
		$this->url->setVariableRequete('action', 'rechercher');
373
		if (!is_null($txt)) {
377
		if (!is_null($txt)) {
374
			$this->url->setVariableRequete('recherche', $txt);
378
			$this->url->setVariableRequete('recherche', $txt);
Line 383... Line 387...
383
		return $url->getURL();
387
		return $url->getURL();
384
	}
388
	}
Line 385... Line 389...
385
	
389
	
386
	protected function obtenirObjetUrlFicheStructure($id_structure) {
390
	protected function obtenirObjetUrlFicheStructure($id_structure) {
-
 
391
		$this->url->setRequete(false);
-
 
392
		if (!is_null($this->registre->get('contexte'))) {
-
 
393
			$this->url->setVariableRequete('contexte', $this->registre->get('contexte'));
387
		$this->url->setRequete(false);
394
		}
388
		$this->url->setVariableRequete('module', 'FicheStructure');
395
		$this->url->setVariableRequete('module', 'FicheStructure');
389
		$this->url->setVariableRequete('id', $id_structure);
396
		$this->url->setVariableRequete('id', $id_structure);
390
		$url = clone $this->url;
397
		$url = clone $this->url;
391
		$this->url->unsetVariablesRequete(array('module', 'id'));
398
		$this->url->unsetVariablesRequete(array('module', 'id'));
Line 397... Line 404...
397
		return $url->getURL();
404
		return $url->getURL();
398
	}
405
	}
Line 399... Line 406...
399
	
406
	
400
	protected function obtenirObjetUrlFicheCollection($id_collection) {
407
	protected function obtenirObjetUrlFicheCollection($id_collection) {
-
 
408
		$this->url->setRequete(false);
-
 
409
		if (!is_null($this->registre->get('contexte'))) {
-
 
410
			$this->url->setVariableRequete('contexte', $this->registre->get('contexte'));
401
		$this->url->setRequete(false);
411
		}
402
		$this->url->setVariableRequete('module', 'FicheCollection');
412
		$this->url->setVariableRequete('module', 'FicheCollection');
403
		$this->url->setVariableRequete('id', $id_collection);
413
		$this->url->setVariableRequete('id', $id_collection);
404
		$url = clone $this->url;
414
		$url = clone $this->url;
405
		$this->url->unsetVariablesRequete(array('module', 'id'));
415
		$this->url->unsetVariablesRequete(array('module', 'id'));
Line 411... Line 421...
411
		return $url->getURL();
421
		return $url->getURL();
412
	}
422
	}
Line 413... Line 423...
413
	
423
	
414
	protected function obtenirObjetUrlFichePersonne($id_personne) {
424
	protected function obtenirObjetUrlFichePersonne($id_personne) {
-
 
425
		$this->url->setRequete(false);
-
 
426
		if (!is_null($this->registre->get('contexte'))) {
-
 
427
			$this->url->setVariableRequete('contexte', $this->registre->get('contexte'));
415
		$this->url->setRequete(false);
428
		}
416
		$this->url->setVariableRequete('module', 'FichePersonne');
429
		$this->url->setVariableRequete('module', 'FichePersonne');
417
		$this->url->setVariableRequete('id', $id_personne);
430
		$this->url->setVariableRequete('id', $id_personne);
418
		$url = clone $this->url;
431
		$url = clone $this->url;
419
		$this->url->unsetVariablesRequete(array('module', 'id'));
432
		$this->url->unsetVariablesRequete(array('module', 'id'));