Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 836 Rev 837
Line 70... Line 70...
70
		extract($this->parametres);
70
		extract($this->parametres);
71
		$this->carte = (isset($carte) ? $carte : self::SERVICE_CARTO_ACTION_DEFAUT);
71
		$this->carte = (isset($carte) ? $carte : self::SERVICE_CARTO_ACTION_DEFAUT);
72
		$this->utilisateur = (isset($utilisateur) ? $utilisateur : '*');
72
		$this->utilisateur = (isset($utilisateur) ? $utilisateur : '*');
73
		$this->projet = (isset($projet) ? $projet : '*');
73
		$this->projet = (isset($projet) ? $projet : '*');
74
		$this->dept = (isset($dept) ? $dept : '*');
74
		$this->dept = (isset($dept) ? $dept : '*');
-
 
75
		$this->commune = (isset($commune) ? $commune : '*');
75
		$this->num_taxon = (isset($num_taxon) ? $num_taxon : '*');
76
		$this->num_taxon = (isset($num_taxon) ? $num_taxon : '*');
76
		$this->station = (isset($station) ? $station : null);
77
		$this->station = (isset($station) ? $station : null);
77
		$this->format = (isset($format) ? $format : null);
78
		$this->format = (isset($format) ? $format : null);
78
	}
79
	}
Line 90... Line 91...
90
		$widget['donnees']['url_json'] = $url_json;
91
		$widget['donnees']['url_json'] = $url_json;
91
		$widget['donnees']['url_base'] = $url_base;
92
		$widget['donnees']['url_base'] = $url_base;
92
		$widget['donnees']['utilisateur'] = $this->utilisateur;
93
		$widget['donnees']['utilisateur'] = $this->utilisateur;
93
		$widget['donnees']['projet'] = $this->projet;
94
		$widget['donnees']['projet'] = $this->projet;
94
		$widget['donnees']['dept'] = $this->dept;
95
		$widget['donnees']['dept'] = $this->dept;
-
 
96
		$widget['donnees']['commune'] = $this->commune;
95
		$widget['donnees']['num_taxon'] = $this->num_taxon;
97
		$widget['donnees']['num_taxon'] = $this->num_taxon;
96
		$widget['donnees']['taxons'] = $this->chargerTaxons();
98
		$widget['donnees']['taxons'] = $this->chargerTaxons();
97
		if ($this->num_taxon != '*') {
99
		if ($this->num_taxon != '*') {
98
			$taxon_courrant = current($widget['donnees']['taxons']);
100
			$taxon_courrant = current($widget['donnees']['taxons']);
99
			$widget['donnees']['taxon_nom'] = $taxon_courrant['nom'];
101
			$widget['donnees']['taxon_nom'] = $taxon_courrant['nom'];
Line 119... Line 121...
119
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::SERVICE_CARTO_NOM);
121
		$url = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::SERVICE_CARTO_NOM);
120
		if ($action) {
122
		if ($action) {
121
			$url .= "/$action";
123
			$url .= "/$action";
Line 122... Line 124...
122
			
124
			
123
			$parametres_retenus = array();
125
			$parametres_retenus = array();
124
			$parametres_a_tester = array('station', 'utilisateur', 'projet', 'dept', 'num_taxon');
126
			$parametres_a_tester = array('station', 'utilisateur', 'projet', 'dept', 'commune', 'num_taxon');
125
			foreach ($parametres_a_tester as $param) {
127
			foreach ($parametres_a_tester as $param) {
126
				if ($this->$param != null && $this->$param != '*') {
128
				if ($this->$param != null && $this->$param != '*') {
127
					$parametres_retenus[$param] = $this->$param;
129
					$parametres_retenus[$param] = $this->$param;
128
				}
130
				}
Line 200... Line 202...
200
	/**
202
	/**
201
	 * Tableau des observations d'une station
203
	 * Tableau des observations d'une station
202
	 */
204
	 */
203
	public function executerObservations() {
205
	public function executerObservations() {
204
		$widget = null;
206
		$widget = null;
205
		$observations = $this->chargerObservation();
207
		$observations = $this->chargerObservations();
-
 
208
		$nbre_obs = $this->chargerObservationsNbre();
Line 206... Line 209...
206
				
209
				
207
		// Création des infos du widget
210
		// Création des infos du widget
208
		if (isset($observations['commune'])) {
211
		if (isset($observations['commune'])) {
209
			$commune = $observations['commune'];
212
			$commune = $observations['commune'];
Line 222... Line 225...
222
			$widget['donnees']['images'] = $this->chargerImages($obs_ids);
225
			$widget['donnees']['images'] = $this->chargerImages($obs_ids);
223
		}
226
		}
Line 224... Line 227...
224
		
227
		
225
		$widget['donnees']['observations'] = $observations;
228
		$widget['donnees']['observations'] = $observations;
-
 
229
		$widget['donnees']['station_id'] = $this->station;
Line 226... Line 230...
226
		$widget['donnees']['station_id'] = $this->station;
230
		$widget['donnees']['nbre_obs_total'] = $nbre_obs;
227
		
231
		
Line -... Line 232...
-
 
232
		return $widget;
-
 
233
	}
-
 
234
	
-
 
235
	private function chargerPagination($url_tpl, $nbre) {
-
 
236
		
-
 
237
	}	
-
 
238
	
-
 
239
	private function chargerObservationsNbre() {
-
 
240
		// Récupération des données au format Json
-
 
241
		$url = $this->contruireUrlServiceCarto('observations-nombre');
-
 
242
		$json = $this->getDao()->consulter($url);
-
 
243
		$nbre = json_decode($json);
228
		return $widget;
244
		return $nbre;
229
	}
245
	}
230
	
246
	
231
	private function chargerObservation() {
247
	private function chargerObservations() {
232
		// Récupération des données au format Json
248
		// Récupération des données au format Json