[evolvis-commits] r9847: missed reporting fil?==?UTF-8?Q?es↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 17:32:31 CET 2011


Author: mirabilos
Date: 2011-02-24 17:32:31 +0100 (Thu, 24 Feb 2011)
New Revision: 9847

Added:
   trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackeract_graph.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackerpie_graph.php
Log:
missed reporting files


Added: trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackeract_graph.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackeract_graph.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackeract_graph.php	2011-02-24 16:32:31 UTC (rev 9847)
@@ -0,0 +1,109 @@
+<?php
+/**
+ * Reporting System
+ *
+ * Copyright 2004 (c) GForge LLC
+ *
+ * @version   $Id$
+ * @author Tim Perdue tim at gforge.org
+ * @date 2003-03-16
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('pre.php');
+require_once($sys_path_to_jpgraph.'jpgraph.php');
+require_once($sys_path_to_jpgraph.'jpgraph_line.php');
+require_once('common/reporting/ReportTrackerAct.class');
+
+if (!$SPAN) {
+	$SPAN=REPORT_TYPE_MONTHLY;
+}
+
+//
+//	Create Report
+//
+$report=new ReportTrackerAct($SPAN,$group_id,$atid,$start,$end); 
+
+//
+//	Check for error, such as license key problem
+//
+if ($report->isError()) {
+	echo $report->getErrorMessage();
+	exit;
+}
+
+//
+// Get Group Object
+//
+$g =& group_get_object($group_id);
+if (!$g || $g->isError()) {
+	exit_error("Could Not Get Group");
+}
+
+// Create the graph. These two calls are always required
+$graph  = new Graph(640, 480,"auto");
+$graph->SetMargin(50,10,35,50);
+$graph->SetScale( "textlin");
+//$graph->SetScale( "linlog");
+//$graph ->SetYScale("log");
+
+// Create the average time plot
+$ydata  =& $report->getAverageTimeData();
+$lineplot =new LinePlot($ydata);
+$lineplot ->SetColor("black");
+$graph->Add( $lineplot);
+
+// Create the open count plot
+$ydata2  =& $report->getOpenCountData();
+$lineplot2 =new LinePlot($ydata2);
+$lineplot2 ->SetColor("blue");
+$graph->Add( $lineplot2 );
+
+// Create the still open count plot
+$ydata3  =& $report->getStillOpenCountData();
+$lineplot3 =new LinePlot($ydata3);
+$lineplot3 ->SetColor("red");
+$graph->Add( $lineplot3 );
+
+//	Legends
+$lineplot->SetLegend ("Avg Time Open");
+$lineplot2 ->SetLegend("Total Opened");
+$lineplot3 ->SetLegend("Total Still Open");
+
+//echo "<pre>".print_r($report->getDates()).'<br>'.print_r($ydata).'<br>'.print_r($ydata2).'<br>'.print_r($ydata3);
+//echo "<pre>".print_r($ydata2);
+//exit;
+
+//
+//	Titles
+//
+$graph->title->Set("Tracker Activity For: ".$g->getPublicName(). 
+	" (".date('m/d/Y',$report->getStartDate()) ."-". date('m/d/Y',$report->getEndDate()) .")");
+$graph->subtitle->Set($report_company_name);
+//$graph->xaxis-> title->Set("Date" );
+//$graph->yaxis-> title->Set("Number" ); 
+
+$a=$report->getDates();
+$graph->xaxis->SetTickLabels($a); 
+$graph->xaxis->SetLabelAngle(90);
+$graph->xaxis->SetTextLabelInterval($report->getGraphInterval());
+
+// Display the graph
+$graph->Stroke();
+
+?>

Added: trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackerpie_graph.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackerpie_graph.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/tracker/reporting/trackerpie_graph.php	2011-02-24 16:32:31 UTC (rev 9847)
@@ -0,0 +1,134 @@
+<?php
+/**
+ * Reporting System
+ *
+ * Copyright 2004 (c) GForge LLC
+ *
+ * @version   $Id$
+ * @author Tim Perdue tim at gforge.org
+ * @date 2003-03-16
+ *
+ * This file is part of GForge.
+ *
+ * GForge is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GForge is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GForge; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('pre.php');
+require_once($sys_path_to_jpgraph.'jpgraph.php');
+require_once($sys_path_to_jpgraph.'jpgraph_pie.php');
+require_once($sys_path_to_jpgraph.'jpgraph_pie3d.php');
+require_once('common/reporting/Report.class');
+require_once('common/reporting/report_utils.php');
+require_once('www/tracker/include/ArtifactTypeHtml.class');
+
+session_require( array('group'=>$sys_stats_group) );
+
+//
+//	Create Report
+//
+$report=new Report();
+
+//
+//	Check for error, such as license key problem
+//
+if ($report->isError()) {
+	echo $report->getErrorMessage();
+	exit;
+}
+
+if (!isset($area)) {
+	$area='category';
+}
+
+if (!$start) {
+	$start=mktime(0,0,0,date('m'),1,date('Y'));;
+}
+if (!$end) {
+	$end=time();
+} else {
+	$end--;
+}
+
+
+if ($area == 'category') {
+
+	$sql="SELECT ac.category_name,count(*) 
+	FROM artifact a, artifact_category ac
+	WHERE a.group_artifact_id='$atid'
+	AND a.category_id=ac.id
+	AND a.open_date BETWEEN '$start' AND '$end'
+	GROUP BY category_name";
+
+} elseif ($area == 'group') {
+
+	$sql="SELECT ag.group_name,count(*) 
+	FROM artifact a, artifact_group ag
+	WHERE a.group_artifact_id='$atid'
+	AND a.artifact_group_id=ag.id
+	AND a.open_date BETWEEN '$start' AND '$end'
+	GROUP BY group_name";
+
+} elseif ($area == 'resolution') {
+
+	$sql="SELECT ar.resolution_name,count(*) 
+	FROM artifact a, artifact_resolution ar
+	WHERE a.group_artifact_id='$atid'
+	AND a.resolution_id=ar.id
+	AND a.open_date BETWEEN '$start' AND '$end'
+	GROUP BY resolution_name";
+
+} else {
+
+	$sql="SELECT u.realname,count(*) 
+	FROM artifact a, users u
+	WHERE a.group_artifact_id='$atid'
+	AND a.assigned_to=u.user_id
+	AND a.open_date BETWEEN '$start' AND '$end'
+	GROUP BY realname";
+
+}
+
+//echo $sql;
+//exit;
+
+$res=db_query($sql);
+
+if (db_error()) {
+	exit_error('Error',db_error());
+}
+
+// Create the graph. These two calls are always required
+$graph  = new PieGraph(640, 480,"auto");
+//$graph->SetMargin(50,10,35,50);
+
+$arr['category']='By Category';
+$arr['group']='By Group';
+$arr['resolution']='By Resolution';
+$arr['technician']='By Tecnician';
+$graph->title->Set($arr[$area]." (".date('m/d/Y',$start) ."-". date('m/d/Y',$end) .")");
+$graph->subtitle->Set($report_company_name);
+
+// Create the tracker open plot
+report_pie_arr(util_result_column_to_array($res,0), util_result_column_to_array($res,1));
+
+$p1  = new PiePlot3D($pie_vals);
+$p1->ExplodeSlice (0);
+$p1->SetLegends($pie_labels);
+$graph->Add( $p1);
+
+// Display the graph
+$graph->Stroke();
+
+?>



More information about the evolvis-commits mailing list