Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 152 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
113 jpm 4
 * Classe mère des Controleurs des modules présentant des Fiches.
9 jpm 5
 *
6
 * @package		Collection
7
 * @category	Php 5.2
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
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
12
 * @version		SVN: $Id: Fiche.php 152 2010-09-06 16:19:12Z jpm $
13
 */
114 jpm 14
abstract class Fiche extends aControleur {
9 jpm 15
 
113 jpm 16
	protected $structureDao = null;
17
	protected $collectionDao = null;
18
	protected $personneDao = null;
18 jpm 19
 
20
	public function __construct()  {
21
		parent::__construct();
150 jpm 22
		$this->structureDao = new StructureDao();
145 jpm 23
		$this->collectionDao = new CollectionDao();
152 jpm 24
		$this->personneDao = new PersonneDao();
18 jpm 25
	}
26
 
55 jpm 27
	// +---------------------------------------------------------------------------------------------------------------+
113 jpm 28
	// MÉTHODES GÉNÉRIQUES
15 jpm 29
 
113 jpm 30
	protected function obtenirNomCompletPersonne($personne_id) {
31
		$personne_nom = $this->personneDao->getPersonneNomComplet($personne_id);
15 jpm 32
		return $personne_nom;
33
	}
34
 
113 jpm 35
	protected function obtenirCourrielsPersonne($personne_id) {
36
		$courriels = $this->personneDao->getPersonneCourriels($personne_id);
93 jpm 37
		$courriels = $this->traiterTxtTruck($courriels);
38
		$courriels = $this->formaterCourriels($courriels);
39
		return $courriels;
40
	}
41
 
113 jpm 42
	protected function traiterDonneesElementAPublication(&$publications) {
55 jpm 43
		foreach ($publications as &$publication) {
44
			$publication['_editeur_'] = $this->construireTxtTruck($publication['cpu_ce_truk_editeur']);
45
			$publication['_date_parution_'] = rtrim($publication['cpu_date_parution'],'-00-00');
46
		}
47
	}
48
 
113 jpm 49
	protected function traiterMetaDonnees(&$donnees) {
93 jpm 50
		$meta = array();
51
		$meta['_guid_'] = $donnees['_guid_'];
132 jpm 52
		$meta['_guid_url_'] = $this->obtenirPermalienGuid($donnees['_guid_']);
93 jpm 53
		$meta['_notes_'] = $donnees['cmhl_notes'];
54
		$meta['_source_'] = $donnees['cmhl_source'];
55
		$meta['_date_modification_'] = $donnees['cmhl_date_modification'];
56
		$meta['_modifier_par_'] = $this->obtenirNomCompletPersonne($donnees['cmhl_ce_modifier_par']);
57
		$meta['_modifier_par_courriel_'] = $this->obtenirCourrielsPersonne($donnees['cmhl_ce_modifier_par']);
58
		$meta['_etat_'] = $this->construireTxtListeOntologie($donnees['cmhl_ce_etat']);
59
		return $this->getVue('metadonnees', $meta);
55 jpm 60
	}
9 jpm 61
}