Fix: Show sending method

Fix: Avoid long loop with bad date in dol_print_date
This commit is contained in:
Laurent Destailleur 2009-02-03 02:59:16 +00:00
parent f9dde86da9
commit 5a4dc21369
2 changed files with 8 additions and 4 deletions

View File

@ -691,9 +691,13 @@ else
// Sending method
print '<tr><td>'.$langs->trans("SendingMethod").'</td>';
print '<td colspan="3">';
// 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 '&nbsp;';
print '</td>';
print '</tr>';

View File

@ -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];