diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index dc894663e4c..12825d9a780 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2315,6 +2315,7 @@ class Adherent extends CommonObject $response = new WorkboardResponse(); $response->warning_delay=$conf->adherent->subscription->warning_delay/60/60/24; $response->label=$langs->trans("MembersWithSubscriptionToReceive"); + $response->labelShort=$langs->trans("MembersWithSubscriptionToReceiveShort"); $response->url=DOL_URL_ROOT.'/adherents/list.php?mainmenu=members&statut=1&filter=outofdate'; $response->img=img_object('', "user"); diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 6e4e3fb941b..79ae09c1678 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1103,6 +1103,7 @@ class ActionComm extends CommonObject $response = new WorkboardResponse(); $response->warning_delay = $conf->agenda->warning_delay/60/60/24; $response->label = $langs->trans("ActionsToDo"); + $response->labelShort = $langs->trans("ActionsToDoShort"); $response->url = DOL_URL_ROOT.'/comm/action/list.php?actioncode=0&status=todo&mainmenu=agenda'; if ($user->rights->agenda->allactions->read) $response->url.='&filtert=-1'; $response->img = img_object('', "action", 'class="inline-block valigntextmiddle"'); diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index a4ff5cec29a..f1a6d4eb466 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3268,21 +3268,24 @@ class Propal extends CommonObject $delay_warning = 0; $statut = 0; - $label = ''; + $label = $labelShort = ''; if ($mode == 'opened') { $delay_warning=$conf->propal->cloture->warning_delay; $statut = self::STATUS_VALIDATED; $label = $langs->trans("PropalsToClose"); + $labelShort = $langs->trans("ToClose"); } if ($mode == 'signed') { $delay_warning=$conf->propal->facturation->warning_delay; $statut = self::STATUS_SIGNED; $label = $langs->trans("PropalsToBill"); // We set here bill but may be billed or ordered + $labelShort = $langs->trans("ToBill"); } $response = new WorkboardResponse(); $response->warning_delay = $delay_warning/60/60/24; $response->label = $label; + $response->labelShort = $labelShort; $response->url = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals'; $response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?viewstatut='.$statut.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc'; $response->img = img_object('', "propal"); diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 01f41b7cdbc..f9662a562f2 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3412,6 +3412,7 @@ class Commande extends CommonOrder $response = new WorkboardResponse(); $response->warning_delay=$conf->commande->client->warning_delay/60/60/24; $response->label=$langs->trans("OrdersToProcess"); + $response->labelShort = $langs->trans("ToProcess"); $response->url=DOL_URL_ROOT.'/commande/list.php?viewstatut=-3&mainmenu=commercial&leftmenu=orders'; $response->img=img_object('', "order"); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 1b9cc3db566..33de9d47e18 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3924,6 +3924,7 @@ class Facture extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->client->warning_delay/60/60/24; $response->label=$langs->trans("CustomerBillsUnpaid"); + $response->labelShort=$langs->trans("Unpaid"); $response->url=DOL_URL_ROOT.'/compta/facture/list.php?search_status=1&mainmenu=billing&leftmenu=customers_bills'; $response->img=img_object('', "bill"); diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index e6e9b7f2e4d..0a2c59ece2c 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2186,23 +2186,27 @@ class Contrat extends CommonObject if ($mode == 'inactive') { $warning_delay = $conf->contrat->services->inactifs->warning_delay; $label = $langs->trans("BoardNotActivatedServices"); + $labelShort = $langs->trans("BoardNotActivatedServicesShort"); $url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=0&sortfield=cd.date_fin_validite&sortorder=asc'; } elseif ($mode == 'expired') { $warning_delay = $conf->contrat->services->expires->warning_delay; $url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&filter=expired&sortfield=cd.date_fin_validite&sortorder=asc'; $label = $langs->trans("BoardExpiredServices"); + $labelShort = $langs->trans("BoardExpiredServicesShort"); } else { $warning_delay = $conf->contrat->services->expires->warning_delay; $url = DOL_URL_ROOT.'/contrat/services_list.php?mainmenu=commercial&leftmenu=contracts&mode=4&sortfield=cd.date_fin_validite&sortorder=asc'; //$url.= '&op2day='.$arraydatetouse['mday'].'&op2month='.$arraydatetouse['mon'].'&op2year='.$arraydatetouse['year']; //if ($warning_delay >= 0) $url.='&filter=expired'; $label = $langs->trans("BoardRunningServices"); + $labelShort = $langs->trans("BoardRunningServicesShort"); } $response = new WorkboardResponse(); $response->warning_delay = $warning_delay/60/60/24; $response->label = $label; + $response->labelShort = $labelShort; $response->url = $url; $response->img = img_object('', "contract"); diff --git a/htdocs/core/class/workboardresponse.class.php b/htdocs/core/class/workboardresponse.class.php index 35449693599..3af5feaecbc 100644 --- a/htdocs/core/class/workboardresponse.class.php +++ b/htdocs/core/class/workboardresponse.class.php @@ -37,6 +37,18 @@ class WorkboardResponse */ public $label; + /** + * Short Label of the warning + * @var string + */ + public $labelShort; + + /** + * infoKey of the warning + * @var string + */ + public $infoKey = 'todo'; + /** * URL to list to do items * @var string diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ae63a132965..9b1a62ed402 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2333,12 +2333,14 @@ class ExpenseReport extends CommonObject { $response->warning_delay=$conf->expensereport->approve->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToApprove"); + $response->labelShort=$langs->trans("ToApprove"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=2'; } else { $response->warning_delay=$conf->expensereport->payment->warning_delay/60/60/24; $response->label=$langs->trans("ExpenseReportsToPay"); + $response->labelShort=$langs->trans("ToPay"); $response->url=DOL_URL_ROOT.'/expensereport/list.php?mainmenu=hrm&statut=5'; } $response->img=img_object('', "trip"); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 9d5bfce0189..a77206d5f42 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2835,6 +2835,7 @@ class CommandeFournisseur extends CommonOrder $response = new WorkboardResponse(); $response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SuppliersOrdersToProcess"); + $response->labelShort=$langs->trans("ToProcess"); $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3&mainmenu=commercial&leftmenu=orders_suppliers'; $response->img=img_object('', "order"); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index fd1b98208aa..b1c623bb0f0 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -2203,6 +2203,7 @@ class FactureFournisseur extends CommonInvoice $response = new WorkboardResponse(); $response->warning_delay=$conf->facture->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SupplierBillsToPay"); + $response->labelShort=$langs->trans("ToPay"); $response->url=DOL_URL_ROOT.'/fourn/facture/list.php?search_status=1&mainmenu=billing&leftmenu=suppliers_bills'; $response->img=img_object($langs->trans("Bills"), "bill"); diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 0245073a060..66c212ef4c7 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -2228,6 +2228,7 @@ class Holiday extends CommonObject $response = new WorkboardResponse(); $response->warning_delay=$conf->holiday->approve->warning_delay/60/60/24; $response->label=$langs->trans("HolidaysToApprove"); + $response->labelShort=$langs->trans("ToApprove"); $response->url=DOL_URL_ROOT.'/holiday/list.php?search_statut=2&mainmenu=hrm&leftmenu=holiday'; $response->img=img_object('', "holiday"); diff --git a/htdocs/index.php b/htdocs/index.php index d6ce8c90067..b7eebe24063 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -100,7 +100,7 @@ if (! empty($conf->global->MAIN_MOTD)) } -print '
';
- foreach($valid_dashboardlines as $board)
+ foreach($dashboardgroup as $groupKey => $groupElement) {
+ $boards = array();
+
+ if(!empty($conf->global->MAIN_DISPLAY_NEW_OPENED_DASH_BOARD) || !empty($conf->global->MAIN_FEATURES_LEVEL))
+ {
+ foreach ($groupElement['stats'] as $infoKey)
+ {
+ if(!empty($valid_dashboardlines[$infoKey]))
+ {
+ $boards[] = $valid_dashboardlines[$infoKey];
+ $isIntopOpenedDashBoard[]=$infoKey;
+ }
+ }
+ }
+
+ if(!empty($boards))
+ {
+ $groupName = $langs->trans($groupElement['groupName']);
+ $groupKeyLowerCase = strtolower($groupKey);
+
+ $openedDashBoard.= ' '."\n";
+ $openedDashBoard.= ' '."\n";
+ $openedDashBoard.="\n";
+ }
+ }
+
+ if ($showweather && !empty($isIntopOpenedDashBoard))
+ {
+ $appendClass = $conf->global->MAIN_DISABLE_METEO == 2 ?' hideonsmartphone' : '';
+ $weather = getWeatherStatus($totallate);
+
+ $text='';
+ 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");
+
+
+
+ $weatherDashBoard= ''."\n";
+ $openedDashBoard.= ' '."\n";
+ $openedDashBoard.= ' '."\n";
+ $openedDashBoard.= ''."\n";
+
+ $openedDashBoard .= ' '.$groupName.'' . "\n";
+
+ foreach($boards as $board) {
+ if(!empty($board->labelShort)){
+ $infoName = ''.$board->labelShort.'';
+ }
+ else{
+ $infoName = $board->label ;
+ }
+
+ $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 = '';
+ if($board->nbtodolate>0)
+ {
+ $textLate .= ' ';
+ $textLate .= ' '.$board->nbtodolate;
+ $textLate .= '';
+ }
+
+ $nbtodClass = '';
+ if($board->nbtodo>0){
+ $nbtodClass = 'badge badge-info';
+ }
+
+ $openedDashBoard .= ' '.$infoName.' : '.$board->nbtodo.''.$textLate.'' . "\n";
+
+ if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)){
+ $openedDashBoard .= ''.$langs->trans('Total').' : '.price($board->total) .'';
+ }
+ }
+
+ $openedDashBoard.= ' '."\n";
+ $openedDashBoard.= ' '."\n";
+ $weatherDashBoard.= ' '."\n";
+ $weatherDashBoard.="\n";
+
+ $openedDashBoard=$weatherDashBoard.$openedDashBoard;
+ }
+
+ if(!empty($isIntopOpenedDashBoard))
+ {
+ for ($i = 1; $i <= 10; $i++) {
+ $openedDashBoard .= '';
+ }
+ }
+
+ $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;
+ }
- $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").')';
+ if (empty($board->nbtodo)) $nbworkboardempty++;
+ $nbworkboardcount++;
- $boxwork .=''."\n";
+ $weatherDashBoard.= ' '."\n";
+ $weatherDashBoard.= ' '."\n";
+ $weatherDashBoard.= ''."\n";
+ $weatherDashBoard.= ' '.$langs->trans('GlobalOpenedElemView').'' . "\n";
+
+ if($totallatePercentage>0 && !empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)){
+ $weatherDashBoard.= ' '.$langs->transnoentitiesnoconv("NActionsLate", price($totallatePercentage).'%').'' . "\n";
+ $weatherDashBoard.= ' '.$langs->trans('NActionsLate', $totalLateNumber).'' . "\n";
+ }
+ else{
+ $weatherDashBoard.= ' '.$langs->transnoentitiesnoconv("NActionsLate", $totalLateNumber).'' . "\n";
+ if($totallatePercentage>0){
+ $weatherDashBoard.= ' '.$langs->trans('NActionsLate', price($totallatePercentage).'%').'' . "\n";
+ }
+ }
+
+ $weatherDashBoard.= ' '."\n";
+ $weatherDashBoard.= ' ';
+
+ $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").')';
+
+
+ $boxwork .=' ';
$boxwork .= ' ';
$sep=($conf->dol_use_jmobile?' ':' '); $boxwork .= ''.$board->img.' '.$board->label.' '; $boxwork .= ''.$board->nbtodo.''; - if ($board->total > 0 && ! empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) + if ($board->total > 0 && !empty($conf->global->MAIN_WORKBOARD_SHOW_TOTAL_WO_TAX)) { $boxwork .= ' / '.price($board->total) .''; } @@ -636,7 +862,14 @@ $boxwork.=' |