3 * Project Statistics Page
4 * Copyright 2003 GForge, LLC
9 require_once('../../env.inc.php');
10 require_once $gfwww.'include/pre.php';
11 require_once $gfcommon.'reporting/report_utils.php';
12 require_once $gfcommon.'reporting/Report.class.php';
14 $group_id = getIntFromRequest('group_id');
19 $group =& group_get_object($group_id);
20 if (!$group || !is_object($group)) {
21 exit_error('Error','Could Not Get Group');
22 } elseif ($group->isError()) {
23 exit_error('Error',$group->getErrorMessage());
27 if ($report->isError()) {
28 exit_error($report->getErrorMessage());
31 $area = getStringFromRequest('area');
32 $SPAN = getIntFromRequest('SPAN', REPORT_TYPE_MONTHLY);
33 $start = getIntFromRequest('start');
34 $end = getIntFromRequest('end');
37 $z =& $report->getMonthStartArr();
40 if (!$end || $end <= $start) {
41 $z =& $report->getMonthStartArr();
42 $end = $z[count($z)-1];
45 // Find a default SPAN value depending on the number of days.
46 $delta=($end - $start)/24/60/60;
49 if ($delta > 60) $SPAN=2;
50 if ($delta > 365) $SPAN=3;
53 site_project_header(array('title'=>_('Project Activity').' '.$group->getPublicName(),'group'=>$group_id,'toptab'=>'home'));
55 $area = util_ensure_value_in_set ($area, array ('tracker','forum','docman','taskman','downloads')) ;
56 if ($SPAN && !is_numeric($SPAN)) { $SPAN = 1; }
57 if ($start && !is_numeric($start)) { $start = false; }
58 if ($end && !is_numeric($end)) { $end = false; }
61 // BEGIN PAGE CONTENT CODE
65 <h1><?php echo _('Project Activity'); ?></h1>
67 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
68 <input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
70 <td><strong><?php echo _('Areas'); ?>:</strong><br /><?php echo report_area_box('area',$area,$group); ?></td>
71 <td><strong><?php echo _('Type'); ?>:</strong><br /><?php echo report_span_box('SPAN',$SPAN); ?></td>
72 <td><strong><?php echo _('Start'); ?>:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
73 <td><strong><?php echo _('End'); ?>:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
74 <td><input type="submit" name="submit" value="<?php echo _('Refresh'); ?>" /></td>
78 <img src="/reporting/projectact_graph.php?<?php echo "SPAN=$SPAN&start=$start&end=$end&g_id=$group_id&area=$area"; ?>" width="640" height="480" alt="" />
83 site_project_footer( array() );