-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.php
More file actions
70 lines (60 loc) · 2.78 KB
/
report.php
File metadata and controls
70 lines (60 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
/**
*
* @package mahara
* @subpackage core
* @author Melissa Draper <melissa@catalyst.net.nz>, Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
* @copyright For copyright information on Mahara, please see the README file distributed with this software.
*/
define('INTERNAL', 1);
require(dirname(dirname(__FILE__)) . '/init.php');
require_once('view.php');
require_once('group.php');
safe_require('artefact', 'comment');
define('TITLE', get_string('report', 'group'));
define('MENUITEM', 'groups/report');
define('GROUP', param_integer('group'));
define('SUBSECTIONHEADING', get_string('report', 'group'));
$wwwroot = get_config('wwwroot');
$needsubdomain = get_config('cleanurlusersubdomains');
$limit = param_integer('limit', 0);
$limit = user_preferred_limit($limit, 'itemsperpage');
$offset = param_integer('offset', 0);
$sort = param_variable('sort', 'title');
$direction = param_variable('direction', 'asc');
$group = group_current_group();
$role = group_user_access($group->id);
if (!group_role_can_access_report($group, $role)) {
throw new AccessDeniedException();
}
$sharedviews = View::get_participation_sharedviews_data($group->id, $sort, $direction, $limit, $offset);
$pagination = array(
'baseurl' => $wwwroot . 'group/report.php?group=' . $group->id . '&sort=' . $sort . '&direction=' . $direction,
'id' => 'sharedviews_pagination',
'datatable' => 'sharedviewsreport',
'jsonscript' => 'group/participationsharedviews.json.php',
'setlimit' => true,
'resultcounttextsingular' => get_string('view', 'view'),
'resultcounttextplural' => get_string('views', 'view'),
);
$sharedviews = View::render_participation_views($sharedviews, 'group/participationsharedviews.tpl', $pagination);
$groupviews = View::get_participation_groupviews_data($group->id, $sort, $direction, $limit, $offset);
$pagination = array(
'baseurl' => $wwwroot . 'group/report.php?group=' . $group->id . '&sort=' . $sort . '&direction=' . $direction,
'id' => 'groupviews_pagination',
'datatable' => 'groupviewsreport',
'jsonscript' => 'group/participationgroupviews.json.php',
'setlimit' => true,
'resultcounttextsingular' => get_string('view', 'view'),
'resultcounttextplural' => get_string('views', 'view'),
);
$groupviews = View::render_participation_views($groupviews, 'group/participationgroupviews.tpl', $pagination);
$smarty = smarty(array('paginator'));
$smarty->assign('baseurl', get_config('wwwroot') . 'group/report.php?group=' . $group->id);
$smarty->assign('heading', $group->name);
$smarty->assign('sharedviews', $sharedviews);
$smarty->assign('groupviews', $groupviews);
$smarty->assign('sort', $sort);
$smarty->assign('direction', $direction);
$smarty->display('group/report.tpl');