Subversion Repositories eFlore/Applications.coel-consultation

Compare Revisions

Ignore whitespace Rev 150 → Rev 151

/trunk/bibliotheque/dao/CollectionDao.php
94,10 → 94,26
* @return array un tableau contenant les informations sur les publications liées à la collection.
*/
public function getPublicationsLiees($id_collection) {
$donnees = $this->getCollectionAPublication($id_collection);
return $donnees['collectionsAPublication'];
}
/**
* Retourne le nombre de publications liées à une collection.
*
* @param integer l'id de la collection.
* @return integer le nombre de publications liées à la collection.
*/
public function getNbrePublicationsLiees($id_collection) {
$donnees = $this->getCollectionAPublication($id_collection);
return $donnees['nbElements'];
}
private function getCollectionAPublication($id_collection) {
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_PUBLICATION."/$id_collection";
$json = $this->envoyerRequeteConsultation($url);
$donnees = json_decode($json, true);
return $donnees['collectionsAPublication'];
return $donnees;
}
/**
107,11 → 123,27
* @return array un tableau contenant les informations sur les publications liées à la collection.
*/
public function getCommentairesLies($id_collection) {
$donnees = $this->getCollectionACommentaire($id_collection);
return $donnees['collectionsACommentaire'];
}
/**
* Retourne le nombre de commentaires publics liés à une collection.
*
* @param integer l'id de la collection.
* @return integer le nombre de commentaires publics liés à la collection.
*/
public function getNbreCommentairesLies($id_collection) {
$donnees = $this->getCollectionACommentaire($id_collection);
return $donnees['nbElements'];
}
private function getCollectionACommentaire($id_collection) {
$commentaire_public = '1';
$url = $this->url_jrest.self::SERVICE_COLLECTION_A_COMMENTAIRE."/$id_collection/$commentaire_public";
$json = $this->envoyerRequeteConsultation($url);
$donnees = json_decode($json, true);
return $donnees['collectionsACommentaire'];
return $donnees;
}
}
?>
/trunk/controleurs/FicheCollection.php
39,8 → 39,8
$this->donnees['id'] = $_GET['id'];
$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']);
$this->creerPaginationPublications($this->donnees['id']);
$this->creerPaginationCommentaires($this->donnees['id']);
// Traitements des données
$this->traiterDonneesCollection($this->donnees['info']);
90,7 → 90,53
$this->collectionDao->setDistinction(1);
$this->donnees['personnes'] = $this->collectionDao->getPersonnesLiees($id_collection);
}
private function creerPaginationPublications($id_collection) {
// Gestion du nombre de résultats
$donnees_total = $this->collectionDao->getNbrePublicationsLiees($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['publicationsFrag'] = $fragmenteur->executer();
list($de, $a) = $fragmenteur->getDeplacementParPageId();
$this->url->unsetVariablesRequete(array('page'));
 
// Gestion de l'accès aux données
$this->collectionDao->setLimitation(($de - 1), $fragmenteur->getDonneesParPage());
$this->collectionDao->setDistinction(1);
$this->donnees['publications'] = $this->collectionDao->getPublicationsLiees($id_collection);
}
private function creerPaginationCommentaires($id_collection) {
// Gestion du nombre de résultats
$donnees_total = $this->collectionDao->getNbreCommentairesLies($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['commentairesFrag'] = $fragmenteur->executer();
list($de, $a) = $fragmenteur->getDeplacementParPageId();
$this->url->unsetVariablesRequete(array('page'));
 
// Gestion de l'accès aux données
$this->collectionDao->setLimitation(($de - 1), $fragmenteur->getDonneesParPage());
$this->collectionDao->setDistinction(1);
$this->donnees['commentaires'] = $this->collectionDao->getCommentairesLies($id_collection);
}
 
private function traiterDonneesCollection(&$donnees) {
// liste 29 : Liste des types de collection dans le standard NCD
Ontologie::chargerListe(1032);
/trunk/squelettes/fiche_collection.tpl.html
105,6 → 105,7
<h2>Publications</h2>
<h3>Publication(s) de la collection</h3>
<?php if (count($publications) > 0) : ?>
<?=$publicationsFrag;?>
<table>
<thead>
<tr>
304,6 → 305,7
<h2>Notes</h2>
<h3>Notes liées à la collection</h3>
<?php if (count($commentaires) > 0) : ?>
<?=$commentairesFrag;?>
<table>
<thead>
<tr>