From 8ef2bb9f0b13c1749a63cc787cdbc97c8b1cce55 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 29 Oct 2007 12:54:25 +0000 Subject: [PATCH] Fix: Supprime nombreux warnings --- htdocs/install/etape1.php | 5 ++--- htdocs/install/etape2.php | 5 +---- htdocs/install/etape4.php | 5 +---- htdocs/lib/functions.inc.php | 7 +++---- 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index df24fc68729..f4663283909 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -19,7 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -105,8 +104,8 @@ if ($_POST["action"] == "set") fputs($fp, ' - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -27,8 +26,6 @@ */ include("./inc.php"); -if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; -define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix); require_once($dolibarr_main_document_root . "/lib/databases/".$dolibarr_main_db_type.".lib.php"); require_once($dolibarr_main_document_root . "/conf/conf.class.php"); diff --git a/htdocs/install/etape4.php b/htdocs/install/etape4.php index 76d01f827ae..64c282165fa 100644 --- a/htdocs/install/etape4.php +++ b/htdocs/install/etape4.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien DiCintio - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -30,8 +29,6 @@ include_once("./inc.php"); -if (! isset($dolibarr_main_db_prefix) || ! $dolibarr_main_db_prefix) $dolibarr_main_db_prefix='llx_'; -define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix); require_once($dolibarr_main_document_root . "/lib/databases/".$dolibarr_main_db_type.".lib.php"); require_once($dolibarr_main_document_root . "/conf/conf.class.php"); diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index e97b9f20855..f8a0400bda8 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -520,8 +520,8 @@ function dolibarr_print_date($time,$format='') { global $conf; - // Si format non défini, on prend $conf->format_date_text_short - if (! $format) $format=$conf->format_date_text_short; + // Si format non défini, on prend $conf->format_date_text_short sinon %Y-%m-%d %H:%M:%S + if (! $format) $format=(isset($conf->format_date_text_short) ? $conf->format_date_text_short : '%Y-%m-%d %H:%M:%S'); if ($format == 'day') $format=$conf->format_date_short; if ($format == 'hour') $format=$conf->format_hour_short; @@ -529,10 +529,9 @@ function dolibarr_print_date($time,$format='') if ($format == 'dayhour') $format=$conf->format_date_hour_short; if ($format == 'dayhourtext') $format=$conf->format_date_hour_text_short; if ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ'; - 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))