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 '