diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 9159438fd87..afa5d6079fc 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -595,7 +595,7 @@ function dol_get_next_week($day, $week, $month, $year) * True or 1 or 'gmt' to compare with GMT date. * Example: dol_get_first_day(1970,1,false) will return -3600 with TZ+1, a dol_print_date on it will return 1970-01-01 00:00:00 * Example: dol_get_first_day(1970,1,true) will return 0 whatever is TZ, a dol_print_date on it will return 1970-01-01 00:00:00 - * @return int|string Date as a timestamp, '' if error + * @return int|'' Date as a timestamp, '' if error */ function dol_get_first_day($year, $month = 1, $gm = false) { @@ -614,7 +614,7 @@ function dol_get_first_day($year, $month = 1, $gm = false) * @param int $month Month * @param bool|int<0,1>|'gmt'|'tzserver'|'tzref'|'tzuser'|'tzuserrel' $gm False or 0 or 'tzserver' = Return date to compare with server TZ, * True or 1 or 'gmt' to compare with GMT date. - * @return int|string Date as a timestamp, '' if error + * @return int|'' Date as a timestamp, '' if error */ function dol_get_last_day($year, $month = 12, $gm = false) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 5f1f9496d5f..0f49eebe26b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3904,7 +3904,7 @@ function dol_getdate($timestamp, $fast = false, $forcetimezone = '') * 'tzuserrel' = local to user TZ taking dst into account at the given date. Use this one to convert date input from user into a GMT date. * 'tz,TimeZone' = use specified timezone * @param int $check 0=No check on parameters (Can use day 32, etc...) - * @return int|string Date as a timestamp, '' if error + * @return int|'' Date as a timestamp, '' if error * @see dol_print_date(), dol_stringtotime(), dol_getdate() */ function dol_mktime($hour, $minute, $second, $month, $day, $year, $gm = 'auto', $check = 1) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 7d03c54a5b6..5ecd7788178 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -178,13 +178,6 @@ if ($id == '' && $ref == '') { exit(); } -if ($dates === '') { - $dates = null; -} -if ($datee === '') { - $datee = null; -} - $mine = GETPOST('mode') == 'mine' ? 1 : 0; //if (! $user->rights->projet->all->lire) $mine=1; // Special for projects @@ -766,10 +759,10 @@ if (!$showdatefilter) { print ''; print ''; print '
'; - print $form->selectDate((int) $dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate($dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate((int) $datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print '
'; print ''; @@ -804,11 +797,10 @@ foreach ($listofreferent as $key => $value) { $name = $langs->trans($value['name']); $qualified = $value['test']; $margin = empty($value['margin']) ? '' : $value['margin']; - if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add') + if ($qualified && $margin) { // If this element must be included into profit calculation ($margin is 'minus' or 'add') if ($margin === 'add') { $tooltiponprofitplus .= ' > '.$name." (+)
\n"; - } - if ($margin === 'minus') { + } elseif ($margin === 'minus') { $tooltiponprofitminus .= ' > '.$name." (-)
\n"; } } @@ -853,7 +845,7 @@ foreach ($listofreferent as $key => $value) { $qualified = $value['test']; $margin = empty($value['margin']) ? 0 : $value['margin']; $project_field = empty($value['project_field']) ? '' : $value['project_field']; - if ($qualified && isset($margin)) { // If this element must be included into profit calculation ($margin is 'minus' or 'add') + if ($qualified) { // If this element must be included into profit summary table ($margin is '', 'minus' or 'add') $element = new $classname($db); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee, !empty($project_field) ? $project_field : 'fk_projet');