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 $gfcommon.'reporting/report_utils.php';
27 require_once $gfcommon.'reporting/ReportUserTime.class.php';
29 session_require_global_perm ('forge_stats', 'read') ;
32 if ($report->isError()) {
33 exit_error($report->getErrorMessage());
36 $start = getIntFromRequest('start');
37 $end = getIntFromRequest('end');
38 $sw = getStringFromRequest('sw');
39 $typ = getStringFromRequest('typ');
40 $dev_id = getIntFromRequest('dev_id');
41 $type = getStringFromRequest('type');
43 if (!$start || !$end) $z =& $report->getMonthStartArr();
49 $end = $z[count($z)-1];
51 if ($end < $start) list($start, $end) = array($end, $start);
53 if ($typ != 'r' && $start == $end) {
54 $error_msg .= _('Start and end dates must be different');
57 report_header(_('User Time Reporting'));
59 $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');
61 echo _('Choose the <strong>First Letter</strong> of the name of the person you wish to report on.');
64 for ($i=0; $i<count($abc_array); $i++) {
65 if ($sw == $abc_array[$i]) {
66 echo '<strong>'.$abc_array[$i].'</strong> ';
68 echo '<a href="usertime.php?sw='.$abc_array[$i].'&typ='.$typ.'">'.$abc_array[$i].'</a> ';
75 $a[]=_('By Category');
76 $a[]=_('By Subproject');
84 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
85 <input type="hidden" name="sw" value="<?php echo $sw; ?>" />
86 <input type="hidden" name="typ" value="<?php echo $typ; ?>" />
88 <td><strong><?php echo _('User'); ?>:</strong><br /><?php echo report_usertime_box('dev_id',$dev_id,$sw); ?></td>
89 <td><strong><?php echo _('Type'); ?>:</strong><br /><?php echo html_build_select_box_from_arrays($a2,$a,'type',$type,false); ?></td>
90 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
91 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
92 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" /></td>
96 if ($dev_id && $typ=='r') {
97 $report=new ReportUserTime($dev_id,$type,$start,$end);
98 $labels = $report->labels;
99 $data = $report->getData();
101 echo $HTML->listTableTop (array('Type','Time'));
103 for ($i=0; $i<count($labels); $i++) {
105 echo '<tr '. $HTML->boxGetAltRowStyle($i) .'>'.
106 '<td>'. $labels[$i] .'</td><td>'. $data[$i] .'</td></tr>';
110 echo $HTML->listTableBottom ();
112 } elseif ($dev_id && $start != $end) { ?>
114 <img src="usertime_graph.php?<?php echo "start=$start&end=$end&dev_id=$dev_id&type=$type"; ?>" width="640" height="480" alt="" />
126 // c-file-style: "bsd"