From 5a4dc21369663d89d793feadfea8bb9f1e874d22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Feb 2009 02:59:16 +0000 Subject: [PATCH] Fix: Show sending method Fix: Avoid long loop with bad date in dol_print_date --- htdocs/expedition/fiche.php | 10 +++++++--- htdocs/lib/functions.lib.php | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 198d42a1489..0fdd5dd640e 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -691,9 +691,13 @@ else // Sending method print ''.$langs->trans("SendingMethod").''; print ''; - // Get code using getLabelFromKey - $code=$langs->getLabelFromKey($db,$expedition->expedition_method_id,'expedition_methode','rowid','code'); - print $langs->trans("SendingMethod".strtoupper($code)); + if ($expedition->expedition_method_id > 0) + { + // Get code using getLabelFromKey + $code=$langs->getLabelFromKey($db,$expedition->expedition_method_id,'expedition_methode','rowid','code'); + print $langs->trans("SendingMethod".strtoupper($code)); + } + else print ' '; print ''; print ''; diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 27d521ee375..47e15ab4e71 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -412,7 +412,7 @@ function dol_print_date($time,$format='',$to_gmt=false,$outputlangs='') || eregi('^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])$',$time,$reg)) { // This part of code should not be used. - dolibarr_syslog("Functions.lib::dolibarr_print_date function call with deprecated parameter in page ".$_SERVER["PHP_SELF"], LOG_WARNING); + dolibarr_syslog("Functions.lib::dolibarr_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_WARNING); // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' $syear = $reg[1]; $smonth = $reg[2];