Line 118... |
Line 118... |
118 |
private function getServiceStructureExpertise() {
|
118 |
private function getServiceStructureExpertise() {
|
119 |
$donnees = array();
|
119 |
$donnees = array();
|
Line 120... |
Line 120... |
120 |
|
120 |
|
121 |
// Construction de la requête
|
121 |
// Construction de la requête
|
- |
|
122 |
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
|
122 |
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
|
123 |
' cs_id_structure, cs_nom, cs_description, cs_adresse_01, cs_code_postal, cs_ville, cs_courriel, '.
|
123 |
' cs_id_structure, '.
|
124 |
' cs_truk_telephone, cs_truk_url,'.
|
124 |
' SUM(csap_bota_travail_hebdo_tps) AS personnel_heure_nbre, '.
|
125 |
' SUM(csap_bota_travail_hebdo_tps) AS personnel_heure_nbre, '.
|
125 |
' cs_nom, csc_truk_stockage_parametre, csv_mark_visite_avec_motif '.
|
126 |
' csc_truk_stockage_parametre, cmlv_nom, csv_mark_visite_avec_motif '.
|
126 |
'FROM coel_structure '.
|
127 |
'FROM coel_structure '.
|
127 |
' LEFT JOIN coel_structure_a_personne ON (cs_id_structure = csap_id_structure) '.
|
128 |
' LEFT JOIN coel_structure_a_personne ON (cs_id_structure = csap_id_structure) '.
|
128 |
' LEFT JOIN coel_structure_conservation ON (cs_id_structure = csc_id_structure) '.
|
129 |
' LEFT JOIN coel_structure_conservation ON (cs_id_structure = csc_id_structure) '.
|
- |
|
130 |
' LEFT JOIN coel_structure_valorisation ON (cs_id_structure = csv_id_structure) '.
|
129 |
' LEFT JOIN coel_structure_valorisation ON (cs_id_structure = csv_id_structure) '.
|
131 |
' LEFT JOIN coel_meta_liste_valeur on `cmlv_id_valeur` =`cs_ce_truk_type_public`'.
|
130 |
'GROUP BY cs_id_structure '.
|
132 |
'GROUP BY cs_id_structure '.
|
131 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_nom ASC').' ';
|
133 |
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'cs_nom ASC').' ';
|
132 |
$message_echec = "La requête a retourné aucun résultat.";
|
134 |
$message_echec = "La requête n'a retourné aucun résultat.";
|
Line 133... |
Line 135... |
133 |
$structures = $this->executerRequete($requete, $message_echec);
|
135 |
$structures = $this->executerRequete($requete, $message_echec);
|
134 |
|
136 |
|
135 |
// Construction de la requête
|
137 |
// Construction de la requête
|
136 |
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
|
138 |
$requete = 'SELECT '.(($this->distinct) ? 'DISTINCT' : '').' '.
|
137 |
' cs_id_structure, '.
|
139 |
' cs_id_structure, '.
|
138 |
' COUNT(cc_id_collection) AS collection_nbre '.
|
140 |
' COUNT(cc_id_collection) AS collection_nbre '.
|
139 |
'FROM coel_structure '.
|
141 |
'FROM coel_structure '.
|
140 |
' LEFT JOIN coel_collection ON (cs_id_structure = cc_ce_structure) '.
|
142 |
' LEFT JOIN coel_collection ON (cs_id_structure = cc_ce_structure) '.
|
141 |
'GROUP BY cs_id_structure ';
|
143 |
'GROUP BY cs_id_structure ';
|
Line 142... |
Line 144... |
142 |
$message_echec = "La requête comptant le nombre de collection a retourné aucun résultat.";
|
144 |
$message_echec = "La requête comptant le nombre de collections n'a retourné aucun résultat.";
|
143 |
$collections_nbre = $this->executerRequete($requete, $message_echec);
|
145 |
$collections_nbre = $this->executerRequete($requete, $message_echec);
|
144 |
|
146 |
|
Line 164... |
Line 166... |
164 |
|
166 |
|
165 |
// Traitement final des données concernant les structures
|
167 |
// Traitement final des données concernant les structures
|
166 |
foreach ($structures as $structure) {
|
168 |
foreach ($structures as $structure) {
|
167 |
$id_structure = $structure['cs_id_structure'];
|
169 |
$id_structure = $structure['cs_id_structure'];
|
- |
|
170 |
$nom = $structure['cs_nom'];
|
- |
|
171 |
$description = $structure['cs_description'];
|
- |
|
172 |
$adresse_01 = $structure['cs_adresse_01'];
|
- |
|
173 |
$code_postal = $structure['cs_code_postal'];
|
- |
|
174 |
$ville = $structure['cs_ville'];
|
- |
|
175 |
$telephone = $utilTruck->construireTxtListeOntologie($structure['cs_truk_telephone']);
|
- |
|
176 |
$courriel = $structure['cs_courriel'];
|
- |
|
177 |
$type = $structure['cmlv_nom'];
|
168 |
$nom = $structure['cs_nom'];
|
178 |
$url = $utilTruck->construireTxtListeOntologie($structure['cs_truk_url']);
|
169 |
$stockage_params = $utilTruck->construireTxtListeOntologie($structure['csc_truk_stockage_parametre']);
|
179 |
$stockage_params = $utilTruck->construireTxtListeOntologie($structure['csc_truk_stockage_parametre']);
|
170 |
$stockage_params_nbre = $utilTruck->getNbreValeur($structure['csc_truk_stockage_parametre']);
|
180 |
$stockage_params_nbre = $utilTruck->getNbreValeur($structure['csc_truk_stockage_parametre']);
|
171 |
$stockage_params_nbre = empty($stockage_params_nbre) ? 0 : $stockage_params_nbre;
|
181 |
$stockage_params_nbre = empty($stockage_params_nbre) ? 0 : $stockage_params_nbre;
|
172 |
$collection_nbre = $collections_par_structure[$structure['cs_id_structure']];
|
182 |
$collection_nbre = $collections_par_structure[$structure['cs_id_structure']];
|
173 |
$collection_nbre = empty($collection_nbre) ? 0 : $collection_nbre;
|
183 |
$collection_nbre = empty($collection_nbre) ? 0 : $collection_nbre;
|
174 |
$personnel_heure_nbre = empty($structure['personnel_heure_nbre']) ? 0 : $structure['personnel_heure_nbre'];
|
184 |
$personnel_heure_nbre = empty($structure['personnel_heure_nbre']) ? 0 : $structure['personnel_heure_nbre'];
|
Line 175... |
Line 185... |
175 |
$visite_avec_motif_science = $structure['csv_mark_visite_avec_motif'];
|
185 |
$visite_avec_motif_science = $structure['csv_mark_visite_avec_motif'];
|
176 |
|
186 |
|
- |
|
187 |
$structure_affichage = array(
|
- |
|
188 |
'nom' => $nom,
|
- |
|
189 |
'description' => $description,
|
- |
|
190 |
'adresse' => $adresse_01,
|
- |
|
191 |
'code_postal' => $code_postal,
|
- |
|
192 |
'ville' => $ville,
|
- |
|
193 |
'telephone' => $telephone,
|
- |
|
194 |
'courriel' => $courriel,
|
177 |
$structure_affichage = array(
|
195 |
'url' => $url,
|
178 |
'nom' => $nom,
|
196 |
'type' => $type,
|
179 |
'stockage_params' => $stockage_params,
|
197 |
'stockage_params' => $stockage_params,
|
180 |
'stockage_params_nbre' => $stockage_params_nbre,
|
198 |
'stockage_params_nbre' => $stockage_params_nbre,
|
181 |
'collection_nbre' => $collection_nbre,
|
199 |
'collection_nbre' => $collection_nbre,
|