Line 28... |
Line 28... |
28 |
// Pré traitement des paramêtres
|
28 |
// Pré traitement des paramêtres
|
29 |
$p = $this->traiterParametresUrl(array('id_collection','source'), $param);
|
29 |
$p = $this->traiterParametresUrl(array('id_collection','source'), $param);
|
Line 30... |
Line 30... |
30 |
|
30 |
|
31 |
// Construction de la requête
|
31 |
// Construction de la requête
|
32 |
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
|
32 |
$requete = (($this->distinct) ? 'SELECT DISTINCT ' : 'SELECT ').
|
33 |
' ccapu.*, cpu.*, cs_nom '.
|
33 |
' ccapu.*, cpu.* '.
|
34 |
'FROM coel_collection_a_publication AS ccapu '.
|
34 |
'FROM coel_collection_a_publication AS ccapu '.
|
35 |
' LEFT JOIN coel_meta_historique_ligne ON (ccapu_ce_meta = cmhl_id_historique_ligne) '.
|
35 |
' LEFT JOIN coel_meta_historique_ligne ON (ccapu_ce_meta = cmhl_id_historique_ligne) '.
|
36 |
' LEFT JOIN coel_publication AS cpu ON (ccapu_id_publication = cpu_id_publication) '.
|
- |
|
37 |
' LEFT JOIN coel_structure AS cs ON (cs_id_structure = cpu_ce_truk_editeur) '.
|
36 |
' LEFT JOIN coel_publication AS cpu ON (ccapu_id_publication = cpu_id_publication) '.
|
38 |
((count($p) != 0) ? 'WHERE ' : '').
|
37 |
((count($p) != 0) ? 'WHERE ' : '').
|
39 |
(isset($p['id_collection']) ? "AND ccapu_id_collection = {$p['id_collection']} " : '').
|
38 |
(isset($p['id_collection']) ? "AND ccapu_id_collection = {$p['id_collection']} " : '').
|
40 |
(isset($p['source']) ? "AND ccapu_source = {$p['source']} " : '').
|
39 |
(isset($p['source']) ? "AND ccapu_source = {$p['source']} " : '').
|
41 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccapu_ce_meta DESC').' ';
|
40 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'ccapu_ce_meta DESC').' ';
|
Line 49... |
Line 48... |
49 |
if ($donnees === false) {
|
48 |
if ($donnees === false) {
|
50 |
$this->messages[] = "La requête a retourné aucun résultat.";
|
49 |
$this->messages[] = "La requête a retourné aucun résultat.";
|
51 |
}
|
50 |
}
|
Line 52... |
Line 51... |
52 |
|
51 |
|
53 |
$nbElements = $this->bdd->query($requeteCount)->rowCount();
|
52 |
$nbElements = $this->bdd->query($requeteCount)->rowCount();
|
54 |
|
- |
|
55 |
// Bricolage crado pour remplacer les "ce_" éditeurs par la valeur jointe depuis coel_structure
|
- |
|
56 |
foreach ($donnees as &$d) {
|
- |
|
57 |
$ce_ed = $d['cpu_ce_truk_editeur'];
|
- |
|
58 |
if (is_numeric($ce_ed)) {
|
- |
|
59 |
$cs_nom = $d['cs_nom'];
|
- |
|
60 |
if ($cs_nom === null) {
|
- |
|
61 |
$cs_nom = ""; // c'est ça ou rien
|
- |
|
62 |
}
|
- |
|
63 |
$d['cpu_ce_truk_editeur'] = $cs_nom;
|
- |
|
64 |
}
|
- |
|
65 |
}
|
- |
|
66 |
|
53 |
|
67 |
$info['nbElements'] = $nbElements;
|
54 |
$info['nbElements'] = $nbElements;
|
Line 68... |
Line 55... |
68 |
$info['collectionsAPublication'] = $donnees;
|
55 |
$info['collectionsAPublication'] = $donnees;
|
69 |
|
56 |
|