Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1300 Rev 1301
Line 219... Line 219...
219
 
219
 
220
	private function creerPropositionAPartirObservation($id_observation) {
220
	private function creerPropositionAPartirObservation($id_observation) {
221
		$idObs =  $this->bdd->proteger($id_observation);
221
		$idObs =  $this->bdd->proteger($id_observation);
222
		$insertion = 'INSERT IGNORE INTO del_commentaire '.
222
		$insertion = 'INSERT IGNORE INTO del_commentaire '.
223
			'(ce_observation, ce_utilisateur, utilisateur_prenom, utilisateur_nom, utilisateur_courriel, '.
223
			'(ce_observation, ce_utilisateur, utilisateur_prenom, utilisateur_nom, utilisateur_courriel, '.
224
			'nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, nom_referentiel, proposition_initiale) '.
224
			'nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, nt, famille, nom_referentiel, date, proposition_initiale) '.
225
			'SELECT id_observation, ce_utilisateur, prenom, nom, '.
225
			'SELECT id_observation, ce_utilisateur, prenom, nom, '.
226
			'		courriel, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, '.
226
			'		courriel, nom_sel, nom_sel_nn, nom_ret, nom_ret_nn, '.
227
			"		nt, famille, 'bdtfx_v1', '1' ".
227
			"		nt, famille, 'bdtfx_v1', NOW(), '1' ".
228
			'FROM del_observation AS do '.
228
			'FROM del_observation AS do '.
229
			'	LEFT JOIN del_utilisateur AS du '.
229
			'	LEFT JOIN del_utilisateur AS du '.
230
			'		ON do.ce_utilisateur = du.id_utilisateur '.
230
			'		ON do.ce_utilisateur = du.id_utilisateur '.
Line 235... Line 235...
235
	}
235
	}
Line 236... Line 236...
236
 
236
 
237
	private function genererEntete($utilisateur) {
237
	private function genererEntete($utilisateur) {
Line 238... Line 238...
238
		$this->parametres = array_merge($this->parametres, $utilisateur);
238
		$this->parametres = array_merge($this->parametres, $utilisateur);
239
 
239
 
240
		$entete = array();
240
		$entete = array('date');
241
		foreach ($this->mappingCommentaire as $nomOriginal => $nomFinal) {
241
		foreach ($this->mappingCommentaire as $nomOriginal => $nomFinal) {
242
			if (isset($this->parametres[$nomFinal]) && $this->parametres[$nomFinal] != null) {
242
			if (isset($this->parametres[$nomFinal]) && $this->parametres[$nomFinal] != null) {
243
				$entete[] = $nomOriginal;
243
				$entete[] = $nomOriginal;
244
			}
-
 
Line 245... Line 244...
245
		}
244
			}
246
		$entete[] = 'date';
245
		}
Line 247... Line 246...
247
 
246
 
248
		return implode(', ', $entete);
247
		return implode(', ', $entete);
249
	}
248
	}
250
 
249
 
251
	private function genererValues() {
250
	private function genererValues() {
252
		$valeurs = array();
251
		$valeurs = array('NOW()');
253
		foreach ($this->mappingCommentaire as $nomOriginal => $nomFinal) {
252
		foreach ($this->mappingCommentaire as $nomOriginal => $nomFinal) {
254
			if (isset($this->parametres[$nomFinal]) && $this->parametres[$nomFinal] != null) {
-
 
Line 255... Line 253...
255
				$valeurs[] = $this->bdd->proteger($this->parametres[$nomFinal]);
253
			if (isset($this->parametres[$nomFinal]) && $this->parametres[$nomFinal] != null) {
256
			}
254
				$valeurs[] = $this->bdd->proteger($this->parametres[$nomFinal]);
257
		}
255
			}
258
		$valeurs[] = 'NOW()';
256
		}
259
 
257