From 6ce6dc145f6fe3854cb934a13485ab7eef4db8e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Mar 2020 02:20:31 +0100 Subject: [PATCH] Use colors of status in donut --- htdocs/adherents/index.php | 2 -- htdocs/mrp/class/mo.class.php | 2 +- htdocs/mrp/index.php | 22 +++++++++++++++------- htdocs/mrp/mo_production.php | 2 +- htdocs/theme/eldy/dropdown.inc.php | 2 +- htdocs/theme/eldy/global.inc.php | 4 ++++ 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 542251061d3..029cf868bb0 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -176,11 +176,9 @@ if ($conf->use_javascript_ajax) $SommeD = 0; $total = 0; $dataval = array(); - $datalabels = array(); $i = 0; foreach ($AdherentType as $key => $adhtype) { - $datalabels[] = array($i, $adhtype->getNomUrl(0, dol_size(16))); $dataval['draft'][] = array($i, isset($MemberToValidate[$key]) ? $MemberToValidate[$key] : 0); $dataval['notuptodate'][] = array($i, isset($MembersValidated[$key]) ? $MembersValidated[$key] - (isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0) : 0); $dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index c4024a89c57..c83a0ff1aca 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1091,7 +1091,7 @@ class Mo extends CommonObject $statusType = 'status'.$status; if ($status == self::STATUS_VALIDATED) $statusType = 'status1'; - if ($status == self::STATUS_INPROGRESS) $statusType = 'status3'; + if ($status == self::STATUS_INPROGRESS) $statusType = 'status4'; if ($status == self::STATUS_PRODUCED) $statusType = 'status6'; if ($status == self::STATUS_CANCELED) $statusType = 'status5'; diff --git a/htdocs/mrp/index.php b/htdocs/mrp/index.php index b6e69c9c542..c95eca30770 100644 --- a/htdocs/mrp/index.php +++ b/htdocs/mrp/index.php @@ -66,6 +66,7 @@ if ($conf->use_javascript_ajax) $sql= "SELECT COUNT(t.rowid) as nb, status"; $sql.=" FROM ".MAIN_DB_PREFIX."mrp_mo as t"; $sql.=" GROUP BY t.status"; + $sql.=" ORDER BY t.status ASC"; $resql = $db->query($sql); if ($resql) @@ -74,18 +75,24 @@ if ($conf->use_javascript_ajax) $i = 0; $totalnb=0; - $dataseries=array(); - // -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not) + $dataseries = array(); + $colorseries = array(); + + include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php'; + while ($i < $num) { $obj = $db->fetch_object($resql); if ($obj) { - //if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1)) - { - $dataseries[$obj->status]=array(0=>$staticmo->LibStatut($obj->status), $obj->nb); - $totalnb+=$obj->nb; - } + $dataseries[$obj->status]=array(0=>$staticmo->LibStatut($obj->status), $obj->nb); + if ($obj->status == Mo::STATUS_DRAFT) $coloseries[$obj->status] = '-'.$badgeStatus0; + if ($obj->status == Mo::STATUS_VALIDATED) $coloseries[$obj->status] = $badgeStatus1; + if ($obj->status == Mo::STATUS_INPROGRESS) $coloseries[$obj->status] = $badgeStatus4; + if ($obj->status == Mo::STATUS_PRODUCED) $coloseries[$obj->status] = $badgeStatus6; + if ($obj->status == Mo::STATUS_CANCELED) $coloseries[$obj->status] = '-'.$badgeStatus5; + + $totalnb+=$obj->nb; } $i++; } @@ -101,6 +108,7 @@ if ($conf->use_javascript_ajax) include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php'; $dolgraph = new DolGraph(); $dolgraph->SetData($dataseries); + $dolgraph->SetDataColor(array_values($coloseries)); $dolgraph->setShowLegend(2); $dolgraph->setShowPercent(1); $dolgraph->SetType(array('pie')); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 6cf45bf238b..a065cc922fe 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -621,7 +621,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline'))) { - print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/theme/eldy/dropdown.inc.php b/htdocs/theme/eldy/dropdown.inc.php index 6a0054a3ed8..bfe55597316 100644 --- a/htdocs/theme/eldy/dropdown.inc.php +++ b/htdocs/theme/eldy/dropdown.inc.php @@ -190,7 +190,7 @@ a.top-menu-dropdown-link { .dropdown-menu .dropdown-header{ - padding: 5px 10px 10px 10px; + padding: 8px 8px 8px 8px; } .dropdown-menu > .user-footer { diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index c8cdf0a951a..97458577f59 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -374,6 +374,10 @@ input#onlinepaymenturl, input#directdownloadlink { opacity: 0.7; } +.formconsumeproduce { + background: #f3f3f3; + padding: 20px 0px 0px 0px; +} div#moretabsList, div#moretabsListaction { z-index: 5;