Subversion Repositories eFlore/Applications.coel-consultation

Compare Revisions

Ignore whitespace Rev 143 → Rev 144

/trunk/controleurs/FicheCollection.php
13,6 → 13,9
*/
class FicheCollection extends Fiche {
private $donnees = array();
protected $collectionDao = null;
//+----------------------------------------------------------------------------------------------------------------+
// Méthodes
/**
25,8 → 28,6
// +---------------------------------------------------------------------------------------------------------------+
// FICHE COLLECTION
public function afficherCollection() {
$donnees = array();
 
// Gestion des actions par défaut
$this->executerAction('Recherche', 'chargerMoteurRecherche');
35,39 → 36,62
} else {
// Récupération des données
$donnees['id'] = $_GET['id'];
$collectionDao = $this->getModele('CollectionDao');
$donnees['info'] = $collectionDao->getCollection($donnees['id']);
$donnees['personnes'] = $collectionDao->getCollectionAPersonne($donnees['id']);
$donnees['publications'] = $collectionDao->getCollectionAPublication($donnees['id']);
$donnees['commentaires'] = $collectionDao->getCollectionACommentaire($donnees['id']);
$this->donnees['id'] = $_GET['id'];
$this->collectionDao = new CollectionDao();
$this->donnees['info'] = $this->collectionDao->getCollection($this->donnees['id']);
$this->creerPaginationPersonnes($this->donnees['id']);
$this->donnees['publications'] = $this->collectionDao->getPublicationsLiees($this->donnees['id']);
$this->donnees['commentaires'] = $this->collectionDao->getCommentairesLies($this->donnees['id']);
// Traitements des données
$this->traiterDonneesCollection($donnees['info']);
$this->traiterDonneesCollectionAPersonne($donnees['personnes']);
$this->traiterDonneesElementAPublication($donnees['publications']);
$this->traiterDonneesCollectionDescription($donnees['info']);
$this->traiterDonneesCollectionContenu($donnees['info']);
$this->traiterDonneesCollectionInventaire($donnees['info']);
$this->traiterDonneesCollectionACommentaire($donnees['commentaires']);
$this->postraiterDonnees($donnees);
$donnees['metadonnees'] = $this->traiterMetaDonnees($donnees['info']);
$this->traiterDonneesCollection($this->donnees['info']);
$this->traiterDonneesCollectionAPersonne($this->donnees['personnes']);
$this->traiterDonneesElementAPublication($this->donnees['publications']);
$this->traiterDonneesCollectionDescription($this->donnees['info']);
$this->traiterDonneesCollectionContenu($this->donnees['info']);
$this->traiterDonneesCollectionInventaire($this->donnees['info']);
$this->traiterDonneesCollectionACommentaire($this->donnees['commentaires']);
$this->postraiterDonnees($this->donnees);
$this->donnees['metadonnees'] = $this->traiterMetaDonnees($this->donnees['info']);
// Création des méta-données de la page
$titre = $donnees['info']['cc_nom'];
$description = $donnees['info']['cc_description'];
$tags = "Collection, id:{$donnees['id']}, {$donnees['info']['_guid_']}";
$titre = $this->donnees['info']['cc_nom'];
$description = $this->donnees['info']['cc_description'];
$tags = "Collection, id:{$this->donnees['id']}, {$this->donnees['info']['_guid_']}";
// Envoie à la sortie
//Debug::printr($donnees);
//Debug::printr($this->donnees);
$this->setSortie(self::META_TITRE, $titre);
$this->setSortie(self::META_DESCRIPTION, $description);
$this->setSortie(self::META_TAGS, $tags);
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_collection', $donnees));
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_collection', $this->donnees));
$this->chargerPiedDePage();
}
}
private function creerPaginationPersonnes($id_collection) {
// Gestion du nombre de résultats
$donnees_total = $this->collectionDao->getNbrePersonnesLiees($id_collection);
// Gestion du fragmenteur
$urlFiche = $this->obtenirObjetUrlFicheCollection($id_collection);
$options = array(
'url' => $urlFiche,
'donnees_total' => $donnees_total,
'donnees_par_page' => Config::get('resultat_par_page_defaut'),
'donnees_par_page_choix' => Config::get('resultat_par_page_choix'),
);
$fragmenteur = Composant::fabrique('fragmenteur', $options);
$this->donnees['personnesFrag'] = $fragmenteur->executer();
list($de, $a) = $fragmenteur->getDeplacementParPageId();
$this->url->unsetVariablesRequete(array('recherche', 'page'));
 
// Gestion de l'accès aux données
$this->collectionDao->setLimitation(($de - 1), $fragmenteur->getDonneesParPage());
$this->collectionDao->setDistinction(1);
$this->donnees['personnes'] = $this->collectionDao->getPersonnesLiees($id_collection);
}
 
private function traiterDonneesCollection(&$donnees) {
// liste 29 : Liste des types de collection dans le standard NCD
Ontologie::chargerListe(1032);