top dashboard info first result

This commit is contained in:
John Botella 2019-08-01 15:18:42 +02:00
parent 9b84987cc1
commit 40ac24fc26
2 changed files with 91 additions and 18 deletions

View File

@ -684,6 +684,7 @@ $boxwork.='</tr>'."\n";
// Show dashboard
$nbworkboardempty=0;
$isIntopOpenedDashBoard = array();
if (! empty($valid_dashboardlines))
{
$openedDashBoard = '';
@ -698,6 +699,7 @@ if (! empty($valid_dashboardlines))
if(!empty($valid_dashboardlines[$infoKey]))
{
$boards[] = $valid_dashboardlines[$infoKey];
$isIntopOpenedDashBoard[]=$infoKey;
}
}
@ -719,12 +721,21 @@ if (! empty($valid_dashboardlines))
$textLateTitle = $langs->trans("NActionsLate", $board->nbtodolate);
$textLateTitle.= ' ('.$langs->trans("Late").' = '.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($board->warning_delay) >= 0 ? '+' : '').ceil($board->warning_delay).' '.$langs->trans("days").')';
$textLate = img_picto($textLateTitle, "warning_white", 'class="inline-block hideonsmartphone valigntextbottom"').'';
$textLate .= '<span class="dashboardlineindicatorlate'.($board->nbtodolate>0?' dashboardlineko':' dashboardlineok').'">';
$textLate .= $board->nbtodolate;
$textLate .= '</span>';
$textLate = '';
if($board->nbtodolate>0)
{
$textLate .= ' <span title="'.dol_htmlentities($textLateTitle).'" class="classfortooltip badge badge-danger">';
$textLate .= '<i class="fa fa-exclamation-triangle"></i> '.$board->nbtodolate;
$textLate .= '</span>';
}
$openedDashBoard .= ' <span class="info-box-text">'.$infoName.' : <span class="label label-default">'.$board->nbtodo.'</span>'.$textLate.'</span>' . "\n";
$nbtodClass = '';
if($board->nbtodo>0){
$nbtodClass = 'badge badge-info';
}
$openedDashBoard .= ' <span class="info-box-text">'.$infoName.' : <span class="'.$nbtodClass.'">'.$board->nbtodo.'</span>'.$textLate.'</span>' . "\n";
}
@ -736,10 +747,17 @@ if (! empty($valid_dashboardlines))
}
$nbworkboardcount=0;
foreach($valid_dashboardlines as $infoKey => $board)
{
if (empty($board->nbtodo)) $nbworkboardempty++;
if(in_array($infoKey, $isIntopOpenedDashBoard)){
// skip if info is present on top
continue;
}
if (empty($board->nbtodo)) $nbworkboardempty++;
$nbworkboardcount++;
@ -820,8 +838,11 @@ print '<div class="fichecenter fichecenterbis">';
$boxlist.='<div class="twocolumns">';
$boxlist.='<div class="firstcolumn fichehalfleft boxhalfleft" id="boxhalfleft">';
if(!empty($nbworkboardcount))
{
$boxlist.=$boxwork;
}
$boxlist.=$boxwork;
$boxlist.=$resultboxes['boxlista'];
$boxlist.= '</div>';

View File

@ -59,7 +59,7 @@ if (! defined('ISLOADEDBYSTEELSHEET'))  die('Must be call by steelsheet'); ?>
.progress-description,
.info-box-text {
display: block;
font-size: 14px;
font-size: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@ -74,25 +74,77 @@ if (! defined('ISLOADEDBYSTEELSHEET'))  die('Must be call by steelsheet'); ?>
margin: 0;
}
/* ICONS */
.info-box-icon {
color: #fff !important;
}
.bg-infoxbox-action{
background-color: #d81b60 !important;
}
.fa-dol-action:before {
content: "\f073";
}
.bg-infoxbox-project{
background-color: #605ca8 !important;
}
.fa-dol-project:before {
content: "\f0e8";
.bg-infoxbox-action{
background-color: #d81b60 !important;
}
.bg-infoxbox-propal,
.bg-infoxbox-facture,
.bg-infoxbox-commande{
background-color: #dd4b39 !important;
}
.bg-infoxbox-supplier_proposal,
.bg-infoxbox-invoice_supplier,
.bg-infoxbox-order_supplier{
background-color: #00c0ef !important;
}
.bg-infoxbox-contrat{
background-color: #00a65a !important;
}
.bg-infoxbox-bank_account{
background-color: #f39c12 !important;
}
.bg-infoxbox-adherent{
//background-color: #f39c12 !important;
}
.bg-infoxbox-expensereport{
background-color: #a55114 !important;
}
.bg-infoxbox-holiday{
background-color: #cbd81b !important;
}
.fa-dol-action:before {
content: "\f073";
}
.fa-dol-propal:before,
.fa-dol-supplier_proposal:before {
content: "\f2b5";
}
.fa-dol-facture:before,
.fa-dol-invoice_supplier:before {
content: "\f571";
}
.fa-dol-project:before {
content: "\f0e8";
}
.fa-dol-commande:before,
.fa-dol-order_supplier:before {
content: "\f570";
}
.fa-dol-contrat:before {
content: "\f1e6";
}
.fa-dol-bank_account:before {
content: "\f19c";
}
.fa-dol-adherent:before {
content: "\f0c0";
}
.fa-dol-expensereport:before {
content: "\f555";
}
.fa-dol-holiday:before {
content: "\f5ca";
}