3 * FusionForge reporting system
5 * Copyright (C) 2009 Alain Peyrat, Alcatel-Lucent
6 * Copyright 2009, Roland Mas
7 * Copyright 2012, Franck Villaume
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.
27 * Standard Alcatel-Lucent disclaimer for contributing to open source
29 * "The class ("Contribution") has not been tested and/or
30 * validated for release as or in products, combinations with products or
31 * other commercial use. Any use of the Contribution is entirely made at
32 * the user's own responsibility and the user can not rely on any features,
33 * functionalities or performances Alcatel-Lucent has attributed to the
36 * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
37 * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
38 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
39 * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
40 * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
41 * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
42 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
43 * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
44 * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
48 require_once $gfcommon.'reporting/Report.class.php';
50 class ReportPerGroupDocmanDownloads extends Report {
52 function __construct($group_id, $start = 0, $end = 0) {
56 $start = mktime(0, 0, 0, date('m'), 1, date('Y'));
64 // Convert start & end date to month .
65 $start_m = date('Ym', $start);
66 $end_m = date('Ym', $end);
69 $this->setError(_('No group_id set.'));
73 $res = db_query_params ('SELECT docdata_vw.filename, docdata_vw.realname,
74 docman_dlstats_doc.month || lpad(docman_dlstats_doc.day::text,2,0::text),
77 FROM docman_dlstats_doc, docdata_vw
78 WHERE docdata_vw.group_id = $1
79 AND docman_dlstats_doc.month >= $2
80 AND docman_dlstats_doc.month <= $3
81 ORDER BY docman_dlstats_doc.month DESC,
82 docman_dlstats_doc.day DESC',
87 $this->start_date = $start;
88 $this->end_date = $end;
90 if (!$res || db_error()) {
91 $this->setError('ReportUserAct:: '.db_error());
95 $rows = db_numrows($res);
99 while ($row = db_fetch_array($res)) {