diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 112939fa7d5..45a8d5bd5c6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2969,6 +2969,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $picto .= '.png'; } $fullpathpicto = $picto; + $reg=array(); + if (preg_match('/class="([^"]+)"/', $moreatt, $reg)) { + $morecss .= ($morecss ? ' ' : '') . $reg[1]; + $moreatt = str_replace('class="'.$reg[1].'"', '', $moreatt); + } } else { $pictowithoutext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto); @@ -3152,7 +3157,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ return $fullpathpicto; } // tag title is used for tooltip on , tag alt can be used with very simple text on image for blind people - return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup + return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } /** @@ -3180,10 +3185,11 @@ function img_object($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $moreatt Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path + * @param string $morecss More CSS * @return string Return img tag * @see #img_object, #img_picto */ -function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0) +function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0, $morecss = '') { global $conf; @@ -3191,7 +3197,7 @@ function img_weather($titlealt, $picto, $moreatt = '', $pictoisfullpath = 0) $path = DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/weather/'.$picto; - return img_picto($titlealt, $path, $moreatt, 1); + return img_picto($titlealt, $path, $moreatt, 1, 0, 0, '', $morecss); } /** diff --git a/htdocs/index.php b/htdocs/index.php index 9217af0f4c3..bc918ab76f4 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -118,7 +118,9 @@ if (empty($user->societe_id)) $boxstat.='
'; $boxstat.=''; $boxstat.=''; - $boxstat.=''; + $boxstat.=''; $boxstat.=''; $boxstat.='
'.$langs->trans("DolibarrStateBoard").''; + $boxstat.='
'.$langs->trans("DolibarrStateBoard").'
'; + $boxstat.='
'; @@ -530,10 +532,20 @@ $boxwork=''; $boxwork.='
'; $boxwork.=''."\n"; $boxwork.=''; -$boxwork.=''; +$boxwork.=''; $boxwork.=''."\n"; -if ($showweather) +/*if ($showweather) { $boxwork.=''; $boxwork.=''; $boxwork.=''; -} +}*/ // Show dashboard $nbworkboardempty=0; @@ -694,9 +706,10 @@ $db->close(); * @param int $totallate Nb of element late * @param string $text Text to show on logo * @param string $options More parameters on img tag + * @param string $morecss More CSS * @return string Return img tag of weather */ -function showWeather($totallate, $text, $options) +function showWeather($totallate, $text, $options, $morecss = '') { global $conf; @@ -723,10 +736,10 @@ function showWeather($totallate, $text, $options) $level3=$conf->global->{$used_conf.'3'}; } - if ($totallate <= $level0) $out.=img_weather($text, 'weather-clear.png', $options); - elseif ($totallate > $level0 && $totallate <= $level1) $out.=img_weather($text, 'weather-few-clouds.png', $options); - elseif ($totallate > $level1 && $totallate <= $level2) $out.=img_weather($text, 'weather-clouds.png', $options); - elseif ($totallate > $level2 && $totallate <= $level3) $out.=img_weather($text, 'weather-many-clouds.png', $options); - elseif ($totallate > $level3) $out.=img_weather($text, 'weather-storm.png', $options); + if ($totallate <= $level0) $out.=img_weather($text, 'weather-clear.png', $options, 0, $morecss); + elseif ($totallate > $level0 && $totallate <= $level1) $out.=img_weather($text, 'weather-few-clouds.png', $options, 0, $morecss); + elseif ($totallate > $level1 && $totallate <= $level2) $out.=img_weather($text, 'weather-clouds.png', $options, 0, $morecss); + elseif ($totallate > $level2 && $totallate <= $level3) $out.=img_weather($text, 'weather-many-clouds.png', $options, 0, $morecss); + elseif ($totallate > $level3) $out.=img_weather($text, 'weather-storm.png', $options, 0, $morecss); return $out; }
'.$langs->trans("DolibarrWorkBoard").'
'.$langs->trans("DolibarrWorkBoard").'
'; +if ($showweather) +{ + if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate", $totallate.(!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE) ? '%' : '')).')'; + else $text=$langs->transnoentitiesnoconv("NoItemLate"); + $text.='. '.$langs->transnoentitiesnoconv("LateDesc"); + //$text.=$form->textwithpicto('',$langs->trans("LateDesc")); + $options='height="24px" style="float: right"'; + $boxwork.=showWeather($totallate, $text, $options, 'inline-block valignmiddle'); +} +$boxwork.='
'; @@ -546,7 +558,7 @@ if ($showweather) $boxwork.=showWeather($totallate, $text, $options); $boxwork.='