3 * FusionForge reporting system
5 * Copyright 2003-2004, Tim Perdue/GForge, LLC
6 * Copyright 2009, Roland Mas
7 * Copyright (C) 2010 Alain Peyrat - Alcatel-Lucent
9 * This file is part of FusionForge. FusionForge is free software;
10 * you can redistribute it and/or modify it under the terms of the
11 * GNU General Public License as published by the Free Software
12 * Foundation; either version 2 of the Licence, or (at your option)
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 along
21 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 require_once $gfcommon.'reporting/Report.class.php';
27 class ReportProjectAct extends Report {
31 function ReportProjectAct($span,$group_id,$start=0,$end=0) {
35 $start=mktime(0,0,0,date('m'),1,date('Y'));;
44 $this->setError('No group_id');
47 if (!$span || $span == REPORT_TYPE_MONTHLY) {
48 $res = db_query_params ('SELECT * FROM rep_group_act_monthly WHERE group_id=$1 AND month BETWEEN $2 AND $3 ORDER BY month',
52 } elseif ($span == REPORT_TYPE_WEEKLY) {
53 $res = db_query_params ('SELECT * FROM rep_group_act_weekly WHERE group_id=$1 AND week BETWEEN $2 AND $3 ORDER BY week',
57 } elseif ($span == REPORT_TYPE_DAILY) {
58 $res = db_query_params ('SELECT * FROM rep_group_act_daily WHERE group_id=$1 AND day BETWEEN $2 AND $3 ORDER BY day',
64 $this->start_date=$start;
67 if (!$res || db_error()) {
68 $this->setError('ReportProjectAct:: '.db_error());
71 $this->setSpan($span);
72 $this->setDates($res,1);
77 function &getTrackerOpened() {
78 return util_result_column_to_array($this->res,2);
81 function &getTrackerClosed() {
82 return util_result_column_to_array($this->res,3);
85 function &getForum() {
86 return util_result_column_to_array($this->res,4);
90 return util_result_column_to_array($this->res,5);
93 function &getDownloads() {
94 return util_result_column_to_array($this->res,6);
97 function &getCVSCommits() {
98 return util_result_column_to_array($this->res,7);
101 function &getTaskOpened() {
102 return util_result_column_to_array($this->res,8);
105 function &getTaskClosed() {
106 return util_result_column_to_array($this->res,9);
109 function &getPageViews() {
110 return util_result_column_to_array($this->res,10);
117 // c-file-style: "bsd"