[Vtigercrm-commits] [vtiger-commits] r4513 - in /vtigercrm/trunk/modules/Dashboard: Entity_charts.php accumulated_bargraph.php display_charts.php line_graph.php pie_graph.php vertical_bargraph.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Mar 28 00:35:11 EST 2006


Author: saraj
Date: Mon Mar 27 22:35:01 2006
New Revision: 4513

Log:
junk code removed in dashboards modules

Modified:
    vtigercrm/trunk/modules/Dashboard/Entity_charts.php
    vtigercrm/trunk/modules/Dashboard/accumulated_bargraph.php
    vtigercrm/trunk/modules/Dashboard/display_charts.php
    vtigercrm/trunk/modules/Dashboard/line_graph.php
    vtigercrm/trunk/modules/Dashboard/pie_graph.php
    vtigercrm/trunk/modules/Dashboard/vertical_bargraph.php

Modified: vtigercrm/trunk/modules/Dashboard/Entity_charts.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/Entity_charts.php (original)
+++ vtigercrm/trunk/modules/Dashboard/Entity_charts.php Mon Mar 27 22:35:01 2006
@@ -17,11 +17,10 @@
 
 //To get the account names
 
-/*
-	Function to get the Account name for a given account id
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-         * Contributor(s): ______________________________________..
+/* Function to get the Account name for a given account id
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
  */
 
 function get_account_name($acc_id)
@@ -45,163 +44,163 @@
 	return $name;
 }
 
-/*   Function returns the values to render the graph for a particular type 
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-         * Contributor(s): ______________________________________..
- */
+/* Function returns the values to render the graph for a particular type 
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
+*/
 
 // TO get the Values for a particular graph type 
 function module_Chart($user_id,$date_start="2000-01-01",$end_date="2017-01-01",$query,$graph_for,$title,$added_qry="",$module="",$graph_type)
 {
-		
-        global $adb;
-        global $days,$date_array,$period_type;
-
-        $where= " and crmentity.smownerid=".$user_id." and crmentity.createdtime between '".$date_start."' and '".$end_date."'" ;
-        $query.=$where;
+
+	global $adb;
+	global $days,$date_array,$period_type;
+
+	$where= " and crmentity.smownerid=".$user_id." and crmentity.createdtime between '".$date_start."' and '".$end_date."'" ;
+	$query.=$where;
 	if($added_qry!="")
 		$query.=$added_qry;
 
-        $result=$adb->query($query);
-        $no_of_rows=$adb->num_rows($result);
-        $mod_count_array=array();
-        $mod_name_array=array();
-        $count_by_date[]=array();
-        $mod_tot_cnt_array=array();
-
-        $mod_name_val="";
-        $mod_cnt_crtd_date="";
+	$result=$adb->query($query);
+	$no_of_rows=$adb->num_rows($result);
+	$mod_count_array=array();
+	$mod_name_array=array();
+	$count_by_date[]=array();
+	$mod_tot_cnt_array=array();
+
+	$mod_name_val="";
+	$mod_cnt_crtd_date="";
 	$target_val="";
 	$bar_target_val="";
 	$test_target_val="";
 
-        if($no_of_rows!=0)
-        {
-                while($row = $adb->fetch_array($result))
-                {
-                        $mod_name= $row[$graph_for];
-                        if($mod_name=="")
-                                $mod_name="Un Assigned";
-                        $crtd_time=$row['createdtime'];
-                        $crtd_time_array=explode(" ",$crtd_time);
-                        $crtd_date=$crtd_time_array[0];
-
-                        if(!isset($mod_tot_cnt_array[$crtd_date]))
-                                $mod_tot_cnt_array[$crtd_date]=0;
-
-                        $mod_tot_cnt_array[$crtd_date]+=1;
-
-                        if (in_array($mod_name,$mod_name_array) == false)
-                        {
-                                array_push($mod_name_array,$mod_name); // getting all the unique Names into the array
-			}
-			
+	if($no_of_rows!=0)
+	{
+		while($row = $adb->fetch_array($result))
+		{
+			$mod_name= $row[$graph_for];
+			if($mod_name=="")
+				$mod_name="Un Assigned";
+			$crtd_time=$row['createdtime'];
+			$crtd_time_array=explode(" ",$crtd_time);
+			$crtd_date=$crtd_time_array[0];
+
+			if(!isset($mod_tot_cnt_array[$crtd_date]))
+				$mod_tot_cnt_array[$crtd_date]=0;
+
+			$mod_tot_cnt_array[$crtd_date]+=1;
+
+			if (in_array($mod_name,$mod_name_array) == false)
+			{
+				array_push($mod_name_array,$mod_name); // getting all the unique Names into the array
+			}
+
 			//Counting the number of values for a type of graph
-                        if(!isset($mod_count_array[$mod_name]))
-                                $mod_count_array[$mod_name]=0;
-                        $mod_count_array[$mod_name]++;
+			if(!isset($mod_count_array[$mod_name]))
+				$mod_count_array[$mod_name]=0;
+			$mod_count_array[$mod_name]++;
 
 			//Counting the number of values for a type of graph for a particular date
-                        if(!isset($count_by_date[$mod_name][$crtd_date]))
-                                $count_by_date[$mod_name][$crtd_date]=0;
-
-                        $count_by_date[$mod_name][$crtd_date]+=1;
-                }
-                $mod_by_mod_cnt=count($mod_name_array);
-
-                if($mod_by_mod_cnt!=0)
-                {
-                        $url_string="";
-
-                        $mod_cnt_table="<table border=0 cellspacing=1 cellpadding=3><tr>
-                                <th>  Status </th>";
-
-                        //Assigning the Header values to the table and giving the dates as graphformat 
-                        for($i=0; $i<$days; $i++)
-                        {
-                                $tdate=$date_array[$i];
-                                $values=Graph_n_table_format($period_type,$tdate);
-                                $graph_format=$values[0];
-                                $table_format=$values[1];
-                                $mod_cnt_table.= "<th>$table_format</th>";
-
-                        }
-                        $mod_cnt_table .= "<th>Total</th></tr>" ;
+			if(!isset($count_by_date[$mod_name][$crtd_date]))
+				$count_by_date[$mod_name][$crtd_date]=0;
+
+			$count_by_date[$mod_name][$crtd_date]+=1;
+		}
+		$mod_by_mod_cnt=count($mod_name_array);
+
+		if($mod_by_mod_cnt!=0)
+		{
+			$url_string="";
+
+			$mod_cnt_table="<table border=0 cellspacing=1 cellpadding=3><tr>
+				<th>  Status </th>";
+
+			//Assigning the Header values to the table and giving the dates as graphformat 
+			for($i=0; $i<$days; $i++)
+			{
+				$tdate=$date_array[$i];
+				$values=Graph_n_table_format($period_type,$tdate);
+				$graph_format=$values[0];
+				$table_format=$values[1];
+				$mod_cnt_table.= "<th>$table_format</th>";
+
+			}
+			$mod_cnt_table .= "<th>Total</th></tr>" ;
 
 			//For all type of the array 
-                        for ($i=0;$i<count($mod_name_array); $i++)
-                        {
-                                $name=$mod_name_array[$i];
-                                if($name=="")
-                                        $name="Un Assigned";
+			for ($i=0;$i<count($mod_name_array); $i++)
+			{
+				$name=$mod_name_array[$i];
+				if($name=="")
+					$name="Un Assigned";
 
 				if($graph_for =="accountid")
-                                {
-                                        $name_val_table=get_account_name($name);
-                                }
+				{
+					$name_val_table=get_account_name($name);
+				}
 				else
 				{
 					$name_val_table=$name;
 				}
-				
-
-                                $mod_cnt_table .= "<tr><td>$name_val_table</td>";
+
+
+				$mod_cnt_table .= "<tr><td>$name_val_table</td>";
 				$mod_cnt_crtd_date="";
 				//For all the days
-                                for($j=0;$j<$days;$j++)
-                                {
-                                 	$tdate=$date_array[$j];
-
-                                        if (!isset($count_by_date[$name][$tdate]))
-                                        {
-                                                $count_by_date[$name][$tdate]="0";
-                                        }
-                                        $cnt_by_date=$count_by_date[$name][$tdate];
-                                        $mod_cnt_table .= "<td>$cnt_by_date </td>";
-
-                                        if($i==0)
-                                        {
-                                                $values=Graph_n_table_format($period_type,$tdate);
-                                                $graph_format=$values[0];
-                                                $table_format=$values[1];
-
-
-                                                //passing the created dates to graph
-                                                if($mod_graph_date!="")
-                                                        $mod_graph_date="$mod_graph_date,$graph_format";
-                                                else
-                                                        $mod_graph_date="$graph_format";
-
-                                        }
-
-                                        //passing the name count by date to graph
-                                        if($mod_cnt_crtd_date!="")
-                                                $mod_cnt_crtd_date.=",$cnt_by_date";
-                                        else
-                                                $mod_cnt_crtd_date="$cnt_by_date";
-
-                                }
-
-                                $mod_count_val=$mod_count_array[$name];
-
-                                $tot_mod_cnt=array_sum($count_by_date[$name]);
-                                $mod_cnt_table .= "<td align=center>$tot_mod_cnt</td></tr>";
-							
+				for($j=0;$j<$days;$j++)
+				{
+					$tdate=$date_array[$j];
+
+					if (!isset($count_by_date[$name][$tdate]))
+					{
+						$count_by_date[$name][$tdate]="0";
+					}
+					$cnt_by_date=$count_by_date[$name][$tdate];
+					$mod_cnt_table .= "<td>$cnt_by_date </td>";
+
+					if($i==0)
+					{
+						$values=Graph_n_table_format($period_type,$tdate);
+						$graph_format=$values[0];
+						$table_format=$values[1];
+
+
+						//passing the created dates to graph
+						if($mod_graph_date!="")
+							$mod_graph_date="$mod_graph_date,$graph_format";
+						else
+							$mod_graph_date="$graph_format";
+
+					}
+
+					//passing the name count by date to graph
+					if($mod_cnt_crtd_date!="")
+						$mod_cnt_crtd_date.=",$cnt_by_date";
+					else
+						$mod_cnt_crtd_date="$cnt_by_date";
+
+				}
+
+				$mod_count_val=$mod_count_array[$name];
+
+				$tot_mod_cnt=array_sum($count_by_date[$name]);
+				$mod_cnt_table .= "<td align=center>$tot_mod_cnt</td></tr>";
+
 				if($graph_for =="accountid")
 				{
 					$name_val=get_account_name($name);
 					if($name_val!="")
 						$name=$name_val;
 				}
-                                //Passing name to graph
-                                if($mod_name_val!="") $mod_name_val.=",$name";
-                                else $mod_name_val="$name";
-
-
-	                         //Passing count to graph
-                                if($mod_cnt_val!="") $mod_cnt_val.=",$mod_count_val";
-                                else $mod_cnt_val="$mod_count_val";	
+				//Passing name to graph
+				if($mod_name_val!="") $mod_name_val.=",$name";
+				else $mod_name_val="$name";
+
+
+				//Passing count to graph
+				if($mod_cnt_val!="") $mod_cnt_val.=",$mod_count_val";
+				else $mod_cnt_val="$mod_count_val";	
 
 				if($module!="")
 				{
@@ -220,81 +219,81 @@
 						$bar_target_val .=",".$link_val;
 				}
 				//The data as per given date
-                                if($i==0)
-                                        $urlstring .=$mod_cnt_crtd_date;
-                                else
-                                        $urlstring .="K".$mod_cnt_crtd_date;
+				if($i==0)
+					$urlstring .=$mod_cnt_crtd_date;
+				else
+					$urlstring .="K".$mod_cnt_crtd_date;
 
 				if($i==0)
 					$test_target_val.=$link_val;
 				else
-					 $test_target_val.="K".$link_val;
-                         }
-                        $mod_cnt_table .="</tr><tr><td class=\"$class\">Total</td>";
+					$test_target_val.="K".$link_val;
+			}
+			$mod_cnt_table .="</tr><tr><td class=\"$class\">Total</td>";
 			//For all Days getting the table 
-                        for($k=0; $k<$days;$k++)
-                        {
-                                $tdate=$date_array[$k];
-                                if(!isset($mod_tot_cnt_array[$tdate]))
-                                        $mod_tot_cnt_array[$tdate]="0";
-                                $tot= $mod_tot_cnt_array[$tdate];
-                                if($period_type!="yday")
-                                        $mod_cnt_table.="<td>$tot</td>";
-                        }
-                        $cnt_total=array_sum($mod_tot_cnt_array);
-                        $mod_cnt_table.="<td align=\"center\" class=\"$class\">$cnt_total</td></tr></table>";
-                        $mod_cnt_table.="</table>";
-                        $title_of_graph="$title : $cnt_total";
+			for($k=0; $k<$days;$k++)
+			{
+				$tdate=$date_array[$k];
+				if(!isset($mod_tot_cnt_array[$tdate]))
+					$mod_tot_cnt_array[$tdate]="0";
+				$tot= $mod_tot_cnt_array[$tdate];
+				if($period_type!="yday")
+					$mod_cnt_table.="<td>$tot</td>";
+			}
+			$cnt_total=array_sum($mod_tot_cnt_array);
+			$mod_cnt_table.="<td align=\"center\" class=\"$class\">$cnt_total</td></tr></table>";
+			$mod_cnt_table.="</table>";
+			$title_of_graph="$title : $cnt_total";
 			$bar_target_val=urlencode($bar_target_val);
 			$test_target_val=urlencode($test_target_val);
 
-		
-                        $Prod_mod_val=array($mod_name_val,$mod_cnt_val,$title_of_graph,$bar_target_val,$mod_graph_date,$urlstring,$mod_cnt_table,$test_target_val);	
-                        return $Prod_mod_val;
-                }
-                else
-                {
-                        $data=0;
-	
-                }
-		 
-        }
+
+			$Prod_mod_val=array($mod_name_val,$mod_cnt_val,$title_of_graph,$bar_target_val,$mod_graph_date,$urlstring,$mod_cnt_table,$test_target_val);	
+			return $Prod_mod_val;
+		}
+		else
+		{
+			$data=0;
+
+		}
+
+	}
 	else
-        {
-                $data=0;
+	{
+		$data=0;
 		echo "<h3> The data is not available with the specified time period</h3>";
-        }
-         return $data;
+	}
+	return $data;
 }
 
 
 /** Saving the images of the graph in the /cache/images
-        otherwise it will render the graph with the given details
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-        * Contributor(s): ______________________________________..
- */
+  * otherwise it will render the graph with the given details
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+  * Contributor(s): ______________________________________..
+*/
 
 
 function save_image_map($filename,$image_map)
 {
 
-	
-        global $log;
-
-        if (!$handle = fopen($filename, 'w')) {
-                $log->debug(" Cannot open file ($filename)");
-                return;
-        }
-
-        // Write $somecontent to our opened file.
-        if (fwrite($handle, $image_map) === FALSE) {
-          $log->debug(" Cannot write to file ($filename)");
-           return false;
-        }
-
-        fclose($handle);
-        return true;
+
+	global $log;
+
+	if (!$handle = fopen($filename, 'w')) {
+		$log->debug(" Cannot open file ($filename)");
+		return;
+	}
+
+	// Write $somecontent to our opened file.
+	if (fwrite($handle, $image_map) === FALSE) {
+		$log->debug(" Cannot write to file ($filename)");
+		return false;
+	}
+
+	fclose($handle);
+	return true;
 }
 
 ?>

Modified: vtigercrm/trunk/modules/Dashboard/accumulated_bargraph.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/accumulated_bargraph.php (original)
+++ vtigercrm/trunk/modules/Dashboard/accumulated_bargraph.php Mon Mar 27 22:35:01 2006
@@ -13,72 +13,66 @@
 $top=(isset($_REQUEST['top']))?$_REQUEST['top']:40;
 $bottom=(isset($_REQUEST['bottom']))?$_REQUEST['bottom']:50;
 $title=(isset($_REQUEST['title']))?$_REQUEST['title']:"Horizontal graph";
-//$target_val=(isset($_REQUEST['target_val']))?$_REQUEST['target_val']:"";
 $target_val=(isset($_REQUEST['test']))?$_REQUEST['test']:"";
-/*
-function accumlated_graph($refer_code,$referdata,$datavalue,$title,$target_val,$width,$height,$left,$right,$top,$bottom)
-{
-*/
-	//Exploding the data values
-	$datavalue=explode("K",$datavalue);
-	$name_value=explode(",",$referdata);
-	$datax=explode(",",$refer_code); //The values to the XAxis
-	$target_val=urldecode($target_val);
-        $target_val=explode("K",$target_val);
+//Exploding the data values
+$datavalue=explode("K",$datavalue);
+$name_value=explode(",",$referdata);
+$datax=explode(",",$refer_code); //The values to the XAxis
+$target_val=urldecode($target_val);
+$target_val=explode("K",$target_val);
 
 
 
 
-	$color_array=array("#FF8B8B","#8BFF8B","#A8A8FF","#FFFF6E","#C5FFFF","#FFA8FF","#FFE28B","lightpink","burlywood2","cadetblue");
+$color_array=array("#FF8B8B","#8BFF8B","#A8A8FF","#FFFF6E","#C5FFFF","#FFA8FF","#FFE28B","lightpink","burlywood2","cadetblue");
 
-	// Create the graph. These two calls are always required
-	$graph = new Graph($width,$height,"auto");    
-	$graph->SetScale("textlin");
+// Create the graph. These two calls are always required
+$graph = new Graph($width,$height,"auto");    
+$graph->SetScale("textlin");
 
-	$graph->SetShadow();
+$graph->SetShadow();
 
 
-	// Create the lines of the Graph
-	for($i=0;$i<count($datavalue);$i++)
-	{
-		$data=$datavalue[$i];
-		$target=$target_val[$i];
-	        $graph_data=explode(",",$data);
-        	$data[$i]=$data;
-	        $bplot[$i] = new BarPlot($graph_data);
-        	$bplot[$i]->SetFillColor($color_array[$i]);
-		$bplot[$i]->SetWidth(10);
+// Create the lines of the Graph
+for($i=0;$i<count($datavalue);$i++)
+{
+	$data=$datavalue[$i];
+	$target=$target_val[$i];
+	$graph_data=explode(",",$data);
+	$data[$i]=$data;
+	$bplot[$i] = new BarPlot($graph_data);
+	$bplot[$i]->SetFillColor($color_array[$i]);
+	$bplot[$i]->SetWidth(10);
 
-                $bplot[$i]->value->Show();
-                $bplot[$i]->value->SetFont(FF_FONT1,FS_NORMAL,8);
-                $bplot[$i]->value->SetColor("black");
-                $bplot[$i]->value->SetFormat('%d');
-                $bplot[$i]->SetValuePos('max');
+	$bplot[$i]->value->Show();
+	$bplot[$i]->value->SetFont(FF_FONT1,FS_NORMAL,8);
+	$bplot[$i]->value->SetColor("black");
+	$bplot[$i]->value->SetFormat('%d');
+	$bplot[$i]->SetValuePos('max');
 
-	}
+}
 
-	$gbplot = new AccBarPlot($bplot);
-	$gbplot->SetWidth(0.7);
+$gbplot = new AccBarPlot($bplot);
+$gbplot->SetWidth(0.7);
 
-        // Add the bar to the graph
-        $graph->Add($gbplot);
+// Add the bar to the graph
+$graph->Add($gbplot);
 
-	$graph->xaxis->SetTickLabels($datax);
+$graph->xaxis->SetTickLabels($datax);
 
-	$graph->title->Set($title);
+$graph->title->Set($title);
 
-	$graph->Set90AndMargin($left,$right,$top,$bottom);
-	//$graph->SetFrame(false);
-	$graph->title->SetFont(FF_FONT1,FS_BOLD);
-	$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
-	$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->Set90AndMargin($left,$right,$top,$bottom);
+//$graph->SetFrame(false);
+$graph->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
+$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
 
-	$graph->SetColor("#7D9CB8");
-	$graph->SetMarginColor("#3D6A93");
+$graph->SetColor("#7D9CB8");
+$graph->SetMarginColor("#3D6A93");
 
-	// Display the graph
-	$graph->Stroke();
-//}
+// Display the graph
+$graph->Stroke();
 
 ?>
 

Modified: vtigercrm/trunk/modules/Dashboard/display_charts.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/display_charts.php (original)
+++ vtigercrm/trunk/modules/Dashboard/display_charts.php Mon Mar 27 22:35:01 2006
@@ -88,125 +88,6 @@
           "ticketsbystatus" => "Tickets by status",
           "ticketsbypriority" => "Tickets by Priority",
           );
-/*
-if($type == "leadsource")
-{
-     $graph_by="leadsource";
-     $graph_title="Leads By Source";
-     $module="Leads";
-     $classsel_name = "dashMnuSel";
-}
-// To display the charts  for Lead status                   
-if ($type == "leadstatus")
-{
-	$graph_by="leadstatus";
-	$graph_title="Leads By Status";
-	$module="Leads";
-	$classsel_name = "dashMnuSel";
-}
-//Charts for Lead Industry
-if($type == "leadindustry")
-{
-	$graph_by="industry";
-     $graph_title="Leads By Industry";
-     $module="Leads";
-     $classsel_name = "dashMnuSel";
-}
-//Sales by Lead Source
-if($type == "salesbyleadsource")
-{
-   $graph_by="leadsource";
-   $graph_title="Sales by LeadSource";
-   $module="Potentials";
-   $classsel_name = "dashMnuSel";
-}
-//Sales by Account
-if($type == "salesbyaccount")
-{
-     $graph_by="accountid";
-     $graph_title="Sales by Accounts";
-     $module="Potentials";
-     $classsel_name = "dashMnuSel";
-}
-//Charts for Account by Industry
-if($type == "accountindustry")
-{
-	$graph_by="industry";
-     $graph_title="Account By Industry";
-     $module="Accounts";
-     $classsel_name = "dashMnuSel";
-}
-//Charts for Products by Category
-if($type == "productcategory")
-{
-	$graph_by="productcategory";
-     $graph_title="Products by Category";
-     $module="Products";
-}
-// Sales Order by Accounts
-if($type == "sobyaccounts")
-{
-	$graph_by="accountid";
-     $graph_title="Sales Order by Accounts";
-     $module="SalesOrder";
-}
-//Sales Order by Status
-if($type == "sobystatus")
-{
-     $graph_by="sostatus";
-     $graph_title="Sales Order by Status";
-     $module="SalesOrder";
-}
-//Purchase Order by Status
-if($type == "pobystatus")
-{
-    $graph_by="postatus";
-    $graph_title="Purchase Order by Status";
-    $module="PurchaseOrder";
-}
-//Quotes by Accounts
-if($type == "quotesbyaccounts")
-{
-   $graph_by="accountid";
-   $graph_title="Quotes by Accounts";
-   $module="Quotes";
-}
-//Quotes by Stage
-if($type == "quotesbystage") 
-{
-   $graph_by="quotestage";
-   $graph_title="Quotes by Stage";
-   $module="Quotes";
-}
-//Invoice by Accounts
-if($type == "invoicebyacnts")
-{
-   $graph_by="accountid";
-   $graph_title="Invoices by Accounts";
-   $module="Invoice";
-}
-//Invoices by status
-if($type == "invoicebystatus")
-{
-   $graph_by="invoicestatus";
-   $graph_title="Invoices by status";
-   $module="Invoice";
-}
-//Tickets by Status
-if($type == "ticketsbystatus")
-{
-   $graph_by="ticketstatus";
-   $graph_title="Tickets by status";
-   $module="HelpDesk";
-}
-//Tickets by Priority
-if($type == "ticketsbypriority")
-{
-   $graph_by="priority";
-   $graph_title="Tickets by Priority";
-   $module="HelpDesk";
-}
-  */                  
 function get_graph_by_type($graph_by,$graph_title,$module,$where,$query)
 {
 	global $user_id,$date_start,$end_date,$type;
@@ -245,12 +126,12 @@
  
 }
 
- /** Returns  the Horizontal,vertical, pie graphs and Accumulated Graphs 
-	for the details
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-        * Contributor(s): ______________________________________..
- */
+/** Returns  the Horizontal,vertical, pie graphs and Accumulated Graphs 
+for the details
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+* Contributor(s): ______________________________________..
+*/
 
 
 // Function for get graphs
@@ -262,7 +143,6 @@
 	$val=explode(":",$title); 		
 	$display_title=$val[0];	
 			
-	//$sHTML = "<h2><center>  $display_title in between  $date_start and  $end_date </center></h2>";
 	
 $sHTML .= "<tr>
 	   <td><table width=20%  border=0 cellspacing=0 cellpadding=0 align=left>
@@ -336,12 +216,12 @@
 	return $sHTML;
 }
 
- /** Returns graph, if the cached image is present it'll display that image,
-	otherwise it will render the graph with the given details	
-	* Portions created by vtiger are Copyright (C) vtiger.
-	* All Rights Reserved.
-        * Contributor(s): ______________________________________..
- */
+/** Returns graph, if the cached image is present it'll display that image,
+otherwise it will render the graph with the given details	
+* Portions created by vtiger are Copyright (C) vtiger.
+* All Rights Reserved.
+* Contributor(s): ______________________________________..
+*/
 
 // Function to get the chached image if exists
 function render_graph($cache_file_name,$html_imagename,$cnt_val,$name_val,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$graph_type)

Modified: vtigercrm/trunk/modules/Dashboard/line_graph.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/line_graph.php (original)
+++ vtigercrm/trunk/modules/Dashboard/line_graph.php Mon Mar 27 22:35:01 2006
@@ -40,23 +40,14 @@
 
 // Setup the graph
 
-//$graph = new Graph(300,200);
 $graph = new Graph($width,$height);
 $graph->SetMarginColor('white');
 $graph->SetScale("textlin");
-//$graph->SetFrame(false);
-//$graph->SetMargin(30,50,30,30);
 $graph->SetMargin($left,$right,$top,$bottom);
-
 $graph->tabtitle->Set($title );
 $graph->tabtitle->SetFont(FF_FONT2,FS_BOLD,13);
-
-
 $graph->yaxis->HideZeroLabel();
-//$graph->ygrid->SetFill(true,'#EFEFEF at 0.5','#BBCCFF at 0.5');
-//$graph->ygrid->SetFill(true,'#E3FDFA at 0.5','#F4FDF5 at 0.5');
 $graph->xgrid->Show();
-//$graph->xgrid->Show();
 
 $thick=6;
 // Create the lines of the Graph
@@ -66,8 +57,6 @@
 	$graph_data=explode(",",$data);
 
 	$name=$name_value[$i];
-	
-//	$lineplot ->SetWeight($i);	
 	$color_val=$color_array[$i];
 	$temp="p".$i;
 	$$temp = new LinePlot($graph_data);
@@ -102,9 +91,6 @@
 // Set some other color then the boring default
 $graph->SetColor("#CCDFCC");
 $graph->SetMarginColor("#98C098");
-
-
-//$graph->xaxis->SetTextAlign('center','top');
 $graph->xaxis->SetTickLabels($datax);
 $graph->xaxis->SetLabelAngle(90);
 

Modified: vtigercrm/trunk/modules/Dashboard/pie_graph.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/pie_graph.php (original)
+++ vtigercrm/trunk/modules/Dashboard/pie_graph.php Mon Mar 27 22:35:01 2006
@@ -16,13 +16,13 @@
 
 
 /** Function to render the Horizontal Graph
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-        * Contributor(s): ______________________________________..
- */
+  * Portions created by vtiger are Copyright (C) vtiger.
+  * All Rights Reserved.
+  * Contributor(s): ______________________________________..
+  */
 function pie_chart($referdata,$refer_code,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_image_name)
 {
-	
+
 
 	global $log,$root_directory;
 	//We'll be getting the values in the form of a string separated by commas
@@ -36,8 +36,8 @@
 	for($i=0;$i<count($datax); $i++)
 	{
 		$name=$datax[$i];
-                $pos = substr_count($name," ");
-                $alts[]=$name."=%d";
+		$pos = substr_count($name," ");
+		$alts[]=$name."=%d";
 	}
 
 	$graph = new PieGraph($width,$height,"auto");
@@ -52,20 +52,12 @@
 	$p1->SetTheme("sand");
 	$p1->ExplodeSlice(1);
 	$p1->SetCenter(0.45);
-	//$p1->SetLegends($gDateLocale->GetShortMonth());
 	$p1->SetLegends($datax);
-	//$p1->ShowBorder(false);
-
 
 	// Setup the labels
 	$p1->SetLabelType(PIE_VALUE_PER);    
 	$p1->value->Show();            
-	//$p1->value->SetFont(FF_ARIAL,FS_NORMAL,9);    
-	//$p1->value->SetFormat('%2.1f%%');        
 	$p1->value->SetFormat('%2.1f%%');        
-	//$p1->value->SetFormat("$datax\n$datay('%2.1f%')");
-
-
 	$p1->SetCSIMTargets($target,$alts);
 	// Don't display the border
 	$graph->SetFrame(false);
@@ -73,13 +65,13 @@
 	$graph->Add($p1);
 
 	$graph-> Stroke( $cache_file_name );
-        $imgMap = $graph ->GetHTMLImageMap ($html_image_name);
-        save_image_map($cache_file_name.'.map', $imgMap);
-        $base_name_cache_file=basename($cache_file_name);
-        $ccc="cache/images/".$base_name_cache_file;
-        $img = "<img src=$ccc ismap usemap='#$html_image_name' border=0>" ;
-        $img.=$imgMap;
-        return $img;
+	$imgMap = $graph ->GetHTMLImageMap ($html_image_name);
+	save_image_map($cache_file_name.'.map', $imgMap);
+	$base_name_cache_file=basename($cache_file_name);
+	$ccc="cache/images/".$base_name_cache_file;
+	$img = "<img src=$ccc ismap usemap='#$html_image_name' border=0>" ;
+	$img.=$imgMap;
+	return $img;
 
 }
 ?>

Modified: vtigercrm/trunk/modules/Dashboard/vertical_bargraph.php
==============================================================================
--- vtigercrm/trunk/modules/Dashboard/vertical_bargraph.php (original)
+++ vtigercrm/trunk/modules/Dashboard/vertical_bargraph.php Mon Mar 27 22:35:01 2006
@@ -15,9 +15,9 @@
 include ("jpgraph/src/jpgraph_iconplot.php");
 
 /** Function to render the Vertical Bar Graph
-        * Portions created by vtiger are Copyright (C) vtiger.
-        * All Rights Reserved.
-        * Contributor(s): ______________________________________..
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________..
  */
 
 function vertical_graph($referdata,$refer_code,$width,$height,$left,$right,$top,$bottom,$title,$target_val,$cache_file_name,$html_image_name)
@@ -27,7 +27,7 @@
 	$datay=explode(",",$referdata); //The datay values
 	$datax=explode(",",$refer_code); // The datax values
 	$target_val=urldecode($target_val);// The links values for bar are given as string in the encoded form, here we are decoding it
-        $target=explode(",",$target_val);
+	$target=explode(",",$target_val);
 
 	$alts=array(); //Array which contains the data which is displayed on the mouse over
 	$temp=array();
@@ -97,7 +97,6 @@
 	$bplot->SetFillGradient("navy","lightsteelblue",GRAD_MIDVER);
 	$graph->SetFrame(false);
 	$graph->SetMarginColor('white');
-	//$graph->ygrid->SetFill(true,'azure1','azure2');
 	$graph->xgrid->Show();
 
 	// To get the Targets 
@@ -120,18 +119,15 @@
 
 	$bplot->value->SetFormat('%d');
 
-	// Display the graph
-//	$graph->Stroke(); 
-
-        //Getting the graph in the form of html page
+	//Getting the graph in the form of html page
 	$graph-> Stroke( $cache_file_name );
 	$imgMap = $graph ->GetHTMLImageMap ($html_image_name);
-        save_image_map($cache_file_name.'.map', $imgMap);
-        $base_name_cache_file=basename($cache_file_name);
-        $ccc="cache/images/".$base_name_cache_file;
-        $img= "<img src=$ccc ismap usemap='#$html_image_name' border=0>" ;
-        $img.=$imgMap;
-        return $img;
+	save_image_map($cache_file_name.'.map', $imgMap);
+	$base_name_cache_file=basename($cache_file_name);
+	$ccc="cache/images/".$base_name_cache_file;
+	$img= "<img src=$ccc ismap usemap='#$html_image_name' border=0>" ;
+	$img.=$imgMap;
+	return $img;
 
 }
 ?>





More information about the vtigercrm-commits mailing list