From 9642967c1fb291e81fa784ae1a1a1658a52d8ba0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Jan 2016 12:57:24 +0100 Subject: [PATCH] NEW Indicator on workboard are red/green if late or not. --- htdocs/core/class/html.form.class.php | 10 ++++++---- htdocs/core/class/html.formother.class.php | 2 +- htdocs/index.php | 9 +++++---- htdocs/langs/en_US/boxes.lang | 1 + htdocs/langs/en_US/main.lang | 2 ++ htdocs/theme/eldy/style.css.php | 13 ++++++++++++- htdocs/theme/md/style.css.php | 3 ++- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 62ebd0589c0..e081d902b16 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4509,20 +4509,21 @@ class Form * @param string $htmlname Name of html select area. Must start with "multi" if this is a multiselect * @param array $array Array with key+value * @param string|string[] $id Preselected key or preselected keys for multiselect - * @param int $show_empty 0 no empty value allowed, 1 to add an empty value into list (value is '' or ' '), <0 to add an empty value with key that is this value. + * @param int $show_empty 0 no empty value allowed, 1 or string to add an empty value into list (value is '' or ' ' if 1), <0 to add an empty value with key that is this value. * @param int $key_in_label 1 pour afficher la key dans la valeur "[key] value" * @param int $value_as_key 1 to use value as key * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param int $translate Translate and encode value * @param int $maxlen Length maximum for labels * @param int $disabled Html select box is disabled - * @param int $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort + * @param string $sort 'ASC' or 'DESC' = Sort on label, '' or 'NONE' = Do not sort * @param string $morecss Add more class to css styles * @param int $addjscombo Add js combo + * @param string $moreparamonempty Add more param on the empty option line. Not used if show_empty not set. * @return string HTML select string. * @see multiselectarray */ - static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0) + static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_label=0, $value_as_key=0, $moreparam='', $translate=0, $maxlen=0, $disabled=0, $sort='', $morecss='', $addjscombo=0, $moreparamonempty='') { global $conf, $langs; @@ -4558,7 +4559,8 @@ class Form { $textforempty=' '; if (! empty($conf->use_javascript_ajax)) $textforempty=' '; // If we use ajaxcombo, we need   here to avoid to have an empty element that is too small. - $out.=''."\n"; // id is -2 because -1 is already "do not contact" + if (! is_numeric($show_empty)) $textforempty=$show_empty; + $out.=''."\n"; } if (is_array($array)) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 81ff60f885b..ce49b8ccd17 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -1012,7 +1012,7 @@ class FormOther $selectboxlist.=''; $selectboxlist.=''; $selectboxlist.=''; - $selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel,'',1); + $selectboxlist.=Form::selectarray('boxcombo', $arrayboxtoactivatelabel, '', $langs->trans("ChooseBoxToAdd").'...', 0, 0, '', 0, 0, 0, 'ASC', '', 0, ' disabled hidden selected'); if (empty($conf->use_javascript_ajax)) $selectboxlist.=' '; $selectboxlist.=''; } diff --git a/htdocs/index.php b/htdocs/index.php index 810bafe7ed4..1161848e0ef 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -322,7 +322,7 @@ print ''.$langs->trans("DolibarrWorkBoard"). print ''.$langs->trans("Number").''; print ''.$langs->trans("Late").''; print ' '; -print ' '; +//print ' '; if ($showweather) print ' '; print ''."\n"; @@ -469,7 +469,8 @@ foreach($valid_dashboardlines as $board) print ''; //if ($board->nbtodolate > 0) //{ - print ''; + $textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days"); + print ''; print $board->nbtodolate; print ''; //} @@ -478,9 +479,9 @@ foreach($valid_dashboardlines as $board) if ($board->nbtodolate > 0) print img_picto($langs->trans("NActionsLate",$board->nbtodolate).' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')',"warning"); else print ' '; print ''; - print ''; + /*print ''; print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')'; - print ''; + print '';*/ if ($showweather) { print ''; diff --git a/htdocs/langs/en_US/boxes.lang b/htdocs/langs/en_US/boxes.lang index 634b058f6d4..f635789dc1a 100644 --- a/htdocs/langs/en_US/boxes.lang +++ b/htdocs/langs/en_US/boxes.lang @@ -95,3 +95,4 @@ ForCustomersInvoices=Customers invoices ForCustomersOrders=Customers orders ForProposals=Proposals LastXMonthRolling=The last %s month rolling +ChooseBoxToAdd=Choose a box to add \ No newline at end of file diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index eebec1e7f88..7a23657123f 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -230,6 +230,8 @@ Now=Now HourStart=Start hour Date=Date DateAndHour=Date and hour +DateToday=Today's date +DateReference=Reference date DateStart=Date start DateEnd=Date end DateCreation=Creation date diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 651f3b3027e..7a4a4b2a837 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -293,6 +293,10 @@ input.smallpadd { select.flat, form.flat select { font-weight: normal; } +.optiongrey { + opacity: 0.5; +} +select:invalid { color: gray; } input:disabled { background:#ddd; } @@ -2540,10 +2544,17 @@ div.tabBar .noborder { } span.boxstatsindicator { font-size: 110%; - font-weight: bold; + font-weight: normal; } span.dashboardlineindicator, span.dashboardlineindicatorlate { font-size: 120%; + font-weight: normal; +} +span.dashboardlineok { + color: #008800; +} +span.dashboardlineko { + color: #880000; font-weight: bold; } .boxtable { diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 6dcc831ce7e..730b94db899 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2376,13 +2376,14 @@ div.tabBar .noborder { } span.boxstatsindicator { font-size: 110%; - font-weight: bold; + font-weight: normal; } span.dashboardlineindicator, span.dashboardlineindicatorlate { font-size: 120%; font-weight: bold; } + .boxtable { -moz-box-shadow: 3px 3px 4px #f4f4f4; -webkit-box-shadow: 3px 3px 4px #f4f4f4;