Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3531 Rev 3743
Line 134... Line 134...
134
	private function getChampsEtendus() {
134
	private function getChampsEtendus() {
135
		$champs = new GestionChampsEtendus2($this->config);
135
		$champs = new GestionChampsEtendus2($this->config);
136
		$projet = (isset($_GET['projet'])) ? $_GET['projet'] : "";
136
		$projet = (isset($_GET['projet'])) ? $_GET['projet'] : "";
137
		$langue = (isset($_GET['langue'])) ? $_GET['langue'] : "fr";
137
		$langue = (isset($_GET['langue'])) ? $_GET['langue'] : "fr";
138
		$liste = $champs->consulterProjetChampsEtendus($projet, $langue);
138
		$liste = $champs->consulterProjetChampsEtendus($projet, $langue);
139
		$liste = $this->traiterCorrespondanceChampsEtendusBDInterface($liste);
139
		$liste = $this->traiterCorrespondanceChampsEtendusBDInterface($liste, $projet);
Line 140... Line 140...
140
		
140
		
141
		$this->envoyerJson($liste);
141
		$this->envoyerJson($liste);
Line 211... Line 211...
211
			}
211
			}
212
			$i++;
212
			$i++;
213
		} 
213
		} 
214
		return $champsrequete;
214
		return $champsrequete;
215
	}
215
	}
216
	protected function traiterCorrespondanceChampsEtendusBDInterface(Array $champsrequete) {
216
	protected function traiterCorrespondanceChampsEtendusBDInterface(Array $champsrequete, $projet = "null") {
217
		$champssupp = array(); $i = 0;
217
		$champssupp = array(); $i = 0;
218
		foreach ($champsrequete as $champ) {
218
		foreach ($champsrequete as $champ) {
219
			$champssupp[$champ['project']]['projet'] = $champ['project'];
219
			$champssupp[$projet]['projet'] = $champ['project'];
220
			$champssupp[$champ['project']]['langue'] = $champ['language_iso_code'];
220
			$champssupp[$projet]['langue'] = $champ['language_iso_code'];
221
			// pour la table extended fiels champs interface => champs bd
221
			// pour la table extended fiels champs interface => champs bd
222
			foreach ($this->correspondance_champs_etendus as $ci => $ce) {
222
			foreach ($this->correspondance_champs_etendus as $ci => $ce) {
223
				if (isset($champ[$ce]) && $champ[$ce] != "") {
223
				if (isset($champ[$ce]) && $champ[$ce] != "") {
224
					$champssupp[$champ['project']]['champs-supp'][$i][$ci] = $champ[$ce];
224
				    $champssupp[$projet]['champs-supp'][$i][$ci] = $champ[$ce];
225
				} else {
225
				} else {
226
					$champssupp[$champ['project']]['champs-supp'][$i][$ci]= "";
226
				    $champssupp[$projet]['champs-supp'][$i][$ci]= "";
227
				}
227
				}
228
			}
228
			}
229
			// pour la table extended fiels trad champs interface => champs bd
229
			// pour la table extended fiels trad champs interface => champs bd
230
			foreach ($this->correspondance_champs_etendus_trad as $cet => $cr) {
230
			foreach ($this->correspondance_champs_etendus_trad as $cet => $cr) {
231
				if (isset($champ[$cr]) && $champ[$cr] != "") {
231
				if (isset($champ[$cr]) && $champ[$cr] != "") {
232
					$champssupp[$champ['project']]['champs-supp'][$i][$cet]= $champ[$cr];
232
				    $champssupp[$projet]['champs-supp'][$i][$cet]= $champ[$cr];
233
				} else {
233
				} else {
234
					$champssupp[$champ['project']]['champs-supp'][$i][$cet]="";
234
				    $champssupp[$projet]['champs-supp'][$i][$cet]="";
235
				}
235
				}
236
			}$i++;
236
			}$i++;
237
		}
237
		}
238
		return $champssupp;
238
		return $champssupp;
239
	}
239
	}