5 * Copyright 2003, Tim Perdue, tim@gforge.org
6 * Copyright 2004 (c) GForge LLC
7 * Copyright (C) 2011 Alain Peyrat - Alcatel-Lucent
8 * http://fusionforge.org
10 * This file is part of FusionForge. FusionForge is free software;
11 * you can redistribute it and/or modify it under the terms of the
12 * GNU General Public License as published by the Free Software
13 * Foundation; either version 2 of the Licence, or (at your option)
16 * FusionForge is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 require_once('../../env.inc.php');
27 require_once $gfcommon.'include/pre.php';
28 require_once $gfcommon.'reporting/report_utils.php';
29 require_once $gfcommon.'reporting/Report.class.php';
30 require_once $gfwww.'tracker/include/ArtifactTypeHtml.class.php';
31 require_once $gfwww.'tracker/include/ArtifactTypeFactoryHtml.class.php';
33 if (!session_loggedin()) {
37 $group_id = getIntFromRequest('group_id');
38 $atid = getIntFromRequest('atid');
39 $area = getFilteredStringFromRequest('area', '/^[a-z]+$/');
40 $SPAN = getIntFromRequest('SPAN', REPORT_TYPE_MONTHLY);
41 $start = getIntFromRequest('start');
42 $end = getIntFromRequest('end');
45 if ($report->isError()) {
46 exit_error($report->getErrorMessage());
49 $group = group_get_object($group_id);
50 if (!$group || !is_object($group)) {
53 if ($group->isError()) {
54 if($group->isPermissionDeniedError()) {
55 exit_permission_denied($group->getErrorMessage());
57 exit_error($group->getErrorMessage(), 'tracker');
62 * Set the start date to birth of the project.
64 $res = db_query_params('SELECT register_time FROM groups WHERE group_id=$1',
66 $report->site_start_date = db_result($res,0,'register_time');
68 if (!$start || !$end) $z =& $report->getMonthStartArr();
74 $end = $z[count($z)-1];
76 if ($end < $start) list($start, $end) = array($end, $start);
79 // Get list of trackers this person can see
82 $atf = new ArtifactTypeFactory($group);
84 foreach ($atf->getArtifactTypes() as $at) {
85 if (forge_check_perm ('tracker', $at->getID(), 'read')) {
86 $tids[] = $at->getID();
90 $restracker = db_query_params('SELECT group_artifact_id, name
91 FROM artifact_group_list
92 WHERE group_artifact_id = ANY ($1)',
93 array(db_int_array_to_any_clause($tids)));
97 // Build list of reports
101 $vals[]='activity'; $labels[]=_('Response Time');
102 $vals[]='assignee'; $labels[]=_('By Assignee');
105 $h = new ArtifactTypeHtml($group, $atid);
107 $h = new ArtifactTypeFactoryHtml($group);
110 $h->header(array('title' => _('Project Activity')));
113 <form action="<?php echo getStringFromServer('PHP_SELF'); ?>" method="get">
114 <table style="margin-left: auto; margin-right: auto;">
117 <input type="hidden" name="group_id" value="<?php echo $group_id; ?>" />
118 <strong>Tracker:</strong><br /><?php echo html_build_select_box($restracker,'atid',$atid,false); ?></td>
119 <td><strong>Area:</strong><br /><?php echo html_build_select_box_from_arrays($vals, $labels, 'area',$area,false); ?></td>
120 <td><strong>Type:</strong><br /><?php echo report_span_box('SPAN',$SPAN,true); ?></td>
121 <td><strong>Start:</strong><br /><?php echo report_months_box($report, 'start', $start); ?></td>
122 <td><strong>End:</strong><br /><?php echo report_months_box($report, 'end', $end); ?></td>
123 <td><input type="submit" name="submit" value="Refresh" /></td>
128 if (!$area || $area == 'activity') {
130 <img src="trackeract_graph.php?<?php echo "SPAN=$SPAN&start=$start&end=$end&group_id=$group_id&atid=$atid"; ?>" width="640" height="480" alt="" />
134 <img src="trackerpie_graph.php?<?php echo "SPAN=$SPAN&start=$start&end=$end&group_id=$group_id&atid=$atid&area=$area"; ?>" width="640" height="480" alt="" />
142 <?php $h->footer(array()); ?>