From 9e74308131ba02b0bfc1bb15d794ab279da4a85f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 12 Oct 2007 18:15:01 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20ne=20pas=20afficher=20le=201970=20si=20l?= =?UTF-8?q?a=20date=20de=20livraison=20n'est=20pas=20d=E9fini?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/commande/commande.class.php | 2 +- htdocs/commande/fiche.php | 2 +- htdocs/lib/functions.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index bfae7157046..5dc6787be19 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -509,7 +509,7 @@ class Commande extends CommonObject $sql.= " '".addslashes($this->note)."', "; $sql.= " '".addslashes($this->note_public)."', "; $sql.= " '".addslashes($this->ref_client)."', '".$this->modelpdf."', '".$this->cond_reglement_id."', '".$this->mode_reglement_id."',"; - $sql.= " '".($this->date_livraison?$this->db->idate($this->date_livraison):'null')."',"; + $sql.= " '".($this->date_livraison?$this->db->idate($this->date_livraison):'')."',"; $sql.= " '".$this->adresse_livraison_id."',"; $sql.= " '".$this->remise_absolue."',"; $sql.= " '".$this->remise_percent."')"; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 932c409f2dd..b0af05ecfac 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1174,7 +1174,7 @@ else } else { - print dolibarr_print_date($commande->date_livraison,'daytext'); + print $commande->date_livraison ? dolibarr_print_date($commande->date_livraison,'daytext') : ' '; } print ''; print ''.$langs->trans('NotePublic').' :
'; diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index 42478e2635f..761c3bcb7fc 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -533,7 +533,7 @@ function dolibarr_print_date($time,$format='') if (! $format) $format='%Y-%m-%d %H:%M:%S'; // Si date non définie, on renvoie '' - if ("$time" == "") return ''; // $time=0 permis car signifie 01/01/1970 00:00:00 + if ($time == "") return ''; // $time=0 permis car signifie 01/01/1970 00:00:00 // Analyse de la date if (eregi('^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?',$time,$reg))