5 * Copyright 2003-2004 (c) GForge LLC
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 require_once('../env.inc.php');
25 require_once $gfcommon.'include/pre.php';
26 require_once(forge_get_config('jpgraph_path').'/jpgraph.php');
27 require_once(forge_get_config('jpgraph_path').'/jpgraph_pie.php');
28 require_once(forge_get_config('jpgraph_path').'/jpgraph_pie3d.php');
29 require_once $gfcommon.'reporting/ReportUserTime.class.php';
30 require_once $gfcommon.'reporting/report_utils.php';
32 session_require_global_perm ('forge_stats', 'read') ;
34 $dev_id = getIntFromRequest('dev_id');
35 $type = getStringFromRequest('type');
36 $start = getIntFromRequest('start');
37 $end = getIntFromRequest('end');
42 $report=new ReportUserTime($dev_id,$type,$start,$end);
45 // Check for error, such as license key problem
47 if ($report->isError()) {
48 exit_error($report->getErrorMessage());
51 // XXX ogi: Isn't it $type?
52 if (!isset($datatype)) {
57 $start=mktime(0,0,0,date('m'),1,date('Y'));;
65 // Create the graph. These two calls are always required
66 $graph = new PieGraph(640, 480,"auto");
67 $graph->SetMargin(50,10,35,80);
69 $arr['tasks']='By Task';
70 $arr['category']='By Category';
71 $arr['subproject']='By Subproject';
73 $graph->title->Set("Time Report ".$arr[$type]." (".date('m/d/Y',$start) ."-". date('m/d/Y',$end) .")");
74 $graph->subtitle->Set(forge_get_config ('forge_name'));
76 // Create the tracker open plot
77 //$data =& $report->getData();
78 //$labels =& $report->labels;
79 report_pie_arr($report->labels,$report->getData());
81 $p1 = new PiePlot3D( $pie_vals );
82 $p1->ExplodeSlice (0);
83 $p1->SetLegends( $pie_labels );