Subversion Repositories eFlore/Applications.cel

Rev

Rev 1538 | Rev 1571 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1538 Rev 1565
Line 153... Line 153...
153
		$this->envoyerJson($retour);
153
		$this->envoyerJson($retour);
154
	}
154
	}
Line 155... Line 155...
155
	
155
 
156
	private function ajouterChampsEtendusObs($obs_ids, $obs_a_champs_etendus) {
156
	private function ajouterChampsEtendusObs($obs_ids, $obs_a_champs_etendus) {
-
 
157
		$champs_etendus_obs = array();
Line 157... Line 158...
157
		$champs_etendus_obs = array();
158
		$gestionChampsEtendus = new GestionChampsEtendus($this->config, 'obs');
158
		
159
 
159
		foreach($obs_ids as $id_obs) {
160
		foreach ($obs_ids as $id_obs) {
160
			$champs = array_shift($obs_a_champs_etendus);
161
			$champs = array_shift($obs_a_champs_etendus);
161
			if($champs != null && is_array($champs)) {
162
			if ($champs != null && is_array($champs)) {
162
				foreach($champs as $champ_etendu => $valeur) {
163
				foreach ($champs as $infosChamp) {
163
					$champs_etendus_obs[] = array(
164
					$cle = isset($infosChamp['cle']) ? $infosChamp['cle'] : '';
-
 
165
					$label = isset($infosChamp['label']) ? $infosChamp['label'] : '';
164
						'id' => $id_obs,
166
					$valeur = isset($infosChamp['valeur']) ? $infosChamp['valeur'] : '';
165
						'cle' => $champ_etendu,
167
 
166
						'valeur' => $valeur	
-
 
167
					);
-
 
168
				}
168
					if (empty($cle) && !empty($label)) {
Line -... Line 169...
-
 
169
						$cle = $gestionChampsEtendus->transformerLabelEnCle($label);
169
			}
170
					}
-
 
171
 
-
 
172
					if (!empty($cle) && !empty($valeur)) {
170
		}
173
						$champEtendu = new ChampEtendu();
-
 
174
						$champEtendu->id = $id_obs;
Line -... Line 175...
-
 
175
						$champEtendu->cle = $cle;
-
 
176
						$champEtendu->label = empty($label) ? $cle : $label;
-
 
177
						$champEtendu->valeur = $valeur;
-
 
178
 
-
 
179
						$champs_etendus_obs[] = $champEtendu;
-
 
180
					}
171
		
181
				}
172
		$gestion_champs_etendus = new GestionChampsEtendus($this->config, 'obs');
182
			}
Line 173... Line 183...
173
		$ajout_champ_etendus = $gestion_champs_etendus->ajouterChampsEtendusMultiplesAElementsMultiples($champs_etendus_obs);
183
		}
174
		
184
		$ajout_champ_etendus = $gestionChampsEtendus->ajouterParLots($champs_etendus_obs);
Line 205... Line 215...
205
		
215
 
206
		return $imgAAjouter;
216
		return $imgAAjouter;
Line 207... Line 217...
207
	}
217
	}
-
 
218
 
208
	
219
	private function stockerImagesEtLierAObs($img, $id_utilisateur, $utilisateur) {
209
	private function stockerImagesEtLierAObs($img, $id_utilisateur, $utilisateur) {
220
		$img_a_taguer_ids = array();
210
		if(!isset($img['nom']) && is_array($img)) {
221
		if (!isset($img['nom']) && is_array($img)) {
211
			foreach($img as $index => $image) {
222
			foreach ($img as $index => $image) {
212
				$nomFichierImg = $this->traiterNomFichierImage($image['nom']);
223
				$nomFichierImg = $this->traiterNomFichierImage($image['nom']);