Use colors of status in donut
This commit is contained in:
parent
618f42fc1a
commit
6ce6dc145f
@ -176,11 +176,9 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeD = 0;
|
$SommeD = 0;
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$dataval = array();
|
$dataval = array();
|
||||||
$datalabels = array();
|
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($AdherentType as $key => $adhtype)
|
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['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['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);
|
$dataval['uptodate'][] = array($i, isset($MemberUpToDate[$key]) ? $MemberUpToDate[$key] : 0);
|
||||||
|
|||||||
@ -1091,7 +1091,7 @@ class Mo extends CommonObject
|
|||||||
|
|
||||||
$statusType = 'status'.$status;
|
$statusType = 'status'.$status;
|
||||||
if ($status == self::STATUS_VALIDATED) $statusType = 'status1';
|
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_PRODUCED) $statusType = 'status6';
|
||||||
if ($status == self::STATUS_CANCELED) $statusType = 'status5';
|
if ($status == self::STATUS_CANCELED) $statusType = 'status5';
|
||||||
|
|
||||||
|
|||||||
@ -66,6 +66,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
$sql= "SELECT COUNT(t.rowid) as nb, status";
|
$sql= "SELECT COUNT(t.rowid) as nb, status";
|
||||||
$sql.=" FROM ".MAIN_DB_PREFIX."mrp_mo as t";
|
$sql.=" FROM ".MAIN_DB_PREFIX."mrp_mo as t";
|
||||||
$sql.=" GROUP BY t.status";
|
$sql.=" GROUP BY t.status";
|
||||||
|
$sql.=" ORDER BY t.status ASC";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
@ -74,19 +75,25 @@ if ($conf->use_javascript_ajax)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
$totalnb=0;
|
$totalnb=0;
|
||||||
$dataseries=array();
|
$dataseries = array();
|
||||||
// -1=Canceled, 0=Draft, 1=Validated, (2=Accepted/On process not managed for customer orders), 3=Closed (Sent/Received, billed or not)
|
$colorseries = array();
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/theme_vars.inc.php';
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj)
|
if ($obj)
|
||||||
{
|
|
||||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
|
||||||
{
|
{
|
||||||
$dataseries[$obj->status]=array(0=>$staticmo->LibStatut($obj->status), $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;
|
$totalnb+=$obj->nb;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
@ -101,6 +108,7 @@ if ($conf->use_javascript_ajax)
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
$dolgraph = new DolGraph();
|
$dolgraph = new DolGraph();
|
||||||
$dolgraph->SetData($dataseries);
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->SetDataColor(array_values($coloseries));
|
||||||
$dolgraph->setShowLegend(2);
|
$dolgraph->setShowLegend(2);
|
||||||
$dolgraph->setShowPercent(1);
|
$dolgraph->setShowPercent(1);
|
||||||
$dolgraph->SetType(array('pie'));
|
$dolgraph->SetType(array('pie'));
|
||||||
|
|||||||
@ -621,7 +621,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
|
|
||||||
if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline')))
|
if (in_array($action, array('consumeorproduce', 'consumeandproduceall', 'addconsumeline')))
|
||||||
{
|
{
|
||||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" class="formconsumeproduce">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="confirm_'.$action.'">';
|
print '<input type="hidden" name="action" value="confirm_'.$action.'">';
|
||||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||||
|
|||||||
@ -190,7 +190,7 @@ a.top-menu-dropdown-link {
|
|||||||
|
|
||||||
|
|
||||||
.dropdown-menu .dropdown-header{
|
.dropdown-menu .dropdown-header{
|
||||||
padding: 5px 10px 10px 10px;
|
padding: 8px 8px 8px 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-menu > .user-footer {
|
.dropdown-menu > .user-footer {
|
||||||
|
|||||||
@ -374,6 +374,10 @@ input#onlinepaymenturl, input#directdownloadlink {
|
|||||||
opacity: 0.7;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.formconsumeproduce {
|
||||||
|
background: #f3f3f3;
|
||||||
|
padding: 20px 0px 0px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
div#moretabsList, div#moretabsListaction {
|
div#moretabsList, div#moretabsListaction {
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user