Qual: Removed warnings
This commit is contained in:
parent
a5513141d9
commit
55f6cdd495
@ -678,7 +678,7 @@ if ($id > 0)
|
||||
print "<tr ".$bc[$var].">";
|
||||
print '<td nowrap="nowrap"><a href="'.DOL_URL_ROOT.'/fichinter/fiche.php?id='.$objp->id.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a></td>'."\n";
|
||||
//print '<td align="right">'.dol_print_date($db->jdate($objp->startdate)).'</td>'."\n";
|
||||
print '<td align="right">'.ConvertSecondToTime($objp->duration).'</td>'."\n";
|
||||
print '<td align="right">'.convertSecondToTime($objp->duration).'</td>'."\n";
|
||||
print '<td align="right">'.$fichinter_static->getLibStatut(3).'</td>'."\n";
|
||||
print '</tr>';
|
||||
$var=!$var;
|
||||
|
||||
@ -201,9 +201,8 @@ else
|
||||
|
||||
print ' ';
|
||||
//var_dump($birthdatearray);
|
||||
//print ($now-$birthdate).' - '.ConvertSecondToTime($now-$birthdate,'year').'<br>';
|
||||
$ageyear=ConvertSecondToTime($now-$object->birthday,'year')-1970;
|
||||
$agemonth=ConvertSecondToTime($now-$object->birthday,'month')-1;
|
||||
$ageyear=convertSecondToTime($now-$object->birthday,'year')-1970;
|
||||
$agemonth=convertSecondToTime($now-$object->birthday,'month')-1;
|
||||
if ($ageyear >= 2) print '('.$ageyear.' '.$langs->trans("DurationYears").')';
|
||||
else if ($agemonth >= 2) print '('.$agemonth.' '.$langs->trans("DurationMonths").')';
|
||||
else print '('.$agemonth.' '.$langs->trans("DurationMonth").')';
|
||||
|
||||
@ -3437,8 +3437,8 @@ class Form
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
|
||||
|
||||
$hourSelected = ConvertSecondToTime($iSecond,'hour');
|
||||
$minSelected = ConvertSecondToTime($iSecond,'min');
|
||||
$hourSelected = convertSecondToTime($iSecond,'hour');
|
||||
$minSelected = convertSecondToTime($iSecond,'min');
|
||||
}
|
||||
|
||||
print '<select class="flat" name="'.$prefix.'hour"'.($disabled?' disabled="disabled"':'').'>';
|
||||
|
||||
@ -77,8 +77,8 @@ function getServerTimeZoneString()
|
||||
* Return server timezone int.
|
||||
* If $conf->global->MAIN_NEW_DATE is set, we use new behaviour: All convertions take care of dayling saving time.
|
||||
*
|
||||
* @param string $refdate Reference date for timezone (timezone differs on winter and summer)
|
||||
* @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer)
|
||||
* @param string $refgmtdate Reference date for timezone (timezone differs on winter and summer)
|
||||
* @return int An offset in hour (+1 for Europe/Paris on winter and +2 for Europe/Paris on summer)
|
||||
*/
|
||||
function getServerTimeZoneInt($refgmtdate='now')
|
||||
{
|
||||
@ -182,7 +182,7 @@ function dol_time_plus_duree($time,$duration_value,$duration_unit)
|
||||
* @param int $iSeconds Seconds
|
||||
* @return int Time into seconds
|
||||
*/
|
||||
function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
{
|
||||
$iResult=($iHours*3600)+($iMinutes*60)+$iSeconds;
|
||||
return $iResult;
|
||||
@ -198,7 +198,7 @@ function ConvertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
* @return sTime Formated text of duration
|
||||
* Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00
|
||||
*/
|
||||
function ConvertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOfWeek=7)
|
||||
function convertSecondToTime($iSecond,$format='all',$lengthOfDay=86400,$lengthOfWeek=7)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
|
||||
@ -320,7 +320,7 @@ function PLinesb(&$inc, $parent, $lines, &$level, &$projectsrole, &$tasksrole, $
|
||||
|
||||
// Time spent
|
||||
print '<td align="right">';
|
||||
if ($lines[$i]->duration) print ConvertSecondToTime($lines[$i]->duration,'all');
|
||||
if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'all');
|
||||
else print '--:--';
|
||||
print "</td>\n";
|
||||
|
||||
@ -489,7 +489,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
|
||||
print '<td align="right">';
|
||||
if ($showlineingray) print '<i>';
|
||||
else print '<a href="'.DOL_URL_ROOT.'/projet/tasks/time.php?id='.$lines[$i]->id.'">';
|
||||
if ($lines[$i]->duration) print ConvertSecondToTime($lines[$i]->duration,'all');
|
||||
if ($lines[$i]->duration) print convertSecondToTime($lines[$i]->duration,'all');
|
||||
else print '--:--';
|
||||
if ($showlineingray) print '</i>';
|
||||
else print '</a>';
|
||||
@ -517,7 +517,7 @@ function PLines(&$inc, $parent, &$lines, &$level, $var, $showproject, &$taskrole
|
||||
if ($showproject) print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.ConvertSecondToTime($total).'</td></tr>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.convertSecondToTime($total).'</td></tr>';
|
||||
}
|
||||
|
||||
return $inc;
|
||||
|
||||
@ -59,9 +59,9 @@ function build_calfile($format,$title,$desc,$events_array,$outputfile)
|
||||
fwrite($calfileh,"CALSCALE:GREGORIAN\n");
|
||||
fwrite($calfileh,"X-WR-CALNAME:".$encoding.format_cal($format,$title)."\n");
|
||||
fwrite($calfileh,"X-WR-CALDESC:".$encoding.format_cal($format,$desc)."\n");
|
||||
$hh=ConvertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
|
||||
$mm=ConvertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
|
||||
$ss=ConvertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
|
||||
$hh=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'hour');
|
||||
$mm=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'min');
|
||||
$ss=convertSecondToTime($conf->global->MAIN_AGENDA_EXPORT_CACHE,'sec');
|
||||
//fwrite($calfileh,"X-WR-TIMEZONE:Europe/Paris\n");
|
||||
if (! empty($conf->global->MAIN_AGENDA_EXPORT_CACHE)
|
||||
&& $conf->global->MAIN_AGENDA_EXPORT_CACHE > 60) fwrite($calfileh,"X-PUBLISHED-TTL: P".$hh."H".$mm."M".$ss."S\n");
|
||||
|
||||
@ -196,7 +196,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$text=$object->description;
|
||||
if ($object->duree > 0)
|
||||
{
|
||||
$totaltime=ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||
}
|
||||
$desc=dol_htmlentitiesbr($text,1);
|
||||
@ -222,7 +222,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$curY = $nexY;
|
||||
|
||||
$pdf->SetXY($this->marge_gauche, $curY);
|
||||
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".ConvertSecondToTime($objectligne->duration),1,$outputlangs->charset_output);
|
||||
$txt=dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output);
|
||||
$pdf->writeHTMLCell(0, 3, $this->marge_gauche, $curY, $txt, 0, 1, 0);
|
||||
$nexY = $pdf->GetY();
|
||||
|
||||
@ -356,7 +356,7 @@ class pdf_soleil extends ModelePDFFicheinter
|
||||
$text=$object->description;
|
||||
if ($object->duree > 0)
|
||||
{
|
||||
$totaltime=ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY);
|
||||
$text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime;
|
||||
}
|
||||
$desc=dol_htmlentitiesbr($text,1);
|
||||
|
||||
@ -255,7 +255,7 @@ if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
|
||||
$desc=$_POST['np_desc'];
|
||||
$date_intervention = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
|
||||
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
|
||||
$duration = convertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
|
||||
|
||||
$result=$object->addline(
|
||||
$id,
|
||||
@ -328,7 +328,7 @@ if ($action == 'updateline' && $user->rights->ficheinter->creer && $_POST["save"
|
||||
|
||||
$desc = $_POST['np_desc'];
|
||||
$date_inter = dol_mktime($_POST["dihour"], $_POST["dimin"], 0, $_POST["dimonth"], $_POST["diday"], $_POST["diyear"]);
|
||||
$duration = ConvertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
|
||||
$duration = convertTime2Seconds($_POST['durationhour'],$_POST['durationmin']);
|
||||
|
||||
$objectline->datei = $date_inter;
|
||||
$objectline->desc = $desc;
|
||||
@ -812,7 +812,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
|
||||
// Duration
|
||||
print '<tr><td>'.$langs->trans("TotalDuration").'</td>';
|
||||
print '<td>'.ConvertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||
print '<td>'.convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Description (must be a textarea and not html must be allowed (used in list view)
|
||||
@ -919,7 +919,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
print '<td align="center" width="150">'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'</td>';
|
||||
|
||||
// Duration
|
||||
print '<td align="right" width="150">'.ConvertSecondToTime($objp->duree).'</td>';
|
||||
print '<td align="right" width="150">'.convertSecondToTime($objp->duree).'</td>';
|
||||
|
||||
print "</td>\n";
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ if ($result)
|
||||
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->description,20)).'</td>';
|
||||
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'dayhour')."</td>\n";
|
||||
print '<td align="right">'.ConvertSecondToTime($objp->duree).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($objp->duree).'</td>';
|
||||
print '<td align="right">'.$interventionstatic->LibStatut($objp->fk_statut,5).'</td>';
|
||||
|
||||
print "</tr>\n";
|
||||
@ -157,7 +157,7 @@ if ($result)
|
||||
$i++;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.ConvertSecondToTime($total).'</td><td> </td>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.convertSecondToTime($total).'</td><td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -105,7 +105,7 @@ if ( $resql )
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
@ -118,7 +118,7 @@ else
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
@ -160,7 +160,7 @@ if ( $resql )
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
@ -173,7 +173,7 @@ else
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table>";
|
||||
|
||||
@ -220,7 +220,7 @@ if ( $resql )
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$total += $row->nb;
|
||||
}
|
||||
@ -233,7 +233,7 @@ else
|
||||
}
|
||||
print '<tr class="liste_total">';
|
||||
print '<td>'.$langs->trans('Total').'</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($total).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($total).'</td>';
|
||||
print "</tr>\n";
|
||||
print "</table><br>";
|
||||
|
||||
@ -271,7 +271,7 @@ if ( $resql )
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
}
|
||||
@ -314,7 +314,7 @@ if ( $resql )
|
||||
$projectstatic->ref=$row->ref;
|
||||
print $projectstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print '<td align="right">'.ConvertSecondToTime($row->nb).'</td>';
|
||||
print '<td align="right">'.convertSecondToTime($row->nb).'</td>';
|
||||
print "</tr>\n";
|
||||
$var=!$var;
|
||||
}
|
||||
@ -328,7 +328,7 @@ print "</table>";
|
||||
|
||||
print '</td></tr></table>';
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter();
|
||||
|
||||
$db->close();
|
||||
?>
|
||||
|
||||
@ -306,7 +306,7 @@ if ($_GET["id"] > 0)
|
||||
print '<td align="right">'.$langs->trans("Duration").'</td>';
|
||||
print '<td> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$total = 0;
|
||||
foreach ($tasks as $task_time)
|
||||
{
|
||||
@ -361,7 +361,7 @@ if ($_GET["id"] > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
print ConvertSecondToTime($task_time->task_duration,'all');
|
||||
print convertSecondToTime($task_time->task_duration,'all');
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
@ -392,9 +392,9 @@ if ($_GET["id"] > 0)
|
||||
$total += $task_time->task_duration;
|
||||
}
|
||||
print '<tr class="liste_total"><td colspan="3" class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.ConvertSecondToTime($total).'</td><td> </td>';
|
||||
print '<td align="right" nowrap="nowrap" class="liste_total">'.convertSecondToTime($total).'</td><td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print "</table>";
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$result=ConvertTime2Seconds(1,1,2);
|
||||
$result=convertTime2Seconds(1,1,2);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals(3662,$result);
|
||||
|
||||
@ -140,11 +140,11 @@ class DateLibTest extends PHPUnit_Framework_TestCase
|
||||
$langs=$this->savlangs;
|
||||
$db=$this->savdb;
|
||||
|
||||
$result=ConvertSecondToTime(0,'all',86400);
|
||||
$result=convertSecondToTime(0,'all',86400);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals('0',$result);
|
||||
|
||||
$result=ConvertSecondToTime(86400,'all',86400);
|
||||
$result=convertSecondToTime(86400,'all',86400);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertSame('1 '.$langs->trans("Day"),$result);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user