Subversion Repositories eFlore/Applications.cel

Rev

Rev 3886 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3886 Rev 3890
Line 60... Line 60...
60
	
60
       
61
	private $correspondance_champs_etendus = array(
61
        private $correspondance_champs_etendus = array(
62
			"key" => "field_id",
62
                        "key" => "field_id",
63
			"element" => "data_type",
63
                        "element" => "data_type",
64
			"mandatory" => "is_mandatory",
64
                        "mandatory" => "is_mandatory",
-
 
65
                        "unit" => "unit",
65
			"unit" => "unit"
66
                        "is_visible" => "is_visible"
Line 66... Line 67...
66
	);
67
        );
67
	
68
       
68
	private $correspondance_champs_etendus_trad = array(
69
        private $correspondance_champs_etendus_trad = array(
Line 179... Line 180...
179
	
180
       
180
	protected function traiterCorresponceConfigWidgetInterfaceBD(Array $parametres) {
181
        protected function traiterCorresponceConfigWidgetInterfaceBD(Array $parametres) {
181
		$parametres_traites = array();
182
                $parametres_traites = array();
182
		$corresp = $this->correspondance_config_widget;
183
                $corresp = $this->correspondance_config_widget;
183
		foreach($parametres as $cle => $valeur) {
184
                foreach($parametres as $cle => $valeur) {
184
				if(is_string($valeur) && !trim($valeur)) $valeur=NULL;
185
                                if(is_string($valeur) && !trim($valeur) && $valeur !== '0') $valeur=NULL;
185
				if(isset($corresp[$cle])) {
186
                                if(isset($corresp[$cle])) {
186
					$parametres_traites[$corresp[$cle]] = $valeur;
187
                                        $parametres_traites[$corresp[$cle]] = $valeur;
187
				}
188
                                }
188
			}
189
                        }
Line 199... Line 200...
199
			// pour la table extended fiels champs interface => champs bd
200
                        // pour la table extended fiels champs interface => champs bd
200
			foreach ($this->correspondance_champs_etendus as $ci => $ce) {
201
                        foreach ($this->correspondance_champs_etendus as $ci => $ce) {
201
				if (isset($champ[$ci]) && $champ[$ci] != "") {
202
                                if (isset($champ[$ci]) && $champ[$ci] != "") {
202
					$champsrequete['ce'][$i][$ce] = $champ[$ci];
203
                                        $champsrequete['ce'][$i][$ce] = $champ[$ci];
203
				} else {
204
                                } else {
204
					if ($ci == "mandatory") {
205
                                        if ($ci == "mandatory" || $ci == "is_visible") {
205
						$champsrequete['ce'][$i][$ce] = "0";
206
                                                $champsrequete['ce'][$i][$ce] = "0";
206
					} else {
207
                                        } else {
207
						$champsrequete['ce'][$i][$ce] = "";
208
                                                $champsrequete['ce'][$i][$ce] = "";
208
					}
209
                                        }
209
				}
210
                                }
210
			}
211
                        }
211
			$champsrequete['ce'][$i]["is_visible"] = "1";
212
                        //$champsrequete['ce'][$i]["is_visible"] = "1";
212
			// pour la table extended fiels trad champs interface => champs bd
213
                        // pour la table extended fiels trad champs interface => champs bd
213
			foreach ($this->correspondance_champs_etendus_trad as $cit => $cr) {
214
                        foreach ($this->correspondance_champs_etendus_trad as $cit => $cr) {
214
				if (isset($champ[$cit]) && is_array($champ[$cit])) {
215
                                if (isset($champ[$cit]) && is_array($champ[$cit])) {
215
					$champsrequete['cet'][$i][$cr] = json_encode($champ[$cit]);
216
                                        $champsrequete['cet'][$i][$cr] = json_encode($champ[$cit]);
216
				} elseif (isset($champ[$cit]) && $champ[$cit] != "") {
217
                                } elseif (isset($champ[$cit]) && $champ[$cit] != "") {