Subversion Repositories Applications.referentiel

Rev

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

Rev 26 Rev 30
Line 80... Line 80...
80
	public function getElementEnCours($projet) {
80
	public function getElementEnCours($projet) {
81
		$projet = $this->bdd->quote($projet);
81
		$projet = $this->bdd->quote($projet);
82
		$requete =	($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
82
		$requete =	($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
83
					'FROM ref_traitement '.
83
					'FROM ref_traitement '.
84
					"WHERE referentiel_code = $projet ".
84
					"WHERE referentiel_code = $projet ".
-
 
85
					'	AND date_debut IS NOT NULL '.
85
					'	AND date_fin IS NULL '.
86
					'	AND date_fin IS NULL '.
86
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'meta_date_creation  DESC').' ';
87
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'meta_date_creation  DESC').' ';
87
		$this->debug[] = $requete;
88
		$this->debug[] = $requete;
Line 88... Line 89...
88
		
89
		
Line 210... Line 211...
210
						"WHERE id_traitement = $id ";
211
						"WHERE id_traitement = $id ";
211
			$this->debug[] = "$requete";
212
			$this->debug[] = "$requete";
212
			$resultat = $this->bdd->exec($requete);
213
			$resultat = $this->bdd->exec($requete);
213
			if ($resultat === false) {
214
			if ($resultat === false) {
214
				$ok = false;
215
				$ok = false;
-
 
216
				$this->messages[] = "Traitement NON modifié.";
-
 
217
			}
-
 
218
		} catch (PDOException $e) {
-
 
219
			$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
-
 
220
		}
-
 
221
	   	
-
 
222
	   	return $ok;
-
 
223
	}
-
 
224
	
-
 
225
	/**
-
 
226
	 * Méthode pour indiquer la fin d'un traitement.
-
 
227
	 */
-
 
228
	public function updateElementTerminer($id, $params_post) {
-
 
229
		$ok = true;
-
 
230
		try {
-
 
231
			$requete = 	'UPDATE ref_traitement '.
-
 
232
						'SET date_fin = NOW() '.
-
 
233
						"WHERE id_traitement = $id ";
-
 
234
			$this->debug[] = "$requete";
-
 
235
			$resultat = $this->bdd->exec($requete);
-
 
236
			if ($resultat === false) {
-
 
237
				$ok = false;
215
				$this->messages[] = "Traitement NON modifié.";
238
				$this->messages[] = "Traitement NON modifié.";
216
			}
239
			}
217
		} catch (PDOException $e) {
240
		} catch (PDOException $e) {
218
			$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
241
			$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage(), $requete);
219
		}
242
		}