Subversion Repositories eFlore/Applications.del

Rev

Rev 744 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 744 Rev 745
Line 201... Line 201...
201
			return;
201
			return;
202
		}
202
		}
203
	}
203
	}
Line 204... Line 204...
204
	
204
	
205
	/*-------------------------------------------------------------------------------
205
	/*-------------------------------------------------------------------------------
206
								CHARGEMENT DES IMAGES 
206
								CHARGEMENT DES OBSERVATIONS 
207
	--------------------------------------------------------------------------------*/
207
	--------------------------------------------------------------------------------*/
208
	/**
208
	/**
209
	* Chargement depuis la bdd de toutes les liaisons entre images et observations
209
	* Chargement depuis la bdd de toutes les liaisons entre images et observations
210
	* */
210
	* */
Line 241... Line 241...
241
	
241
	
242
		$observations = array();
242
		$observations = array();
243
		foreach ($liaisons as $liaison) {
243
		foreach ($liaisons as $liaison) {
Line 244... Line -...
244
			$idObs = $liaison[$this->mappingObservation['id_observation']];
-
 
245
			
244
			$idObs = $liaison[$this->mappingObservation['id_observation']];
246
			$observation = array();
-
 
247
			foreach ($this->mappingObservation as $id => $champ) {
-
 
248
				$observation[$champ] = $liaison[$id];
-
 
249
			}
245
			
250
			$observation['images'] = array();
246
			$observation = $this->formaterObservation($liaison); 
251
			$observations[$idObs] = $observation;
247
			$observations[$idObs] = $observation;
252
		}
248
		}
Line 309... Line 305...
309
		$observation = array();
305
		$observation = array();
Line 310... Line 306...
310
		
306
		
311
		foreach ($this->mappingObservation as $nomOriginal => $nomFinal) {
307
		foreach ($this->mappingObservation as $nomOriginal => $nomFinal) {
312
			$observation[$nomFinal] = $liaison[$nomOriginal];
308
			$observation[$nomFinal] = $liaison[$nomOriginal];
-
 
309
		}
-
 
310
		
Line 313... Line 311...
313
		}
311
		$observation['images'] = array();
314
 
312
 
Line 315... Line -...
315
		return $observation;
-
 
316
	}
-
 
317
	
-
 
318
	/**
-
 
319
	*  Formater une observation depuis une ligne liaison
-
 
320
	*  @param $liaison liaison issue de la recherche
-
 
321
	*  @return $observation l'observation mise en forme
-
 
322
	* */
-
 
323
	private function formaterVotes($votes) {
-
 
324
		$retour = array();
-
 
325
		foreach ($votes as $vote) {
-
 
326
			$idImage = $vote['ce_image'];
-
 
327
			$id = $vote['id_vote_image'];
-
 
328
			$id_protocole = $vote['ce_protocole'];
-
 
329
			$auteur_id = $vote['ce_utilisateur'];
-
 
330
			$valeur = $vote['valeur_vote'];
-
 
331
			$date = $vote['date_vote_image'];
-
 
332
		
-
 
333
			$retour[$idImage]['valeur'] = $valeur;
-
 
334
			$retour[$idImage]['protocole'] = $id_protocole;
-
 
335
			$retour[$idImage]['auteur_id'] = $auteur_id;
-
 
336
			$retour[$idImage]['date'] = $auteur_id;
-
 
337
		}
-
 
Line 338... Line 313...
338
		
313
		return $observation;
339
		return $retour;
314
	}
340
	}
315
	
341
	
316