Subversion Repositories eFlore/Applications.del

Rev

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

Rev 993 Rev 999
Line 69... Line 69...
69
		$this->id_observation = (isset($_GET['id_observation'])) ? $_GET['id_observation'] : null;
69
		$this->id_observation = (isset($_GET['id_observation'])) ? $_GET['id_observation'] : null;
70
		unset($_GET['id_observation']);
70
		unset($_GET['id_observation']);
71
		$this->parametres = $_GET;
71
		$this->parametres = $_GET;
72
	}
72
	}
Line -... Line 73...
-
 
73
	
-
 
74
	private function convertirParametresEnChaineRequeteService() {
-
 
75
		$requete = '';
-
 
76
		$mapping = $this->config['mapping_masque'];
-
 
77
		if(!empty($this->parametres)) {
-
 
78
			foreach ($this->parametres as $parametre=>$valeur) {
-
 
79
				if (isset($mapping[$parametre])) {
-
 
80
					$requete .= '&'.$mapping[$parametre].'='.urlencode($valeur);
-
 
81
				}
-
 
82
			}
-
 
83
		}
-
 
84
		return $requete;
-
 
85
	}
73
	
86
	
74
	private function convertirParametresEnChaineRequete() {
87
	private function convertirParametresEnChaineRequete() {
75
		$requete = str_replace('masque_','masque.',http_build_query($this->parametres));
88
		$requete = str_replace('masque_','masque.',http_build_query($this->parametres));
76
		if(!empty($this->parametres)) {
89
		if(!empty($this->parametres)) {
77
			$requete = '&'.$requete;
90
			$requete = '&'.$requete;
78
		}
91
		}
79
		return $requete;
92
		return $requete;
Line 80... Line 93...
80
	}
93
	}
81
	
94
	
82
	private function obtenirIdsObservation() {
95
	private function obtenirIdsObservation() {
83
		$ids = json_decode(file_get_contents($this->del_url_service_tpl.'observations?retour.format=widget'.$this->convertirParametresEnChaineRequete()), true);
96
		$ids = json_decode(file_get_contents($this->del_url_service_tpl.'observations?retour.format=widget'.$this->convertirParametresEnChaineRequeteService()), true);
84
		if($this->id_observation == null) {
97
		if($this->id_observation == null) {
85
			$this->id_observation = $ids['resultats'][0];
98
			$this->id_observation = $ids['resultats'][0];
86
		}
99
		}