Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 901 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 901 Rev 996
1
<?php
1
<?php
2
class Recherche extends aControleur {
2
class Recherche extends aControleur {
3
	
3
	
4
	//+----------------------------------------------------------------------------------------------------------------+
4
	//+----------------------------------------------------------------------------------------------------------------+
5
	// Méthodes
5
	// Méthodes
6
	protected $nom = null;
6
	protected $nom = null;
7
	protected $type_nom = 'nom_scientifique';
7
	protected $type_nom = 'nom_scientifique';
8
	protected $type_resultat = '';
8
	protected $type_resultat = '';
9
	protected $submit = '';
9
	protected $submit = '';
10
	protected $acces_fiche = false;
10
	protected $acces_fiche = false;
11
	private $recherche_avancee;
11
	private $recherche_avancee;
12
	private $param;
12
	private $param;
13
	private $i18n =  array();
13
	private $i18n =  array();
-
 
14
	
-
 
15
	private $parametresAvancesGeneriques = array('gen','fam','nn','nt','sp','ssp','type','sto','sti','stc');
14
	
16
	
15
	public function initialiser() {
17
	public function initialiser() {
16
		$this->capturerParametres();
18
		$this->capturerParametres();
17
		$this->capturerParametresAvances();	
19
		$this->capturerParametresAvances();	
18
		$this->i18n = I18n::get('Recherche-form-avancee');
20
		$this->i18n = I18n::get('Recherche-form-avancee');
19
	}
21
	}
20
	
22
	
21
	/**
23
	/**
22
	 * Fonction d'affichage par défaut
24
	 * Fonction d'affichage par défaut
23
	 */
25
	 */
24
	public function executerActionParDefaut() {
26
	public function executerActionParDefaut() {
25
		$this->executerAccueil();
27
		$this->executerAccueil();
26
	}
28
	}
27
	
29
	
28
	public function executerAccueil($donneesMoteur = array()) {
30
	public function executerAccueil($donneesMoteur = array()) {
29
		$niveau = new Niveau();
31
		$niveau = new Niveau();
30
		$donnees['form_niveau'] = $niveau->afficherNiveau();
32
		$donnees['form_niveau'] = $niveau->afficherNiveau();
31
		$recherchesimple = new RechercheSimple();
33
		$recherchesimple = new RechercheSimple();
32
		$donnees['form_nom'] = $recherchesimple->executerFormulaireNom($donneesMoteur);
34
		$donnees['form_nom'] = $recherchesimple->executerFormulaireNom($donneesMoteur);
33
		if (Registre::get('parametres.niveau') != 1) {
35
		if (Registre::get('parametres.niveau') != 1) {
34
			$recherche_avancee = new RechercheAvancee();
36
			$recherche_avancee = new RechercheAvancee();
35
			$donnees['form_recherche_av'] = $recherche_avancee->executerFormulaireRechercheAv($donneesMoteur);
37
			$donnees['form_recherche_av'] = $recherche_avancee->executerFormulaireRechercheAv($donneesMoteur);
36
		}
38
		}
37
		$this->afficherAccueil($donnees);
39
		$this->afficherAccueil($donnees);
38
	}
40
	}
39
	
41
	
40
	private function afficherAccueil($donnees) {
42
	private function afficherAccueil($donnees) {
41
		$donnees['i18n'] = I18n::get('Recherche-accueil');
43
		$donnees['i18n'] = I18n::get('Recherche-accueil');
42
		$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees), true);
44
		$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees), true);
43
	}
45
	}
44
 
46
 
45
	
47
	
46
	//+---------------------------------------------recherche avancee-------------------------------------+	
48
	//+---------------------------------------------recherche avancee-------------------------------------+	
47
	public function executerRechercheAvancee() {
49
	public function executerRechercheAvancee() {
48
		$this->param = $this->nettoyerParametresDefautRechercheAvancee($this->param);
50
		$this->param = $this->nettoyerParametresDefautRechercheAvancee($this->param);
49
		$donnees['param'] = $this->param;
51
		$donnees['param'] = $this->param;
50
		$presence = $this->rechercherCriteresDemandes();
52
		$presence = $this->rechercherCriteresDemandes();
51
		if (empty($presence) && !empty($this->param)) {
53
		if (empty($presence) && !empty($this->param)) {
52
			$donnees['message_av']['attention'] = 'info_res_vide';
54
			$donnees['message_av']['attention'] = 'info_res_vide';
53
		} 
55
		} 
54
		$this->executerAccueil($donnees);
56
		$this->executerAccueil($donnees);
55
		if (Registre::get('resultats')) {
57
		if (Registre::get('resultats')) {
56
			$_GET['resultat'] = $this->type_resultat;
58
			$_GET['resultat'] = $this->type_resultat;
57
			$this->executerAction('Resultat', 'executerResultat');
59
			$this->executerAction('Resultat', 'executerResultat');
58
		}
60
		}
59
	}
61
	}
60
 
62
 
61
	private function nettoyerParametresDefautRechercheAvancee($params) {
63
	private function nettoyerParametresDefautRechercheAvancee($params) {
62
		$params_nettoyes = array();
64
		$params_nettoyes = array();
63
		foreach ($params as $cle => $param) {
65
		foreach ($params as $cle => $param) {
64
			if(!preg_match("#^\(.*\)$#", $param)) {
66
			if(!preg_match("#^\(.*\)$#", $param)) {
65
				$params_nettoyes[$cle] = $param;
67
				$params_nettoyes[$cle] = $param;
66
			}
68
			}
67
		}
69
		}
68
		return $params_nettoyes;
70
		return $params_nettoyes;
69
	}
71
	}
70
	
72
	
71
	public function rechercherCriteresDemandes() {
73
	public function rechercherCriteresDemandes() {
72
		$noms = new Noms(Registre::get('parametres.referentiel'));
74
		$noms = new Noms(Registre::get('parametres.referentiel'));
73
		$res = $noms->getRechercheAvancee($this->param);
75
		$res = $noms->getRechercheAvancee($this->param);
74
		if ($res != false || $res['entete']['total'] != 0) {
76
		if ($res != false || $res['entete']['total'] != 0) {
75
			if ($res['entete']['total'] == 1 ) {
77
			if ($res['entete']['total'] == 1 ) {
76
				$ids = array_keys($res['resultat']);
78
				$ids = array_keys($res['resultat']);
77
				$nom = $res['resultat'][$ids[0]]['nom_sci'];
79
				$nom = $res['resultat'][$ids[0]]['nom_sci'];
78
				$url = $this->urls->obtenirUrlFiche($ids[0], 'nom_scientifique', $nom);
80
				$url = $this->urls->obtenirUrlFiche($ids[0], 'nom_scientifique', $nom);
79
				$this->redirigerVers($url);
81
				$this->redirigerVers($url);
80
			} else {
82
			} else {
81
			$res['type'] = $this->type_nom;
83
			$res['type'] = $this->type_nom;
82
			Registre::set('resultats', $res);
84
			Registre::set('resultats', $res);
83
			}
85
			}
84
		} else {
86
		} else {
85
			$res = '';
87
			$res = '';
86
		}
88
		}
87
		return $res;
89
		return $res;
88
	}
90
	}
89
	
91
	
90
	//+---------------------------------------------recherche simple-------------------------------------+
92
	//+---------------------------------------------recherche simple-------------------------------------+
91
	public function executerRechercheSimple() {
93
	public function executerRechercheSimple() {
92
		$donnees['type_nom'] = $this->type_nom;
94
		$donnees['type_nom'] = $this->type_nom;
93
		$donnees['nom'] = $this->nom;
95
		$donnees['nom'] = $this->nom;
94
		if (strlen($donnees['nom']) < 3) {
96
		if (strlen($donnees['nom']) < 3) {
95
			$donnees['message']['attention'] = 'info_nb_lettres';
97
			$donnees['message']['attention'] = 'info_nb_lettres';
96
		} else {
98
		} else {
97
			$presence = $this->rechercherNom();
99
			$presence = $this->rechercherNom();
98
			if ($presence == '') { // s'il n'y a pas de nom
100
			if ($presence == '') { // s'il n'y a pas de nom
99
				$donnees['message']['attention'] = 'info_sp_abs';
101
				$donnees['message']['attention'] = 'info_sp_abs';
100
			} elseif ($presence == 'sans_correspondance') {
102
			} elseif ($presence == 'sans_correspondance') {
101
				$res = Registre::get('resultats');
103
				$res = Registre::get('resultats');
102
				$id = array_keys($res['resultat']);
104
				$id = array_keys($res['resultat']);
103
				$donnees['message']['nom_ss_corresp']['id'] = $id[0];
105
				$donnees['message']['nom_ss_corresp']['id'] = $id[0];
104
				$nom = array_shift($res['resultat']);
106
				$nom = array_shift($res['resultat']);
105
				$donnees['message']['nom_ss_corresp']['nom'] = $nom['nom_sci'];
107
				$donnees['message']['nom_ss_corresp']['nom'] = $nom['nom_sci'];
106
			} elseif ($presence != 'ok') { // s'il y a des noms approchés
108
			} elseif ($presence != 'ok') { // s'il y a des noms approchés
107
				if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact
109
				if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact
108
					$donnees['message']['attention'] = 'info_sp_abs';
110
					$donnees['message']['attention'] = 'info_sp_abs';
109
				}
111
				}
110
				$donnees['message']['nom_approche'] = $presence;
112
				$donnees['message']['nom_approche'] = $presence;
111
			}
113
			}
112
		}
114
		}
113
		$this->executerAccueil($donnees);
115
		$this->executerAccueil($donnees);
114
		if (Registre::get('resultats')) {
116
		if (Registre::get('resultats')) {
115
			$_GET['resultat'] = $this->type_resultat;
117
			$_GET['resultat'] = $this->type_resultat;
116
			$this->executerAction('Resultat', 'executerResultat');
118
			$this->executerAction('Resultat', 'executerResultat');
117
		}
119
		}
118
	}
120
	}
119
	
121
	
120
	
122
	
121
	// regarde si il y a des résultats correspondant au nom recherché sinon recherche un nom approché
123
	// regarde si il y a des résultats correspondant au nom recherché sinon recherche un nom approché
122
	// $noms classe métier nom ou nom
124
	// $noms classe métier nom ou nom
123
	private function rechercherNom() {
125
	private function rechercherNom() {
124
		$noms = ($this->type_nom == 'nom_vernaculaire') 
126
		$noms = ($this->type_nom == 'nom_vernaculaire') 
125
				? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna')) 
127
				? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna')) 
126
				: new Noms(Registre::get('parametres.referentiel'));
128
				: new Noms(Registre::get('parametres.referentiel'));
127
		$approche = '';
129
		$approche = '';
128
		$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
130
		$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
129
		$form = I18n::get('Recherche-form-nom');
131
		$form = I18n::get('Recherche-form-nom');
130
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
132
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
131
			$approche = $this->rechercherNomApproche($noms);
133
			$approche = $this->rechercherNomApproche($noms);
132
		} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
134
		} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
133
			$approche = $this->traiterAccesFiche($res);
135
			$approche = $this->traiterAccesFiche($res);
134
		} else { // affiche les résultats
136
		} else { // affiche les résultats
135
			$res['type'] = $this->type_nom;
137
			$res['type'] = $this->type_nom;
136
			Registre::set('resultats', $res);
138
			Registre::set('resultats', $res);
137
			$approche = 'ok';
139
			$approche = 'ok';
138
			if ($res['entete']['total'] < 3) { // si moins de 16 noms affiche en plus un nom approché
140
			if ($res['entete']['total'] < 3) { // si moins de 16 noms affiche en plus un nom approché
139
				$approche = $this->rechercherNomApproche($noms);
141
				$approche = $this->rechercherNomApproche($noms);
140
			}
142
			}
141
		}
143
		}
142
		return $approche;
144
		return $approche;
143
	}
145
	}
144
	
146
	
145
	private function traiterAccesFiche($res) {
147
	private function traiterAccesFiche($res) {
146
		$ids = array_keys($res['resultat']);
148
		$ids = array_keys($res['resultat']);
147
		if ($this->type_nom == 'nom_vernaculaire') {
149
		if ($this->type_nom == 'nom_vernaculaire') {
148
			$id = explode(':',$res['resultat'][$ids[0]]['nom_retenu.code']);
150
			$id = explode(':',$res['resultat'][$ids[0]]['nom_retenu.code']);
149
			$id = $id[1];
151
			$id = $id[1];
150
		} else {
152
		} else {
151
			if ($res['resultat'][$ids[0]]['retenu'] == 'absent') { // dans le cas d'un nom sans correspondance
153
			if ($res['resultat'][$ids[0]]['retenu'] == 'absent') { // dans le cas d'un nom sans correspondance
152
				$res['type'] = $this->type_nom;
154
				$res['type'] = $this->type_nom;
153
				Registre::set('resultats', $res);
155
				Registre::set('resultats', $res);
154
				$approche = 'sans_correspondance';
156
				$approche = 'sans_correspondance';
155
				return $approche;
157
				return $approche;
156
			} else {
158
			} else {
157
				$id = $ids[0];
159
				$id = $ids[0];
158
			}
160
			}
159
		}
161
		}
160
		$url = $this->urls->obtenirUrlFiche($id, $this->type_nom, $this->nom);
162
		$url = $this->urls->obtenirUrlFiche($id, $this->type_nom, $this->nom);
161
		$this->redirigerVers($url);
163
		$this->redirigerVers($url);
162
	}
164
	}
163
	
165
	
164
	private function rechercherNomApproche($noms) {
166
	private function rechercherNomApproche($noms) {
165
		$approche = '';
167
		$approche = '';
166
		$res = $noms->getRechercheFloue($this->nom);
168
		$res = $noms->getRechercheFloue($this->nom);
167
		if (!($res == false || $res['entete']['total'] == 0)) {
169
		if (!($res == false || $res['entete']['total'] == 0)) {
168
			for ($i = 0; $i < 3; $i++) {
170
			for ($i = 0; $i < 3; $i++) {
169
				$nom_proche = array_shift($res['resultat']);
171
				$nom_proche = array_shift($res['resultat']);
170
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
172
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
171
				$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
173
				$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
172
			}
174
			}
173
		}
175
		}
174
		return $approche;
176
		return $approche;
175
	}
177
	}
176
	
178
	
177
	//+-----------------------------------------------méthodes utiles---------------------------------+
179
	//+-----------------------------------------------méthodes utiles---------------------------------+
178
	
180
	
179
	private function capturerParametres() {
181
	private function capturerParametres() {
180
		if (isset($_REQUEST['nom'])) {
182
		if (isset($_REQUEST['nom'])) {
181
			$this->nom = $this->convertirEncodageEntree(urldecode($_REQUEST['nom']));
183
			$this->nom = $this->convertirEncodageEntree(urldecode($_REQUEST['nom']));
182
		}
184
		}
183
		if (isset($_GET['type_nom'])) {
185
		if (isset($_GET['type_nom'])) {
184
			$this->type_nom = $this->convertirEncodageEntree(urldecode($_GET['type_nom']));
186
			$this->type_nom = $this->convertirEncodageEntree(urldecode($_GET['type_nom']));
185
		}
187
		}
186
		if (isset($_GET['submit'])) {
188
		if (isset($_GET['submit'])) {
187
			$this->submit = $this->convertirEncodageEntree(urldecode($_GET['submit']));
189
			$this->submit = $this->convertirEncodageEntree(urldecode($_GET['submit']));
188
		}
190
		}
189
		if(isset($_GET['acces_fiche'])) {
191
		if(isset($_GET['acces_fiche'])) {
190
			$this->acces_fiche = true;
192
			$this->acces_fiche = true;
191
		}
193
		}
192
		if (isset($_GET['niveau'])) {
194
		if (isset($_GET['niveau'])) {
193
			Registre::set('parametres.niveau', $this->convertirEncodageEntree($_GET['niveau']));
195
			Registre::set('parametres.niveau', $this->convertirEncodageEntree($_GET['niveau']));
194
		}
196
		}
195
		if (isset($_GET['resultat'])) {
197
		if (isset($_GET['resultat'])) {
196
			$this->type_resultat = $this->convertirEncodageEntree(urldecode($_GET['resultat']));
198
			$this->type_resultat = $this->convertirEncodageEntree(urldecode($_GET['resultat']));
197
		} else {
199
		} else {
198
			$onglet_resultat = $this->recupererTableauConfig('affich_resultats');
200
			$onglet_resultat = $this->recupererTableauConfig('affich_resultats');
199
			$this->type_resultat = $onglet_resultat[Registre::get('parametres.niveau').'_'.$this->type_nom];
201
			$this->type_resultat = $onglet_resultat[Registre::get('parametres.niveau').'_'.$this->type_nom];
200
		}
202
		}
201
	}
203
	}
202
	
204
	
203
	private function capturerParametresAvances() {
205
	private function capturerParametresAvances() {
204
		if (isset($_GET['gen']) && $_GET['gen'] != '') {
206
		$this->capturerParametresAvancesGeneriques();
-
 
207
		$this->capturerParametresAvancesDependantsLangage();
205
			$this->param['gen'] = $this->convertirEncodageEntree(urldecode($_GET['gen']));
208
		$this->capturerParametresAvancesPresenceSpecifiques();
206
		}
209
	}
-
 
210
	
-
 
211
	private function capturerParametresAvancesGeneriques() {
-
 
212
		foreach($this->parametresAvancesGeneriques as $param) {
207
		if (isset($_GET['fam']) && $_GET['fam'] != '') {
213
			if (isset($_GET[$param]) && $_GET[$param] != '') {
208
			$this->param['fam'] = $this->convertirEncodageEntree(urldecode($_GET['fam']));
214
				$this->param[$param] = $this->convertirEncodageEntree(urldecode($_GET[$param]));
-
 
215
			}
209
		}
216
		}
-
 
217
	}
-
 
218
	
-
 
219
	private function capturerParametresAvancesDependantsLangage() {
210
		if (isset($_GET['au']) && $_GET['au'] != '' 
220
		if (isset($_GET['au']) && $_GET['au'] != ''
211
			&& $_GET['au'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-auteur']))) {
221
		&& $_GET['au'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-auteur']))) {
212
			$this->param['au'] = $this->convertirEncodageEntree(urldecode($_GET['au']));
222
			$this->param['au'] = $this->convertirEncodageEntree(urldecode($_GET['au']));
213
		}
223
		}
214
		if (isset($_GET['bib']) && $_GET['bib'] != ''
224
		if (isset($_GET['bib']) && $_GET['bib'] != ''
215
			&& $_GET['bib'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-bib']))) {
225
		&& $_GET['bib'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-bib']))) {
216
			$this->param['bib'] = $this->convertirEncodageEntree(urldecode($_GET['bib']));
226
			$this->param['bib'] = $this->convertirEncodageEntree(urldecode($_GET['bib']));
217
		}
227
		}
218
		if (isset($_GET['nn']) && $_GET['nn'] != '') {
-
 
219
			$this->param['nn'] = $this->convertirEncodageEntree(urldecode($_GET['nn']));
-
 
220
		}
-
 
221
		if (isset($_GET['nt']) && $_GET['nt'] != '') {
-
 
222
			$this->param['nt'] = $this->convertirEncodageEntree(urldecode($_GET['nt']));
-
 
223
		}
-
 
224
		if (isset($_GET['sp']) && $_GET['sp'] != '') {
-
 
225
			$this->param['sp'] = $this->convertirEncodageEntree(urldecode($_GET['sp']));
-
 
226
		}
-
 
227
		if (isset($_GET['ssp']) && $_GET['ssp'] != '') {
-
 
228
			$this->param['ssp'] = $this->convertirEncodageEntree(urldecode($_GET['ssp']));
-
 
229
		}
-
 
230
		if (isset($_GET['type']) && $_GET['type'] != '') {
-
 
231
			$this->param['type'] = $this->convertirEncodageEntree(urldecode($_GET['type']));
-
 
232
		}
-
 
233
		if (isset($_GET['and']) && $_GET['and'] != ''
228
		if (isset($_GET['and']) && $_GET['and'] != ''
234
			&& $_GET['and'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-date']))) {
229
		&& $_GET['and'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-date']))) {
235
			$this->param['and'] = $this->convertirEncodageEntree(urldecode($_GET['and']));
230
			$this->param['and'] = $this->convertirEncodageEntree(urldecode($_GET['and']));
236
		}
231
		}
237
		if (isset($_GET['anf']) && $_GET['anf'] != ''
232
		if (isset($_GET['anf']) && $_GET['anf'] != ''
238
			&& $_GET['anf'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-date']))) {
233
		&& $_GET['anf'] != urlencode($this->i18n['valeur-form-date'])) {
239
			$this->param['anf'] = $this->convertirEncodageEntree(urldecode($_GET['anf']));
234
			$this->param['anf'] = $this->convertirEncodageEntree(urldecode($_GET['anf']));
240
		}
235
		}
241
		if (isset($_GET['prga']) && $_GET['prga'] != '') {
-
 
242
			$this->param['prga'] = $this->convertirEncodageEntree(urldecode($_GET['prga']));
-
 
243
		}
236
	}
-
 
237
	
244
		if (isset($_GET['prco']) && $_GET['prco'] != '') {
238
	private function capturerParametresAvancesPresenceSpecifiques()  {
245
			$this->param['prco'] = $this->convertirEncodageEntree(urldecode($_GET['prco']));
239
		$champs_presence = $this->obtenirChampsPresence();
-
 
240
		foreach($champs_presence as $champ) {
246
		}
241
			$param = $champ['param'];
247
		if (isset($_GET['sto']) && $_GET['sto'] != '') {
242
			if (isset($_GET[$param]) && $_GET[$param] != '') {
248
			$this->param['sto'] = $this->convertirEncodageEntree(urldecode($_GET['sto']));
243
				$this->param[$param] = $this->convertirEncodageEntree(urldecode($_GET[$param]));
249
		}
244
			}
250
		if (isset($_GET['sti']) && $_GET['sti'] != '') {
-
 
251
			$this->param['sti'] = $this->convertirEncodageEntree(urldecode($_GET['sti']));
-
 
252
		}
245
		}
-
 
246
	}
-
 
247
	
-
 
248
	private function obtenirChampsPresence() {
-
 
249
		$tableau_champs_presence = array();
-
 
250
		$referentiel = Registre::get('parametres.referentiel');
-
 
251
		$champs_presence = Config::get($referentiel.'.champsPresence');
-
 
252
		$champs_presence_spl = explode('|', $champs_presence);
253
		if (isset($_GET['stc']) && $_GET['stc'] != '') {
253
		foreach($champs_presence_spl as $champ) {
-
 
254
			$label_param_champ = explode(':', $champ);
254
			$this->param['stc'] = $this->convertirEncodageEntree(urldecode($_GET['stc']));
255
			$tableau_champs_presence[] = array('param' => $label_param_champ[1],
-
 
256
														'label' => $label_param_champ[0]);
255
		}
257
		}
-
 
258
		return $tableau_champs_presence;
256
	}
259
	}
257
	
260
	
258
	protected function recupererTableauConfig($param) {
261
	protected function recupererTableauConfig($param) {
259
		$tableau = array();
262
		$tableau = array();
260
		$tableauPartiel = explode(',', Config::get($param));
263
		$tableauPartiel = explode(',', Config::get($param));
261
		$tableauPartiel = array_map('trim', $tableauPartiel);
264
		$tableauPartiel = array_map('trim', $tableauPartiel);
262
		foreach ($tableauPartiel as $champ) {
265
		foreach ($tableauPartiel as $champ) {
263
			if (strpos($champ, '=') === false) {
266
			if (strpos($champ, '=') === false) {
264
				$tableau[] = $champ;
267
				$tableau[] = $champ;
265
			} else {
268
			} else {
266
				list($cle, $val) = explode('=', $champ);
269
				list($cle, $val) = explode('=', $champ);
267
				$tableau[$cle] = $val;
270
				$tableau[$cle] = $val;
268
			}
271
			}
269
		}
272
		}
270
		return $tableau;
273
		return $tableau;
271
	}
274
	}
272
 
275
 
273
 
276
 
274
	 /**
277
	 /**
275
	 * Convertion des valeurs de requête dans l'encodage de l'application (voir fichier config.ini : appli_encodage),
278
	 * Convertion des valeurs de requête dans l'encodage de l'application (voir fichier config.ini : appli_encodage),
276
	 * A cause d'un bug en cours d'investigation, celle ci utilise des paramètres différents de la fonction de conversion 
279
	 * A cause d'un bug en cours d'investigation, celle ci utilise des paramètres différents de la fonction de conversion 
277
	 * D'encodage de sortie
280
	 * D'encodage de sortie
278
	 * Cette convertion a lieu seulement si les formats sont différents.
281
	 * Cette convertion a lieu seulement si les formats sont différents.
279
	 */
282
	 */
280
	private function convertirEncodageEntree($contenu) {
283
	private function convertirEncodageEntree($contenu) {
281
		if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
284
		if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
282
			$contenu = mb_convert_encoding($contenu, Config::get('appli_encodage'), Config::get('sortie_encodage'));
285
			$contenu = mb_convert_encoding($contenu, Config::get('appli_encodage'), Config::get('sortie_encodage'));
283
		}
286
		}
284
		return $contenu;
287
		return $contenu;
285
	}
288
	}
286
	
289
	
287
}
290
}
288
?>
291
?>