3declare(strict_types=1);
54 $this->repository_object = $repository_obj;
56 $this->
lng = $DIC->language();
57 $this->
lng->loadLanguageModule(
'crs');
59 $this->tpl =
$DIC->ui()->mainTemplate();
60 $this->
ctrl = $DIC->ctrl();
61 $this->
lng->loadLanguageModule(
'trac');
62 $this->
logger = $DIC->logger()->mmbr();
63 $this->
access = $DIC->access();
64 $this->
user = $DIC->user();
65 $this->
error = $DIC[
'ilErr'];
66 $this->
tabs = $DIC->tabs();
67 $this->
toolbar = $DIC->toolbar();
68 $this->rbacsystem =
$DIC->rbac()->system();
69 $this->rbacreview =
$DIC->rbac()->review();
70 $this->tree =
$DIC->repositoryTree();
71 $this->
http = $DIC->http();
80 if ($this->
http->wrapper()->post()->has(
'participants')) {
81 return $this->
http->wrapper()->post()->retrieve(
84 $this->refinery->kindlyTo()->int()
93 if ($this->
http->wrapper()->query()->has(
'member_id')) {
94 return $this->
http->wrapper()->query()->retrieve(
104 if ($this->
http->wrapper()->post()->has(
'subscribers')) {
105 return $this->
http->wrapper()->post()->retrieve(
107 $this->
refinery->kindlyTo()->listOf(
108 $this->refinery->kindlyTo()->int()
117 if ($this->
http->wrapper()->post()->has(
'waiting')) {
118 return $this->
http->wrapper()->post()->retrieve(
120 $this->
refinery->kindlyTo()->listOf(
121 $this->refinery->kindlyTo()->int()
167 string $a_permission,
172 if ($a_ref_id === 0) {
175 return $this->
access->checkAccess($a_permission, $a_cmd, $a_ref_id);
183 if ($a_ref_id === 0) {
184 $a_ref_id = $this->getParentObject()->getRefId();
186 return $this->
access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
195 if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
196 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
197 $this->
ctrl->redirect($this->getParentGUI());
206 if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
207 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_permission'),
true);
208 $this->
ctrl->redirect($this->getParentGUI());
217 return $this->checkPermissionBool(
'manage_members');
232 $cmd = $this->
ctrl->getCmd(
'participants');
233 $next_class = $this->
ctrl->getNextClass();
235 switch ($next_class) {
236 case 'ilrepositorysearchgui':
238 $this->checkPermission(
'manage_members');
241 $rep_search->addUserAccessFilterCallable([$this,
'filterUserIdsByRbacOrPositionOfCurrentUser']);
243 $participants = $this->getMembersObject();
245 $participants->
isAdmin($this->user->getId()) ||
246 $this->access->checkAccess(
'manage_members',
'', $this->getParentObject()->getRefId())
248 $rep_search->setCallback(
251 $this->getParentGUI()->getLocalRoles(),
252 (
string) $this->getDefaultRole()
256 $rep_search->setCallback(
259 $this->getLocalRoles(),
260 (
string) $this->getDefaultRole()
265 $this->
ctrl->setReturn($this,
'participants');
266 $ret = $this->
ctrl->forwardCommand($rep_search);
269 case 'ilmailmembersearchgui':
270 $this->
tabs->clearTargets();
271 $this->
tabs->setBackTarget(
272 $this->
lng->txt(
'btn_back'),
273 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
279 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId())
281 !$this->rbacsystem->checkAccess(
283 $mail->getMailObjectReferenceId()
285 $this->
error->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->error->MESSAGE);
290 $this->getParentObject()->getRefId(),
291 $this->getMailMemberRoles()
293 $mail_search->setObjParticipants(
296 $this->
ctrl->forwardCommand($mail_search);
299 case 'ilusersgallerygui':
301 $this->setSubTabs($this->
tabs);
302 $this->
tabs->setSubTabActive(
303 $this->getParentObject()->getType() .
'_members_gallery'
305 $is_admin = $this->checkRbacOrPositionAccessBool(
'manage_members',
'manage_members');
307 $this->getParentObject()->getRefId(),
313 $this->getParentObject()->getShowMembers() === 0 ||
317 $this->
error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->MESSAGE);
320 $this->showMailToMemberToolbarButton($this->
toolbar,
'jump2UsersGallery');
321 $this->showMemberExportToolbarButton($this->
toolbar,
'jump2UsersGallery');
325 $this->
ctrl->forwardCommand($gallery_gui);
328 case 'ilcourseparticipantsgroupsgui':
330 $this->setSubTabs($this->
tabs);
331 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
334 if ($cmd ===
"show" || $cmd =
"") {
335 $this->showMailToMemberToolbarButton($this->
toolbar);
337 $this->
ctrl->forwardCommand($cmg_gui);
340 case 'ilsessionoverviewgui':
342 $this->setSubTabs($this->
tabs);
343 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
348 $this->
ctrl->forwardCommand($overview);
351 case 'ilmemberexportgui':
353 $this->setSubTabs($this->
tabs);
354 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
357 $this->
ctrl->forwardCommand($export);
360 case 'ilobjectcustomuserfieldsgui':
362 $this->setSubTabs($this->
tabs);
363 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
364 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
365 $this->
ctrl->setReturn($this,
'participants');
367 $this->
ctrl->forwardCommand($cdf_gui);
371 $this->setSubTabs($this->
tabs);
374 $cmd ===
"mailMembersBtn" ||
375 $cmd ===
'membersMap' ||
376 $cmd ===
'printForMembersOutput' ||
377 $cmd ===
'jump2UsersGallery'
379 $this->checkPermission(
'read');
381 $this->checkRbacOrPermissionAccess(
'manage_members',
'manage_members');
393 $this->initParticipantTemplate();
394 $this->showParticipantsToolbar();
395 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
398 $waiting = $this->parseWaitingListTable();
400 $this->tpl->setVariable(
'TABLE_WAIT', $waiting->getHTML());
404 $subscriber = $this->parseSubscriberTable();
406 $this->tpl->setVariable(
'TABLE_SUB', $subscriber->getHTML());
410 $table = $this->initParticipantTableGUI();
411 $table->setTitle($this->
lng->txt($this->getParentObject()->getType() .
'_mem_tbl_header'));
412 $table->setFormAction($this->
ctrl->getFormAction($this));
416 $table->setFilterCommand(
'participantsApplyFilter');
417 $table->setResetCommand(
'participantsResetFilter');
419 $this->tpl->setVariable(
'MEMBERS', $table->getHTML());
432 $table = $this->initParticipantTableGUI();
433 $table->resetOffset();
434 $table->writeFilterToSession();
436 $this->participants();
444 $table = $this->initParticipantTableGUI();
445 $table->resetOffset();
446 $table->resetFilter();
448 $this->participants();
456 $this->activateSubTab($this->getParentObject()->getType() .
"_member_administration");
457 $this->editParticipants(array($this->initMemberIdFromGet()));
466 if (!$post_participants) {
467 $post_participants = $this->initParticipantsFromPost();
470 $real_participants = $this->getMembersObject()->getParticipants();
471 $participants = array_intersect($post_participants, $real_participants);
473 if (!count($participants)) {
474 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
475 $this->
ctrl->redirect($this,
'participants');
477 $table = $this->initEditParticipantTableGUI($participants);
478 $this->tpl->setContent($table->getHTML());
486 $participants = $this->initParticipantsFromPost();
487 if (!count($participants)) {
488 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
489 $this->
ctrl->redirect($this,
'participants');
491 $notifications = $passed = $blocked = $contact = [];
492 if ($this->
http->wrapper()->post()->has(
'notification')) {
493 $notifications = $this->
http->wrapper()->post()->retrieve(
495 $this->
refinery->kindlyTo()->listOf(
496 $this->refinery->kindlyTo()->int()
500 if ($this->
http->wrapper()->post()->has(
'passed')) {
501 $passed = $this->
http->wrapper()->post()->retrieve(
503 $this->
refinery->kindlyTo()->listOf(
504 $this->refinery->kindlyTo()->int()
508 if ($this->
http->wrapper()->post()->has(
'blocked')) {
509 $blocked = $this->
http->wrapper()->post()->retrieve(
511 $this->
refinery->kindlyTo()->listOf(
512 $this->refinery->kindlyTo()->int()
516 if ($this->
http->wrapper()->post()->has(
'contact')) {
517 $contact = $this->
http->wrapper()->post()->retrieve(
519 $this->
refinery->kindlyTo()->listOf(
520 $this->refinery->kindlyTo()->int()
526 $hasEditPermissionAccess =
528 $this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) or
529 $this->getMembersObject()->isAdmin($this->
user->getId())
534 $assignableLocalRoles = array();
535 $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
536 foreach ($this->getLocalTypeRole(
false) as $title => $role_id) {
537 $assignableLocalRoles[$role_id] = $title;
541 if ($this->
http->wrapper()->post()->has(
'roles')) {
542 $post_roles = $this->
http->wrapper()->post()->retrieve(
544 $this->
refinery->kindlyTo()->dictOf(
545 $this->refinery->kindlyTo()->dictOf(
546 $this->refinery->kindlyTo()->int()
553 foreach ($participants as $usr_id) {
554 $memberIsAdmin = $this->rbacreview->isAssigned($usr_id, (
int) $adminRoleId);
560 !$hasEditPermissionAccess &&
563 !is_array($post_roles[$usr_id]) ||
564 !in_array($adminRoleId, $post_roles[$usr_id])
567 $post_roles[$usr_id][] = $adminRoleId;
571 foreach ((array) $post_roles[$usr_id] as $role_id) {
572 if (!array_key_exists($role_id, $assignableLocalRoles)) {
573 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
574 $this->
ctrl->redirect($this,
'participants');
576 if (!$hasEditPermissionAccess &&
577 $role_id == $adminRoleId &&
579 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'));
580 $this->
ctrl->redirect($this,
'participants');
586 foreach ($this->getMembersObject()->getAdmins() as $admin_id) {
587 if (!isset($post_roles[$admin_id])) {
591 if (in_array($adminRoleId, (array) $post_roles[$admin_id])) {
597 if (!$has_admin && is_array($post_roles)) {
599 foreach ($post_roles as $roleIdsToBeAssigned) {
600 if (in_array($adminRoleId, $roleIdsToBeAssigned)) {
608 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_min_one_admin'),
true);
609 $this->
ctrl->redirect($this,
'participants');
612 foreach ($participants as $usr_id) {
613 $this->getMembersObject()->updateRoleAssignments($usr_id, (array) $post_roles[$usr_id]);
616 $this->getMembersObject()->updateNotification($usr_id,
false);
617 if (($this->getMembersObject()->isTutor($usr_id) || $this->getMembersObject()->isAdmin($usr_id)) && in_array(
621 $this->getMembersObject()->updateNotification($usr_id,
true);
624 $this->getMembersObject()->updateBlocked($usr_id,
false);
625 if ((!$this->getMembersObject()->isAdmin($usr_id) && !$this->getMembersObject()->isTutor($usr_id)) && in_array(
629 $this->getMembersObject()->updateBlocked($usr_id,
true);
633 $this->getMembersObject()->updatePassed($usr_id, in_array($usr_id, $passed),
true);
634 $this->getMembersObject()->sendNotification(
641 ($this->getMembersObject()->isAdmin($usr_id) || $this->getMembersObject()->isTutor($usr_id)) &&
642 in_array($usr_id, $contact)
644 $this->getMembersObject()->updateContact($usr_id,
true);
646 $this->getMembersObject()->updateContact($usr_id,
false);
649 $this->updateLPFromStatus($usr_id, in_array($usr_id, $passed));
651 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"msg_obj_modified"),
true);
652 $this->
ctrl->redirect($this,
"participants");
664 $participants = $this->initParticipantsFromPost();
666 if (!count($participants)) {
667 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
668 $this->
ctrl->redirect($this,
'participants');
672 if (!$this->getMembersObject()->checkLastAdmin($participants)) {
673 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt($this->getParentObject()->getType() .
'_at_least_one_admin'),
true);
674 $this->
ctrl->redirect($this,
'participants');
678 if (!$this->checkPermissionBool(
'manage_members')) {
679 $this->
lng->loadLanguageModule(
'rbac');
680 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
'rbac_info_only_position_access'));
685 !$this->
access->checkAccess(
688 $this->getParentObject()->getRefId()
690 !$this->getMembersObject()->isAdmin($this->user->getId())
692 foreach ($participants as $usr_id) {
693 if ($this->getMembersObject()->isAdmin($usr_id)) {
694 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_perm_perm"),
true);
695 $this->
ctrl->redirect($this,
'participants');
701 $this->repository_object->getRefId(),
704 $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
709 $confirm->setFormAction($this->
ctrl->getFormAction($this,
'confirmDeleteParticipants'));
710 $confirm->setHeaderText($this->
lng->txt($this->getParentObject()->getType() .
'_header_delete_members'));
711 $confirm->setConfirm($this->
lng->txt(
'confirm'),
'deleteParticipants');
712 $confirm->setCancel($this->
lng->txt(
'cancel'),
'participants');
714 foreach ($participants as $usr_id) {
719 (
string)
$name[
'user_id'],
720 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']',
724 $this->tpl->setContent($confirm->getHTML());
729 $participants = $this->initParticipantsFromPost();
730 if (!count($participants)) {
731 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
732 $this->
ctrl->redirect($this,
'participants');
738 !$this->
access->checkAccess(
'edit_permission',
'', $this->getParentObject()->getRefId()) &&
739 !$this->getMembersObject()->isAdmin($this->user->getId())
741 foreach ($participants as $part) {
742 if ($this->getMembersObject()->isAdmin($part)) {
743 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_perm'),
true);
744 $this->
ctrl->redirect($this,
'participants');
749 if (!$this->getMembersObject()->deleteParticipants($participants)) {
750 $this->tpl->setOnScreenMessage(
'failure',
'Error deleting participants.',
true);
751 $this->
ctrl->redirect($this,
'participants');
753 foreach ($participants as $usr_id) {
756 switch ($this->getParentObject()->getType()) {
767 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
770 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt($this->getParentObject()->getType() .
"_members_deleted"),
true);
771 $this->
ctrl->redirect($this,
"participants");
777 if ($this->
http->wrapper()->post()->has(
'participants')) {
778 $participants = $this->initParticipantsFromPost();
779 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
780 $participants = $this->initSubscribersFromPost();
781 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
782 $participants = $this->initWaitingListIdsFromPost();
783 } elseif ($this->
http->wrapper()->query()->has(
'member_id')) {
784 $participants = [$this->initMemberIdFromGet()];
786 if (!count($participants)) {
787 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
788 $this->
ctrl->redirect($this,
'participants');
792 foreach ($participants as $usr_id) {
795 $context_options = $this->getMailContextOptions();
805 'sig' => $this->createMailSignature()
822 $this->activateSubTab($this->getParentObject()->getType() .
"_members_map");
828 $map->setMapId(
"course_map")
831 ->setLatitude($this->getParentObject()->getLatitude())
832 ->setLongitude($this->getParentObject()->getLongitude())
833 ->setZoom($this->getParentObject()->getLocationZoom())
834 ->setEnableTypeControl(
true)
835 ->setEnableNavigationControl(
true)
836 ->setEnableCentralMarker(
true);
839 foreach ($members as $user_id) {
840 $map->addUserMarker($user_id);
843 $this->tpl->setContent($map->getHtml());
844 $this->tpl->setLeftContent($map->getUserListHtml());
849 $this->showMailToMemberToolbarButton($this->
toolbar,
'mailMembersBtn');
857 if ($this->canAddOrSearchUsers()) {
862 'auto_complete_name' => $this->
lng->txt(
'user'),
863 'user_type' => $this->getParentGUI()->getLocalRoles(),
864 'user_type_default' => $this->getDefaultRole(),
865 'submit_name' => $this->lng->txt(
'add')
870 $this->
toolbar->addSeparator();
874 $this->
lng->txt($this->getParentObject()->getType() .
"_search_users"),
875 $this->ctrl->getLinkTargetByClass(
876 'ilRepositorySearchGUI',
882 $this->
toolbar->addSeparator();
887 $this->
lng->txt($this->getParentObject()->getType() .
"_print_list"),
888 $this->ctrl->getLinkTarget($this,
'printMembers')
890 $this->showMailToMemberToolbarButton($this->
toolbar,
'participants',
false);
895 ?
string $a_back_cmd =
null,
896 bool $a_separator =
false
899 $this->getParentObject()->getType() ===
'crs' &&
900 $this->getParentObject()->getShowMembersExport()) {
906 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
909 $this->
lng->txt($this->getParentObject()->getType() .
'_print_list'),
910 $this->ctrl->getLinkTarget($this,
'printForMembersOutput')
920 ?
string $a_back_cmd =
null,
921 bool $a_separator =
false
926 ($this->getParentObject()->getMailToMembersType() === 1) ||
928 $this->
access->checkAccess(
'manage_members',
"", $this->getParentObject()->getRefId()) &&
929 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId())
936 if ($a_back_cmd !==
null) {
937 $this->
ctrl->setParameter($this,
"back_cmd", $a_back_cmd);
941 $this->
lng->txt(
"mail_members"),
942 $this->ctrl->getLinkTargetByClass(
'ilMailMemberSearchGUI',
'')
953 return $this->getParentGUI()->createMailSignature();
958 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
961 $this->getParentObject()->getRefId()
963 if ($has_manage_members_permission) {
964 return 'participants';
967 if ($this->getParentObject()->getShowMembers()) {
968 return 'jump2UsersGallery';
970 return 'mailMembersBtn';
977 $member_tab_name = $this->getMemberTabName();
979 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
982 $this->getParentObject()->getRefId()
985 if ($has_manage_members_permission) {
989 $this->
ctrl->getLinkTarget($this,
'')
992 $this->getParentObject()->getShowMembers() &&
998 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilusersgallerygui'),
'view')
1001 $this->getParentObject()->getMailToMembersType() === 1 &&
1002 $this->rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()) &&
1008 $this->
ctrl->getLinkTarget($this,
"mailMembersBtn")
1015 return $this->
lng->txt(
'members');
1023 if ($this->checkRbacOrPositionAccessBool(
1026 $this->getParentObject()->getRefId()
1029 $this->getParentObject()->getType() .
"_member_administration",
1030 $this->
ctrl->getLinkTarget($this,
'participants'),
1038 "crs_members_groups",
1039 $this->
ctrl->getLinkTargetByClass(
"ilCourseParticipantsGroupsGUI",
"show"),
1041 "ilCourseParticipantsGroupsGUI"
1045 $children = $this->tree->getSubTree(
1046 $this->tree->getNodeData($this->getParentObject()->getRefId()),
1050 if (count($children)) {
1053 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilsessionoverviewgui'),
'listSessions'),
1055 'ilsessionoverviewgui'
1059 $this->getParentObject()->getType() .
'_members_gallery',
1060 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1064 } elseif ($this->getParentObject()->getShowMembers()) {
1067 $this->getParentObject()->getType() .
'_members_gallery',
1068 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilUsersGalleryGUI')),
1076 $this->getParentObject()->getType() .
'_members_map',
1077 $this->
ctrl->getLinkTarget($this,
'membersMap'),
1086 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilmemberexportgui'),
'show'),
1099 return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1107 return $this->getParentGUI()->getLocalRoles();
1115 $subscribers = $this->getMembersObject()->getSubscribers();
1116 $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1117 if (!count($filtered_subscribers)) {
1120 $subscriber = $this->initSubscriberTable();
1121 $subscriber->readSubscriberData(
1122 $filtered_subscribers
1130 $subscriber->setTitle($this->
lng->txt(
'group_new_registrations'));
1139 $subscribers = $this->initSubscribersFromPost();
1140 if (!count($subscribers)) {
1141 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1142 $this->
ctrl->redirect($this,
'participants');
1148 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignSubscribers"));
1149 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1150 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1151 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignSubscribers");
1153 foreach ($subscribers as $subscriber) {
1158 (
string)
$name[
'user_id'],
1159 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']',
1163 $this->tpl->setContent($c_gui->getHTML());
1171 $subscribers = $this->initSubscribersFromPost();
1172 if (!count($subscribers)) {
1173 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1174 $this->
ctrl->redirect($this,
'participants');
1176 $this->
lng->loadLanguageModule(
'mmbr');
1179 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseSubscribers"));
1180 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1181 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1182 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseSubscribers");
1184 foreach ($subscribers as $subscriber_id) {
1189 (
string)
$name[
'user_id'],
1190 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']',
1195 $this->tpl->setContent($c_gui->getHTML());
1200 $subscribers = $this->initSubscribersFromPost();
1201 if (!count($subscribers)) {
1202 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1203 $this->
ctrl->redirect($this,
'participants');
1206 if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1207 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1208 $this->
ctrl->redirect($this,
'participants');
1210 foreach ($subscribers as $usr_id) {
1212 $this->getMembersObject()->sendNotification(
1218 $this->getMembersObject()->sendNotification(
1225 $noti->setRefId($this->getParentObject()->getRefId());
1226 $noti->setRecipients(array($usr_id));
1231 $this->getMembersObject()->sendNotification(
1239 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_deleted"),
true);
1240 $this->
ctrl->redirect($this,
'participants');
1248 $subscribers = $this->initSubscribersFromPost();
1249 if (!count($subscribers)) {
1250 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_subscribers_selected"),
true);
1251 $this->
ctrl->redirect($this,
'participants');
1254 if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1255 $this->tpl->setOnScreenMessage(
'failure', $this->
error->getMessage(),
true);
1256 $this->
ctrl->redirect($this,
'participants');
1258 foreach ($subscribers as $usr_id) {
1260 $this->getMembersObject()->sendNotification(
1264 $this->getParentObject()->checkLPStatusSync($usr_id);
1267 $this->getMembersObject()->sendNotification(
1275 $noti->setRefId($this->getParentObject()->getRefId());
1276 $noti->setRecipients(array($usr_id));
1282 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_subscribers_assigned"),
true);
1283 $this->
ctrl->redirect($this,
'participants');
1291 $wait = $this->initWaitingList();
1293 $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1294 if (!count($wait_users)) {
1299 $waiting_table->setUserIds(
1302 $waiting_table->readUserData();
1303 $waiting_table->setTitle($this->
lng->txt(
'crs_waiting_list'));
1305 return $waiting_table;
1313 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1314 if (!count($waiting_list_ids)) {
1315 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1316 $this->
ctrl->redirect($this,
'participants');
1320 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"assignFromWaitingList"));
1321 $c_gui->setHeaderText($this->
lng->txt(
"info_assign_sure"));
1322 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1323 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"assignFromWaitingList");
1325 foreach ($waiting_list_ids as $waiting) {
1330 (
string)
$name[
'user_id'],
1331 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']',
1336 $this->tpl->setContent($c_gui->getHTML());
1344 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1345 if (!count($waiting_list_ids)) {
1346 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_no_users_selected"),
true);
1347 $this->
ctrl->redirect($this,
'participants');
1350 $waiting_list = $this->initWaitingList();
1353 foreach ($waiting_list_ids as $user_id) {
1357 if ($this->getMembersObject()->isAssigned((
int) $user_id)) {
1363 $this->getMembersObject()->sendNotification(
1368 $this->getParentObject()->checkLPStatusSync((
int) $user_id);
1372 $this->getMembersObject()->sendNotification(
1379 $this->getMembersObject()->register((
int) $user_id);
1381 $noti->setRefId($this->getParentObject()->getRefId());
1382 $noti->setRecipients(array($user_id));
1387 $waiting_list->removeFromList((
int) $user_id);
1392 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"crs_users_added"),
true);
1394 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"crs_users_already_assigned"),
true);
1396 $this->
ctrl->redirect($this,
'participants');
1404 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1405 if (!count($waiting_list_ids)) {
1406 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"no_checkbox"),
true);
1407 $this->
ctrl->redirect($this,
'participants');
1409 $this->
lng->loadLanguageModule(
'mmbr');
1413 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"refuseFromList"));
1414 $c_gui->setHeaderText($this->
lng->txt(
"info_refuse_sure"));
1415 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"participants");
1416 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"refuseFromList");
1418 foreach ($waiting_list_ids as $waiting) {
1423 (
string)
$name[
'user_id'],
1424 $name[
'lastname'] .
', ' .
$name[
'firstname'] .
' [' .
$name[
'login'] .
']',
1428 $this->tpl->setContent($c_gui->getHTML());
1436 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1437 if (!count($waiting_list_ids)) {
1438 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
1439 $this->
ctrl->redirect($this,
'participants');
1442 $waiting_list = $this->initWaitingList();
1444 foreach ($waiting_list_ids as $user_id) {
1445 $waiting_list->removeFromList((
int) $user_id);
1448 $this->getMembersObject()->sendNotification(
1455 $this->getMembersObject()->sendNotification(
1463 $noti->setRefId($this->getParentObject()->getRefId());
1464 $noti->setRecipients(array($user_id));
1469 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'crs_users_removed_from_list'),
true);
1470 $this->
ctrl->redirect($this,
'participants');
1480 if ($this->
http->wrapper()->post()->has(
'participants')) {
1481 $users = $this->initParticipantsFromPost();
1482 } elseif ($this->
http->wrapper()->post()->has(
'subscribers')) {
1483 $users = $this->initSubscribersFromPost();
1484 } elseif ($this->
http->wrapper()->post()->has(
'waiting')) {
1485 $users = $this->initWaitingListIdsFromPost();
1488 if (!count($users)) {
1489 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'),
true);
1490 $this->
ctrl->redirect($this,
'participants');
1496 $this->
lng->loadLanguageModule(
'user');
1497 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'clipboard_user_added'),
true);
1498 $this->
ctrl->redirect($this,
'participants');
1508 $this->
tabs->activateSubTab($a_sub_tab);
1516 $this->checkPermission(
'read');
1518 $this->
tabs->clearTargets();
1520 $this->
tabs->setBackTarget(
1521 $this->
lng->txt(
'back'),
1522 $this->ctrl->getLinkTarget($this,
'participants')
1525 $list = $this->initAttendanceList();
1526 $form = $list->initForm(
'printMembersOutput');
1527 $this->tpl->setContent($form->getHTML());
1535 $this->
tabs->clearTargets();
1536 $this->
tabs->setBackTarget(
1537 $this->
lng->txt(
'back'),
1538 $this->ctrl->getLinkTarget($this,
'participants')
1541 $list = $this->initAttendanceList();
1542 $list->initFromForm();
1543 $list->setCallback([$this,
'getAttendanceListUserData']);
1544 $this->member_data = $this->getPrintMemberData(
1545 $this->filterUserIdsByRbacOrPositionOfCurrentUser(
1546 $this->getMembersObject()->getParticipants()
1550 $list->getNonMemberUserData($this->member_data);
1551 $list->getFullscreenHTML();
1559 $this->
tabs->clearTargets();
1560 $this->
tabs->setBackTarget(
1561 $this->
lng->txt(
'back'),
1562 $this->ctrl->getLinkTarget($this,
'jump2UsersGallery')
1565 $list = $this->initAttendanceList();
1566 $list->setTitle($this->
lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle());
1567 $list->initFromSettings();
1568 $list->setCallback([$this,
'getAttendanceListUserData']);
1569 $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1570 $list->getNonMemberUserData($this->member_data);
1571 $list->getFullscreenHTML();
1576 $this->
ctrl->redirectByClass(
'ilUsersGalleryGUI');
1583 $waiting_list = $this->initWaitingList();
1586 $member_id =
$DIC->repositoryTree()->checkForParentType(
1587 $this->getParentObject()->getRefId(),
1591 $member_id =
$DIC->repositoryTree()->checkForParentType(
1592 $this->getParentObject()->getRefId(),
1597 $DIC->logger()->sess()->warning(
'Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
1598 $member_id = $this->getParentObject()->getRefId();
1604 $this->getParentObject(),
1611 $this->getParentObject(),
1612 $this->getMembersObject(),
1616 $list->setId($this->getParentObject()->getType() .
'_memlist_' . $this->getParentObject()->
getId());
1619 $this->
lng->txt($this->getParentObject()->getType() .
'_members_print_title'),
1620 $this->lng->txt(
'obj_' . $this->getParentObject()->getType()) .
': ' . $this->getParentObject()->getTitle()
1625 if ($show_tracking) {
1627 $show_tracking = $olp->isActive();
1629 if ($show_tracking && $this->getParentObject()->getType() !==
'sess') {
1630 $list->addPreset(
'progress', $this->
lng->txt(
'learning_progress'),
true);
1634 if ($privacy->enabledAccessTimesByType($this->getParentObject()->getType())) {
1635 $list->addPreset(
'access', $this->
lng->txt(
'last_access'),
true);
1638 switch ($this->getParentObject()->getType()) {
1640 $list->addPreset(
'status', $this->
lng->txt(
'crs_status'),
true);
1641 $list->addPreset(
'passed', $this->
lng->txt(
'crs_passed'),
true);
1645 $list->addPreset(
'mark', $this->
lng->txt(
'trac_mark'),
true);
1646 $list->addPreset(
'comment', $this->
lng->txt(
'trac_comment'),
true);
1647 if ($this->getParentObject()->enabledRegistration()) {
1648 $list->addPreset(
'registered', $this->
lng->txt(
'event_tbl_registered'),
true);
1650 $list->addPreset(
'participated', $this->
lng->txt(
'event_tbl_participated'),
true);
1651 $list->addBlank($this->
lng->txt(
'sess_signature'));
1653 $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...
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 uses PEAR error class.
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.
Class ilMailMemberSearchGUI.
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.
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)
lookup user name
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)
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.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_usr_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, 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.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface GlobalHttpState.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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.