Remove warnings

This commit is contained in:
Laurent Destailleur
2019-03-13 19:06:45 +01:00
parent e0208cb3d6
commit e7cd8d690c
5 changed files with 11 additions and 8 deletions

View File

@@ -691,11 +691,11 @@ if ($resql)
// Date creation // Date creation
if (! empty($arrayfields['a.datec']['checked'])) { if (! empty($arrayfields['a.datec']['checked'])) {
// Status/Percent // Status/Percent
print '<td align="center" class="nowrap">'.dol_print_date($obj->datec, 'dayhour').'</td>'; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datec), 'dayhour').'</td>';
} }
// Date update // Date update
if (! empty($arrayfields['a.tms']['checked'])) { if (! empty($arrayfields['a.tms']['checked'])) {
print '<td align="center" class="nowrap">'.dol_print_date($obj->datem, 'dayhour').'</td>'; print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->datem), 'dayhour').'</td>';
} }
if (! empty($arrayfields['a.percent']['checked'])) { if (! empty($arrayfields['a.percent']['checked'])) {
// Status/Percent // Status/Percent

View File

@@ -1790,9 +1790,9 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg) if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+) ?([0-9]+)?:?([0-9]+)?:?([0-9]+)?/i', $time, $reg)
|| preg_match('/^([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])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000 || preg_match('/^([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])$/i', $time, $reg)) // Deprecated. Ex: 1970-01-01, 1970-01-01 01:00:00, 19700101010000
{ {
// TODO Remove this. // TODO Remove this. This part of code should not be used.
// This part of code should not be used.
dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR); dol_syslog("Functions.lib::dol_print_date function call with deprecated value of time in page ".$_SERVER["PHP_SELF"], LOG_ERR);
//if (function_exists('debug_print_backtrace')) debug_print_backtrace();
// Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS' // Date has format 'YYYY-MM-DD' or 'YYYY-MM-DD HH:MM:SS' or 'YYYYMMDDHHMMSS'
$syear = (! empty($reg[1]) ? $reg[1] : ''); $syear = (! empty($reg[1]) ? $reg[1] : '');
$smonth = (! empty($reg[2]) ? $reg[2] : ''); $smonth = (! empty($reg[2]) ? $reg[2] : '');
@@ -1801,7 +1801,7 @@ function dol_print_date($time, $format = '', $tzoutput = 'tzserver', $outputlang
$smin = (! empty($reg[5]) ? $reg[5] : ''); $smin = (! empty($reg[5]) ? $reg[5] : '');
$ssec = (! empty($reg[6]) ? $reg[6] : ''); $ssec = (! empty($reg[6]) ? $reg[6] : '');
$time=dol_mktime($shour, $smin, $ssec, $smonth, $sday, $syear, true); $time=²($shour, $smin, $ssec, $smonth, $sday, $syear, true);
$ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt); $ret=adodb_strftime($format, $time+$offsettz+$offsetdst, $to_gmt);
} }
else else

View File

@@ -226,8 +226,8 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning'; $starthalfday=($obj->halfday == -1 || $obj->halfday == 2)?'afternoon':'morning';
$endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon'; $endhalfday=($obj->halfday == 1 || $obj->halfday == 2)?'morning':'afternoon';
print '<td>'.dol_print_date($obj->date_start, 'day').' '.$langs->trans($listhalfday[$starthalfday]); print '<td>'.dol_print_date($db->jdate($obj->date_start), 'day').' '.$langs->trans($listhalfday[$starthalfday]);
print '<td>'.dol_print_date($obj->date_end, 'day').' '.$langs->trans($listhalfday[$endhalfday]); print '<td>'.dol_print_date($db->jdate($obj->date_end), 'day').' '.$langs->trans($listhalfday[$endhalfday]);
print '<td class="right">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>'; print '<td class="right">'.dol_print_date($db->jdate($obj->dm), 'day').'</td>';
print '<td>'.$holidaystatic->LibStatut($obj->status, 3).'</td>'; print '<td>'.$holidaystatic->LibStatut($obj->status, 3).'</td>';
print '</tr>'; print '</tr>';

View File

@@ -503,7 +503,9 @@ while ($i < min($num, $limit))
print $val['css']; print $val['css'];
if ($cssforfield || $val['css']) print '"'; if ($cssforfield || $val['css']) print '"';
print '>'; print '>';
print $object->showOutputField($val, $key, $obj->$key, ''); if ($key == 'status') print $object->getLibStatut(5);
elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
else print $object->showOutputField($val, $key, $obj->$key, '');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;
if (! empty($val['isameasure'])) if (! empty($val['isameasure']))

View File

@@ -640,6 +640,7 @@ while ($i < min($num, $limit))
if ($cssforfield || $val['css']) print '"'; if ($cssforfield || $val['css']) print '"';
print '>'; print '>';
if ($key == 'fk_statut') print $object->getLibStatut(5); if ($key == 'fk_statut') print $object->getLibStatut(5);
elseif (in_array($val['type'], array('date','datetime','timestamp'))) print $object->showOutputField($val, $key, $db->jdate($obj->$key), '');
else print $object->showOutputField($val, $key, $obj->$key, ''); else print $object->showOutputField($val, $key, $obj->$key, '');
print '</td>'; print '</td>';
if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['nbfield']++;