From f7e30a0a5b9eeccd4b1313fe9034d34e88eb0e05 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 8 May 2010 19:31:44 +0000 Subject: [PATCH] Qual: Removed pdate --- htdocs/comm/class/adresse_livraison.class.php | 22 +++++++++---------- htdocs/comm/mailing/mailing.class.php | 12 +++++----- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 12 +++++----- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/htdocs/comm/class/adresse_livraison.class.php b/htdocs/comm/class/adresse_livraison.class.php index 218614c0485..05c458f3312 100644 --- a/htdocs/comm/class/adresse_livraison.class.php +++ b/htdocs/comm/class/adresse_livraison.class.php @@ -349,8 +349,8 @@ class AdresseLivraison global $langs; global $conf; - $sql = 'SELECT a.rowid, a.fk_societe, a.label, a.nom, a.address, a.datec as date_creation'; - $sql .= ', a.tms as date_update'; + $sql = 'SELECT a.rowid, a.fk_societe, a.label, a.nom, a.address,'.$this->db->pdate('a.datec').' as dc'; + $sql .= ','. $this->db->pdate('a.tms').' as date_update'; $sql .= ', a.cp,a.ville, a.note, a.fk_pays, a.tel, a.fax'; $sql .= ', p.code as pays_code, p.libelle as pays'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_adresse_livraison as a'; @@ -366,17 +366,17 @@ class AdresseLivraison $this->id = $obj->rowid; $this->socid = $obj->fk_societe; - $this->date_update = $this->db->jdate($obj->date_update); - $this->date_creation = $this->db->jdate($obj->date_creation); + $this->date_update = $obj->date_update; + $this->date_creation = $obj->date_creation; - $this->label = $obj->label; - $this->nom = $obj->nom; - $this->adresse = $obj->address; // TODO obsolete - $this->address = $obj->address; + $this->label = stripslashes($obj->label); + $this->nom = stripslashes($obj->nom); + $this->adresse = stripslashes($obj->address); // TODO obsolete + $this->address = stripslashes($obj->address); $this->cp = $obj->cp; - $this->ville = $obj->ville; - $this->adresse_full = $obj->address . "\n". $obj->cp . ' '. $obj->ville; - $this->full_address = $obj->address . "\n". $obj->cp . ' '. $obj->ville; //TODO obsolete + $this->ville = stripslashes($obj->ville); + $this->adresse_full = stripslashes($obj->address) . "\n". $obj->cp . ' '. stripslashes($obj->ville); + $this->full_address = stripslashes($obj->address) . "\n". $obj->cp . ' '. stripslashes($obj->ville); //TODO obsolete $this->pays_id = $obj->fk_pays; $this->pays_code = $obj->fk_pays?$obj->pays_code:''; diff --git a/htdocs/comm/mailing/mailing.class.php b/htdocs/comm/mailing/mailing.class.php index d923cd4f4b4..65de6a3a735 100644 --- a/htdocs/comm/mailing/mailing.class.php +++ b/htdocs/comm/mailing/mailing.class.php @@ -179,9 +179,9 @@ class Mailing extends CommonObject $sql .= ", m.email_from, m.email_replyto, m.email_errorsto"; $sql .= ", m.statut, m.nbemail"; $sql .= ", m.fk_user_creat, m.fk_user_valid"; - $sql .= ", ".$this->db->pdate("m.date_creat") . " as date_creat"; - $sql .= ", ".$this->db->pdate("m.date_valid") . " as date_valid"; - $sql .= ", ".$this->db->pdate("m.date_envoi") . " as date_envoi"; + $sql .= ", m.date_creat"; + $sql .= ", m.date_valid"; + $sql .= ", m.date_envoi"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing as m"; $sql .= " WHERE m.rowid = ".$rowid; @@ -210,9 +210,9 @@ class Mailing extends CommonObject $this->user_creat = $obj->fk_user_creat; $this->user_valid = $obj->fk_user_valid; - $this->date_creat = $obj->date_creat; - $this->date_valid = $obj->date_valid; - $this->date_envoi = $obj->date_envoi; + $this->date_creat = $this->db->jdate($obj->date_creat); + $this->date_valid = $this->db->jdate($obj->date_valid); + $this->date_envoi = $this->db->jdate($obj->date_envoi); return 1; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 73ced91da17..50ac7959e67 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1379,7 +1379,7 @@ class Propal extends CommonObject $ga = array(); $sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.fk_statut, p.total_ht, p.ref, p.remise, "; - $sql.= " ".$this->db->pdate("p.datep")." as dp, ".$this->db->pdate("p.fin_validite")." as datelimite"; + $sql.= " p.datep as dp, p.fin_validite as datelimite"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as p, ".MAIN_DB_PREFIX."c_propalst as c"; $sql.= " WHERE p.entity = ".$conf->entity; $sql.= " AND p.fk_soc = s.rowid"; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7b6c9d03456..4b944b19464 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2190,9 +2190,9 @@ class Commande extends CommonObject */ function info($id) { - $sql = 'SELECT c.rowid, '.$this->db->pdate('date_creation').' as datec,'; - $sql.= ' '.$this->db->pdate('date_valid').' as datev,'; - $sql.= ' '.$this->db->pdate('date_cloture').' as datecloture,'; + $sql = 'SELECT c.rowid, date_creation as datec,'; + $sql.= ' date_valid as datev,'; + $sql.= ' date_cloture as datecloture,'; $sql.= ' fk_user_author, fk_user_valid, fk_user_cloture'; $sql.= ' FROM '.MAIN_DB_PREFIX.'commande as c'; $sql.= ' WHERE c.rowid = '.$id; @@ -2224,9 +2224,9 @@ class Commande extends CommonObject $this->user_cloture = $cluser; } - $this->date_creation = $obj->datec; - $this->date_validation = $obj->datev; - $this->date_cloture = $obj->datecloture; + $this->date_creation = $this->db->jdate($obj->datec); + $this->date_validation = $this->db->jdate($obj->datev); + $this->date_cloture = $this->db->jdate($obj->datecloture); } $this->db->free($result);