Subversion Repositories eFlore/Applications.coel

Rev

Rev 1806 | Rev 1895 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1806 Rev 1893
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.* '.
33
					'	ccapu.*, cpu.*, cs_nom '.
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) '.
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) '.
37
					((count($p) != 0) ? 'WHERE ' : '').
38
					((count($p) != 0) ? 'WHERE ' : '').
38
					(isset($p['id_collection']) 	? "AND ccapu_id_collection = {$p['id_collection']} " : '').	
39
					(isset($p['id_collection']) 	? "AND ccapu_id_collection = {$p['id_collection']} " : '').	
39
					(isset($p['source']) 	? "AND ccapu_source = {$p['source']} " : '').
40
					(isset($p['source']) 	? "AND ccapu_source = {$p['source']} " : '').
40
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'ccapu_ce_meta DESC').' ';
41
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'ccapu_ce_meta DESC').' ';
Line 48... Line 49...
48
			if ($donnees === false) {
49
			if ($donnees === false) {
49
				$this->messages[] = "La requête a retourné aucun résultat.";
50
				$this->messages[] = "La requête a retourné aucun résultat.";
50
			}
51
			}
Line 51... Line 52...
51
			
52
			
52
			$nbElements = $this->bdd->query($requeteCount)->rowCount();
53
			$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
			}
53
			
66
 
54
			$info['nbElements'] = $nbElements;
67
			$info['nbElements'] = $nbElements;
Line 55... Line 68...
55
			$info['collectionsAPublication'] = $donnees;
68
			$info['collectionsAPublication'] = $donnees;
56
			
69