Replace deprecated dol_print_graph with DolGraph
This commit is contained in:
parent
38ef5890dc
commit
9c22b5f335
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
|
||||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -165,12 +165,13 @@ if ($conf->use_javascript_ajax)
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").'</th></tr>';
|
||||||
print '<tr '.$bc[0].'><td align="center" colspan="2">';
|
print '<tr><td align="center" colspan="2">';
|
||||||
|
|
||||||
$SommeA=0;
|
$SommeA=0;
|
||||||
$SommeB=0;
|
$SommeB=0;
|
||||||
$SommeC=0;
|
$SommeC=0;
|
||||||
$SommeD=0;
|
$SommeD=0;
|
||||||
|
$total=0;
|
||||||
$dataval=array();
|
$dataval=array();
|
||||||
$datalabels=array();
|
$datalabels=array();
|
||||||
$i=0;
|
$i=0;
|
||||||
@ -187,14 +188,23 @@ if ($conf->use_javascript_ajax)
|
|||||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
$total = $SommeA + $SommeB + $SommeC + $SommeD;
|
||||||
$dataseries=array();
|
$dataseries=array();
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=>round($SommeB));
|
$dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=>round($SommeC));
|
$dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=>round($SommeD));
|
$dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
||||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=>round($SommeA));
|
$dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA));
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
|
print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
|
||||||
print $SommeA+$SommeB+$SommeC+$SommeD;
|
print $SommeA+$SommeB+$SommeC+$SommeD;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -61,7 +61,6 @@ print '<div class="fichecenter"><div class="fichethirdleft">';
|
|||||||
|
|
||||||
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is useless due to the global search combo
|
||||||
{
|
{
|
||||||
$var=false;
|
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
@ -115,14 +114,13 @@ if ($resql)
|
|||||||
|
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
|
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("Proposals").'</td></tr>'."\n";
|
||||||
$var=true;
|
|
||||||
$listofstatus=array(0,1,2,3,4);
|
$listofstatus=array(0,1,2,3,4);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$propalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0));
|
$dataseries[]=array($propalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$propalstatic->LibStatut($status,0).'</td>';
|
print '<td>'.$propalstatic->LibStatut($status,0).'</td>';
|
||||||
print '<td align="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
|
print '<td align="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
|
||||||
@ -131,9 +129,18 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphthirdparties');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
//if ($totalinprocess != $total)
|
//if ($totalinprocess != $total)
|
||||||
@ -173,10 +180,8 @@ if (! empty($conf->propal->enabled))
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -233,10 +238,8 @@ if ($resql)
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -308,8 +311,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
|||||||
$i = 0;
|
$i = 0;
|
||||||
if ($num > 0)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$var=true;
|
|
||||||
|
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
print '<tr class="liste_titre"><td colspan="5">'.$langs->trans("ProposalsOpened").' <a href="'.DOL_URL_ROOT.'/comm/propal/list.php?viewstatut=1"><span class="badge">'.$num.'</span></a></td></tr>';
|
||||||
|
|
||||||
@ -317,7 +318,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
|||||||
while ($i < $nbofloop)
|
while ($i < $nbofloop)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
@ -402,10 +403,9 @@ if (! empty($conf->propal->enabled))
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
@ -474,10 +474,9 @@ if (! empty($conf->propal->enabled))
|
|||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$var = True;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td width="20%" class="nowrap">';
|
print '<td width="20%" class="nowrap">';
|
||||||
|
|||||||
@ -79,7 +79,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
* Statistics
|
* Statistics
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT count(c.rowid), c.fk_statut, c.facture";
|
$sql = "SELECT count(c.rowid), c.fk_statut";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||||
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
|
$sql.= ", ".MAIN_DB_PREFIX."commande as c";
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||||
@ -87,7 +87,8 @@ $sql.= " WHERE c.fk_soc = s.rowid";
|
|||||||
$sql.= " AND c.entity IN (".getEntity('societe').")";
|
$sql.= " AND c.entity IN (".getEntity('societe').")";
|
||||||
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
if ($user->societe_id) $sql.=' AND c.fk_soc = '.$user->societe_id;
|
||||||
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
|
||||||
$sql.= " GROUP BY c.fk_statut, c.facture";
|
$sql.= " GROUP BY c.fk_statut";
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
@ -98,7 +99,6 @@ if ($resql)
|
|||||||
$totalinprocess=0;
|
$totalinprocess=0;
|
||||||
$dataseries=array();
|
$dataseries=array();
|
||||||
$vals=array();
|
$vals=array();
|
||||||
$bool=false;
|
|
||||||
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
@ -107,8 +107,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||||
{
|
{
|
||||||
$bool=(! empty($row[2])?true:false);
|
if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
|
||||||
if (! isset($vals[$row[1].$bool])) $vals[$row[1].$bool]=0;
|
|
||||||
$vals[$row[1].$bool]+=$row[0];
|
$vals[$row[1].$bool]+=$row[0];
|
||||||
$totalinprocess+=$row[0];
|
$totalinprocess+=$row[0];
|
||||||
}
|
}
|
||||||
@ -119,37 +118,38 @@ if ($resql)
|
|||||||
$db->free($resql);
|
$db->free($resql);
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("CustomersOrders").'</th></tr>'."\n";
|
||||||
$listofstatus=array(0,1,2,3,3,-1);
|
$listofstatus=array(0,1,2,3,-1);
|
||||||
$bool=false;
|
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
$dataseries[]=array($commandestatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||||
if ($status==3 && ! $bool) $bool=true;
|
|
||||||
else $bool=false;
|
|
||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr class="impair"><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
$var=true;
|
else
|
||||||
$bool=false;
|
|
||||||
foreach ($listofstatus as $status)
|
|
||||||
{
|
{
|
||||||
if (! $conf->use_javascript_ajax)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
|
print '<tr class="oddeven">';
|
||||||
print '<tr class="oddeven">';
|
|
||||||
print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>';
|
print '<td>'.$commandestatic->LibStatut($status,$bool,0).'</td>';
|
||||||
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||||
print $commandestatic->LibStatut($status,$bool,3);
|
print $commandestatic->LibStatut($status,$bool,3);
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
if ($status==3 && ! $bool) $bool=true;
|
|
||||||
else $bool=false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if ($totalinprocess != $total)
|
//if ($totalinprocess != $total)
|
||||||
|
|||||||
@ -106,14 +106,23 @@ print "</tr>\n";
|
|||||||
$listoftype=$tripandexpense_static->listOfTypes();
|
$listoftype=$tripandexpense_static->listOfTypes();
|
||||||
foreach ($listoftype as $code => $label)
|
foreach ($listoftype as $code => $label)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$label,'data'=>(isset($nb[$code])?(int) $nb[$code]:0));
|
$dataseries[]=array($label, (isset($nb[$code])?(int) $nb[$code]:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'><td align="center" colspan="4">';
|
print '<tr><td align="center" colspan="4">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($totalnb?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +189,7 @@ if ($result)
|
|||||||
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
|
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
|
||||||
print '<td>'.$deplacementstatic->LibStatut($obj->fk_statut,3).'</td>';
|
print '<td>'.$deplacementstatic->LibStatut($obj->fk_statut,3).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -184,7 +184,7 @@ print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' -
|
|||||||
$listofstatus=array(0,4,4,5); $bool=false;
|
$listofstatus=array(0,4,4,5); $bool=false;
|
||||||
foreach($listofstatus as $status)
|
foreach($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$staticcontratligne->LibStatut($status,1,($bool?1:0)),'data'=>(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0));
|
$dataseries[]=array($staticcontratligne->LibStatut($status,1,($bool?1:0)),(isset($nb[$status.$bool])?(int) $nb[$status.$bool]:0));
|
||||||
if (empty($conf->use_javascript_ajax))
|
if (empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -199,8 +199,17 @@ foreach($listofstatus as $status)
|
|||||||
if (! empty($conf->use_javascript_ajax))
|
if (! empty($conf->use_javascript_ajax))
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr class="impair"><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
$listofstatus=array(0,4,4,5); $bool=false;
|
$listofstatus=array(0,4,4,5); $bool=false;
|
||||||
|
|||||||
@ -125,7 +125,7 @@ $arrayfields=array(
|
|||||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
|
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
|
||||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
|
||||||
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
|
||||||
'sale_representative'=>array('label'=>$langs->trans("SalesRepresentative"), 'checked'=>1),
|
'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1),
|
||||||
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
|
'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1),
|
||||||
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
|
||||||
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
|
||||||
@ -740,10 +740,16 @@ if ($resql)
|
|||||||
$userstatic->id=$val['id'];
|
$userstatic->id=$val['id'];
|
||||||
$userstatic->lastname=$val['lastname'];
|
$userstatic->lastname=$val['lastname'];
|
||||||
$userstatic->firstname=$val['firstname'];
|
$userstatic->firstname=$val['firstname'];
|
||||||
print '<div class="float">'.$userstatic->getNomUrl(1);
|
$userstatic->email=$val['email'];
|
||||||
|
$userstatic->statut=$val['statut'];
|
||||||
|
$userstatic->entity=$val['entity'];
|
||||||
|
$userstatic->photo=$val['photo'];
|
||||||
|
|
||||||
|
//print '<div class="float">':
|
||||||
|
print $userstatic->getNomUrl(-2);
|
||||||
$j++;
|
$j++;
|
||||||
if ($j < $nbofsalesrepresentative) print ', ';
|
if ($j < $nbofsalesrepresentative) print ' ';
|
||||||
print '</div>';
|
//print '</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//else print $langs->trans("NoSalesRepresentativeAffected");
|
//else print $langs->trans("NoSalesRepresentativeAffected");
|
||||||
|
|||||||
@ -27,7 +27,7 @@
|
|||||||
* Class to build graphs.
|
* Class to build graphs.
|
||||||
* Usage is:
|
* Usage is:
|
||||||
* $dolgraph=new DolGraph();
|
* $dolgraph=new DolGraph();
|
||||||
* $dolgraph->SetTitle($langs->transnoentities('Tracking_Projects_Pourcent').'<br>'.$langs->transnoentities('Tracking_IndicatorDefGraph').'%');
|
* $dolgraph->SetTitle($langs->transnoentities('MyTitle').'<br>'.$langs->transnoentities('MyTitlePercent').'%');
|
||||||
* $dolgraph->SetMaxValue(50);
|
* $dolgraph->SetMaxValue(50);
|
||||||
* $dolgraph->SetData($data);
|
* $dolgraph->SetData($data);
|
||||||
* $dolgraph->setShowLegend(1);
|
* $dolgraph->setShowLegend(1);
|
||||||
@ -35,7 +35,7 @@
|
|||||||
* $dolgraph->SetType(array('pie'));
|
* $dolgraph->SetType(array('pie'));
|
||||||
* $dolgraph->setWidth('100%');
|
* $dolgraph->setWidth('100%');
|
||||||
* $dolgraph->draw('idofgraph');
|
* $dolgraph->draw('idofgraph');
|
||||||
* print $dolgraph->show();
|
* print $dolgraph->show($total?0:1);
|
||||||
*/
|
*/
|
||||||
class DolGraph
|
class DolGraph
|
||||||
{
|
{
|
||||||
@ -796,7 +796,7 @@ class DolGraph
|
|||||||
* Build a graph using JFlot library. Input when calling this method should be:
|
* Build a graph using JFlot library. Input when calling this method should be:
|
||||||
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
|
* $this->data = array(array(0=>'labelxA',1=>yA), array('labelxB',yB));
|
||||||
* $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
|
* $this->data = array(array(0=>'labelxA',1=>yA1,...,n=>yAn), array('labelxB',yB1,...yBn)); // or when there is n series to show for each x
|
||||||
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // TODO Syntax not supported. Removed when dol_print_graph_removed
|
* $this->data = array(array('label'=>'labelxA','data'=>yA), array('labelxB',yB)); // Syntax deprecated
|
||||||
* $this->legend= array("Val1",...,"Valn"); // list of n series name
|
* $this->legend= array("Val1",...,"Valn"); // list of n series name
|
||||||
* $this->type = array('bars',...'lines'); or array('pie')
|
* $this->type = array('bars',...'lines'); or array('pie')
|
||||||
* $this->mode = 'depth' ???
|
* $this->mode = 'depth' ???
|
||||||
@ -1041,10 +1041,20 @@ class DolGraph
|
|||||||
/**
|
/**
|
||||||
* Output HTML string to show graph
|
* Output HTML string to show graph
|
||||||
*
|
*
|
||||||
* @return string HTML string to show graph
|
* @param int $shownographyet Show graph to say there is not enough data
|
||||||
|
* @return string HTML string to show graph
|
||||||
*/
|
*/
|
||||||
function show()
|
function show($shownographyet=0)
|
||||||
{
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
if ($shownographyet)
|
||||||
|
{
|
||||||
|
$s= '<div class="nographyet" style="width:'.(preg_match('/%/',$this->width)?$this->width:$this->width.'px').'; height:'.(preg_match('/%/',$this->height)?$this->height:$this->height.'px').';"></div>';
|
||||||
|
$s.='<div class="nographyettext">'.$langs->trans("NotEnoughDataYet").'</div>';
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->stringtoshow;
|
return $this->stringtoshow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,7 @@ llxHeader('',$langs->trans("Donations"),$help_url);
|
|||||||
|
|
||||||
$nb=array();
|
$nb=array();
|
||||||
$somme=array();
|
$somme=array();
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
$sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut";
|
$sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||||
@ -69,6 +70,8 @@ if ($result)
|
|||||||
|
|
||||||
$somme[$objp->fk_statut] = $objp->somme;
|
$somme[$objp->fk_statut] = $objp->somme;
|
||||||
$nb[$objp->fk_statut] = $objp->nb;
|
$nb[$objp->fk_statut] = $objp->nb;
|
||||||
|
$total += $objp->somme;
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
@ -87,7 +90,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
{
|
{
|
||||||
$listofsearchfields['search_donation']=array('text'=>'Donation');
|
$listofsearchfields['search_donation']=array('text'=>'Donation');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($listofsearchfields))
|
if (count($listofsearchfields))
|
||||||
{
|
{
|
||||||
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
print '<form method="post" action="'.DOL_URL_ROOT.'/core/search.php">';
|
||||||
@ -103,7 +106,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
}
|
}
|
||||||
@ -118,14 +121,23 @@ print "</tr>\n";
|
|||||||
$listofstatus=array(0,1,-1,2);
|
$listofstatus=array(0,1,-1,2);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$donstatic->LibStatut($status,1),'data'=>(isset($nb[$status])?(int) $nb[$status]:0));
|
$dataseries[]=array($donstatic->LibStatut($status,1), (isset($nb[$status])?(int) $nb[$status]:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'><td align="center" colspan="4">';
|
print '<tr><td align="center" colspan="4">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,7 +153,7 @@ $totalnb=0;
|
|||||||
$var=true;
|
$var=true;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td><a href="list.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>';
|
print '<td><a href="list.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>';
|
||||||
print '<td align="right">'.(! empty($nb[$status])?$nb[$status]:' ').'</td>';
|
print '<td align="right">'.(! empty($nb[$status])?$nb[$status]:' ').'</td>';
|
||||||
@ -191,7 +203,7 @@ if ($resql)
|
|||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -118,14 +118,23 @@ print "</tr>\n";
|
|||||||
$listoftype=$tripandexpense_static->listOfTypes();
|
$listoftype=$tripandexpense_static->listOfTypes();
|
||||||
foreach ($listoftype as $code => $label)
|
foreach ($listoftype as $code => $label)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$label,'data'=>(isset($somme[$code])?(int) $somme[$code]:0));
|
$dataseries[]=array($label, (isset($somme[$code])?(int) $somme[$code]:0));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[0].'><td align="center" colspan="4">';
|
print '<tr><td align="center" colspan="4">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',320,180,$data,1,'pie',0,'',0);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($totalnb?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -208,7 +217,7 @@ if ($result)
|
|||||||
print $expensereportstatic->LibStatut($obj->fk_status,3);
|
print $expensereportstatic->LibStatut($obj->fk_status,3);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||||
|
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -121,15 +121,25 @@ if ($resql)
|
|||||||
$bool=false;
|
$bool=false;
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$fichinterstatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
$dataseries[]=array($fichinterstatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||||
if ($status==3 && ! $bool) $bool=true;
|
if ($status==3 && ! $bool) $bool=true;
|
||||||
else $bool=false;
|
else $bool=false;
|
||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr class="impair"><td align="center" colspan="2">';
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
$data=array('series'=>$dataseries);
|
$data=array('series'=>$dataseries);
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
$var=true;
|
$var=true;
|
||||||
@ -138,7 +148,7 @@ if ($resql)
|
|||||||
{
|
{
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
|
print '<td>'.$fichinterstatic->LibStatut($status,$bool,0).'</td>';
|
||||||
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
print '<td align="right"><a href="list.php?viewstatut='.$status.'">'.(isset($vals[$status.$bool])?$vals[$status.$bool]:0).' ';
|
||||||
@ -190,7 +200,7 @@ if (! empty($conf->ficheinter->enabled))
|
|||||||
$var = true;
|
$var = true;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
@ -240,7 +250,7 @@ if ($resql)
|
|||||||
$var = true;
|
$var = true;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -311,7 +321,7 @@ if (! empty($conf->ficheinter->enabled))
|
|||||||
$var = true;
|
$var = true;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap" width="20%">';
|
print '<td class="nowrap" width="20%">';
|
||||||
|
|||||||
@ -304,7 +304,7 @@ if ($resql)
|
|||||||
|
|
||||||
$topicmail="Information";
|
$topicmail="Information";
|
||||||
$modelmail="intervention";
|
$modelmail="intervention";
|
||||||
$objecttmp=new Intervention($db);
|
$objecttmp=new Fichinter($db);
|
||||||
$trackid='int'.$object->id;
|
$trackid='int'.$object->id;
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||||
|
|
||||||
|
|||||||
@ -116,10 +116,10 @@ if ($resql)
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
foreach (array(0,1,2,3,4,5,6) as $statut)
|
foreach (array(0,1,2,3,4,5,6) as $statut)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$commandestatic->LibStatut($statut,1),'data'=>(isset($vals[$statut])?(int) $vals[$statut]:0));
|
$dataseries[]=array($commandestatic->LibStatut($statut,1), (isset($vals[$statut])?(int) $vals[$statut]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$commandestatic->LibStatut($statut,0).'</td>';
|
print '<td>'.$commandestatic->LibStatut($statut,0).'</td>';
|
||||||
print '<td align="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
print '<td align="right"><a href="list.php?statut='.$statut.'">'.(isset($vals[$statut])?$vals[$statut]:0).'</a></td>';
|
||||||
@ -129,8 +129,17 @@ if ($resql)
|
|||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr class="impair"><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1,'',0);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
//if ($totalinprocess != $total)
|
//if ($totalinprocess != $total)
|
||||||
@ -177,7 +186,7 @@ if ($resql)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$row = $db->fetch_row($resql);
|
$row = $db->fetch_row($resql);
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$langs->trans($commandestatic->statuts[$row[1]]).'</td>';
|
print '<td>'.$langs->trans($commandestatic->statuts[$row[1]]).'</td>';
|
||||||
@ -225,7 +234,7 @@ if (! empty($conf->fournisseur->enabled))
|
|||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
@ -268,7 +277,7 @@ if ($resql)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -324,7 +333,7 @@ if ($resql)
|
|||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|||||||
@ -221,25 +221,38 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
if ($i < $nbmax)
|
if ($i < $nbmax)
|
||||||
$dataseries[]=array('label'=>$obj->label,'data'=>round($obj->nb));
|
{
|
||||||
|
$dataseries[]=array($obj->label, round($obj->nb));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
$rest+=$obj->nb;
|
$rest+=$obj->nb;
|
||||||
|
}
|
||||||
$total+=$obj->nb;
|
$total+=$obj->nb;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if ($i > $nbmax)
|
if ($i > $nbmax)
|
||||||
$dataseries[]=array('label'=>$langs->trans("Other"),'data'=>round($rest));
|
{
|
||||||
$data=array('series'=>$dataseries);
|
$dataseries[]=array($langs->trans("Other"), round($rest));
|
||||||
dol_print_graph('statscategproduct',300,180,$data,1,'pie',0);
|
}
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idstatscategproduct');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$var=true;
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr $bc[$var]><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
|
print '<tr><td>'.$obj->label.'</td><td>'.$obj->nb.'</td></tr>';
|
||||||
$total+=$obj->nb;
|
$total+=$obj->nb;
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,6 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
|||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder nohover" width="100%">';
|
print '<table class="noborder nohover" width="100%">';
|
||||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
|
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
|
||||||
$var=true;
|
|
||||||
$listofstatus=array_keys($listofoppstatus);
|
$listofstatus=array_keys($listofoppstatus);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
@ -65,7 +64,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
|||||||
//$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
|
//$labelstatus .= ' ('.$langs->trans("Coeff").': '.price2num($listofoppstatus[$status]).')';
|
||||||
//$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%';
|
//$labelstatus .= ' - '.price2num($listofoppstatus[$status]).'%';
|
||||||
|
|
||||||
$dataseries[]=array('label'=>$labelstatus,'data'=>(isset($valsamount[$status])?(float) $valsamount[$status]:0));
|
$dataseries[]=array($labelstatus, (isset($valsamount[$status])?(float) $valsamount[$status]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -77,9 +76,19 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
|||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr class="impair"><td align="center" colspan="2">';
|
print '<tr><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',360,180,$data,1,'pie',0,'',0,$totaloppnb?0:1);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->SetHeight(180);
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($totaloppnb?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
//if ($totalinprocess != $total)
|
//if ($totalinprocess != $total)
|
||||||
|
|||||||
@ -122,10 +122,10 @@ if ($resql)
|
|||||||
$listofstatus=array(0,1,2,3,4);
|
$listofstatus=array(0,1,2,3,4);
|
||||||
foreach ($listofstatus as $status)
|
foreach ($listofstatus as $status)
|
||||||
{
|
{
|
||||||
$dataseries[]=array('label'=>$supplier_proposalstatic->LibStatut($status,1),'data'=>(isset($vals[$status])?(int) $vals[$status]:0));
|
$dataseries[]=array($supplier_proposalstatic->LibStatut($status,1), (isset($vals[$status])?(int) $vals[$status]:0));
|
||||||
if (! $conf->use_javascript_ajax)
|
if (! $conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$supplier_proposalstatic->LibStatut($status,0).'</td>';
|
print '<td>'.$supplier_proposalstatic->LibStatut($status,0).'</td>';
|
||||||
print '<td align="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
|
print '<td align="right"><a href="list.php?statut='.$status.'">'.(isset($vals[$status])?$vals[$status]:0).'</a></td>';
|
||||||
@ -134,9 +134,18 @@ if ($resql)
|
|||||||
}
|
}
|
||||||
if ($conf->use_javascript_ajax)
|
if ($conf->use_javascript_ajax)
|
||||||
{
|
{
|
||||||
print '<tr '.$bc[false].'><td align="center" colspan="2">';
|
print '<tr><td align="center" colspan="2">';
|
||||||
$data=array('series'=>$dataseries);
|
|
||||||
dol_print_graph('stats',300,180,$data,1,'pie',1,'',0);
|
include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
||||||
|
$dolgraph = new DolGraph();
|
||||||
|
$dolgraph->SetData($dataseries);
|
||||||
|
$dolgraph->setShowLegend(1);
|
||||||
|
$dolgraph->setShowPercent(1);
|
||||||
|
$dolgraph->SetType(array('pie'));
|
||||||
|
$dolgraph->setWidth('100%');
|
||||||
|
$dolgraph->draw('idgraphstatus');
|
||||||
|
print $dolgraph->show($total?0:1);
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,7 +187,7 @@ if (! empty($conf->supplier_proposal->enabled))
|
|||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
@ -236,7 +245,7 @@ if ($resql)
|
|||||||
$var = True;
|
$var = True;
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
@ -317,7 +326,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
|
|||||||
while ($i < $nbofloop)
|
while ($i < $nbofloop)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user