3 * FusionForge reporting system
5 * Copyright 2003-2004, Tim Perdue/GForge, LLC
6 * Copyright 2009, Roland Mas
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 $gfcommon.'reporting/Report.class.php';
26 class ReportSiteAct extends Report {
30 function ReportSiteAct($span,$start=0,$end=0) {
34 $start=mktime(0,0,0,date('m'),1,date('Y'));;
42 if (!$span || $span == REPORT_TYPE_MONTHLY) {
43 $res = db_query_params ('SELECT * FROM rep_site_act_monthly_vw WHERE month BETWEEN $1 AND $2 ORDER BY month ASC',
46 } elseif ($span == REPORT_TYPE_WEEKLY) {
47 $res = db_query_params ('SELECT * FROM rep_site_act_weekly_vw WHERE week BETWEEN $1 AND $2 ORDER BY week ASC',
50 } elseif ($span == REPORT_TYPE_DAILY) {
51 $res = db_query_params ('SELECT * FROM rep_site_act_daily_vw WHERE day BETWEEN $1 AND $2 ORDER BY day ASC',
56 $this->start_date=$start;
59 if (!$res || db_error()) {
60 $this->setError('ReportProjectAct:: '.db_error());
63 $this->setSpan($span);
64 $this->setDates($res,0);
69 function &getTrackerOpened() {
70 return util_result_column_to_array($this->res,1);
73 function &getTrackerClosed() {
74 return util_result_column_to_array($this->res,2);
77 function &getForum() {
78 return util_result_column_to_array($this->res,3);
82 return util_result_column_to_array($this->res,4);
85 function &getDownloads() {
86 return util_result_column_to_array($this->res,5);
89 function &getCVSCommits() {
90 return util_result_column_to_array($this->res,6);
93 function &getTaskOpened() {
94 return util_result_column_to_array($this->res,7);
97 function &getTaskClosed() {
98 return util_result_column_to_array($this->res,8);
105 // c-file-style: "bsd"