19 declare(strict_types=1);
46 $this->tpl = $DIC->ui()->mainTemplate();
47 $this->
ctrl = $DIC->ctrl();
48 $this->
lng = $DIC->language();
49 $this->
toolbar = $DIC->toolbar();
50 $this->error = $DIC[
'ilErr'];
51 $this->tree = $DIC->repositoryTree();
52 $this->
access = $DIC->access();
54 $this->
lng->loadLanguageModule(
'event');
55 $this->
lng->loadLanguageModule(
'crs');
57 $this->course_ref_id = $a_crs_ref_id;
59 $this->members_obj = $a_members;
64 $next_class = $this->
ctrl->getNextClass($this);
65 $cmd = $this->
ctrl->getCmd();
67 switch ($next_class) {
70 $cmd =
"listSessions";
86 if (!$ilAccess->checkRbacOrPositionPermissionAccess(
'manage_members',
'manage_members', $this->course_ref_id)) {
87 $ilErr->raiseError($this->
lng->txt(
'msg_no_perm_read'),
$ilErr->MESSAGE);
90 $ilToolbar->addButton(
91 $this->
lng->txt(
'event_csv_export'),
92 $this->
ctrl->getLinkTarget($this,
'exportCSV')
95 $part = $this->members_obj->getParticipants();
96 $part = $ilAccess->filterUserIdsByRbacOrPositionOfCurrentUser(
104 $this->tpl->setContent($tbl->getHTML());
115 $this->course_ref_id,
116 $this->members_obj->getParticipants()
123 'userid' => (
int) $user_id,
124 'firstname' => (
string) $name[
"firstname"],
125 'lastname' => (string) $name[
'lastname']
128 usort($sortedMembers,
function (
$a,
$b) {
129 return $a[
'lastname'] <=>
$b[
'lastname'];
133 foreach ($tree->getSubtree($tree->
getNodeData($this->course_ref_id),
false, [
'sess']) as $event_id) {
135 if (!is_object($tmp_event) || !$ilAccess->checkAccess(
'manage_members',
'', $event_id)) {
138 $events[] = $tmp_event;
142 $this->csv->addColumn($this->
lng->txt(
"lastname"));
143 $this->csv->addColumn($this->
lng->txt(
"firstname"));
144 $this->csv->addColumn($this->
lng->txt(
"login"));
146 foreach ($events as $event_obj) {
148 $this->csv->addColumn($event_obj->getTitle() .
' (' . $event_obj->getFirstAppointment()->appointmentToString() .
')');
151 $this->csv->addRow();
153 foreach ($sortedMembers as $member) {
154 $this->csv->addColumn($member[
'lastname']);
155 $this->csv->addColumn($member[
'firstname']);
158 foreach ($events as $event_obj) {
161 $this->csv->addColumn($event_part->hasParticipated($member[
'userid']) ?
162 $this->
lng->txt(
'event_participated') :
163 $this->
lng->txt(
'event_not_participated'));
166 $this->csv->addRow();
171 $this->csv->getCSVString(),
getNodeData(int $a_node_id, ?int $a_tree_pk=null)
get all information of a node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__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
class ilEventParticipants
Base class for course and group participants.
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)