From cfe2991a29ccfd9d1b296b34a00bdb42216bfdaa Mon Sep 17 00:00:00 2001
From: Rodolphe Quiedeville <rodolphe@quiedeville.org>
Date: Thu, 20 Oct 2005 19:18:22 +0000
Subject: [PATCH] Ajout nouveau graph

---
 .../stats/ProcessGraphClients.class.php       | 28 +++++++++++++------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/htdocs/telephonie/stats/ProcessGraphClients.class.php b/htdocs/telephonie/stats/ProcessGraphClients.class.php
index fcd52871f89..e0085afc6e1 100644
--- a/htdocs/telephonie/stats/ProcessGraphClients.class.php
+++ b/htdocs/telephonie/stats/ProcessGraphClients.class.php
@@ -37,7 +37,7 @@ require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/joursemaine.class.php")
 require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/camoyen.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/appelsdureemoyenne.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/comm.nbmensuel.class.php");
-
+require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/comm.nbminutes.class.php");
 require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/camenbert.class.php");
 
 /*
@@ -92,12 +92,16 @@ class ProcessGraphClients
 	
 	while ($i < $num)
 	  {
-	    $obj = $this->db->fetch_object($resql);
-	    
-	    $clients[$i] = $obj->socidp;
-	    
+	    $obj = $this->db->fetch_object($resql);	   
+	    $clients[$i] = $obj->socidp;	    
 	    $i++;
 	  }
+	$this->db->free($resql);
+      }
+    else
+      {
+	print $sql;
+	exit("Erreur recuperation des clients");
       }
 
     if (sizeof($clients))
@@ -105,12 +109,12 @@ class ProcessGraphClients
 	foreach ($clients as $client)
 	  {
 	    $img_root = DOL_DATA_ROOT."/graph/".substr($client,-1)."/telephonie/client/";
-
+	    
 	    $file = $img_root . $client."/graphca.png";
 	    $graphca = new GraphCa($this->db, $file);
 	    $graphca->client = $client;
 	    $graphca->GraphDraw();
-
+	    
 	    $file = $img_root . $client."/graphgain.png";
 
 	    $graphgain = new GraphGain ($this->db, $file);
@@ -150,7 +154,15 @@ class ProcessGraphClients
 	    $graphx->client = $client;
 	    $graphx->show_console = 0 ;
 	    $graphx->Graph();
-
+	    
+	    
+	    $file = $img_root . $client."/nb-minutes-mensuel.png";
+	    
+	    $graphx = new GraphCommNbMinutes ($this->db, $file);
+	    $graphx->client = $client;
+	    $graphx->show_console = 0 ;
+	    $graphx->Graph();
+	    
 	  }       
       }
 
-- 
GitLab