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 220 2014-06-13 12:25:38Z aurelien $
|
|
|
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');
|
220 |
aurelien |
46 |
if(isset($publication['ccapu_source'])) {
|
|
|
47 |
$publication['ccapu_source'] = $publication['ccapu_source'] == "1" ? "oui" : "non";
|
|
|
48 |
}
|
55 |
jpm |
49 |
}
|
|
|
50 |
}
|
|
|
51 |
|
113 |
jpm |
52 |
protected function traiterMetaDonnees(&$donnees) {
|
93 |
jpm |
53 |
$meta = array();
|
|
|
54 |
$meta['_guid_'] = $donnees['_guid_'];
|
132 |
jpm |
55 |
$meta['_guid_url_'] = $this->obtenirPermalienGuid($donnees['_guid_']);
|
93 |
jpm |
56 |
$meta['_notes_'] = $donnees['cmhl_notes'];
|
|
|
57 |
$meta['_source_'] = $donnees['cmhl_source'];
|
|
|
58 |
$meta['_date_modification_'] = $donnees['cmhl_date_modification'];
|
|
|
59 |
$meta['_modifier_par_'] = $this->obtenirNomCompletPersonne($donnees['cmhl_ce_modifier_par']);
|
|
|
60 |
$meta['_modifier_par_courriel_'] = $this->obtenirCourrielsPersonne($donnees['cmhl_ce_modifier_par']);
|
|
|
61 |
$meta['_etat_'] = $this->construireTxtListeOntologie($donnees['cmhl_ce_etat']);
|
|
|
62 |
return $this->getVue('metadonnees', $meta);
|
55 |
jpm |
63 |
}
|
9 |
jpm |
64 |
}
|