20 declare(strict_types=1);
47 $this->tpl = $DIC->ui()->mainTemplate();
48 $this->
ctrl = $DIC->ctrl();
49 $this->
lng = $DIC->language();
50 $this->
toolbar = $DIC->toolbar();
51 $this->error = $DIC[
'ilErr'];
52 $this->tree = $DIC->repositoryTree();
53 $this->
access = $DIC->access();
55 $this->
lng->loadLanguageModule(
'event');
56 $this->
lng->loadLanguageModule(
'crs');
58 $this->course_ref_id = $a_crs_ref_id;
60 $this->members_obj = $a_members;
65 $next_class = $this->
ctrl->getNextClass($this);
66 $cmd = $this->
ctrl->getCmd();
68 switch ($next_class) {
71 $cmd =
"listSessions";
87 if (!$ilAccess->checkRbacOrPositionPermissionAccess(
'manage_members',
'manage_members', $this->course_ref_id)) {
88 $ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'),
$ilErr->MESSAGE);
91 $ilToolbar->addButton(
92 $this->
lng->txt(
'event_csv_export'),
93 $this->
ctrl->getLinkTarget($this,
'exportCSV')
96 $part = $this->members_obj->getParticipants();
97 $part = $ilAccess->filterUserIdsByRbacOrPositionOfCurrentUser(
100 $this->course_ref_id,
105 $this->tpl->setContent($tbl->getHTML());
116 $this->course_ref_id,
117 $this->members_obj->getParticipants()
121 foreach($part as $user_id) {
124 'userid' => (
int) $user_id,
125 'firstname' => (
string)
$name[
"firstname"],
126 'lastname' => (string)
$name[
'lastname']
129 usort($sortedMembers,
function (
$a,
$b) {
130 return $a[
'lastname'] <=>
$b[
'lastname'];
134 foreach ($tree->getSubtree($tree->
getNodeData($this->course_ref_id),
false, [
'sess']) as $event_id) {
136 if (!is_object($tmp_event) || !$ilAccess->checkAccess(
'manage_members',
'', $event_id)) {
139 $events[] = $tmp_event;
143 $this->csv->addColumn($this->
lng->txt(
"lastname"));
144 $this->csv->addColumn($this->
lng->txt(
"firstname"));
145 $this->csv->addColumn($this->
lng->txt(
"login"));
147 foreach ($events as $event_obj) {
149 $this->csv->addColumn($event_obj->getTitle() .
' (' . $event_obj->getFirstAppointment()->appointmentToString() .
')');
152 $this->csv->addRow();
154 foreach ($sortedMembers as $member) {
155 $this->csv->addColumn($member[
'lastname']);
156 $this->csv->addColumn($member[
'firstname']);
159 foreach ($events as $event_obj) {
162 $this->csv->addColumn($event_part->hasParticipated($member[
'userid']) ?
163 $this->
lng->txt(
'event_participated') :
164 $this->
lng->txt(
'event_not_participated'));
167 $this->csv->addRow();
172 $this->csv->getCSVString(),
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
__construct(int $a_crs_ref_id, ilParticipants $a_members)
ilParticipants $members_obj
static _lookupName(int $a_user_id)
lookup user name
Table presentation for session overview.
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")
static _lookupObjId(int $ref_id)
filterUserIdsByRbacOrPositionOfCurrentUser(string $rbac_perm, string $pos_perm, int $ref_id, array $user_ids)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Base class for course and group participants.
Error Handling & global info handling uses PEAR error class.
listSessions()
list sessions of all user
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
ilGlobalTemplateInterface $tpl
static _lookupLogin(int $a_user_id)