diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 6a6474c8306..719a79dcd1c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4097,7 +4097,7 @@ class Form * Function to show a form to select a duration on a page * * @param string $prefix Prefix for input fields - * @param int $iSecond Default preselected duration (number of seconds) + * @param int $iSecond Default preselected duration (number of seconds or '') * @param int $disabled Disable the combo box * @param string $typehour If 'select' then input hour and input min is a combo, if 'text' input hour is in text and input min is a combo * @param string $minunderhours If 1, show minutes selection under the hours @@ -4112,7 +4112,7 @@ class Form $hourSelected=0; $minSelected=0; - if ($iSecond) + if ($iSecond != '') { require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 072db988dc1..777b3633cb5 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -166,7 +166,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0) /** Return, in clear text, value of a number of seconds in days, hours and minutes * * @param int $iSecond Number of seconds - * @param string $format Output format (all: total delay days hour:min like "2 days 12:30"", allhourmin: total delay hours:min like "60:30", allhour: total delay hours without min/sec like "60:30", fullhour: total delay hour decimal like "60.5" for 60:30, hour: only hours part "12", min: only minutes part "30", sec: only seconds part, month: only month part, year: only year part); + * @param string $format Output format ('all': total delay days hour:min like "2 days 12:30"", 'allhourmin': total delay hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part); * @param int $lengthOfDay Length of day (default 86400 seconds for 1 day, 28800 for 8 hour) * @param int $lengthOfWeek Length of week (default 7) * @return string Formated text of duration diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 27f0a5fe63f..27499f65c73 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -352,11 +352,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t print dol_print_date($lines[$i]->date_end,'dayhour'); print ''; + $plannedworkloadoutputformat='allhourmin'; + $timespentoutputformat='allhourmin'; + if (! empty($conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT)) $plannedworkloadoutputformat=$conf->global->PROJECT_PLANNED_WORKLOAD_FORMAT; + if (! empty($conf->global->PROJECT_TIMES_PENT_FORMAT)) $timespentoutputformat=$conf->global->PROJECT_TIME_SPENT_FORMAT; + // Planned Workload (in working hours) print '