Subversion Repositories Applications.referentiel

Rev

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

Rev 23 Rev 24
Line 11... Line 11...
11
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
11
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
12
 * @copyright	2010 Tela-Botanica
12
 * @copyright	2010 Tela-Botanica
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Traitement extends Ref {
15
class Traitement extends Ref {
-
 
16
	
16
	/**
17
	/**
17
	 * Méthode principale appelée avec une requête de type GET.
18
	 * Méthode principale appelée avec une requête de type GET.
18
	 */
19
	 */
19
	public function getElement($param = array()) {
20
	public function getElement($param = array()) {
20
		// Initialisation des variables
21
		// Initialisation des variables
Line 46... Line 47...
46
		// Envoie sur la sortie standard
47
		// Envoie sur la sortie standard
47
		$this->envoyer($info);
48
		$this->envoyer($info);
48
	}
49
	}
Line 49... Line 50...
49
	
50
	
-
 
51
	/**
-
 
52
	 * Retourne les infos sur les traitements en cours ou en attentes.
-
 
53
	 */
-
 
54
	public function getElementEnCours($projet) {
-
 
55
		$projet = $this->bdd->quote($projet);
-
 
56
		$requete =	($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
-
 
57
					'FROM ref_traitement '.
-
 
58
					"WHERE referentiel_code = $projet ".
-
 
59
					'	AND date_fin IS NULL '.
-
 
60
					'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby  : 'meta_date_creation  DESC').' ';
-
 
61
		$this->debug[] = $requete;
-
 
62
		
-
 
63
		// Récupération des résultats
-
 
64
		try {
-
 
65
			$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
-
 
66
			if ($donnees === false) {
-
 
67
				$this->messages[] = "La requête a retourné aucun résultat.";
-
 
68
			}
-
 
69
		} catch (PDOException $e) {
-
 
70
			$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
-
 
71
		}
-
 
72
		return $donnees;
-
 
73
	}
-
 
74
	
50
	/**
75
	/**
51
	 * Méthode appelée pour ajouter un traitement.
76
	 * Méthode appelée pour ajouter un traitement.
52
	 * Retour l'id du nouvel enregistrement ou false!
77
	 * Retour l'id du nouvel enregistrement ou false!
53
	 */
78
	 */
54
	public function createElement($params) {
79
	public function createElement($params) {