Replace deprecated dol_print_graph with DolGraph
This commit is contained in:
parent
38ef5890dc
commit
9c22b5f335
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.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>
|
||||
*
|
||||
* 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 '<table class="noborder nohover" width="100%">';
|
||||
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;
|
||||
$SommeB=0;
|
||||
$SommeC=0;
|
||||
$SommeD=0;
|
||||
$total=0;
|
||||
$dataval=array();
|
||||
$datalabels=array();
|
||||
$i=0;
|
||||
@ -187,14 +188,23 @@ if ($conf->use_javascript_ajax)
|
||||
$SommeD+=isset($MembersResiliated[$key])?$MembersResiliated[$key]:0;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$total = $SommeA + $SommeB + $SommeC + $SommeD;
|
||||
$dataseries=array();
|
||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersNotUpToDate"),'data'=>round($SommeB));
|
||||
$dataseries[]=array('label'=>$langs->trans("MenuMembersUpToDate"),'data'=>round($SommeC));
|
||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusResiliated"),'data'=>round($SommeD));
|
||||
$dataseries[]=array('label'=>$langs->trans("MembersStatusToValid"),'data'=>round($SommeA));
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
$dataseries[]=array($langs->trans("MenuMembersNotUpToDate"), round($SommeB));
|
||||
$dataseries[]=array($langs->trans("MenuMembersUpToDate"), round($SommeC));
|
||||
$dataseries[]=array($langs->trans("MembersStatusResiliated"), round($SommeD));
|
||||
$dataseries[]=array($langs->trans("MembersStatusToValid"), round($SommeA));
|
||||
|
||||
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 '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td align="right">';
|
||||
print $SommeA+$SommeB+$SommeC+$SommeD;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* 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>
|
||||
*
|
||||
* 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
|
||||
{
|
||||
$var=false;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
@ -115,14 +114,13 @@ if ($resql)
|
||||
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
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);
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
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>';
|
||||
@ -131,9 +129,18 @@ if ($resql)
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
print '<tr><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('idgraphthirdparties');
|
||||
print $dolgraph->show($total?0:1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
@ -173,10 +180,8 @@ if (! empty($conf->propal->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -233,10 +238,8 @@ if ($resql)
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -308,8 +311,6 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
$i = 0;
|
||||
if ($num > 0)
|
||||
{
|
||||
$var=true;
|
||||
|
||||
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>';
|
||||
|
||||
@ -317,7 +318,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
|
||||
while ($i < $nbofloop)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
@ -402,10 +403,9 @@ if (! empty($conf->propal->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
@ -474,10 +474,9 @@ if (! empty($conf->propal->enabled))
|
||||
if ($num)
|
||||
{
|
||||
$i = 0;
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td width="20%" class="nowrap">';
|
||||
|
||||
@ -79,7 +79,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
|
||||
* 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.= ", ".MAIN_DB_PREFIX."commande as c";
|
||||
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').")";
|
||||
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;
|
||||
$sql.= " GROUP BY c.fk_statut, c.facture";
|
||||
$sql.= " GROUP BY c.fk_statut";
|
||||
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@ -98,7 +99,6 @@ if ($resql)
|
||||
$totalinprocess=0;
|
||||
$dataseries=array();
|
||||
$vals=array();
|
||||
$bool=false;
|
||||
// -1=Canceled, 0=Draft, 1=Validated, 2=Accepted/On process, 3=Closed (Sent/Received, billed or not)
|
||||
while ($i < $num)
|
||||
{
|
||||
@ -107,8 +107,7 @@ if ($resql)
|
||||
{
|
||||
//if ($row[1]!=-1 && ($row[1]!=3 || $row[2]!=1))
|
||||
{
|
||||
$bool=(! empty($row[2])?true:false);
|
||||
if (! isset($vals[$row[1].$bool])) $vals[$row[1].$bool]=0;
|
||||
if (! isset($vals[$row[1]])) $vals[$row[1]]=0;
|
||||
$vals[$row[1].$bool]+=$row[0];
|
||||
$totalinprocess+=$row[0];
|
||||
}
|
||||
@ -119,37 +118,38 @@ if ($resql)
|
||||
$db->free($resql);
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
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);
|
||||
$bool=false;
|
||||
$listofstatus=array(0,1,2,3,-1);
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
$dataseries[]=array('label'=>$commandestatic->LibStatut($status,$bool,1),'data'=>(isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||
if ($status==3 && ! $bool) $bool=true;
|
||||
else $bool=false;
|
||||
$dataseries[]=array($commandestatic->LibStatut($status,$bool,1), (isset($vals[$status.$bool])?(int) $vals[$status.$bool]:0));
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
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>';
|
||||
}
|
||||
$var=true;
|
||||
$bool=false;
|
||||
foreach ($listofstatus as $status)
|
||||
else
|
||||
{
|
||||
if (! $conf->use_javascript_ajax)
|
||||
{
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
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 $commandestatic->LibStatut($status,$bool,3);
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
if ($status==3 && ! $bool) $bool=true;
|
||||
else $bool=false;
|
||||
}
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
|
||||
@ -106,14 +106,23 @@ print "</tr>\n";
|
||||
$listoftype=$tripandexpense_static->listOfTypes();
|
||||
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)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td align="center" colspan="4">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
print '<tr><td align="center" colspan="4">';
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
@ -180,7 +189,7 @@ if ($result)
|
||||
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
|
||||
print '<td>'.$deplacementstatic->LibStatut($obj->fk_statut,3).'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' -
|
||||
$listofstatus=array(0,4,4,5); $bool=false;
|
||||
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))
|
||||
{
|
||||
|
||||
@ -199,8 +199,17 @@ foreach($listofstatus as $status)
|
||||
if (! empty($conf->use_javascript_ajax))
|
||||
{
|
||||
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>';
|
||||
}
|
||||
$listofstatus=array(0,4,4,5); $bool=false;
|
||||
|
||||
@ -125,7 +125,7 @@ $arrayfields=array(
|
||||
's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
|
||||
'state.nom'=>array('label'=>$langs->trans("StateShort"), '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.datec'=>array('label'=>$langs->trans("DateCreation"), '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->lastname=$val['lastname'];
|
||||
$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++;
|
||||
if ($j < $nbofsalesrepresentative) print ', ';
|
||||
print '</div>';
|
||||
if ($j < $nbofsalesrepresentative) print ' ';
|
||||
//print '</div>';
|
||||
}
|
||||
}
|
||||
//else print $langs->trans("NoSalesRepresentativeAffected");
|
||||
|
||||
@ -27,7 +27,7 @@
|
||||
* Class to build graphs.
|
||||
* Usage is:
|
||||
* $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->SetData($data);
|
||||
* $dolgraph->setShowLegend(1);
|
||||
@ -35,7 +35,7 @@
|
||||
* $dolgraph->SetType(array('pie'));
|
||||
* $dolgraph->setWidth('100%');
|
||||
* $dolgraph->draw('idofgraph');
|
||||
* print $dolgraph->show();
|
||||
* print $dolgraph->show($total?0:1);
|
||||
*/
|
||||
class DolGraph
|
||||
{
|
||||
@ -796,7 +796,7 @@ class DolGraph
|
||||
* 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=>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->type = array('bars',...'lines'); or array('pie')
|
||||
* $this->mode = 'depth' ???
|
||||
@ -1041,10 +1041,20 @@ class DolGraph
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ llxHeader('',$langs->trans("Donations"),$help_url);
|
||||
|
||||
$nb=array();
|
||||
$somme=array();
|
||||
$total = 0;
|
||||
|
||||
$sql = "SELECT count(d.rowid) as nb, sum(d.amount) as somme , d.fk_statut";
|
||||
$sql.= " FROM ".MAIN_DB_PREFIX."don as d";
|
||||
@ -69,6 +70,8 @@ if ($result)
|
||||
|
||||
$somme[$objp->fk_statut] = $objp->somme;
|
||||
$nb[$objp->fk_statut] = $objp->nb;
|
||||
$total += $objp->somme;
|
||||
|
||||
$i++;
|
||||
}
|
||||
$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');
|
||||
}
|
||||
|
||||
|
||||
if (count($listofsearchfields))
|
||||
{
|
||||
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>';
|
||||
$i++;
|
||||
}
|
||||
print '</table>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
}
|
||||
@ -118,14 +121,23 @@ print "</tr>\n";
|
||||
$listofstatus=array(0,1,-1,2);
|
||||
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)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td align="center" colspan="4">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
print '<tr><td align="center" colspan="4">';
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
@ -141,7 +153,7 @@ $totalnb=0;
|
||||
$var=true;
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td><a href="list.php?statut='.$status.'">'.$donstatic->LibStatut($status,4).'</a></td>';
|
||||
print '<td align="right">'.(! empty($nb[$status])?$nb[$status]:' ').'</td>';
|
||||
@ -191,7 +203,7 @@ if ($resql)
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -118,14 +118,23 @@ print "</tr>\n";
|
||||
$listoftype=$tripandexpense_static->listOfTypes();
|
||||
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)
|
||||
{
|
||||
print '<tr '.$bc[0].'><td align="center" colspan="4">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',320,180,$data,1,'pie',0,'',0);
|
||||
print '<tr><td align="center" colspan="4">';
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
@ -208,7 +217,7 @@ if ($result)
|
||||
print $expensereportstatic->LibStatut($obj->fk_status,3);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
||||
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
|
||||
|
||||
|
||||
*
|
||||
* 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
|
||||
@ -121,15 +121,25 @@ if ($resql)
|
||||
$bool=false;
|
||||
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;
|
||||
else $bool=false;
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
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);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
$var=true;
|
||||
@ -138,7 +148,7 @@ if ($resql)
|
||||
{
|
||||
if (! $conf->use_javascript_ajax)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
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).' ';
|
||||
@ -190,7 +200,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
@ -240,7 +250,7 @@ if ($resql)
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -311,7 +321,7 @@ if (! empty($conf->ficheinter->enabled))
|
||||
$var = true;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap" width="20%">';
|
||||
|
||||
@ -304,7 +304,7 @@ if ($resql)
|
||||
|
||||
$topicmail="Information";
|
||||
$modelmail="intervention";
|
||||
$objecttmp=new Intervention($db);
|
||||
$objecttmp=new Fichinter($db);
|
||||
$trackid='int'.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
|
||||
|
||||
|
||||
@ -116,10 +116,10 @@ if ($resql)
|
||||
print "</tr>\n";
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
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>';
|
||||
@ -129,8 +129,17 @@ if ($resql)
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
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>';
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
@ -177,7 +186,7 @@ if ($resql)
|
||||
while ($i < $num)
|
||||
{
|
||||
$row = $db->fetch_row($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans($commandestatic->statuts[$row[1]]).'</td>';
|
||||
@ -225,7 +234,7 @@ if (! empty($conf->fournisseur->enabled))
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="nowrap">';
|
||||
@ -268,7 +277,7 @@ if ($resql)
|
||||
while ($i < $num)
|
||||
{
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>';
|
||||
@ -324,7 +333,7 @@ if ($resql)
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -221,25 +221,38 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
if ($i < $nbmax)
|
||||
$dataseries[]=array('label'=>$obj->label,'data'=>round($obj->nb));
|
||||
{
|
||||
$dataseries[]=array($obj->label, round($obj->nb));
|
||||
}
|
||||
else
|
||||
{
|
||||
$rest+=$obj->nb;
|
||||
}
|
||||
$total+=$obj->nb;
|
||||
$i++;
|
||||
}
|
||||
if ($i > $nbmax)
|
||||
$dataseries[]=array('label'=>$langs->trans("Other"),'data'=>round($rest));
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('statscategproduct',300,180,$data,1,'pie',0);
|
||||
{
|
||||
$dataseries[]=array($langs->trans("Other"), round($rest));
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
$var=true;
|
||||
while ($i < $num)
|
||||
{
|
||||
$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;
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -52,7 +52,6 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder nohover" width="100%">';
|
||||
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Statistics").' - '.$langs->trans("OpportunitiesStatusForOpenedProjects").'</th></tr>'."\n";
|
||||
$var=true;
|
||||
$listofstatus=array_keys($listofoppstatus);
|
||||
foreach ($listofstatus as $status)
|
||||
{
|
||||
@ -65,7 +64,7 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
//$labelstatus .= ' ('.$langs->trans("Coeff").': '.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)
|
||||
{
|
||||
|
||||
@ -77,9 +76,19 @@ if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr class="impair"><td align="center" colspan="2">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',360,180,$data,1,'pie',0,'',0,$totaloppnb?0:1);
|
||||
print '<tr><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->SetHeight(180);
|
||||
$dolgraph->draw('idgraphstatus');
|
||||
print $dolgraph->show($totaloppnb?0:1);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
//if ($totalinprocess != $total)
|
||||
|
||||
@ -122,10 +122,10 @@ if ($resql)
|
||||
$listofstatus=array(0,1,2,3,4);
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
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>';
|
||||
@ -134,9 +134,18 @@ if ($resql)
|
||||
}
|
||||
if ($conf->use_javascript_ajax)
|
||||
{
|
||||
print '<tr '.$bc[false].'><td align="center" colspan="2">';
|
||||
$data=array('series'=>$dataseries);
|
||||
dol_print_graph('stats',300,180,$data,1,'pie',1,'',0);
|
||||
print '<tr><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);
|
||||
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
@ -178,7 +187,7 @@ if (! empty($conf->supplier_proposal->enabled))
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -236,7 +245,7 @@ if ($resql)
|
||||
$var = True;
|
||||
while ($i < $num)
|
||||
{
|
||||
|
||||
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -317,7 +326,7 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos
|
||||
while ($i < $nbofloop)
|
||||
{
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Ref
|
||||
|
||||
Loading…
Reference in New Issue
Block a user