5 * Copyright 2003-2004 (c) GForge LLC
6 * http://fusionforge.org
8 * This file is part of FusionForge.
10 * FusionForge is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * FusionForge is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with FusionForge; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 require_once('../env.inc.php');
26 require_once $gfcommon.'include/pre.php';
27 require_once $gfcommon.'reporting/report_utils.php';
28 require_once $gfcommon.'reporting/ReportUserTime.class.php';
30 session_require_global_perm ('forge_stats', 'read') ;
33 if ($report->isError()) {
34 exit_error($report->getErrorMessage());
37 $start = getIntFromRequest('start');
38 $end = getIntFromRequest('end');
39 $sw = getStringFromRequest('sw');
40 $typ = getStringFromRequest('typ');
41 $dev_id = getStringFromRequest('dev_id');
42 $type = getStringFromRequest('type');
45 $z =& $report->getMonthStartArr();
46 $start = $z[count($z)-1];
50 report_header(_('User Time Reporting'));
52 $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');
54 echo _('Choose the <strong>First Letter</strong> of the name of the person you wish to report on.');
57 for ($i=0; $i<count($abc_array); $i++) {
58 if ($sw == $abc_array[$i]) {
59 echo '<strong>'.$abc_array[$i].'</strong> ';
61 echo '<a href="usertime.php?sw='.$abc_array[$i].'&typ='.$typ.'">'.$abc_array[$i].'</a> ';
68 $a[]=_('By Category');
69 $a[]=_('By Subproject');
76 <h2><?php echo _('User Time Reporting'); ?></h2>
78 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
79 <input type="hidden" name="sw" value="<?php echo $sw; ?>" />
80 <input type="hidden" name="typ" value="<?php echo $typ; ?>" />
82 <td><strong><?php echo _('User'); ?>:</strong><br /><?php echo report_usertime_box('dev_id',$dev_id,$sw); ?></td>
83 <td><strong><?php echo _('Type'); ?>:</strong><br /><?php echo html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
84 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
85 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
86 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" /></td>
90 if ($dev_id && $typ=='r') {
91 $report=new ReportUserTime($dev_id,$type,$start,$end);
92 $labels = $report->labels;
93 $data = $report->getData();
95 echo $HTML->listTableTop (array('Type','Time'));
97 for ($i=0; $i<count($labels); $i++) {
99 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
100 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
104 echo $HTML->listTableBottom ();
106 } elseif ($dev_id) { ?>
108 <img src="usertime_graph.php?<?php echo "start=$start&end=$end&dev_id=$dev_id&type=$type"; ?>" width="640" height="480" alt="" />
120 // c-file-style: "bsd"