19declare(strict_types=1);
56 $this->repository_object = $repository_obj;
58 $this->
lng = $DIC->language();
59 $this->
lng->loadLanguageModule(
'crs');
61 $this->tpl =
$DIC->ui()->mainTemplate();
62 $this->
ctrl = $DIC->ctrl();
63 $this->
lng->loadLanguageModule(
'trac');
64 $this->
lng->loadLanguageModule(
'mmbr');
65 $this->
logger = $DIC->logger()->mmbr();
66 $this->
access = $DIC->access();
67 $this->
user = $DIC->user();
68 $this->
error = $DIC[
'ilErr'];
69 $this->
tabs = $DIC->tabs();
70 $this->
toolbar = $DIC->toolbar();
71 $this->rbacsystem =
$DIC->rbac()->system();
72 $this->rbacreview =
$DIC->rbac()->review();
73 $this->tree =
$DIC->repositoryTree();
74 $this->
http = $DIC->http();
76 $this->
profile = $DIC[
'user']->getProfile();
84 if ($this->
http->wrapper()->post()->has(
'participants')) {
85 return $this->
http->wrapper()->post()->retrieve(
88 $this->refinery->kindlyTo()->int()
97 if ($this->
http->wrapper()->query()->has(
'member_id')) {
98 return $this->
http->wrapper()->query()->retrieve(
108 if ($this->
http->wrapper()->post()->has(
'subscribers')) {
109 return $this->
http->wrapper()->post()->retrieve(
111 $this->
refinery->kindlyTo()->listOf(
112 $this->refinery->kindlyTo()->int()
121 if ($this->
http->wrapper()->post()->has(
'waiting')) {
122 return $this->
http->wrapper()->post()->retrieve(
124 $this->
refinery->kindlyTo()->listOf(
125 $this->refinery->kindlyTo()->int()
171 string $a_permission,
176 if ($a_ref_id === 0) {
179 return $this->
access->checkAccess($a_permission, $a_cmd, $a_ref_id);
187 if ($a_ref_id === 0) {
188 $a_ref_id = $this->getParentObject()->getRefId();
190 return $this->
access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
199 if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
200 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
201 $this->
ctrl->redirect($this->getParentGUI());
210 if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
211 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
212 $this->
ctrl->redirect($this->getParentGUI());
221 return $this->checkPermissionBool(
'manage_members');
236 $cmd = $this->
ctrl->getCmd(
'participants');
237 $next_class = $this->
ctrl->getNextClass();
239 switch ($next_class) {
240 case 'ilrepositorysearchgui':
242 $this->checkPermission(
'manage_members');
245 $rep_search->addUserAccessFilterCallable([$this,
'filterUserIdsByRbacOrPositionOfCurrentUser']);
247 $participants = $this->getMembersObject();
249 $participants->
isAdmin($this->user->getId()) ||
250 $this->access->checkAccess(
'manage_members',
'', $this->getParentObject()->getRefId())
252 $rep_search->setCallback(
255 $this->getParentGUI()->getLocalRoles(),
256 (
string) $this->getDefaultRole()
260 $rep_search->setCallback(
263 $this->getLocalRoles(),
264 (
string) $this->getDefaultRole()
269 $this->
ctrl->setReturn($this,
'participants');
270 $ret = $this->
ctrl->forwardCommand($rep_search);
273 case 'ilmailmembersearchgui':
274 $this->
tabs->clearTargets();
275 $this->
tabs->setBackTarget(
276 $this->
lng->txt(
'btn_back'),
277 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
283 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId())
285 !$this->rbacsystem->checkAccess(
287 $mail->getMailObjectReferenceId()
289 $this->
error->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->error->MESSAGE);
294 $this->getParentObject()->getRefId(),
295 $this->getMailMemberRoles()
297 $mail_search->setObjParticipants(
300 $this->
ctrl->forwardCommand($mail_search);
303 case 'ilusersgallerygui':
305 $this->setSubTabs($this->
tabs);
306 $this->
tabs->setSubTabActive(
307 $this->getParentObject()->getType() .
'_members_gallery'
309 $is_admin = $this->checkRbacOrPositionAccessBool(
'manage_members',
'manage_members');
311 $this->getParentObject()->getRefId(),
317 !$this->getParentObject()->getShowMembers() ||
321 $this->
error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
324 $this->showMailToMemberToolbarButton($this->
toolbar,
'jump2UsersGallery');
325 $this->showMemberExportToolbarButton($this->
toolbar,
'jump2UsersGallery');
329 $this->
ctrl->forwardCommand($gallery_gui);
332 case 'ilcourseparticipantsgroupsgui':
334 $this->setSubTabs($this->
tabs);
335 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
338 if ($cmd ===
"show" || $cmd =
"") {
339 $this->showMailToMemberToolbarButton($this->
toolbar);
341 $this->
ctrl->forwardCommand($cmg_gui);
344 case 'ilsessionoverviewgui':
346 $this->setSubTabs($this->
tabs);
347 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
352 $this->
ctrl->forwardCommand($overview);
355 case 'ilmemberexportgui':
357 $this->setSubTabs($this->
tabs);
358 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
361 $this->
ctrl->forwardCommand($export);
364 case 'ilobjectcustomuserfieldsgui':
366 $this->setSubTabs($this->
tabs);
367 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
368 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
369 $this->
ctrl->setReturn($this,
'participants');
371 $this->
ctrl->forwardCommand($cdf_gui);
375 $this->setSubTabs($this->
tabs);
378 $cmd ===
"mailMembersBtn" ||
379 $cmd ===
'membersMap' ||
380 $cmd ===
'printForMembersOutput' ||
381 $cmd ===
'jump2UsersGallery'
383 $this->checkPermission(
'read');
385 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
397 $this->initParticipantTemplate();
398 $this->showParticipantsToolbar();
399 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
402 $waiting = $this->parseWaitingListTable();
404 $this->tpl->setVariable(
'TABLE_WAIT', $waiting->getHTML());
408 $subscriber = $this->parseSubscriberTable();
410 $this->tpl->setVariable(
'TABLE_SUB', $subscriber->getHTML());
414 $table = $this->initParticipantTableGUI();
415 $table->setTitle($this->getParticipantTableTitle());
416 $table->setFormAction($this->
ctrl->getFormAction($this));
420 $table->setFilterCommand(
'participantsApplyFilter');
421 $table->setResetCommand(
'participantsResetFilter');
423 $this->tpl->setVariable(
'MEMBERS', $table->getHTML());
428 return $this->
lng->txt($this->getParentObject()->getType() .
'_mem_tbl_header');
441 $table = $this->initParticipantTableGUI();
442 $table->resetOffset();
443 $table->writeFilterToSession();
445 $this->participants();
453 $table = $this->initParticipantTableGUI();
454 $table->resetOffset();
455 $table->resetFilter();
457 $this->participants();
465 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
466 $this->editParticipants(array($this->initMemberIdFromGet()));
475 if (!$post_participants) {
476 $post_participants = $this->initParticipantsFromPost();
479 $real_participants = $this->getMembersObject()->getParticipants();
480 $participants = array_intersect($post_participants, $real_participants);
481 $participants = $this->filterUserIdsByRbacOrPositionOfCurrentUser($participants);
482 if (!count($participants)) {
483 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
484 $this->
ctrl->redirect($this,
'participants');
486 $table = $this->initEditParticipantTableGUI($participants);
487 $this->tpl->setContent($table->getHTML());
495 $participants = $this->initParticipantsFromPost();
496 if (!count($participants)) {
497 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
498 $this->
ctrl->redirect($this,
'participants');
500 $notifications = $passed = $blocked = $contact = [];
501 if ($this->
http->wrapper()->post()->has(
'notification')) {
502 $notifications = $this->
http->wrapper()->post()->retrieve(
504 $this->
refinery->kindlyTo()->listOf(
505 $this->refinery->kindlyTo()->int()
509 if ($this->
http->wrapper()->post()->has(
'passed')) {
510 $passed = $this->
http->wrapper()->post()->retrieve(
512 $this->
refinery->kindlyTo()->listOf(
513 $this->refinery->kindlyTo()->int()
517 if ($this->
http->wrapper()->post()->has(
'blocked')) {
518 $blocked = $this->
http->wrapper()->post()->retrieve(
520 $this->
refinery->kindlyTo()->listOf(
521 $this->refinery->kindlyTo()->int()
525 if ($this->
http->wrapper()->post()->has(
'contact')) {
526 $contact = $this->
http->wrapper()->post()->retrieve(
528 $this->
refinery->kindlyTo()->listOf(
529 $this->refinery->kindlyTo()->int()
535 $hasEditPermissionAccess =
537 $this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) or
538 $this->getMembersObject()->isAdmin($this->
user->getId())
543 $assignableLocalRoles = array();
544 $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
545 foreach ($this->getLocalTypeRole(
false) as $title => $role_id) {
546 $assignableLocalRoles[$role_id] = $title;
550 if ($this->
http->wrapper()->post()->has(
'roles')) {
551 $post_roles = $this->
http->wrapper()->post()->retrieve(
553 $this->
refinery->kindlyTo()->dictOf(
554 $this->refinery->kindlyTo()->dictOf(
555 $this->refinery->kindlyTo()->int()
562 foreach ($participants as $usr_id) {
563 $memberIsAdmin = $this->rbacreview->isAssigned($usr_id, (
int) $adminRoleId);
569 !$hasEditPermissionAccess &&
572 !is_array($post_roles[$usr_id]) ||
573 !in_array($adminRoleId, $post_roles[$usr_id])
576 $post_roles[$usr_id][] = $adminRoleId;
579 if (!isset($post_roles[$usr_id]) || empty($post_roles[$usr_id])) {
580 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'mmbr_role_error'),
true);
581 $this->
ctrl->redirect($this,
'participants');
585 foreach ((array) ($post_roles[$usr_id] ?? []) as $role_id) {
586 if (!array_key_exists($role_id, $assignableLocalRoles)) {
587 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
588 $this->
ctrl->redirect($this,
'participants');
590 if (!$hasEditPermissionAccess &&
591 $role_id == $adminRoleId &&
593 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'));
594 $this->
ctrl->redirect($this,
'participants');
600 foreach ($this->getMembersObject()->getAdmins() as $admin_id) {
601 if (!isset($post_roles[$admin_id])) {
605 if (in_array($adminRoleId, (array) $post_roles[$admin_id])) {
611 if (!$has_admin && is_array($post_roles)) {
613 foreach ($post_roles as $roleIdsToBeAssigned) {
614 if (in_array($adminRoleId, $roleIdsToBeAssigned)) {
622 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_min_one_admin'),
true);
623 $this->
ctrl->redirect($this,
'participants');
626 foreach ($participants as $usr_id) {
627 $this->getMembersObject()->updateRoleAssignments($usr_id, (array) ($post_roles[$usr_id] ?? []));
630 $this->getMembersObject()->updateNotification($usr_id,
false);
631 if (($this->getMembersObject()->isTutor($usr_id) || $this->getMembersObject()->isAdmin($usr_id)) && in_array(
635 $this->getMembersObject()->updateNotification($usr_id,
true);
638 $this->getMembersObject()->updateBlocked($usr_id,
false);
639 if ((!$this->getMembersObject()->isAdmin($usr_id) && !$this->getMembersObject()->isTutor($usr_id)) && in_array(
643 $this->getMembersObject()->updateBlocked($usr_id,
true);
647 $this->getMembersObject()->updatePassed($usr_id, in_array($usr_id, $passed),
true);
648 $this->getMembersObject()->sendNotification(
655 ($this->getMembersObject()->isAdmin($usr_id) || $this->getMembersObject()->isTutor($usr_id)) &&
656 in_array($usr_id, $contact)
658 $this->getMembersObject()->updateContact($usr_id,
true);
660 $this->getMembersObject()->updateContact($usr_id,
false);
663 $this->updateLPFromStatus($usr_id, in_array($usr_id, $passed));
665 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
666 $this->
ctrl->redirect($this,
"participants");
678 $participants = $this->initParticipantsFromPost();
680 if (!count($participants)) {
681 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
682 $this->
ctrl->redirect($this,
'participants');
686 if (!$this->getMembersObject()->checkLastAdmin($participants)) {
687 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_at_least_one_admin'),
true);
688 $this->
ctrl->redirect($this,
'participants');
692 if (!$this->checkPermissionBool(
'manage_members')) {
693 $this->
lng->loadLanguageModule(
'rbac');
694 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'rbac_info_only_position_access'));
699 !$this->
access->checkAccess(
702 $this->getParentObject()->getRefId()
704 !$this->getMembersObject()->isAdmin($this->user->getId())
706 foreach ($participants as $usr_id) {
707 if ($this->getMembersObject()->isAdmin($usr_id)) {
708 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_perm_perm"),
true);
709 $this->
ctrl->redirect($this,
'participants');
715 $this->repository_object->getRefId(),
718 $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
723 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'confirmDeleteParticipants'));
724 $confirm->setHeaderText($this->
lng->txt($this->getParentObject()->getType() .
'_header_delete_members'));
725 $confirm->setConfirm($this->
lng->txt(
'confirm'),
'deleteParticipants');
726 $confirm->setCancel($this->
lng->txt(
'cancel'),
'participants');
728 foreach ($participants as $usr_id) {
733 (
string) $name[
'user_id'],
734 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
738 $this->tpl->setContent($confirm->getHTML());
743 $participants = $this->initParticipantsFromPost();
744 if (!count($participants)) {
745 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
746 $this->
ctrl->redirect($this,
'participants');
752 !$this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) &&
753 !$this->getMembersObject()->isAdmin($this->user->getId())
755 foreach ($participants as $part) {
756 if ($this->getMembersObject()->isAdmin($part)) {
757 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
758 $this->
ctrl->redirect($this,
'participants');
763 if (!$this->getMembersObject()->deleteParticipants($participants)) {
764 $this->tpl->setOnScreenMessage(
'failure',
'Error deleting participants.',
true);
765 $this->
ctrl->redirect($this,
'participants');
767 foreach ($participants as $usr_id) {
770 switch ($this->getParentObject()->getType()) {
781 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
784 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt($this->getParentObject()->getType() .
"_members_deleted"),
true);
785 $this->
ctrl->redirect($this,
"participants");
791 if ($this->
http->wrapper()->post()->has(
'participants')) {
792 $participants = $this->initParticipantsFromPost();
793 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
794 $participants = $this->initSubscribersFromPost();
795 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
796 $participants = $this->initWaitingListIdsFromPost();
797 } elseif ($this->
http->wrapper()->query()->has(
'member_id')) {
798 $participants = [$this->initMemberIdFromGet()];
800 if (!count($participants)) {
801 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
802 $this->
ctrl->redirect($this,
'participants');
806 foreach ($participants as $usr_id) {
809 $context_options = $this->getMailContextOptions();
819 'sig' => $this->createMailSignature()
836 $this->activateSubTab($this->getParentObject()->getType() .
"_members_map");
842 $map->setMapId(
"course_map")
845 ->setLatitude($this->getParentObject()->getLatitude())
846 ->setLongitude($this->getParentObject()->getLongitude())
847 ->setZoom($this->getParentObject()->getLocationZoom())
848 ->setEnableTypeControl(
true)
849 ->setEnableNavigationControl(
true)
850 ->setEnableCentralMarker(
true);
857 $this->tpl->setContent($map->getHtml());
858 $this->tpl->setLeftContent($map->getUserListHtml());
863 $this->showMailToMemberToolbarButton($this->
toolbar,
'mailMembersBtn');
871 if ($this->canAddOrSearchUsers()) {
876 'auto_complete_name' => $this->
lng->txt(
'user'),
877 'user_type' => $this->getParentGUI()->getLocalRoles(),
878 'user_type_default' => $this->getDefaultRole(),
879 'submit_name' => $this->lng->txt(
'add')
884 $this->
toolbar->addSeparator();
888 $this->
lng->txt($this->getParentObject()->getType() .
"_search_users"),
889 $this->ctrl->getLinkTargetByClass(
890 'ilRepositorySearchGUI',
896 $this->
toolbar->addSeparator();
901 $this->
lng->txt($this->getParentObject()->getType() .
"_print_list"),
902 $this->ctrl->getLinkTarget($this,
'printMembers')
904 $this->showMailToMemberToolbarButton($this->
toolbar,
'participants',
false);
909 ?
string $a_back_cmd =
null,
910 bool $a_separator =
false
913 $this->getParentObject()->getType() ===
'crs' &&
914 $this->getParentObject()->getShowMembersExport()) {
920 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
923 $this->
lng->txt($this->getParentObject()->getType() .
'_print_list'),
924 $this->ctrl->getLinkTarget($this,
'printForMembersOutput')
934 ?
string $a_back_cmd =
null,
935 bool $a_separator =
false
940 ($this->getParentObject()->getMailToMembersType() === 1) ||
942 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId()) &&
943 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId())
950 if ($a_back_cmd !==
null) {
951 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
955 $this->getMailButtonLabel(),
956 $this->
ctrl->getLinkTargetByClass(
'ilMailMemberSearchGUI',
'')
963 return $this->
lng->txt(
"mail_members");
972 return $this->getParentGUI()->createMailSignature();
977 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
980 $this->getParentObject()->getRefId()
982 if ($has_manage_members_permission) {
983 return 'participants';
986 if ($this->getParentObject()->getShowMembers()) {
987 return 'jump2UsersGallery';
989 return 'mailMembersBtn';
996 $member_tab_name = $this->getMemberTabName();
998 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
1001 $this->getParentObject()->getRefId()
1004 if ($has_manage_members_permission) {
1008 $this->
ctrl->getLinkTarget($this,
'')
1011 $this->getParentObject()->getShowMembers() &&
1017 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilusersgallerygui'),
'view')
1020 $this->getParentObject()->getMailToMembersType() === 1 &&
1021 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()) &&
1027 $this->
ctrl->getLinkTarget($this,
"mailMembersBtn")
1034 return $this->
lng->txt(
'members');
1042 if ($this->checkRbacOrPositionAccessBool(
1045 $this->getParentObject()->getRefId()
1048 $this->getParentObject()->getType() .
"_member_administration",
1049 $this->
ctrl->getLinkTarget($this,
'participants'),
1057 "crs_members_groups",
1058 $this->
ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1060 "ilCourseParticipantsGroupsGUI"
1064 $children = $this->tree->getSubTree(
1065 $this->tree->getNodeData($this->getParentObject()->getRefId()),
1069 if (count($children)) {
1072 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilsessionoverviewgui'),
'listSessions'),
1074 'ilsessionoverviewgui'
1078 $this->getParentObject()->getType() .
'_members_gallery',
1079 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1083 } elseif ($this->getParentObject()->getShowMembers()) {
1086 $this->getParentObject()->getType() .
'_members_gallery',
1087 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1095 $this->getParentObject()->getType() .
'_members_map',
1096 $this->
ctrl->getLinkTarget($this,
'membersMap'),
1105 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilmemberexportgui'),
'show'),
1118 return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1126 return $this->getParentGUI()->getLocalRoles();
1134 $subscribers = $this->getMembersObject()->getSubscribers();
1135 $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1136 if (!count($filtered_subscribers)) {
1139 $subscriber = $this->initSubscriberTable();
1140 $subscriber->readSubscriberData(
1141 $filtered_subscribers
1149 $subscriber->setTitle($this->
lng->txt(
'group_new_registrations'));
1158 $subscribers = $this->initSubscribersFromPost();
1159 if (!count($subscribers)) {
1160 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1161 $this->
ctrl->redirect($this,
'participants');
1167 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignSubscribers"));
1168 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1169 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1170 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignSubscribers");
1172 foreach ($subscribers as $subscriber) {
1177 (
string) $name[
'user_id'],
1178 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1182 $this->tpl->setContent($c_gui->getHTML());
1190 $subscribers = $this->initSubscribersFromPost();
1191 if (!count($subscribers)) {
1192 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1193 $this->
ctrl->redirect($this,
'participants');
1197 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseSubscribers"));
1198 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1199 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1200 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseSubscribers");
1202 foreach ($subscribers as $subscriber_id) {
1207 (
string) $name[
'user_id'],
1208 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1213 $this->tpl->setContent($c_gui->getHTML());
1218 $subscribers = $this->initSubscribersFromPost();
1219 if (!count($subscribers)) {
1220 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1221 $this->
ctrl->redirect($this,
'participants');
1224 if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1225 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1226 $this->
ctrl->redirect($this,
'participants');
1228 foreach ($subscribers as $usr_id) {
1230 $this->getMembersObject()->sendNotification(
1236 $this->getMembersObject()->sendNotification(
1243 $noti->setRefId($this->getParentObject()->getRefId());
1244 $noti->setRecipients(array($usr_id));
1249 $this->getMembersObject()->sendNotification(
1257 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_deleted"),
true);
1258 $this->
ctrl->redirect($this,
'participants');
1266 $subscribers = $this->initSubscribersFromPost();
1267 if (!count($subscribers)) {
1268 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1269 $this->
ctrl->redirect($this,
'participants');
1272 if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1273 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1274 $this->
ctrl->redirect($this,
'participants');
1276 foreach ($subscribers as $usr_id) {
1278 $this->getMembersObject()->sendNotification(
1282 $this->getParentObject()->checkLPStatusSync($usr_id);
1285 $this->getMembersObject()->sendNotification(
1293 $noti->setRefId($this->getParentObject()->getRefId());
1294 $noti->setRecipients(array($usr_id));
1300 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_assigned"),
true);
1301 $this->
ctrl->redirect($this,
'participants');
1309 $wait = $this->initWaitingList();
1311 $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1312 if (!count($wait_users)) {
1317 $waiting_table->setUserIds(
1320 $waiting_table->readUserData();
1321 $waiting_table->setTitle($this->
lng->txt(
'crs_waiting_list'));
1323 return $waiting_table;
1331 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1332 if (!count($waiting_list_ids)) {
1333 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1334 $this->
ctrl->redirect($this,
'participants');
1338 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignFromWaitingList"));
1339 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1340 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1341 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignFromWaitingList");
1343 foreach ($waiting_list_ids as $waiting) {
1348 (
string) $name[
'user_id'],
1349 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1354 $this->tpl->setContent($c_gui->getHTML());
1362 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1363 if (!count($waiting_list_ids)) {
1364 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1365 $this->
ctrl->redirect($this,
'participants');
1368 $waiting_list = $this->initWaitingList();
1371 foreach ($waiting_list_ids as
$user_id) {
1375 if ($this->getMembersObject()->isAssigned((
int)
$user_id)) {
1381 $this->getMembersObject()->sendNotification(
1386 $this->getParentObject()->checkLPStatusSync((
int)
$user_id);
1390 $this->getMembersObject()->sendNotification(
1397 $this->getMembersObject()->register((
int)
$user_id);
1399 $noti->setRefId($this->getParentObject()->getRefId());
1400 $noti->setRecipients(array(
$user_id));
1405 $waiting_list->removeFromList((
int)
$user_id);
1410 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_users_added"),
true);
1412 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"crs_users_already_assigned"),
true);
1414 $this->
ctrl->redirect($this,
'participants');
1422 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1423 if (!count($waiting_list_ids)) {
1424 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1425 $this->
ctrl->redirect($this,
'participants');
1430 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseFromList"));
1431 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1432 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1433 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseFromList");
1435 foreach ($waiting_list_ids as $waiting) {
1440 (
string) $name[
'user_id'],
1441 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1445 $this->tpl->setContent($c_gui->getHTML());
1453 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1454 if (!count($waiting_list_ids)) {
1455 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
1456 $this->
ctrl->redirect($this,
'participants');
1459 $waiting_list = $this->initWaitingList();
1461 foreach ($waiting_list_ids as
$user_id) {
1462 $waiting_list->removeFromList((
int)
$user_id);
1465 $this->getMembersObject()->sendNotification(
1472 $this->getMembersObject()->sendNotification(
1480 $noti->setRefId($this->getParentObject()->getRefId());
1481 $noti->setRecipients(array(
$user_id));
1486 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_users_removed_from_list'),
true);
1487 $this->
ctrl->redirect($this,
'participants');
1497 if ($this->
http->wrapper()->post()->has(
'participants')) {
1498 $users = $this->initParticipantsFromPost();
1499 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
1500 $users = $this->initSubscribersFromPost();
1501 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
1502 $users = $this->initWaitingListIdsFromPost();
1505 if (!count($users)) {
1506 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1507 $this->
ctrl->redirect($this,
'participants');
1513 $this->
lng->loadLanguageModule(
'user');
1514 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
1515 $this->
ctrl->redirect($this,
'participants');
1525 $this->
tabs->activateSubTab($a_sub_tab);
1533 $this->checkPermission(
'read');
1535 $this->
tabs->clearTargets();
1537 $this->
tabs->setBackTarget(
1538 $this->
lng->txt(
'back'),
1539 $this->ctrl->getLinkTarget($this,
'participants')
1542 $list = $this->initAttendanceList();
1543 $form = $list->initForm(
'printMembersOutput');
1544 $this->tpl->setContent($form->getHTML());
1552 $this->
tabs->clearTargets();
1553 $this->
tabs->setBackTarget(
1554 $this->
lng->txt(
'back'),
1555 $this->ctrl->getLinkTarget($this,
'participants')
1558 $list = $this->initAttendanceList();
1559 $list->initFromForm();
1560 $list->setCallback([$this,
'getAttendanceListUserData']);
1561 $this->member_data = $this->getPrintMemberData(
1562 $this->filterUserIdsByRbacOrPositionOfCurrentUser(
1563 $this->getMembersObject()->getParticipants()
1567 $list->getNonMemberUserData($this->member_data);
1568 $list->getFullscreenHTML();
1576 $this->
tabs->clearTargets();
1577 $this->
tabs->setBackTarget(
1578 $this->
lng->txt(
'back'),
1579 $this->ctrl->getLinkTarget($this,
'jump2UsersGallery')
1582 $list = $this->initAttendanceList();
1583 $list->setTitle($this->
lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle());
1584 $list->initFromSettings();
1585 $list->setCallback([$this,
'getAttendanceListUserData']);
1586 $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1587 $list->getNonMemberUserData($this->member_data);
1588 $list->getFullscreenHTML();
1593 $this->
ctrl->redirectByClass(
'ilUsersGalleryGUI');
1600 $waiting_list = $this->initWaitingList();
1607 $member_id =
$DIC->repositoryTree()->checkForParentType(
1608 $this->getParentObject()->getRefId(),
1612 $member_id =
$DIC->repositoryTree()->checkForParentType(
1613 $this->getParentObject()->getRefId(),
1618 $DIC->logger()->sess()->warning(
'Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
1619 $member_id = $this->getParentObject()->getRefId();
1625 $this->getParentObject(),
1632 $this->getParentObject(),
1633 $this->getMembersObject(),
1637 $list->setId($this->getParentObject()->getType() .
'_memlist_' . $this->getParentObject()->
getId());
1640 $this->
lng->txt($this->getParentObject()->getType() .
'_members_print_title'),
1641 $this->lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle()
1646 if ($show_tracking) {
1648 $show_tracking = $olp->isActive();
1650 if ($show_tracking && $this->getParentObject()->getType() !==
'sess') {
1651 $list->addPreset(
'progress', $this->
lng->txt(
'learning_progress'),
true);
1655 if ($privacy->enabledAccessTimesByType($this->getParentObject()->getType())) {
1656 $list->addPreset(
'access', $this->
lng->txt(
'last_access'),
true);
1659 switch ($this->getParentObject()->getType()) {
1661 $list->addPreset(
'status', $this->
lng->txt(
'crs_status'),
true);
1662 $list->addPreset(
'passed', $this->
lng->txt(
'crs_passed'),
true);
1666 $list->addPreset(
'mark', $this->
lng->txt(
'trac_mark'),
true);
1667 $list->addPreset(
'comment', $this->
lng->txt(
'trac_comment'),
true);
1668 if ($this->getParentObject()->enabledRegistration()) {
1669 $list->addPreset(
'registered', $this->
lng->txt(
'event_tbl_registered'),
true);
1671 $list->addPreset(
'participated', $this->
lng->txt(
'event_tbl_participated'),
true);
1672 $list->addBlank($this->
lng->txt(
'sess_signature'));
1674 $list->addUserFilter(
'registered', $this->
lng->txt(
'event_list_registered_only'));
Class ilAbstractMailMemberRoles.
Base class for attendance lists.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TYPE_STATUS_CHANGED
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
const TYPE_ADMISSION_MEMBER
const TYPE_DISMISS_MEMBER
Class ilCourseParticipantsGroupsGUI.
static isReferenceMemberUpdateConfirmationRequired(int $course_ref_id, array $participants)
Error Handling & global info handling.
GUI class for membership features.
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
const TYPE_DISMISS_MEMBER
GUI class for learning sequence membership features.
const TYPE_DISMISS_MEMBER
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
Component logger with individual log levels by component id.
static isActivated()
Checks whether Map feature is activated.
static getMapGUI()
Get an instance of the GUI class.
Base class for member tab content.
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
assignFromWaitingList()
Assign from waiting list.
printMembersOutput()
print members output
participantsApplyFilter()
Apply filter for participant table.
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
parseWaitingListTable()
Parse table of subscription request.
assignSubscribers()
Do assignment of subscription request.
printForMembersOutput()
print members output
participantsResetFilter()
reset participants filter
sendMailToSelectedUsers()
confirmAssignFromWaitingList()
Assign from waiting list (confirmatoin)
updateParticipants()
update members
initWaitingListIdsFromPost()
showParticipantsToolbar()
Show participants toolbar.
ilParticipants $participants
addMemberTab(ilTabsGUI $tabs, bool $a_is_participant=false)
participants()
Show participant table, subscriber table, wating list table;.
parseSubscriberTable()
Parse table of subscription request.
updateLPFromStatus(int $usr_id, bool $has_passed)
checkRbacOrPermissionAccess(string $a_rbac_perm, string $a_pos_perm)
check rbac or position access
initAttendanceList(bool $a_for_members=false)
editMember()
Edit one participant.
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
__construct(ilObjectGUI $repository_gui, ilObject $repository_obj)
ilObjectGUI $repository_gui
editParticipants(array $post_participants=array())
Edit participants.
confirmRefuseSubscribers()
Refuse subscriber confirmation.
activateSubTab(string $a_sub_tab)
createMailSignature()
Create Mail signature.
ilGlobalTemplateInterface $tpl
confirmDeleteParticipants()
Show confirmation screen for participants deletion.
confirmAssignSubscribers()
Show subscription confirmation.
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
Show mail to member toolbar button.
initSubscribersFromPost()
addToClipboard()
Add selected users to user clipboard.
getParticipantTableTitle()
readMemberData(array $usr_ids, array $columns)
Required for member table guis.
setSubTabs(ilTabsGUI $tabs)
Set sub tabs.
refuseFromList()
refuse from waiting list
confirmRefuseFromList()
Refuse from waiting list (confirmation)
canAddOrSearchUsers()
Check if current user is allowed to add / search users.
showMemberExportToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
ilObject $repository_object
initParticipantsFromPost()
getAttendanceListUserData(int $user_id, array $filters=[])
static _enabledLearningProgress()
static _enabledUserRelatedData()
static _lookupName(int $a_user_id)
static _lookupLogin(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
Class ilObjectGUI Basic methods of all Output classes.
static getInstance(int $obj_id)
Class ilObject Basic functions for all objects.
Base class for course and group participants.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
static getInstance(int $a_ref_id)
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
isAdmin(int $a_usr_id)
check if user is admin
class ilRbacReview Contains Review functions of core Rbac.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
static fillAutoCompleteToolbar(object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
GUI class for membership features.
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
GUI class for course/group subscriptions.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getInstance(int $a_usr_id)
@ilCtrl_Calls ilUsersGalleryGUI: ILIAS\User\Profile\PublicProfileGUI @ilCtrl_isCalledBy ilUsersGaller...
Class ilUsersGalleryParticipants.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static redirect(string $a_script)
GUI class for course/group waiting list.
Interface GlobalHttpState.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))