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 ReportUserAct extends Report {
30 function ReportUserAct($span,$user_id,$start=0,$end=0) {
34 $start=mktime(0,0,0,date('m'),1,date('Y'));;
43 $this->setError('No User_id');
46 if (!$span || $span == REPORT_TYPE_MONTHLY) {
47 $res = db_query_params ('SELECT * FROM rep_user_act_monthly WHERE user_id=$1 AND month BETWEEN $2 AND $3 ORDER BY month ASC',
51 } elseif ($span == REPORT_TYPE_WEEKLY) {
52 $res = db_query_params ('SELECT * FROM rep_user_act_weekly WHERE user_id=$1 AND week BETWEEN $2 AND $3 ORDER BY week ASC',
56 } elseif ($span == REPORT_TYPE_DAILY) {
57 $res = db_query_params ('SELECT * FROM rep_user_act_daily WHERE user_id=$1 AND day BETWEEN $2 AND $3 ORDER BY day ASC',
63 $this->start_date=$start;
66 if (!$res || db_error()) {
67 $this->setError('ReportUserAct:: '.db_error());
70 $this->setSpan($span);
71 $this->setDates($res,1);
76 function &getTrackerOpened() {
77 return util_result_column_to_array($this->res,2);
80 function &getTrackerClosed() {
81 return util_result_column_to_array($this->res,3);
84 function &getForum() {
85 return util_result_column_to_array($this->res,4);
89 return util_result_column_to_array($this->res,5);
92 function &getCVSCommits() {
93 return util_result_column_to_array($this->res,6);
96 function &getTaskOpened() {
97 return util_result_column_to_array($this->res,7);
100 function &getTaskClosed() {
101 return util_result_column_to_array($this->res,8);
108 // c-file-style: "bsd"