5 * Copyright 2004 (c) GForge LLC
7 * @author Tim Perdue tim@gforge.org
10 * This file is part of GForge.
12 * GForge is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * GForge is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with GForge; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 require_once('../env.inc.php');
28 require_once $gfwww.'include/pre.php';
29 require_once $gfcommon.'reporting/report_utils.php';
30 require_once $gfcommon.'reporting/ReportUserTime.class.php';
32 session_require( array('group'=>$sys_stats_group) );
35 if ($report->isError()) {
36 exit_error($report->getErrorMessage());
39 $start = getIntFromRequest('start');
40 $end = getIntFromRequest('end');
41 $sw = getStringFromRequest('sw');
42 $typ = getStringFromRequest('typ');
43 $dev_id = getStringFromRequest('dev_id');
44 $type = getStringFromRequest('type');
47 $z =& $report->getMonthStartArr();
48 $start = $z[count($z)-1];
52 echo report_header(_('User Time Reporting'));
54 $abc_array = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
56 echo _('Choose the <strong>First Letter</strong> of the name of the person you wish to report on.');
59 for ($i=0; $i<count($abc_array); $i++) {
60 if ($sw == $abc_array[$i]) {
61 echo '<strong>'.$abc_array[$i].'</strong> ';
63 echo '<a href="usertime.php?sw='.$abc_array[$i].'&typ='.$typ.'">'.$abc_array[$i].'</a> ';
70 $a[]=_('By Category');
71 $a[]=_('By Subproject');
78 <h2><?php echo _('User Time Reporting'); ?></h2>
80 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
81 <input type="hidden" name="sw" value="<?php echo $sw; ?>" />
82 <input type="hidden" name="typ" value="<?php echo $typ; ?>" />
84 <td><strong><?php echo _('User'); ?>:</strong><br /><?php echo report_usertime_box('dev_id',$dev_id,$sw); ?></td>
85 <td><strong><?php echo _('Type'); ?>:</strong><br /><?php echo html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
86 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
87 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
88 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" /></td>
92 if ($dev_id && $typ=='r') {
93 $report=new ReportUserTime($dev_id,$type,$start,$end);
94 $labels = $report->labels;
95 $data = $report->getData();
97 echo $HTML->listTableTop (array('Type','Time'));
99 for ($i=0; $i<count($labels); $i++) {
101 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
102 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
106 echo $HTML->listTableBottom ();
108 } elseif ($dev_id) { ?>
110 <img src="usertime_graph.php?<?php echo "start=$start&end=$end&dev_id=$dev_id&type=$type"; ?>" width="640" height="480" alt="" />
118 echo report_footer();
122 // c-file-style: "bsd"