5 * Copyright 2004 (c) GForge LLC
8 * @author Tim Perdue tim@gforge.org
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 require_once('../env.inc.php');
29 require_once('pre.php');
30 require_once('common/reporting/report_utils.php');
31 require_once('common/reporting/ReportProjectTime.class');
33 session_require( array('group'=>$sys_stats_group) );
38 if ($report->isError()) {
39 exit_error($report->getErrorMessage());
42 $sw = getStringFromRequest('sw');
43 $typ = getStringFromRequest('typ');
44 $g_id = getStringFromRequest('g_id');
45 $typ = getStringFromRequest('typ');
46 $start = getStringFromRequest('start');
47 $end = getStringFromRequest('end');
50 $z =& $report->getMonthStartArr();
51 $start = $z[count($z)-1];
54 echo report_header(_('Time Tracking By Project'));
57 $a[]=_('By Category');
58 $a[]=_('By Subproject');
67 <h3><?php echo _('Time Tracking By Project'); ?></h3>
69 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
70 <input type="hidden" name="sw" value="<?php echo $sw; ?>">
71 <input type="hidden" name="typ" value="<?php echo $typ; ?>">
73 <td><strong><?php echo _('Project'); ?>:</strong><br /><?php echo report_group_box('g_id',$g_id); ?></td>
74 <td><strong><?php echo _('Type'); ?>:</strong><br /><?php echo html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
75 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
76 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
77 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>"></td>
82 if ($g_id && $typ=='r') {
83 $report=new ReportProjectTime($g_id,$type,$start,$end);
85 $labels = $report->labels;
86 $data = $report->getData();
88 echo $HTML->listTableTop (array(_('Type'),
91 for ($i=0; $i<count($labels); $i++) {
93 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
94 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
97 echo $HTML->listTableBottom ();
100 <img src="projecttime_graph.php?<?php echo "start=$start&end=$end&g_id=$g_id&type=$type"; ?>" width="640" height="480">
106 echo report_footer();