Subversion Repositories Applications.referentiel

Compare Revisions

Ignore whitespace Rev 37 → Rev 38

/trunk/services/modules/Referentiel.php
79,8 → 79,9
if (!is_null($projet)) {
$requete = ($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
"FROM $projet ".
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'num_nom ASC').' ';
//"LIMIT $this->start, $this->limit ";
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'num_nom ASC').' '.
"LIMIT $this->start, $this->limit ";
$this->debug[] = $requete;
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
100,7 → 101,7
* Appelée avec les paramêtres d'url suivant :
* /RefReferentiel/nombre/code_du_referentiel
*/
public function getElementNombre($projet) {
public function getElementNombre($params_url) {
$p = $this->traiterParametresUrl(array('projet'), $params_url, false);
extract($p);
/trunk/services/modules/Ref.php
35,12 → 35,14
if (isset($_GET)) {
$get_params = array('orderby', 'distinct', 'start', 'limit', 'formatRetour');
foreach ($get_params as $get) {
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';');
$_GET[$get] = str_replace($verifier, '', $_GET[$get]);
if (isset($_GET[$get]) && $_GET[$get] != '') {
$this->$get = $_GET[$get];
} else {
$_GET[$get] = null;
if (isset($_GET[$get])) {
$verifier = array('NULL', "\n", "\r", "\\", "'", '"', "\x00", "\x1a", ';');
$_GET[$get] = strip_tags(str_replace($verifier, '', $_GET[$get]));
if ($_GET[$get] != '') {
$this->$get = $_GET[$get];
} else {
$_GET[$get] = null;
}
}
}
}
/trunk/services/modules/Traitement.php
107,6 → 107,38
}
/**
* Retourne les infos sur les traitements en attente.
*/
public function getElementEnAttente($params_url) {
$p = $this->traiterParametresUrl(array('projet'), $params_url);
extract($p);
$donnees = false;
if (!is_null($projet)) {
$requete = ($this->distinct ? 'SELECT DISTINCT' : 'SELECT').' * '.
'FROM ref_traitement '.
"WHERE referentiel_code = $projet ".
' AND date_debut IS NULL '.
' AND date_fin IS NULL '.
'ORDER BY '.((!is_null($this->orderby)) ? $this->orderby : 'meta_date_creation DESC').' ';
// Récupération des résultats
try {
$donnees = $this->bdd->query($requete)->fetchAll(PDO::FETCH_ASSOC);
if ($donnees === false) {
$this->messages[] = "La requête a retourné aucun résultat.";
}
} catch (PDOException $e) {
$this->messages[] = sprintf($this->getTxt('sql_erreur'), $e->getFile(), $e->getLine(), $e->getMessage());
}
} else {
$this->messages[] = "Veuillez préciser le nom de code du projet comme premier paramêtre (ex. : bdnff).";
}
return $donnees;
}
/**
* Retourne les infos sur les traitements en cours.
*/
public function getElementEnCours($params_url) {