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 114 2010-06-28 09:49:51Z 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();
|
|
|
22 |
$this->structureDao = $this->getModele('StructureDao');
|
|
|
23 |
$this->collectionDao = $this->getModele('CollectionDao');
|
113 |
jpm |
24 |
$this->personneDao = $this->getModele('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_'];
|
|
|
52 |
$meta['_notes_'] = $donnees['cmhl_notes'];
|
|
|
53 |
$meta['_source_'] = $donnees['cmhl_source'];
|
|
|
54 |
$meta['_date_modification_'] = $donnees['cmhl_date_modification'];
|
|
|
55 |
$meta['_modifier_par_'] = $this->obtenirNomCompletPersonne($donnees['cmhl_ce_modifier_par']);
|
|
|
56 |
$meta['_modifier_par_courriel_'] = $this->obtenirCourrielsPersonne($donnees['cmhl_ce_modifier_par']);
|
|
|
57 |
$meta['_etat_'] = $this->construireTxtListeOntologie($donnees['cmhl_ce_etat']);
|
|
|
58 |
return $this->getVue('metadonnees', $meta);
|
55 |
jpm |
59 |
}
|
9 |
jpm |
60 |
}
|