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->
logger = $DIC->logger()->mmbr();
65 $this->
access = $DIC->access();
66 $this->
user = $DIC->user();
67 $this->
error = $DIC[
'ilErr'];
68 $this->
tabs = $DIC->tabs();
69 $this->
toolbar = $DIC->toolbar();
70 $this->rbacsystem =
$DIC->rbac()->system();
71 $this->rbacreview =
$DIC->rbac()->review();
72 $this->tree =
$DIC->repositoryTree();
73 $this->
http = $DIC->http();
75 $this->
profile = $DIC[
'user']->getProfile();
83 if ($this->
http->wrapper()->post()->has(
'participants')) {
84 return $this->
http->wrapper()->post()->retrieve(
87 $this->refinery->kindlyTo()->int()
96 if ($this->
http->wrapper()->query()->has(
'member_id')) {
97 return $this->
http->wrapper()->query()->retrieve(
107 if ($this->
http->wrapper()->post()->has(
'subscribers')) {
108 return $this->
http->wrapper()->post()->retrieve(
110 $this->
refinery->kindlyTo()->listOf(
111 $this->refinery->kindlyTo()->int()
120 if ($this->
http->wrapper()->post()->has(
'waiting')) {
121 return $this->
http->wrapper()->post()->retrieve(
123 $this->
refinery->kindlyTo()->listOf(
124 $this->refinery->kindlyTo()->int()
170 string $a_permission,
175 if ($a_ref_id === 0) {
178 return $this->
access->checkAccess($a_permission, $a_cmd, $a_ref_id);
186 if ($a_ref_id === 0) {
187 $a_ref_id = $this->getParentObject()->getRefId();
189 return $this->
access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
198 if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
199 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
200 $this->
ctrl->redirect($this->getParentGUI());
209 if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
210 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
211 $this->
ctrl->redirect($this->getParentGUI());
220 return $this->checkPermissionBool(
'manage_members');
235 $cmd = $this->
ctrl->getCmd(
'participants');
236 $next_class = $this->
ctrl->getNextClass();
238 switch ($next_class) {
239 case 'ilrepositorysearchgui':
241 $this->checkPermission(
'manage_members');
244 $rep_search->addUserAccessFilterCallable([$this,
'filterUserIdsByRbacOrPositionOfCurrentUser']);
246 $participants = $this->getMembersObject();
248 $participants->
isAdmin($this->user->getId()) ||
249 $this->access->checkAccess(
'manage_members',
'', $this->getParentObject()->getRefId())
251 $rep_search->setCallback(
254 $this->getParentGUI()->getLocalRoles(),
255 (
string) $this->getDefaultRole()
259 $rep_search->setCallback(
262 $this->getLocalRoles(),
263 (
string) $this->getDefaultRole()
268 $this->
ctrl->setReturn($this,
'participants');
269 $ret = $this->
ctrl->forwardCommand($rep_search);
272 case 'ilmailmembersearchgui':
273 $this->
tabs->clearTargets();
274 $this->
tabs->setBackTarget(
275 $this->
lng->txt(
'btn_back'),
276 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
282 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId())
284 !$this->rbacsystem->checkAccess(
286 $mail->getMailObjectReferenceId()
288 $this->
error->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->error->MESSAGE);
293 $this->getParentObject()->getRefId(),
294 $this->getMailMemberRoles()
296 $mail_search->setObjParticipants(
299 $this->
ctrl->forwardCommand($mail_search);
302 case 'ilusersgallerygui':
304 $this->setSubTabs($this->
tabs);
305 $this->
tabs->setSubTabActive(
306 $this->getParentObject()->getType() .
'_members_gallery'
308 $is_admin = $this->checkRbacOrPositionAccessBool(
'manage_members',
'manage_members');
310 $this->getParentObject()->getRefId(),
316 !$this->getParentObject()->getShowMembers() ||
320 $this->
error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
323 $this->showMailToMemberToolbarButton($this->
toolbar,
'jump2UsersGallery');
324 $this->showMemberExportToolbarButton($this->
toolbar,
'jump2UsersGallery');
328 $this->
ctrl->forwardCommand($gallery_gui);
331 case 'ilcourseparticipantsgroupsgui':
333 $this->setSubTabs($this->
tabs);
334 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
337 if ($cmd ===
"show" || $cmd =
"") {
338 $this->showMailToMemberToolbarButton($this->
toolbar);
340 $this->
ctrl->forwardCommand($cmg_gui);
343 case 'ilsessionoverviewgui':
345 $this->setSubTabs($this->
tabs);
346 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
351 $this->
ctrl->forwardCommand($overview);
354 case 'ilmemberexportgui':
356 $this->setSubTabs($this->
tabs);
357 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
360 $this->
ctrl->forwardCommand($export);
363 case 'ilobjectcustomuserfieldsgui':
365 $this->setSubTabs($this->
tabs);
366 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
367 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
368 $this->
ctrl->setReturn($this,
'participants');
370 $this->
ctrl->forwardCommand($cdf_gui);
374 $this->setSubTabs($this->
tabs);
377 $cmd ===
"mailMembersBtn" ||
378 $cmd ===
'membersMap' ||
379 $cmd ===
'printForMembersOutput' ||
380 $cmd ===
'jump2UsersGallery'
382 $this->checkPermission(
'read');
384 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
396 $this->initParticipantTemplate();
397 $this->showParticipantsToolbar();
398 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
401 $waiting = $this->parseWaitingListTable();
403 $this->tpl->setVariable(
'TABLE_WAIT', $waiting->getHTML());
407 $subscriber = $this->parseSubscriberTable();
409 $this->tpl->setVariable(
'TABLE_SUB', $subscriber->getHTML());
413 $table = $this->initParticipantTableGUI();
414 $table->setTitle($this->getParticipantTableTitle());
415 $table->setFormAction($this->
ctrl->getFormAction($this));
419 $table->setFilterCommand(
'participantsApplyFilter');
420 $table->setResetCommand(
'participantsResetFilter');
422 $this->tpl->setVariable(
'MEMBERS', $table->getHTML());
427 return $this->
lng->txt($this->getParentObject()->getType() .
'_mem_tbl_header');
440 $table = $this->initParticipantTableGUI();
441 $table->resetOffset();
442 $table->writeFilterToSession();
444 $this->participants();
452 $table = $this->initParticipantTableGUI();
453 $table->resetOffset();
454 $table->resetFilter();
456 $this->participants();
464 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
465 $this->editParticipants(array($this->initMemberIdFromGet()));
474 if (!$post_participants) {
475 $post_participants = $this->initParticipantsFromPost();
478 $real_participants = $this->getMembersObject()->getParticipants();
479 $participants = array_intersect($post_participants, $real_participants);
481 if (!count($participants)) {
482 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
483 $this->
ctrl->redirect($this,
'participants');
485 $table = $this->initEditParticipantTableGUI($participants);
486 $this->tpl->setContent($table->getHTML());
494 $participants = $this->initParticipantsFromPost();
495 if (!count($participants)) {
496 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
497 $this->
ctrl->redirect($this,
'participants');
499 $notifications = $passed = $blocked = $contact = [];
500 if ($this->
http->wrapper()->post()->has(
'notification')) {
501 $notifications = $this->
http->wrapper()->post()->retrieve(
503 $this->
refinery->kindlyTo()->listOf(
504 $this->refinery->kindlyTo()->int()
508 if ($this->
http->wrapper()->post()->has(
'passed')) {
509 $passed = $this->
http->wrapper()->post()->retrieve(
511 $this->
refinery->kindlyTo()->listOf(
512 $this->refinery->kindlyTo()->int()
516 if ($this->
http->wrapper()->post()->has(
'blocked')) {
517 $blocked = $this->
http->wrapper()->post()->retrieve(
519 $this->
refinery->kindlyTo()->listOf(
520 $this->refinery->kindlyTo()->int()
524 if ($this->
http->wrapper()->post()->has(
'contact')) {
525 $contact = $this->
http->wrapper()->post()->retrieve(
527 $this->
refinery->kindlyTo()->listOf(
528 $this->refinery->kindlyTo()->int()
534 $hasEditPermissionAccess =
536 $this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) or
537 $this->getMembersObject()->isAdmin($this->
user->getId())
542 $assignableLocalRoles = array();
543 $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
544 foreach ($this->getLocalTypeRole(
false) as $title => $role_id) {
545 $assignableLocalRoles[$role_id] = $title;
549 if ($this->
http->wrapper()->post()->has(
'roles')) {
550 $post_roles = $this->
http->wrapper()->post()->retrieve(
552 $this->
refinery->kindlyTo()->dictOf(
553 $this->refinery->kindlyTo()->dictOf(
554 $this->refinery->kindlyTo()->int()
561 foreach ($participants as $usr_id) {
562 $memberIsAdmin = $this->rbacreview->isAssigned($usr_id, (
int) $adminRoleId);
568 !$hasEditPermissionAccess &&
571 !is_array($post_roles[$usr_id]) ||
572 !in_array($adminRoleId, $post_roles[$usr_id])
575 $post_roles[$usr_id][] = $adminRoleId;
579 foreach ((array) $post_roles[$usr_id] as $role_id) {
580 if (!array_key_exists($role_id, $assignableLocalRoles)) {
581 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
582 $this->
ctrl->redirect($this,
'participants');
584 if (!$hasEditPermissionAccess &&
585 $role_id == $adminRoleId &&
587 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'));
588 $this->
ctrl->redirect($this,
'participants');
594 foreach ($this->getMembersObject()->getAdmins() as $admin_id) {
595 if (!isset($post_roles[$admin_id])) {
599 if (in_array($adminRoleId, (array) $post_roles[$admin_id])) {
605 if (!$has_admin && is_array($post_roles)) {
607 foreach ($post_roles as $roleIdsToBeAssigned) {
608 if (in_array($adminRoleId, $roleIdsToBeAssigned)) {
616 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_min_one_admin'),
true);
617 $this->
ctrl->redirect($this,
'participants');
620 foreach ($participants as $usr_id) {
621 $this->getMembersObject()->updateRoleAssignments($usr_id, (array) $post_roles[$usr_id]);
624 $this->getMembersObject()->updateNotification($usr_id,
false);
625 if (($this->getMembersObject()->isTutor($usr_id) || $this->getMembersObject()->isAdmin($usr_id)) && in_array(
629 $this->getMembersObject()->updateNotification($usr_id,
true);
632 $this->getMembersObject()->updateBlocked($usr_id,
false);
633 if ((!$this->getMembersObject()->isAdmin($usr_id) && !$this->getMembersObject()->isTutor($usr_id)) && in_array(
637 $this->getMembersObject()->updateBlocked($usr_id,
true);
641 $this->getMembersObject()->updatePassed($usr_id, in_array($usr_id, $passed),
true);
642 $this->getMembersObject()->sendNotification(
649 ($this->getMembersObject()->isAdmin($usr_id) || $this->getMembersObject()->isTutor($usr_id)) &&
650 in_array($usr_id, $contact)
652 $this->getMembersObject()->updateContact($usr_id,
true);
654 $this->getMembersObject()->updateContact($usr_id,
false);
657 $this->updateLPFromStatus($usr_id, in_array($usr_id, $passed));
659 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
660 $this->
ctrl->redirect($this,
"participants");
672 $participants = $this->initParticipantsFromPost();
674 if (!count($participants)) {
675 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
676 $this->
ctrl->redirect($this,
'participants');
680 if (!$this->getMembersObject()->checkLastAdmin($participants)) {
681 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_at_least_one_admin'),
true);
682 $this->
ctrl->redirect($this,
'participants');
686 if (!$this->checkPermissionBool(
'manage_members')) {
687 $this->
lng->loadLanguageModule(
'rbac');
688 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'rbac_info_only_position_access'));
693 !$this->
access->checkAccess(
696 $this->getParentObject()->getRefId()
698 !$this->getMembersObject()->isAdmin($this->user->getId())
700 foreach ($participants as $usr_id) {
701 if ($this->getMembersObject()->isAdmin($usr_id)) {
702 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_perm_perm"),
true);
703 $this->
ctrl->redirect($this,
'participants');
709 $this->repository_object->getRefId(),
712 $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
717 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'confirmDeleteParticipants'));
718 $confirm->setHeaderText($this->
lng->txt($this->getParentObject()->getType() .
'_header_delete_members'));
719 $confirm->setConfirm($this->
lng->txt(
'confirm'),
'deleteParticipants');
720 $confirm->setCancel($this->
lng->txt(
'cancel'),
'participants');
722 foreach ($participants as $usr_id) {
727 (
string) $name[
'user_id'],
728 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
732 $this->tpl->setContent($confirm->getHTML());
737 $participants = $this->initParticipantsFromPost();
738 if (!count($participants)) {
739 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
740 $this->
ctrl->redirect($this,
'participants');
746 !$this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) &&
747 !$this->getMembersObject()->isAdmin($this->user->getId())
749 foreach ($participants as $part) {
750 if ($this->getMembersObject()->isAdmin($part)) {
751 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
752 $this->
ctrl->redirect($this,
'participants');
757 if (!$this->getMembersObject()->deleteParticipants($participants)) {
758 $this->tpl->setOnScreenMessage(
'failure',
'Error deleting participants.',
true);
759 $this->
ctrl->redirect($this,
'participants');
761 foreach ($participants as $usr_id) {
764 switch ($this->getParentObject()->getType()) {
775 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
778 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt($this->getParentObject()->getType() .
"_members_deleted"),
true);
779 $this->
ctrl->redirect($this,
"participants");
785 if ($this->
http->wrapper()->post()->has(
'participants')) {
786 $participants = $this->initParticipantsFromPost();
787 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
788 $participants = $this->initSubscribersFromPost();
789 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
790 $participants = $this->initWaitingListIdsFromPost();
791 } elseif ($this->
http->wrapper()->query()->has(
'member_id')) {
792 $participants = [$this->initMemberIdFromGet()];
794 if (!count($participants)) {
795 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
796 $this->
ctrl->redirect($this,
'participants');
800 foreach ($participants as $usr_id) {
803 $context_options = $this->getMailContextOptions();
813 'sig' => $this->createMailSignature()
830 $this->activateSubTab($this->getParentObject()->getType() .
"_members_map");
836 $map->setMapId(
"course_map")
839 ->setLatitude($this->getParentObject()->getLatitude())
840 ->setLongitude($this->getParentObject()->getLongitude())
841 ->setZoom($this->getParentObject()->getLocationZoom())
842 ->setEnableTypeControl(
true)
843 ->setEnableNavigationControl(
true)
844 ->setEnableCentralMarker(
true);
851 $this->tpl->setContent($map->getHtml());
852 $this->tpl->setLeftContent($map->getUserListHtml());
857 $this->showMailToMemberToolbarButton($this->
toolbar,
'mailMembersBtn');
865 if ($this->canAddOrSearchUsers()) {
870 'auto_complete_name' => $this->
lng->txt(
'user'),
871 'user_type' => $this->getParentGUI()->getLocalRoles(),
872 'user_type_default' => $this->getDefaultRole(),
873 'submit_name' => $this->lng->txt(
'add')
878 $this->
toolbar->addSeparator();
882 $this->
lng->txt($this->getParentObject()->getType() .
"_search_users"),
883 $this->ctrl->getLinkTargetByClass(
884 'ilRepositorySearchGUI',
890 $this->
toolbar->addSeparator();
895 $this->
lng->txt($this->getParentObject()->getType() .
"_print_list"),
896 $this->ctrl->getLinkTarget($this,
'printMembers')
898 $this->showMailToMemberToolbarButton($this->
toolbar,
'participants',
false);
903 ?
string $a_back_cmd =
null,
904 bool $a_separator =
false
907 $this->getParentObject()->getType() ===
'crs' &&
908 $this->getParentObject()->getShowMembersExport()) {
914 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
917 $this->
lng->txt($this->getParentObject()->getType() .
'_print_list'),
918 $this->ctrl->getLinkTarget($this,
'printForMembersOutput')
928 ?
string $a_back_cmd =
null,
929 bool $a_separator =
false
934 ($this->getParentObject()->getMailToMembersType() === 1) ||
936 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId()) &&
937 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId())
944 if ($a_back_cmd !==
null) {
945 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
949 $this->getMailButtonLabel(),
950 $this->
ctrl->getLinkTargetByClass(
'ilMailMemberSearchGUI',
'')
957 return $this->
lng->txt(
"mail_members");
966 return $this->getParentGUI()->createMailSignature();
971 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
974 $this->getParentObject()->getRefId()
976 if ($has_manage_members_permission) {
977 return 'participants';
980 if ($this->getParentObject()->getShowMembers()) {
981 return 'jump2UsersGallery';
983 return 'mailMembersBtn';
990 $member_tab_name = $this->getMemberTabName();
992 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
995 $this->getParentObject()->getRefId()
998 if ($has_manage_members_permission) {
1002 $this->
ctrl->getLinkTarget($this,
'')
1005 $this->getParentObject()->getShowMembers() &&
1011 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilusersgallerygui'),
'view')
1014 $this->getParentObject()->getMailToMembersType() === 1 &&
1015 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()) &&
1021 $this->
ctrl->getLinkTarget($this,
"mailMembersBtn")
1028 return $this->
lng->txt(
'members');
1036 if ($this->checkRbacOrPositionAccessBool(
1039 $this->getParentObject()->getRefId()
1042 $this->getParentObject()->getType() .
"_member_administration",
1043 $this->
ctrl->getLinkTarget($this,
'participants'),
1051 "crs_members_groups",
1052 $this->
ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1054 "ilCourseParticipantsGroupsGUI"
1058 $children = $this->tree->getSubTree(
1059 $this->tree->getNodeData($this->getParentObject()->getRefId()),
1063 if (count($children)) {
1066 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilsessionoverviewgui'),
'listSessions'),
1068 'ilsessionoverviewgui'
1072 $this->getParentObject()->getType() .
'_members_gallery',
1073 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1077 } elseif ($this->getParentObject()->getShowMembers()) {
1080 $this->getParentObject()->getType() .
'_members_gallery',
1081 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1089 $this->getParentObject()->getType() .
'_members_map',
1090 $this->
ctrl->getLinkTarget($this,
'membersMap'),
1099 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilmemberexportgui'),
'show'),
1112 return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1120 return $this->getParentGUI()->getLocalRoles();
1128 $subscribers = $this->getMembersObject()->getSubscribers();
1129 $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1130 if (!count($filtered_subscribers)) {
1133 $subscriber = $this->initSubscriberTable();
1134 $subscriber->readSubscriberData(
1135 $filtered_subscribers
1143 $subscriber->setTitle($this->
lng->txt(
'group_new_registrations'));
1152 $subscribers = $this->initSubscribersFromPost();
1153 if (!count($subscribers)) {
1154 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1155 $this->
ctrl->redirect($this,
'participants');
1161 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignSubscribers"));
1162 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1163 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1164 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignSubscribers");
1166 foreach ($subscribers as $subscriber) {
1171 (
string) $name[
'user_id'],
1172 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1176 $this->tpl->setContent($c_gui->getHTML());
1184 $subscribers = $this->initSubscribersFromPost();
1185 if (!count($subscribers)) {
1186 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1187 $this->
ctrl->redirect($this,
'participants');
1189 $this->
lng->loadLanguageModule(
'mmbr');
1192 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseSubscribers"));
1193 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1194 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1195 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseSubscribers");
1197 foreach ($subscribers as $subscriber_id) {
1202 (
string) $name[
'user_id'],
1203 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1208 $this->tpl->setContent($c_gui->getHTML());
1213 $subscribers = $this->initSubscribersFromPost();
1214 if (!count($subscribers)) {
1215 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1216 $this->
ctrl->redirect($this,
'participants');
1219 if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1220 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1221 $this->
ctrl->redirect($this,
'participants');
1223 foreach ($subscribers as $usr_id) {
1225 $this->getMembersObject()->sendNotification(
1231 $this->getMembersObject()->sendNotification(
1238 $noti->setRefId($this->getParentObject()->getRefId());
1239 $noti->setRecipients(array($usr_id));
1244 $this->getMembersObject()->sendNotification(
1252 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_deleted"),
true);
1253 $this->
ctrl->redirect($this,
'participants');
1261 $subscribers = $this->initSubscribersFromPost();
1262 if (!count($subscribers)) {
1263 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1264 $this->
ctrl->redirect($this,
'participants');
1267 if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1268 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1269 $this->
ctrl->redirect($this,
'participants');
1271 foreach ($subscribers as $usr_id) {
1273 $this->getMembersObject()->sendNotification(
1277 $this->getParentObject()->checkLPStatusSync($usr_id);
1280 $this->getMembersObject()->sendNotification(
1288 $noti->setRefId($this->getParentObject()->getRefId());
1289 $noti->setRecipients(array($usr_id));
1295 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_assigned"),
true);
1296 $this->
ctrl->redirect($this,
'participants');
1304 $wait = $this->initWaitingList();
1306 $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1307 if (!count($wait_users)) {
1312 $waiting_table->setUserIds(
1315 $waiting_table->readUserData();
1316 $waiting_table->setTitle($this->
lng->txt(
'crs_waiting_list'));
1318 return $waiting_table;
1326 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1327 if (!count($waiting_list_ids)) {
1328 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1329 $this->
ctrl->redirect($this,
'participants');
1333 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignFromWaitingList"));
1334 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1335 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1336 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignFromWaitingList");
1338 foreach ($waiting_list_ids as $waiting) {
1343 (
string) $name[
'user_id'],
1344 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1349 $this->tpl->setContent($c_gui->getHTML());
1357 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1358 if (!count($waiting_list_ids)) {
1359 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1360 $this->
ctrl->redirect($this,
'participants');
1363 $waiting_list = $this->initWaitingList();
1366 foreach ($waiting_list_ids as
$user_id) {
1370 if ($this->getMembersObject()->isAssigned((
int)
$user_id)) {
1376 $this->getMembersObject()->sendNotification(
1381 $this->getParentObject()->checkLPStatusSync((
int)
$user_id);
1385 $this->getMembersObject()->sendNotification(
1392 $this->getMembersObject()->register((
int)
$user_id);
1394 $noti->setRefId($this->getParentObject()->getRefId());
1395 $noti->setRecipients(array(
$user_id));
1400 $waiting_list->removeFromList((
int)
$user_id);
1405 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_users_added"),
true);
1407 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"crs_users_already_assigned"),
true);
1409 $this->
ctrl->redirect($this,
'participants');
1417 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1418 if (!count($waiting_list_ids)) {
1419 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1420 $this->
ctrl->redirect($this,
'participants');
1422 $this->
lng->loadLanguageModule(
'mmbr');
1426 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseFromList"));
1427 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1428 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1429 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseFromList");
1431 foreach ($waiting_list_ids as $waiting) {
1436 (
string) $name[
'user_id'],
1437 $name[
'lastname'] .
', ' . $name[
'firstname'] .
' [' . $name[
'login'] .
']',
1441 $this->tpl->setContent($c_gui->getHTML());
1449 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1450 if (!count($waiting_list_ids)) {
1451 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
1452 $this->
ctrl->redirect($this,
'participants');
1455 $waiting_list = $this->initWaitingList();
1457 foreach ($waiting_list_ids as
$user_id) {
1458 $waiting_list->removeFromList((
int)
$user_id);
1461 $this->getMembersObject()->sendNotification(
1468 $this->getMembersObject()->sendNotification(
1476 $noti->setRefId($this->getParentObject()->getRefId());
1477 $noti->setRecipients(array(
$user_id));
1482 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_users_removed_from_list'),
true);
1483 $this->
ctrl->redirect($this,
'participants');
1493 if ($this->
http->wrapper()->post()->has(
'participants')) {
1494 $users = $this->initParticipantsFromPost();
1495 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
1496 $users = $this->initSubscribersFromPost();
1497 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
1498 $users = $this->initWaitingListIdsFromPost();
1501 if (!count($users)) {
1502 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1503 $this->
ctrl->redirect($this,
'participants');
1509 $this->
lng->loadLanguageModule(
'user');
1510 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
1511 $this->
ctrl->redirect($this,
'participants');
1521 $this->
tabs->activateSubTab($a_sub_tab);
1529 $this->checkPermission(
'read');
1531 $this->
tabs->clearTargets();
1533 $this->
tabs->setBackTarget(
1534 $this->
lng->txt(
'back'),
1535 $this->ctrl->getLinkTarget($this,
'participants')
1538 $list = $this->initAttendanceList();
1539 $form = $list->initForm(
'printMembersOutput');
1540 $this->tpl->setContent($form->getHTML());
1548 $this->
tabs->clearTargets();
1549 $this->
tabs->setBackTarget(
1550 $this->
lng->txt(
'back'),
1551 $this->ctrl->getLinkTarget($this,
'participants')
1554 $list = $this->initAttendanceList();
1555 $list->initFromForm();
1556 $list->setCallback([$this,
'getAttendanceListUserData']);
1557 $this->member_data = $this->getPrintMemberData(
1558 $this->filterUserIdsByRbacOrPositionOfCurrentUser(
1559 $this->getMembersObject()->getParticipants()
1563 $list->getNonMemberUserData($this->member_data);
1564 $list->getFullscreenHTML();
1572 $this->
tabs->clearTargets();
1573 $this->
tabs->setBackTarget(
1574 $this->
lng->txt(
'back'),
1575 $this->ctrl->getLinkTarget($this,
'jump2UsersGallery')
1578 $list = $this->initAttendanceList();
1579 $list->setTitle($this->
lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle());
1580 $list->initFromSettings();
1581 $list->setCallback([$this,
'getAttendanceListUserData']);
1582 $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1583 $list->getNonMemberUserData($this->member_data);
1584 $list->getFullscreenHTML();
1589 $this->
ctrl->redirectByClass(
'ilUsersGalleryGUI');
1596 $waiting_list = $this->initWaitingList();
1603 $member_id =
$DIC->repositoryTree()->checkForParentType(
1604 $this->getParentObject()->getRefId(),
1608 $member_id =
$DIC->repositoryTree()->checkForParentType(
1609 $this->getParentObject()->getRefId(),
1614 $DIC->logger()->sess()->warning(
'Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
1615 $member_id = $this->getParentObject()->getRefId();
1621 $this->getParentObject(),
1628 $this->getParentObject(),
1629 $this->getMembersObject(),
1633 $list->setId($this->getParentObject()->getType() .
'_memlist_' . $this->getParentObject()->
getId());
1636 $this->
lng->txt($this->getParentObject()->getType() .
'_members_print_title'),
1637 $this->lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle()
1642 if ($show_tracking) {
1644 $show_tracking = $olp->isActive();
1646 if ($show_tracking && $this->getParentObject()->getType() !==
'sess') {
1647 $list->addPreset(
'progress', $this->
lng->txt(
'learning_progress'),
true);
1651 if ($privacy->enabledAccessTimesByType($this->getParentObject()->getType())) {
1652 $list->addPreset(
'access', $this->
lng->txt(
'last_access'),
true);
1655 switch ($this->getParentObject()->getType()) {
1657 $list->addPreset(
'status', $this->
lng->txt(
'crs_status'),
true);
1658 $list->addPreset(
'passed', $this->
lng->txt(
'crs_passed'),
true);
1662 $list->addPreset(
'mark', $this->
lng->txt(
'trac_mark'),
true);
1663 $list->addPreset(
'comment', $this->
lng->txt(
'trac_comment'),
true);
1664 if ($this->getParentObject()->enabledRegistration()) {
1665 $list->addPreset(
'registered', $this->
lng->txt(
'event_tbl_registered'),
true);
1667 $list->addPreset(
'participated', $this->
lng->txt(
'event_tbl_participated'),
true);
1668 $list->addBlank($this->
lng->txt(
'sess_signature'));
1670 $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'))