Skip to content

Commit

Permalink
NEW Indicator on workboard are red/green if late or not.
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 18, 2016
1 parent a33d6c1 commit 9642967
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
10 changes: 6 additions & 4 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -4509,20 +4509,21 @@ function select_duration($prefix, $iSecond='', $disabled=0, $typehour='select',
* @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 '&nbsp;'), <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 '&nbsp;' 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;

Expand Down Expand Up @@ -4558,7 +4559,8 @@ static function selectarray($htmlname, $array, $id='', $show_empty=0, $key_in_la
{
$textforempty=' ';
if (! empty($conf->use_javascript_ajax)) $textforempty='&nbsp;'; // If we use ajaxcombo, we need &nbsp; here to avoid to have an empty element that is too small.
$out.='<option value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id==-2?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
if (! is_numeric($show_empty)) $textforempty=$show_empty;
$out.='<option class="optiongrey" '.($moreparamonempty?$moreparamonempty.' ':'').'value="'.($show_empty < 0 ? $show_empty : -1).'"'.($id == $show_empty ?' selected':'').'>'.$textforempty.'</option>'."\n";
}

if (is_array($array))
Expand Down
2 changes: 1 addition & 1 deletion htdocs/core/class/html.formother.class.php
Expand Up @@ -1012,7 +1012,7 @@ static function printBoxesArea($user,$areacode)
$selectboxlist.='<input type="hidden" name="userid" value="'.$user->id.'">';
$selectboxlist.='<input type="hidden" name="areacode" value="'.$areacode.'">';
$selectboxlist.='<input type="hidden" name="boxorder" value="'.$boxorder.'">';
$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.=' <input type="submit" class="button" value="'.$langs->trans("AddBox").'">';
$selectboxlist.='</form>';
}
Expand Down
9 changes: 5 additions & 4 deletions htdocs/index.php
Expand Up @@ -322,7 +322,7 @@
print '<th class="liste_titre" align="right">'.$langs->trans("Number").'</th>';
print '<th class="liste_titre" align="right">'.$langs->trans("Late").'</th>';
print '<th class="liste_titre">&nbsp;</th>';
print '<th class="liste_titre" width="20">&nbsp;</th>';
//print '<th class="liste_titre" width="20">&nbsp;</th>';
if ($showweather) print '<th class="liste_titre hideonsmartphone" width="80">&nbsp;</th>';
print '</tr>'."\n";

Expand Down Expand Up @@ -469,7 +469,8 @@
print '<td align="right">';
//if ($board->nbtodolate > 0)
//{
print '<a class="dashboardlineindicatorlate" href="'.$board->url.'"><span class="dashboardlineindicatorlate">';
$textlate = $langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days");
print '<a title="'.dol_escape_htmltag($textlate).'" class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'" href="'.$board->url.'"><span class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'">';
print $board->nbtodolate;
print '</span></a>';
//}
Expand All @@ -478,9 +479,9 @@
if ($board->nbtodolate > 0) print img_picto($langs->trans("NActionsLate",$board->nbtodolate).' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')',"warning");
else print '&nbsp;';
print '</td>';
print '<td class="nowrap" align="right">';
/*print '<td class="nowrap" align="right">';
print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
print '</td>';
print '</td>';*/
if ($showweather)
{
print '<td class="nohover hideonsmartphone" rowspan="'.$rowspan.'" width="80" style="border-left: 1px solid #DDDDDD" align="center">';
Expand Down
1 change: 1 addition & 0 deletions htdocs/langs/en_US/boxes.lang
Expand Up @@ -95,3 +95,4 @@ ForCustomersInvoices=Customers invoices
ForCustomersOrders=Customers orders
ForProposals=Proposals
LastXMonthRolling=The last %s month rolling
ChooseBoxToAdd=Choose a box to add
2 changes: 2 additions & 0 deletions htdocs/langs/en_US/main.lang
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion htdocs/theme/eldy/style.css.php
Expand Up @@ -293,6 +293,10 @@
select.flat, form.flat select {
font-weight: normal;
}
.optiongrey {
opacity: 0.5;
}
select:invalid { color: gray; }
input:disabled {
background:#ddd;
}
Expand Down Expand Up @@ -2540,10 +2544,17 @@
}
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 {
Expand Down
3 changes: 2 additions & 1 deletion htdocs/theme/md/style.css.php
Expand Up @@ -2376,13 +2376,14 @@
}
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;
Expand Down

0 comments on commit 9642967

Please sign in to comment.