Rewrite working board to prepare new features
This commit is contained in:
parent
0b69d0143b
commit
c3d4df2b72
@ -364,18 +364,6 @@ $showweather=empty($conf->global->MAIN_DISABLE_METEO)?1:0;
|
|||||||
//Array that contains all WorkboardResponse classes to process them
|
//Array that contains all WorkboardResponse classes to process them
|
||||||
$dashboardlines=array();
|
$dashboardlines=array();
|
||||||
|
|
||||||
$boxwork='';
|
|
||||||
$boxwork.='<div class="box">';
|
|
||||||
$boxwork.='<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable" width="100%">'."\n";
|
|
||||||
$boxwork.='<tr class="liste_titre">';
|
|
||||||
$boxwork.='<th class="liste_titre" colspan="2">'.$langs->trans("DolibarrWorkBoard").'</th>';
|
|
||||||
$boxwork.='<th class="liste_titre" align="right">'.$langs->trans("Number").'</th>';
|
|
||||||
$boxwork.='<th class="liste_titre" align="right">'.$form->textwithpicto($langs->trans("Late"),$langs->trans("LateDesc")).'</th>';
|
|
||||||
$boxwork.='<th class="liste_titre"> </th>';
|
|
||||||
//print '<th class="liste_titre" width="20"> </th>';
|
|
||||||
if ($showweather) $boxwork.='<th class="liste_titre hideonsmartphone" width="80"> </th>';
|
|
||||||
$boxwork.='</tr>'."\n";
|
|
||||||
|
|
||||||
// Do not include sections without management permission
|
// Do not include sections without management permission
|
||||||
require DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
|
require DOL_DOCUMENT_ROOT.'/core/class/workboardresponse.class.php';
|
||||||
|
|
||||||
@ -531,27 +519,64 @@ foreach($valid_dashboardlines as $board)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$boxwork='';
|
||||||
|
$boxwork.='<div class="box">';
|
||||||
|
$boxwork.='<table summary="'.dol_escape_htmltag($langs->trans("WorkingBoard")).'" class="noborder boxtable" width="100%">'."\n";
|
||||||
|
$boxwork.='<tr class="liste_titre">';
|
||||||
|
$boxwork.='<th class="liste_titre">'.$langs->trans("DolibarrWorkBoard").'</th>';
|
||||||
|
$boxwork.='<th class="liste_titre" align="right">'.$langs->trans("Number").'</th>';
|
||||||
|
$boxwork.='<th class="liste_titre" align="right">'.$form->textwithpicto($langs->trans("Late"),$langs->trans("LateDesc")).'</th>';
|
||||||
|
$boxwork.='<th class="liste_titre" style="width: 22px"> </th>';
|
||||||
|
//print '<th class="liste_titre" width="20"> </th>';
|
||||||
|
//if ($showweather) $boxwork.='<th class="liste_titre hideonsmartphone" width="80"> </th>';
|
||||||
|
$boxwork.='</tr>'."\n";
|
||||||
|
|
||||||
|
if ($showweather)
|
||||||
|
{
|
||||||
|
$var=!$var;
|
||||||
|
$boxwork.='<tr '.$bc[$var].'>';
|
||||||
|
$boxwork.='<td colspan="4" class="nohover hideonsmartphone center valignmiddle">';
|
||||||
|
//$boxwork.=$langs->trans("Meteo");
|
||||||
|
//$boxwork.='</td><td colspan="2" class="nohover center">';
|
||||||
|
$text='';
|
||||||
|
if ($totallate > 0) $text=$langs->transnoentitiesnoconv("WarningYouHaveAtLeastOneTaskLate").' ('.$langs->transnoentitiesnoconv("NActionsLate",$totallate).')';
|
||||||
|
$options='height="64px"';
|
||||||
|
if ($rowspan <= 2) $options='height="24"'; // Weather logo is smaller if dashboard has few elements
|
||||||
|
else if ($rowspan <= 3) $options='height="48"'; // Weather logo is smaller if dashboard has few elements
|
||||||
|
$boxwork.=showWeather($totallate,$text,$options);
|
||||||
|
$boxwork.='</td>';
|
||||||
|
/*$boxwork.='<td align="left" colspan="3" class="nohover">';
|
||||||
|
if ($board->nbtodolate > 0) $boxwork.=img_picto($textlate,"warning");
|
||||||
|
else $boxwork.=' ';
|
||||||
|
$boxwork.='</td>';*/
|
||||||
|
$boxwork.='</tr>';
|
||||||
|
$showweather=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Show dashboard
|
// Show dashboard
|
||||||
foreach($valid_dashboardlines as $board)
|
foreach($valid_dashboardlines as $board)
|
||||||
{
|
{
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
$boxwork.= '<tr '.$bc[$var].'><td width="16">'.$board->img.'</td><td>'.$board->label.'</td>';
|
$boxwork.= '<tr '.$bc[$var].'><td class="nowrap">'.$board->img.' '.$board->label.'</td>';
|
||||||
$boxwork.= '<td align="right"><a class="dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator">'.$board->nbtodo.'</span></a></td>';
|
$boxwork.= '<td align="right"><a class="dashboardlineindicator" href="'.$board->url.'"><span class="dashboardlineindicator">'.$board->nbtodo.'</span></a></td>';
|
||||||
$boxwork.= '<td align="right">';
|
$boxwork.= '<td align="right">';
|
||||||
$textlate = $langs->trans("NActionsLate",$board->nbtodolate);
|
$textlate = $langs->trans("NActionsLate",$board->nbtodolate);
|
||||||
$textlate .= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
|
$textlate.= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
|
||||||
$boxwork.= '<a title="'.dol_escape_htmltag($textlate).'" class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late ).'"><span class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'">';
|
$boxwork.= '<a title="'.dol_escape_htmltag($textlate).'" class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'" href="'.((!$board->url_late) ? $board->url : $board->url_late ).'">';
|
||||||
|
$boxwork.= '<span class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'">';
|
||||||
$boxwork.= $board->nbtodolate;
|
$boxwork.= $board->nbtodolate;
|
||||||
$boxwork.= '</span></a>';
|
$boxwork.= '</span>';
|
||||||
|
$boxwork.= '</a>';
|
||||||
$boxwork.='</td>';
|
$boxwork.='</td>';
|
||||||
$boxwork.='<td align="left">';
|
$boxwork.='<td>';
|
||||||
if ($board->nbtodolate > 0) $boxwork.=img_picto($textlate,"warning");
|
if ($board->nbtodolate > 0) $boxwork.=img_picto($textlate, "warning", 'class="valignmiddle"').' ';
|
||||||
else $boxwork.=' ';
|
|
||||||
$boxwork.='</td>';
|
$boxwork.='</td>';
|
||||||
/*print '<td class="nowrap" align="right">';
|
/*print '<td class="nowrap" align="right">';
|
||||||
print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
|
print ' (>'.ceil($board->warning_delay).' '.$langs->trans("days").')';
|
||||||
print '</td>';*/
|
print '</td>';*/
|
||||||
|
/*
|
||||||
if ($showweather)
|
if ($showweather)
|
||||||
{
|
{
|
||||||
$boxwork.='<td class="nohover hideonsmartphone noborderbottom" rowspan="'.$rowspan.'" width="80" style="border-left: 1px solid #DDDDDD" align="center">';
|
$boxwork.='<td class="nohover hideonsmartphone noborderbottom" rowspan="'.$rowspan.'" width="80" style="border-left: 1px solid #DDDDDD" align="center">';
|
||||||
@ -563,7 +588,7 @@ foreach($valid_dashboardlines as $board)
|
|||||||
$boxwork.=showWeather($totallate,$text,$options);
|
$boxwork.=showWeather($totallate,$text,$options);
|
||||||
$boxwork.='</td>';
|
$boxwork.='</td>';
|
||||||
$showweather=0;
|
$showweather=0;
|
||||||
}
|
}*/
|
||||||
$boxwork.='</tr>';
|
$boxwork.='</tr>';
|
||||||
$boxwork.="\n";
|
$boxwork.="\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user