ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMembershipGUI Class Reference

Base class for member tab content. More...

+ Inheritance diagram for ilMembershipGUI:
+ Collaboration diagram for ilMembershipGUI:

Public Member Functions

 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 
 getParentGUI ()
 
 getParentObject ()
 
 getMembersObject ()
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $a_user_ids)
 Filter user ids by access. More...
 
 executeCommand ()
 
 getAttendanceListUserData (int $user_id, array $filters=[])
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 Create Mail signature. More...
 
 addMemberTab (ilTabsGUI $tabs, bool $a_is_participant=false)
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 initParticipantsFromPost ()
 
 initMemberIdFromGet ()
 
 initSubscribersFromPost ()
 
 initWaitingListIdsFromPost ()
 
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 checkPermissionBool (string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
 
 checkRbacOrPositionAccessBool (string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
 
 checkPermission (string $a_permission, string $a_cmd="")
 Check permission If not granted redirect to parent gui. More...
 
 checkRbacOrPermissionAccess (string $a_rbac_perm, string $a_pos_perm)
 check rbac or position access More...
 
 canAddOrSearchUsers ()
 Check if current user is allowed to add / search users. More...
 
 participants ()
 Show participant table, subscriber table, wating list table;. More...
 
 getParticipantTableTitle ()
 
 participantsApplyFilter ()
 Apply filter for participant table. More...
 
 participantsResetFilter ()
 reset participants filter More...
 
 editMember ()
 Edit one participant. More...
 
 editParticipants (array $post_participants=array())
 Edit participants. More...
 
 updateLPFromStatus (int $usr_id, bool $has_passed)
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 
 getMailContextOptions ()
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMemberExportToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 Show mail to member toolbar button. More...
 
 getMailButtonLabel ()
 
 getDefaultCommand ()
 
 getMemberTabName ()
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 refuseSubscribers ()
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 activateSubTab (string $a_sub_tab)
 
 printMembers ()
 
 printMembersOutput ()
 print members output More...
 
 printForMembersOutput ()
 print members output More...
 
 jump2UsersGallery ()
 
 initAttendanceList (bool $a_for_members=false)
 

Protected Attributes

GlobalHttpState $http
 
Factory $refinery
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilLogger $logger
 
ilGlobalTemplateInterface $tpl
 
ilAccessHandler $access
 
ilParticipants $participants = null
 
ilObjUser $user
 
ilErrorHandling $error
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTree $tree
 
Profile $profile
 
array $member_data = []
 

Private Attributes

ilObject $repository_object
 
ilObjectGUI $repository_gui
 

Detailed Description

Base class for member tab content.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 29 of file class.ilMembershipGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
ilObject  $repository_obj 
)

Reimplemented in ilGroupMembershipGUI, and ilSessionMembershipGUI.

Definition at line 51 of file class.ilMembershipGUI.php.

52 {
53 global $DIC;
54
55 $this->repository_gui = $repository_gui;
56 $this->repository_object = $repository_obj;
57
58 $this->lng = $DIC->language();
59 $this->lng->loadLanguageModule('crs');
60 $this->lng->loadLanguageModule($this->getParentObject()->getType());
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();
74 $this->refinery = $DIC->refinery();
75 $this->profile = $DIC['user']->getProfile();
76 }
error(string $a_errmsg)
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $repository_gui, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), error(), getParentObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\logger(), ILIAS\Repository\profile(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ activateSubTab()

ilMembershipGUI::activateSubTab ( string  $a_sub_tab)
protected

Definition at line 1519 of file class.ilMembershipGUI.php.

1519 : void
1520 {
1521 $this->tabs->activateSubTab($a_sub_tab);
1522 }

References ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ addMemberTab()

ilMembershipGUI::addMemberTab ( ilTabsGUI  $tabs,
bool  $a_is_participant = false 
)

Definition at line 986 of file class.ilMembershipGUI.php.

986 : void
987 {
988 $mail = new ilMail($this->user->getId());
989
990 $member_tab_name = $this->getMemberTabName();
991
992 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
993 'manage_members',
994 'manage_members',
995 $this->getParentObject()->getRefId()
996 );
997
998 if ($has_manage_members_permission) {
999 $tabs->addTab(
1000 'members',
1001 $member_tab_name,
1002 $this->ctrl->getLinkTarget($this, '')
1003 );
1004 } elseif (
1005 $this->getParentObject()->getShowMembers() &&
1006 $a_is_participant
1007 ) {
1008 $tabs->addTab(
1009 'members',
1010 $member_tab_name,
1011 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilusersgallerygui'), 'view')
1012 );
1013 } elseif (
1014 $this->getParentObject()->getMailToMembersType() === 1 &&
1015 $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1016 $a_is_participant
1017 ) {
1018 $tabs->addTab(
1019 'members',
1020 $member_tab_name,
1021 $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1022 );
1023 }
1024 }
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.

References ilTabsGUI\addTab(), ILIAS\Repository\ctrl(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

Definition at line 1489 of file class.ilMembershipGUI.php.

1489 : void
1490 {
1491 // begin-patch clipboard
1492 $users = [];
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();
1499 }
1500 // end-patch clipboard
1501 if (!count($users)) {
1502 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1503 $this->ctrl->redirect($this, 'participants');
1504 }
1505 $clip = ilUserClipboard::getInstance($this->user->getId());
1506 $clip->add($users);
1507 $clip->save();
1508
1509 $this->lng->loadLanguageModule('user');
1510 $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
1511 $this->ctrl->redirect($this, 'participants');
1512 }
static getInstance(int $a_usr_id)

References ILIAS\Repository\ctrl(), ilUserClipboard\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ assignFromWaitingList()

ilMembershipGUI::assignFromWaitingList ( )

Assign from waiting list.

Definition at line 1355 of file class.ilMembershipGUI.php.

1355 : void
1356 {
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');
1361 }
1362
1363 $waiting_list = $this->initWaitingList();
1364
1365 $added_users = 0;
1366 foreach ($waiting_list_ids as $user_id) {
1367 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId((int) $user_id, false)) {
1368 continue;
1369 }
1370 if ($this->getMembersObject()->isAssigned((int) $user_id)) {
1371 continue;
1372 }
1373
1374 if ($this instanceof ilCourseMembershipGUI) {
1375 $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1376 $this->getMembersObject()->sendNotification(
1378 (int) $user_id,
1379 true
1380 );
1381 $this->getParentObject()->checkLPStatusSync((int) $user_id);
1382 }
1383 if ($this instanceof ilGroupMembershipGUI) {
1384 $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER);
1385 $this->getMembersObject()->sendNotification(
1387 (int) $user_id,
1388 true
1389 );
1390 }
1391 if ($this instanceof ilSessionMembershipGUI) {
1392 $this->getMembersObject()->register((int) $user_id);
1394 $noti->setRefId($this->getParentObject()->getRefId());
1395 $noti->setRecipients(array($user_id));
1397 $noti->send();
1398 }
1399
1400 $waiting_list->removeFromList((int) $user_id);
1401 ++$added_users;
1402 }
1403
1404 if ($added_users) {
1405 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_users_added"), true);
1406 } else {
1407 $this->tpl->setOnScreenMessage('info', $this->lng->txt("crs_users_already_assigned"), true);
1408 }
1409 $this->ctrl->redirect($this, 'participants');
1410 }
GUI class for membership features.
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
GUI class for membership features.

References $user_id, ILIAS\Repository\ctrl(), ilObjectFactory\getInstanceByObjId(), ilParticipants\IL_CRS_MEMBER, ilParticipants\IL_GRP_MEMBER, ILIAS\Repository\lng(), ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilCourseMembershipMailNotification\TYPE_ADMISSION_MEMBER.

+ Here is the call graph for this function:

◆ assignSubscribers()

ilMembershipGUI::assignSubscribers ( )

Do assignment of subscription request.

Definition at line 1259 of file class.ilMembershipGUI.php.

1259 : void
1260 {
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');
1265 }
1266
1267 if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1268 $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1269 $this->ctrl->redirect($this, 'participants');
1270 } else {
1271 foreach ($subscribers as $usr_id) {
1272 if ($this instanceof ilCourseMembershipGUI) {
1273 $this->getMembersObject()->sendNotification(
1275 $usr_id
1276 );
1277 $this->getParentObject()->checkLPStatusSync($usr_id);
1278 }
1279 if ($this instanceof ilGroupMembershipGUI) {
1280 $this->getMembersObject()->sendNotification(
1282 $usr_id
1283 );
1284 }
1285 if ($this instanceof ilSessionMembershipGUI) {
1286 // todo refactor to participants
1288 $noti->setRefId($this->getParentObject()->getRefId());
1289 $noti->setRecipients(array($usr_id));
1291 $noti->send();
1292 }
1293 }
1294 }
1295 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_assigned"), true);
1296 $this->ctrl->redirect($this, 'participants');
1297 }
assignSubscribers()
Do assignment of subscription request.

References ILIAS\Repository\ctrl(), error(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

+ Here is the call graph for this function:

◆ canAddOrSearchUsers()

ilMembershipGUI::canAddOrSearchUsers ( )
protected

Check if current user is allowed to add / search users.

Reimplemented in ilSessionMembershipGUI.

Definition at line 218 of file class.ilMembershipGUI.php.

218 : bool
219 {
220 return $this->checkPermissionBool('manage_members');
221 }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)

◆ checkPermission()

ilMembershipGUI::checkPermission ( string  $a_permission,
string  $a_cmd = "" 
)
protected

Check permission If not granted redirect to parent gui.

Definition at line 196 of file class.ilMembershipGUI.php.

196 : void
197 {
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());
201 }
202 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by ilSessionMembershipGUI\deleteParticipants(), ilLearningSequenceMembershipGUI\printMembers(), and ilSessionMembershipGUI\updateMembers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissionBool()

ilMembershipGUI::checkPermissionBool ( string  $a_permission,
string  $a_cmd = '',
string  $a_type = '',
int  $a_ref_id = 0 
)
protected

Definition at line 169 of file class.ilMembershipGUI.php.

174 : bool {
175 if ($a_ref_id === 0) {
176 $a_ref_id = $this->getParentObject()->getRefId();
177 }
178 return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
179 }

References getParentObject().

Referenced by ilSessionMembershipGUI\checkRbacOrPositionAccessBool().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRbacOrPermissionAccess()

ilMembershipGUI::checkRbacOrPermissionAccess ( string  $a_rbac_perm,
string  $a_pos_perm 
)
protected

check rbac or position access

Definition at line 207 of file class.ilMembershipGUI.php.

207 : void
208 {
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());
212 }
213 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ checkRbacOrPositionAccessBool()

ilMembershipGUI::checkRbacOrPositionAccessBool ( string  $a_rbac_perm,
string  $a_pos_perm,
int  $a_ref_id = 0 
)
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 181 of file class.ilMembershipGUI.php.

185 : bool {
186 if ($a_ref_id === 0) {
187 $a_ref_id = $this->getParentObject()->getRefId();
188 }
189 return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
190 }

Referenced by ilCourseMembershipGUI\assignMembers(), ilLearningSequenceMembershipGUI\members(), ilLearningSequenceMembershipGUI\printMembers(), and ilLearningSequenceMembershipGUI\setSubTabs().

+ Here is the caller graph for this function:

◆ confirmAssignFromWaitingList()

ilMembershipGUI::confirmAssignFromWaitingList ( )

Assign from waiting list (confirmatoin)

Definition at line 1324 of file class.ilMembershipGUI.php.

1324 : void
1325 {
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');
1330 }
1331 $c_gui = new ilConfirmationGUI();
1332 // set confirm/cancel commands
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");
1337
1338 foreach ($waiting_list_ids as $waiting) {
1339 $name = ilObjUser::_lookupName($waiting);
1340
1341 $c_gui->addItem(
1342 'waiting[]',
1343 (string) $name['user_id'],
1344 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1345 ilUtil::getImagePath('standard/icon_usr.svg')
1346 );
1347 }
1348
1349 $this->tpl->setContent($c_gui->getHTML());
1350 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupName(int $a_user_id)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilObjUser\_lookupName(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmAssignSubscribers()

ilMembershipGUI::confirmAssignSubscribers ( )

Show subscription confirmation.

Definition at line 1150 of file class.ilMembershipGUI.php.

1150 : void
1151 {
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');
1156 }
1157
1158 $c_gui = new ilConfirmationGUI();
1159
1160 // set confirm/cancel commands
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");
1165
1166 foreach ($subscribers as $subscriber) {
1167 $name = ilObjUser::_lookupName($subscriber);
1168
1169 $c_gui->addItem(
1170 'subscribers[]',
1171 (string) $name['user_id'],
1172 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1173 ilUtil::getImagePath('standard/icon_usr.svg')
1174 );
1175 }
1176 $this->tpl->setContent($c_gui->getHTML());
1177 }

References ilObjUser\_lookupName(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

Reimplemented in ilSessionMembershipGUI.

Definition at line 670 of file class.ilMembershipGUI.php.

670 : void
671 {
673
674 if (!count($participants)) {
675 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
676 $this->ctrl->redirect($this, 'participants');
677 }
678
679 // Check last admin
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');
683 }
684
685 // if only position access is granted, show additional info
686 if (!$this->checkPermissionBool('manage_members')) {
687 $this->lng->loadLanguageModule('rbac');
688 $this->tpl->setOnScreenMessage('info', $this->lng->txt('rbac_info_only_position_access'));
689 }
690
691 // Access check for admin deletion
692 if (
693 !$this->access->checkAccess(
694 'edit_permission',
695 '',
696 $this->getParentObject()->getRefId()
697 ) &&
698 !$this->getMembersObject()->isAdmin($this->user->getId())
699 ) {
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');
704 }
705 }
706 }
707
709 $this->repository_object->getRefId(),
711 )) {
712 $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
713 return;
714 }
715
716 $confirm = new ilConfirmationGUI();
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');
721
722 foreach ($participants as $usr_id) {
723 $name = ilObjUser::_lookupName($usr_id);
724
725 $confirm->addItem(
726 'participants[]',
727 (string) $name['user_id'],
728 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
729 ilUtil::getImagePath('standard/icon_usr.svg')
730 );
731 }
732 $this->tpl->setContent($confirm->getHTML());
733 }
static isReferenceMemberUpdateConfirmationRequired(int $course_ref_id, array $participants)
ilParticipants $participants

References ilObjUser\_lookupName(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), ilCourseReferencePathInfo\isReferenceMemberUpdateConfirmationRequired(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

Definition at line 1415 of file class.ilMembershipGUI.php.

1415 : void
1416 {
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');
1421 }
1422 $this->lng->loadLanguageModule('mmbr');
1423 $c_gui = new ilConfirmationGUI();
1424
1425 // set confirm/cancel commands
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");
1430
1431 foreach ($waiting_list_ids as $waiting) {
1432 $name = ilObjUser::_lookupName($waiting);
1433
1434 $c_gui->addItem(
1435 'waiting[]',
1436 (string) $name['user_id'],
1437 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1438 ilUtil::getImagePath('standard/icon_usr.svg')
1439 );
1440 }
1441 $this->tpl->setContent($c_gui->getHTML());
1442 }

References ilObjUser\_lookupName(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ confirmRefuseSubscribers()

ilMembershipGUI::confirmRefuseSubscribers ( )

Refuse subscriber confirmation.

Definition at line 1182 of file class.ilMembershipGUI.php.

1182 : void
1183 {
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');
1188 }
1189 $this->lng->loadLanguageModule('mmbr');
1190 $c_gui = new ilConfirmationGUI();
1191 // set confirm/cancel commands
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");
1196
1197 foreach ($subscribers as $subscriber_id) {
1198 $name = ilObjUser::_lookupName($subscriber_id);
1199
1200 $c_gui->addItem(
1201 'subscribers[]',
1202 (string) $name['user_id'],
1203 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1204 ilUtil::getImagePath('standard/icon_usr.svg')
1205 );
1206 }
1207
1208 $this->tpl->setContent($c_gui->getHTML());
1209 }

References ilObjUser\_lookupName(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ createMailSignature()

ilMembershipGUI::createMailSignature ( )

Create Mail signature.

Todo:
better implementation

Definition at line 964 of file class.ilMembershipGUI.php.

964 : string
965 {
966 return $this->getParentGUI()->createMailSignature();
967 }

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 735 of file class.ilMembershipGUI.php.

735 : void
736 {
738 if (!count($participants)) {
739 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
740 $this->ctrl->redirect($this, 'participants');
741 }
742
743 // If the user doesn't have the edit_permission and is not administrator, he may not remove
744 // members who have the course administrator role
745 if (
746 !$this->access->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
747 !$this->getMembersObject()->isAdmin($this->user->getId())
748 ) {
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');
753 }
754 }
755 }
756
758 $this->tpl->setOnScreenMessage('failure', 'Error deleting participants.', true);
759 $this->ctrl->redirect($this, 'participants');
760 } else {
761 foreach ($participants as $usr_id) {
762 $mail_type = 0;
763 // @todo more generic
764 switch ($this->getParentObject()->getType()) {
765 case 'crs':
767 break;
768 case 'grp':
770 break;
771 case 'lso':
773 break;
774 }
775 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
776 }
777 }
778 $this->tpl->setOnScreenMessage('success', $this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
779 $this->ctrl->redirect($this, "participants");
780 }

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_DISMISS_MEMBER, ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER, and ilLearningSequenceMembershipMailNotification\TYPE_DISMISS_MEMBER.

Referenced by ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editMember()

ilMembershipGUI::editMember ( )
protected

Edit one participant.

Definition at line 462 of file class.ilMembershipGUI.php.

462 : void
463 {
464 $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
465 $this->editParticipants(array($this->initMemberIdFromGet()));
466 }
editParticipants(array $post_participants=array())
Edit participants.
activateSubTab(string $a_sub_tab)

◆ editParticipants()

ilMembershipGUI::editParticipants ( array  $post_participants = array())
protected

Edit participants.

Parameters
int[]$post_participants

Definition at line 472 of file class.ilMembershipGUI.php.

472 : void
473 {
474 if (!$post_participants) {
475 $post_participants = $this->initParticipantsFromPost();
476 }
477
478 $real_participants = $this->getMembersObject()->getParticipants();
479 $participants = array_intersect($post_participants, $real_participants);
480
481 if (!count($participants)) {
482 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
483 $this->ctrl->redirect($this, 'participants');
484 }
485 $table = $this->initEditParticipantTableGUI($participants);
486 $this->tpl->setContent($table->getHTML());
487 }

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilMembershipGUI::executeCommand ( )

Definition at line 233 of file class.ilMembershipGUI.php.

233 : void
234 {
235 $cmd = $this->ctrl->getCmd('participants');
236 $next_class = $this->ctrl->getNextClass();
237
238 switch ($next_class) {
239 case 'ilrepositorysearchgui':
240
241 $this->checkPermission('manage_members');
242
243 $rep_search = new ilRepositorySearchGUI();
244 $rep_search->addUserAccessFilterCallable([$this, 'filterUserIdsByRbacOrPositionOfCurrentUser']);
245
247 if (
248 $participants->isAdmin($this->user->getId()) ||
249 $this->access->checkAccess('manage_members', '', $this->getParentObject()->getRefId())
250 ) {
251 $rep_search->setCallback(
252 $this,
253 'assignMembers',
254 $this->getParentGUI()->getLocalRoles(),
255 (string) $this->getDefaultRole()
256 );
257 } else {
258 //#18445 excludes admin role
259 $rep_search->setCallback(
260 $this,
261 'assignMembers',
262 $this->getLocalRoles(),
263 (string) $this->getDefaultRole()
264 );
265 }
266
267 // Set tabs
268 $this->ctrl->setReturn($this, 'participants');
269 $ret = $this->ctrl->forwardCommand($rep_search);
270 break;
271
272 case 'ilmailmembersearchgui':
273 $this->tabs->clearTargets();
274 $this->tabs->setBackTarget(
275 $this->lng->txt('btn_back'),
276 $this->ctrl->getLinkTarget($this, $this->getDefaultCommand())
277 );
278
279 $mail = new ilMail($this->user->getId());
280 if (!(
281 $this->getParentObject()->getMailToMembersType() === ilCourseConstants::MAIL_ALLOWED_ALL ||
282 $this->access->checkAccess('manage_members', "", $this->getParentObject()->getRefId())
283 ) ||
284 !$this->rbacsystem->checkAccess(
285 'internal_mail',
286 $mail->getMailObjectReferenceId()
287 )) {
288 $this->error->raiseError($this->lng->txt("msg_no_perm_read"), $this->error->MESSAGE);
289 }
290
291 $mail_search = new ilMailMemberSearchGUI(
292 $this,
293 $this->getParentObject()->getRefId(),
294 $this->getMailMemberRoles()
295 );
296 $mail_search->setObjParticipants(
297 ilParticipants::getInstance($this->getParentObject()->getRefId())
298 );
299 $this->ctrl->forwardCommand($mail_search);
300 break;
301
302 case 'ilusersgallerygui':
303
304 $this->setSubTabs($this->tabs);
305 $this->tabs->setSubTabActive(
306 $this->getParentObject()->getType() . '_members_gallery'
307 );
308 $is_admin = $this->checkRbacOrPositionAccessBool('manage_members', 'manage_members');
309 $is_participant = ilParticipants::_isParticipant(
310 $this->getParentObject()->getRefId(),
311 $this->user->getId()
312 );
313 if (
314 !$is_admin &&
315 (
316 !$this->getParentObject()->getShowMembers() ||
317 !$is_participant
318 )
319 ) {
320 $this->error->raiseError($this->lng->txt('msg_no_perm_read'), $this->error->MESSAGE);
321 }
322
323 $this->showMailToMemberToolbarButton($this->toolbar, 'jump2UsersGallery');
324 $this->showMemberExportToolbarButton($this->toolbar, 'jump2UsersGallery');
325
327 $gallery_gui = new ilUsersGalleryGUI($provider);
328 $this->ctrl->forwardCommand($gallery_gui);
329 break;
330
331 case 'ilcourseparticipantsgroupsgui':
332
333 $this->setSubTabs($this->tabs);
334 $this->checkRbacOrPermissionAccess('manage_members', 'manage_members');
335
336 $cmg_gui = new ilCourseParticipantsGroupsGUI($this->getParentObject()->getRefId());
337 if ($cmd === "show" || $cmd = "") {
339 }
340 $this->ctrl->forwardCommand($cmg_gui);
341 break;
342
343 case 'ilsessionoverviewgui':
344
345 $this->setSubTabs($this->tabs);
346 $this->checkRbacOrPermissionAccess('manage_members', 'manage_members');
347
348 $prt = ilParticipants::getInstance($this->getParentObject()->getRefId());
349
350 $overview = new ilSessionOverviewGUI($this->getParentObject()->getRefId(), $prt);
351 $this->ctrl->forwardCommand($overview);
352 break;
353
354 case 'ilmemberexportgui':
355
356 $this->setSubTabs($this->tabs);
357 $this->checkRbacOrPermissionAccess('manage_members', 'manage_members');
358
359 $export = new ilMemberExportGUI($this->getParentObject()->getRefId());
360 $this->ctrl->forwardCommand($export);
361 break;
362
363 case 'ilobjectcustomuserfieldsgui':
364
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');
369 $cdf_gui = new ilObjectCustomUserFieldsGUI($this->getParentGUI()->getObject()->getId());
370 $this->ctrl->forwardCommand($cdf_gui);
371 break;
372
373 default:
374 $this->setSubTabs($this->tabs);
375 //exclude mailMembersBtn cmd from this check
376 if (
377 $cmd === "mailMembersBtn" ||
378 $cmd === 'membersMap' ||
379 $cmd === 'printForMembersOutput' ||
380 $cmd === 'jump2UsersGallery'
381 ) {
382 $this->checkPermission('read');
383 } else {
384 $this->checkRbacOrPermissionAccess('manage_members', 'manage_members');
385 }
386 $this->$cmd();
387 break;
388 }
389 }
Class ilCourseParticipantsGroupsGUI.
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
checkRbacOrPermissionAccess(string $a_rbac_perm, string $a_pos_perm)
check rbac or position access
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
Show mail to member toolbar button.
setSubTabs(ilTabsGUI $tabs)
Set sub tabs.
showMemberExportToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
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
@ilCtrl_Calls ilUsersGalleryGUI: ILIAS\User\Profile\PublicProfileGUI @ilCtrl_isCalledBy ilUsersGaller...
Class ilUsersGalleryParticipants.
$provider
Definition: ltitoken.php:80

References $provider, ilParticipants\_isParticipant(), ILIAS\Repository\access(), ILIAS\Repository\ctrl(), error(), ILIAS\Survey\Mode\getId(), ilParticipants\getInstance(), ilParticipants\isAdmin(), ILIAS\Repository\lng(), ilCourseConstants\MAIL_ALLOWED_ALL, ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser ( array  $a_user_ids)

Filter user ids by access.

Parameters
int[]$a_usr_ids
Returns
int[]

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, and ilLearningSequenceMembershipGUI.

Definition at line 228 of file class.ilMembershipGUI.php.

228 : array
229 {
230 return $a_user_ids;
231 }

◆ getAttendanceListUserData()

ilMembershipGUI::getAttendanceListUserData ( int  $user_id,
array  $filters = [] 
)

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, ilLearningSequenceMembershipGUI, and ilSessionMembershipGUI.

Definition at line 430 of file class.ilMembershipGUI.php.

430 : array
431 {
432 return [];
433 }

◆ getCtrl()

ilMembershipGUI::getCtrl ( )
protected

Definition at line 136 of file class.ilMembershipGUI.php.

137 {
138 return $this->ctrl;
139 }
ilCtrlInterface $ctrl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

+ Here is the caller graph for this function:

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

Reimplemented in ilLearningSequenceMembershipGUI.

Definition at line 969 of file class.ilMembershipGUI.php.

969 : string
970 {
971 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
972 'manage_members',
973 'manage_members',
974 $this->getParentObject()->getRefId()
975 );
976 if ($has_manage_members_permission) {
977 return 'participants';
978 }
979
980 if ($this->getParentObject()->getShowMembers()) {
981 return 'jump2UsersGallery';
982 }
983 return 'mailMembersBtn';
984 }

◆ getDefaultRole()

ilMembershipGUI::getDefaultRole ( )
protected

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, and ilLearningSequenceMembershipGUI.

Definition at line 1514 of file class.ilMembershipGUI.php.

1514 : ?int
1515 {
1516 return null;
1517 }

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected

Definition at line 131 of file class.ilMembershipGUI.php.

131 : ilLanguage
132 {
133 return $this->lng;
134 }
language handling

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

+ Here is the caller graph for this function:

◆ getLocalRoles()

ilMembershipGUI::getLocalRoles ( )
Returns
array<int, string>

Definition at line 1118 of file class.ilMembershipGUI.php.

1118 : array
1119 {
1120 return $this->getParentGUI()->getLocalRoles();
1121 }

◆ getLogger()

ilMembershipGUI::getLogger ( )
protected

Definition at line 141 of file class.ilMembershipGUI.php.

141 : ilLogger
142 {
143 return $this->logger;
144 }
Component logger with individual log levels by component id.

References $logger.

◆ getMailButtonLabel()

ilMembershipGUI::getMailButtonLabel ( )
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 955 of file class.ilMembershipGUI.php.

955 : string
956 {
957 return $this->lng->txt("mail_members");
958 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, and ilSessionMembershipGUI.

Definition at line 820 of file class.ilMembershipGUI.php.

820 : array
821 {
822 return [];
823 }

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, ilLearningSequenceMembershipGUI, and ilSessionMembershipGUI.

Definition at line 164 of file class.ilMembershipGUI.php.

165 {
166 return null;
167 }
Class ilAbstractMailMemberRoles.

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

◆ getMemberTabName()

ilMembershipGUI::getMemberTabName ( )
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 1026 of file class.ilMembershipGUI.php.

1026 : string
1027 {
1028 return $this->lng->txt('members');
1029 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Reimplemented in ilLearningSequenceMembershipGUI.

Definition at line 151 of file class.ilMembershipGUI.php.

151 : ilObject
152 {
154 }
Class ilObject Basic functions for all objects.

References $repository_object.

Referenced by __construct(), ilCourseMembershipGUI\assignMembers(), ilGroupMembershipGUI\assignMembers(), checkPermissionBool(), ilSessionMembershipGUI\checkRbacOrPositionAccessBool(), ilSessionMembershipGUI\deleteParticipants(), ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses(), ilCourseMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), ilGroupMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), ilCourseMembershipGUI\getLocalTypeRole(), ilGroupMembershipGUI\getLocalTypeRole(), ilCourseMembershipGUI\getMailContextOptions(), ilGroupMembershipGUI\getMailContextOptions(), ilSessionMembershipGUI\getMailContextOptions(), getMembersObject(), ilSessionMembershipGUI\getMemberTabName(), ilSessionMembershipGUI\getParticipantTableTitle(), ilCourseMembershipGUI\getPrintMemberData(), ilCourseMembershipGUI\initEditParticipantTableGUI(), ilGroupMembershipGUI\initEditParticipantTableGUI(), ilCourseMembershipGUI\initParticipantTableGUI(), ilGroupMembershipGUI\initParticipantTableGUI(), ilSessionMembershipGUI\initParticipantTableGUI(), ilSessionMembershipGUI\initSubscriberTable(), ilCourseMembershipGUI\initWaitingList(), ilGroupMembershipGUI\initWaitingList(), ilSessionMembershipGUI\initWaitingList(), ilCourseMembershipGUI\showDeleteParticipantsConfirmationWithLinkedCourses(), and ilSessionMembershipGUI\updateMembers().

+ Here is the caller graph for this function:

◆ getParticipantTableTitle()

ilMembershipGUI::getParticipantTableTitle ( )
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 425 of file class.ilMembershipGUI.php.

425 : string
426 {
427 return $this->lng->txt($this->getParentObject()->getType() . '_mem_tbl_header');
428 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initAttendanceList()

ilMembershipGUI::initAttendanceList ( bool  $a_for_members = false)
protected

Definition at line 1592 of file class.ilMembershipGUI.php.

1593 {
1594 global $DIC;
1595
1596 $waiting_list = $this->initWaitingList();
1597
1598 if ($this instanceof ilSessionMembershipGUI) {
1599 /*
1600 * TODO this exact logic is also in ilSessionParticipantsTableGUI and ilSessionMembershipGUI,
1601 * should be centralized.
1602 */
1603 $member_id = $DIC->repositoryTree()->checkForParentType(
1604 $this->getParentObject()->getRefId(),
1605 'grp'
1606 );
1607 if (!$member_id) {
1608 $member_id = $DIC->repositoryTree()->checkForParentType(
1609 $this->getParentObject()->getRefId(),
1610 'crs'
1611 );
1612 }
1613 if (!$member_id) {
1614 $DIC->logger()->sess()->warning('Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
1615 $member_id = $this->getParentObject()->getRefId();
1616 }
1617 $part = ilParticipants::getInstance($member_id);
1618
1619 $list = new ilAttendanceList(
1620 $this,
1621 $this->getParentObject(),
1622 $part,
1623 $waiting_list
1624 );
1625 } else {
1626 $list = new ilAttendanceList(
1627 $this,
1628 $this->getParentObject(),
1629 $this->getMembersObject(),
1630 $waiting_list
1631 );
1632 }
1633 $list->setId($this->getParentObject()->getType() . '_memlist_' . $this->getParentObject()->getId());
1634
1635 $list->setTitle(
1636 $this->lng->txt($this->getParentObject()->getType() . '_members_print_title'),
1637 $this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle()
1638 );
1639
1640 $show_tracking =
1641 (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
1642 if ($show_tracking) {
1643 $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
1644 $show_tracking = $olp->isActive();
1645 }
1646 if ($show_tracking && $this->getParentObject()->getType() !== 'sess') {
1647 $list->addPreset('progress', $this->lng->txt('learning_progress'), true);
1648 }
1649
1650 $privacy = ilPrivacySettings::getInstance();
1651 if ($privacy->enabledAccessTimesByType($this->getParentObject()->getType())) {
1652 $list->addPreset('access', $this->lng->txt('last_access'), true);
1653 }
1654
1655 switch ($this->getParentObject()->getType()) {
1656 case 'crs':
1657 $list->addPreset('status', $this->lng->txt('crs_status'), true);
1658 $list->addPreset('passed', $this->lng->txt('crs_passed'), true);
1659 break;
1660
1661 case 'sess':
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);
1666 }
1667 $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1668 $list->addBlank($this->lng->txt('sess_signature'));
1669
1670 $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1671 break;
1672
1673 case 'grp':
1674 default:
1675 break;
1676 }
1677 return $list;
1678 }
Base class for attendance lists.
static getInstance(int $obj_id)
if(!file_exists('../ilias.ini.php'))

References $DIC, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ILIAS\Survey\Mode\getId(), ilPrivacySettings\getInstance(), ilParticipants\getInstance(), ilObjectLP\getInstance(), and ILIAS\Repository\lng().

Referenced by ilLearningSequenceMembershipGUI\printMembers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMemberIdFromGet()

ilMembershipGUI::initMemberIdFromGet ( )
protected

Definition at line 94 of file class.ilMembershipGUI.php.

94 : int
95 {
96 if ($this->http->wrapper()->query()->has('member_id')) {
97 return $this->http->wrapper()->query()->retrieve(
98 'member_id',
99 $this->refinery->kindlyTo()->int()
100 );
101 }
102 return 0;
103 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ initParticipantsFromPost()

ilMembershipGUI::initParticipantsFromPost ( )
protected
Returns
int[]

Definition at line 81 of file class.ilMembershipGUI.php.

81 : array
82 {
83 if ($this->http->wrapper()->post()->has('participants')) {
84 return $this->http->wrapper()->post()->retrieve(
85 'participants',
86 $this->refinery->kindlyTo()->listOf(
87 $this->refinery->kindlyTo()->int()
88 )
89 );
90 }
91 return [];
92 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubscribersFromPost()

ilMembershipGUI::initSubscribersFromPost ( )
protected

Definition at line 105 of file class.ilMembershipGUI.php.

105 : array
106 {
107 if ($this->http->wrapper()->post()->has('subscribers')) {
108 return $this->http->wrapper()->post()->retrieve(
109 'subscribers',
110 $this->refinery->kindlyTo()->listOf(
111 $this->refinery->kindlyTo()->int()
112 )
113 );
114 }
115 return [];
116 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ initSubscriberTable()

ilMembershipGUI::initSubscriberTable ( )
protected

Reimplemented in ilSessionMembershipGUI.

Definition at line 1140 of file class.ilMembershipGUI.php.

1141 {
1142 $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1143 $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1144 return $subscriber;
1145 }
GUI class for course/group subscriptions.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initWaitingListIdsFromPost()

ilMembershipGUI::initWaitingListIdsFromPost ( )
protected

Definition at line 118 of file class.ilMembershipGUI.php.

118 : array
119 {
120 if ($this->http->wrapper()->post()->has('waiting')) {
121 return $this->http->wrapper()->post()->retrieve(
122 'waiting',
123 $this->refinery->kindlyTo()->listOf(
124 $this->refinery->kindlyTo()->int()
125 )
126 );
127 }
128 return [];
129 }

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ jump2UsersGallery()

ilMembershipGUI::jump2UsersGallery ( )
protected

Definition at line 1587 of file class.ilMembershipGUI.php.

1587 : void
1588 {
1589 $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1590 }

References ILIAS\Repository\ctrl().

Referenced by ilLearningSequenceMembershipGUI\members().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

Definition at line 855 of file class.ilMembershipGUI.php.

855 : void
856 {
857 $this->showMailToMemberToolbarButton($this->toolbar, 'mailMembersBtn');
858 }

References ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

Definition at line 828 of file class.ilMembershipGUI.php.

828 : void
829 {
830 $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
831 if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
832 return;
833 }
834
835 $map = ilMapUtil::getMapGUI();
836 $map->setMapId("course_map")
837 ->setWidth("700px")
838 ->setHeight("500px")
839 ->setLatitude($this->getParentObject()->getLatitude())
840 ->setLongitude($this->getParentObject()->getLongitude())
841 ->setZoom($this->getParentObject()->getLocationZoom())
842 ->setEnableTypeControl(true)
843 ->setEnableNavigationControl(true)
844 ->setEnableCentralMarker(true);
845
846 $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
847 foreach ($members as $user_id) {
848 $map->addUserMarker($user_id);
849 }
850
851 $this->tpl->setContent($map->getHtml());
852 $this->tpl->setLeftContent($map->getUserListHtml());
853 }
static isActivated()
Checks whether Map feature is activated.
static getMapGUI()
Get an instance of the GUI class.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.

References $user_id, ILIAS\Survey\Mode\getId(), ilParticipants\getInstanceByObjId(), ilMapUtil\getMapGUI(), and ilMapUtil\isActivated().

+ Here is the call graph for this function:

◆ parseSubscriberTable()

ilMembershipGUI::parseSubscriberTable ( )
protected

Parse table of subscription request.

Definition at line 1126 of file class.ilMembershipGUI.php.

1127 {
1128 $subscribers = $this->getMembersObject()->getSubscribers();
1129 $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1130 if (!count($filtered_subscribers)) {
1131 return null;
1132 }
1133 $subscriber = $this->initSubscriberTable();
1134 $subscriber->readSubscriberData(
1135 $filtered_subscribers
1136 );
1137 return $subscriber;
1138 }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.

◆ parseWaitingListTable()

ilMembershipGUI::parseWaitingListTable ( )
protected

Parse table of subscription request.

Definition at line 1302 of file class.ilMembershipGUI.php.

1303 {
1304 $wait = $this->initWaitingList();
1305
1306 $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1307 if (!count($wait_users)) {
1308 return null;
1309 }
1310
1311 $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1312 $waiting_table->setUserIds(
1313 $wait_users
1314 );
1315 $waiting_table->readUserData();
1316 $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1317
1318 return $waiting_table;
1319 }
GUI class for course/group waiting list.

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ participants()

ilMembershipGUI::participants ( )
protected

Show participant table, subscriber table, wating list table;.

Definition at line 394 of file class.ilMembershipGUI.php.

394 : void
395 {
396 $this->initParticipantTemplate();
398 $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
399
400 // show waiting list table
401 $waiting = $this->parseWaitingListTable();
402 if ($waiting instanceof ilWaitingListTableGUI) {
403 $this->tpl->setVariable('TABLE_WAIT', $waiting->getHTML());
404 }
405
406 // show subscriber table
407 $subscriber = $this->parseSubscriberTable();
408 if ($subscriber instanceof ilSubscriberTableGUI) {
409 $this->tpl->setVariable('TABLE_SUB', $subscriber->getHTML());
410 }
411
412 // show member table
413 $table = $this->initParticipantTableGUI();
414 $table->setTitle($this->getParticipantTableTitle());
415 $table->setFormAction($this->ctrl->getFormAction($this));
416 $table->parse();
417
418 // filter commands
419 $table->setFilterCommand('participantsApplyFilter');
420 $table->setResetCommand('participantsResetFilter');
421
422 $this->tpl->setVariable('MEMBERS', $table->getHTML());
423 }
parseWaitingListTable()
Parse table of subscription request.
showParticipantsToolbar()
Show participants toolbar.
parseSubscriberTable()
Parse table of subscription request.

References ILIAS\Repository\ctrl().

Referenced by getMembersObject(), and ilLearningSequenceMembershipGUI\members().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ participantsApplyFilter()

ilMembershipGUI::participantsApplyFilter ( )
protected

Apply filter for participant table.

Definition at line 438 of file class.ilMembershipGUI.php.

438 : void
439 {
440 $table = $this->initParticipantTableGUI();
441 $table->resetOffset();
442 $table->writeFilterToSession();
443
444 $this->participants();
445 }

◆ participantsResetFilter()

ilMembershipGUI::participantsResetFilter ( )
protected

reset participants filter

Definition at line 450 of file class.ilMembershipGUI.php.

450 : void
451 {
452 $table = $this->initParticipantTableGUI();
453 $table->resetOffset();
454 $table->resetFilter();
455
456 $this->participants();
457 }

◆ printForMembersOutput()

ilMembershipGUI::printForMembersOutput ( )
protected

print members output

Definition at line 1570 of file class.ilMembershipGUI.php.

1570 : void
1571 {
1572 $this->tabs->clearTargets();
1573 $this->tabs->setBackTarget(
1574 $this->lng->txt('back'),
1575 $this->ctrl->getLinkTarget($this, 'jump2UsersGallery')
1576 );
1577
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();
1585 }
initAttendanceList(bool $a_for_members=false)

References ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ printMembers()

ilMembershipGUI::printMembers ( )
protected
Todo:
: refactor to own class

Reimplemented in ilLearningSequenceMembershipGUI.

Definition at line 1527 of file class.ilMembershipGUI.php.

1527 : void
1528 {
1529 $this->checkPermission('read');
1530
1531 $this->tabs->clearTargets();
1532
1533 $this->tabs->setBackTarget(
1534 $this->lng->txt('back'),
1535 $this->ctrl->getLinkTarget($this, 'participants')
1536 );
1537
1538 $list = $this->initAttendanceList();
1539 $form = $list->initForm('printMembersOutput');
1540 $this->tpl->setContent($form->getHTML());
1541 }

References ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ printMembersOutput()

ilMembershipGUI::printMembersOutput ( )
protected

print members output

Definition at line 1546 of file class.ilMembershipGUI.php.

1546 : void
1547 {
1548 $this->tabs->clearTargets();
1549 $this->tabs->setBackTarget(
1550 $this->lng->txt('back'),
1551 $this->ctrl->getLinkTarget($this, 'participants')
1552 );
1553
1554 $list = $this->initAttendanceList();
1555 $list->initFromForm();
1556 $list->setCallback([$this, 'getAttendanceListUserData']);
1557 $this->member_data = $this->getPrintMemberData(
1559 $this->getMembersObject()->getParticipants()
1560 )
1561 );
1562
1563 $list->getNonMemberUserData($this->member_data);
1564 $list->getFullscreenHTML();
1565 }

References ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

+ Here is the call graph for this function:

◆ readMemberData()

ilMembershipGUI::readMemberData ( array  $usr_ids,
array  $columns 
)

Required for member table guis.

Todo:
needs refactoring and should not be located in GUI classes

Definition at line 1110 of file class.ilMembershipGUI.php.

1110 : array
1111 {
1112 return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1113 }

Referenced by ilGroupMembershipGUI\getPrintMemberData(), and ilGroupMembershipGUI\initEditParticipantTableGUI().

+ Here is the caller graph for this function:

◆ refuseFromList()

ilMembershipGUI::refuseFromList ( )
protected

refuse from waiting list

Definition at line 1447 of file class.ilMembershipGUI.php.

1447 : void
1448 {
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');
1453 }
1454
1455 $waiting_list = $this->initWaitingList();
1456
1457 foreach ($waiting_list_ids as $user_id) {
1458 $waiting_list->removeFromList((int) $user_id);
1459
1460 if ($this instanceof ilCourseMembershipGUI) {
1461 $this->getMembersObject()->sendNotification(
1463 (int) $user_id,
1464 true
1465 );
1466 }
1467 if ($this instanceof ilGroupMembershipGUI) {
1468 $this->getMembersObject()->sendNotification(
1470 (int) $user_id,
1471 true
1472 );
1473 }
1474 if ($this instanceof ilSessionMembershipGUI) {
1476 $noti->setRefId($this->getParentObject()->getRefId());
1477 $noti->setRecipients(array($user_id));
1479 $noti->send();
1480 }
1481 }
1482 $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_users_removed_from_list'), true);
1483 $this->ctrl->redirect($this, 'participants');
1484 }

References $user_id, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, and ilSessionMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

+ Here is the call graph for this function:

◆ refuseSubscribers()

ilMembershipGUI::refuseSubscribers ( )
protected

Definition at line 1211 of file class.ilMembershipGUI.php.

1211 : void
1212 {
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');
1217 }
1218
1219 if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1220 $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1221 $this->ctrl->redirect($this, 'participants');
1222 } else {
1223 foreach ($subscribers as $usr_id) {
1224 if ($this instanceof ilCourseMembershipGUI) {
1225 $this->getMembersObject()->sendNotification(
1227 $usr_id
1228 );
1229 }
1230 if ($this instanceof ilGroupMembershipGUI) {
1231 $this->getMembersObject()->sendNotification(
1233 $usr_id
1234 );
1235 }
1236 if ($this instanceof ilSessionMembershipGUI) {
1238 $noti->setRefId($this->getParentObject()->getRefId());
1239 $noti->setRecipients(array($usr_id));
1241 $noti->send();
1242 }
1243 if ($this instanceof ilLearningSequenceMembershipGUI) {
1244 $this->getMembersObject()->sendNotification(
1246 $usr_id
1247 );
1248 }
1249 }
1250 }
1251
1252 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_deleted"), true);
1253 $this->ctrl->redirect($this, 'participants');
1254 }
GUI class for learning sequence membership features.

References ILIAS\Repository\ctrl(), error(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilLearningSequenceMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, and ilSessionMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

+ Here is the call graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

Definition at line 782 of file class.ilMembershipGUI.php.

782 : void
783 {
784 $participants = [];
785 if ($this->http->wrapper()->post()->has('participants')) {
787 } elseif ($this->http->wrapper()->post()->has('subscribers')) {
789 } elseif ($this->http->wrapper()->post()->has('waiting')) {
791 } elseif ($this->http->wrapper()->query()->has('member_id')) {
793 }
794 if (!count($participants)) {
795 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
796 $this->ctrl->redirect($this, 'participants');
797 }
798
799 $rcps = [];
800 foreach ($participants as $usr_id) {
801 $rcps[] = ilObjUser::_lookupLogin($usr_id);
802 }
803 $context_options = $this->getMailContextOptions();
804
808 $this,
809 'participants',
810 array(),
811 array(
812 'type' => 'new',
813 'sig' => $this->createMailSignature()
814 ),
815 $context_options
816 )
817 );
818 }
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static setRecipients(array $recipients, string $type='to')
createMailSignature()
Create Mail signature.
static _lookupLogin(int $a_user_id)
static redirect(string $a_script)

References ilObjUser\_lookupLogin(), ILIAS\Repository\ctrl(), ilMailFormCall\getRedirectTarget(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilUtil\redirect(), and ilMailFormCall\setRecipients().

+ Here is the call graph for this function:

◆ setSubTabs()

ilMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

Reimplemented in ilLearningSequenceMembershipGUI.

Definition at line 1034 of file class.ilMembershipGUI.php.

1034 : void
1035 {
1037 'manage_members',
1038 'manage_members',
1039 $this->getParentObject()->getRefId()
1040 )) {
1042 $this->getParentObject()->getType() . "_member_administration",
1043 $this->ctrl->getLinkTarget($this, 'participants'),
1044 "members",
1045 get_class($this)
1046 );
1047
1048 // show group overview
1049 if ($this instanceof ilCourseMembershipGUI) {
1051 "crs_members_groups",
1052 $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1053 "",
1054 "ilCourseParticipantsGroupsGUI"
1055 );
1056 }
1057
1058 $children = $this->tree->getSubTree(
1059 $this->tree->getNodeData($this->getParentObject()->getRefId()),
1060 false,
1061 ['sess']
1062 );
1063 if (count($children)) {
1065 'events',
1066 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilsessionoverviewgui'), 'listSessions'),
1067 '',
1068 'ilsessionoverviewgui'
1069 );
1070 }
1072 $this->getParentObject()->getType() . '_members_gallery',
1073 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1074 'view',
1075 'ilUsersGalleryGUI'
1076 );
1077 } elseif ($this->getParentObject()->getShowMembers()) {
1078 // gallery
1080 $this->getParentObject()->getType() . '_members_gallery',
1081 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1082 'view',
1083 'ilUsersGalleryGUI'
1084 );
1085 }
1086
1087 if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1089 $this->getParentObject()->getType() . '_members_map',
1090 $this->ctrl->getLinkTarget($this, 'membersMap'),
1091 "membersMap",
1092 get_class($this)
1093 );
1094 }
1095
1096 if (ilPrivacySettings::getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1098 'export_members',
1099 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilmemberexportgui'), 'show'),
1100 '',
1101 'ilmemberexportgui'
1102 );
1103 }
1104 }
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)

References ilTabsGUI\addSubTabTarget(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), and ilMapUtil\isActivated().

+ Here is the call graph for this function:

◆ showMailToMemberToolbarButton()

ilMembershipGUI::showMailToMemberToolbarButton ( ilToolbarGUI  $toolbar,
?string  $a_back_cmd = null,
bool  $a_separator = false 
)
protected

Show mail to member toolbar button.

Definition at line 926 of file class.ilMembershipGUI.php.

930 : void {
931 $mail = new ilMail($this->user->getId());
932
933 if (
934 ($this->getParentObject()->getMailToMembersType() === 1) ||
935 (
936 $this->access->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
937 $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
938 )
939 ) {
940 if ($a_separator) {
942 }
943
944 if ($a_back_cmd !== null) {
945 $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
946 }
947
949 $this->getMailButtonLabel(),
950 $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
951 );
952 }
953 }
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')

References ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), and ILIAS\Repository\ctrl().

Referenced by ilLearningSequenceMembershipGUI\showParticipantsToolbar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMemberExportToolbarButton()

ilMembershipGUI::showMemberExportToolbarButton ( ilToolbarGUI  $toolbar,
?string  $a_back_cmd = null,
bool  $a_separator = false 
)
protected

Definition at line 901 of file class.ilMembershipGUI.php.

905 : void {
906 if (
907 $this->getParentObject()->getType() === 'crs' &&
908 $this->getParentObject()->getShowMembersExport()) {
909 if ($a_separator) {
911 }
912
913 if ($a_back_cmd) {
914 $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
915 }
917 $this->lng->txt($this->getParentObject()->getType() . '_print_list'),
918 $this->ctrl->getLinkTarget($this, 'printForMembersOutput')
919 );
920 }
921 }

References ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ showParticipantsToolbar()

ilMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

Reimplemented in ilLearningSequenceMembershipGUI.

Definition at line 863 of file class.ilMembershipGUI.php.

863 : void
864 {
865 if ($this->canAddOrSearchUsers()) {
867 $this,
868 $this->toolbar,
869 array(
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')
874 )
875 );
876
877 // spacer
878 $this->toolbar->addSeparator();
879
880 // search button
881 $this->toolbar->addButton(
882 $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
883 $this->ctrl->getLinkTargetByClass(
884 'ilRepositorySearchGUI',
885 'start'
886 )
887 );
888
889 // separator
890 $this->toolbar->addSeparator();
891 }
892
893 // print button
894 $this->toolbar->addButton(
895 $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
896 $this->ctrl->getLinkTarget($this, 'printMembers')
897 );
898 $this->showMailToMemberToolbarButton($this->toolbar, 'participants', false);
899 }
canAddOrSearchUsers()
Check if current user is allowed to add / search users.
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...

References ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ updateLPFromStatus()

ilMembershipGUI::updateLPFromStatus ( int  $usr_id,
bool  $has_passed 
)
protected

Reimplemented in ilCourseMembershipGUI.

Definition at line 663 of file class.ilMembershipGUI.php.

663 : void
664 {
665 }

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

Definition at line 492 of file class.ilMembershipGUI.php.

492 : void
493 {
495 if (!count($participants)) {
496 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
497 $this->ctrl->redirect($this, 'participants');
498 }
499 $notifications = $passed = $blocked = $contact = [];
500 if ($this->http->wrapper()->post()->has('notification')) {
501 $notifications = $this->http->wrapper()->post()->retrieve(
502 'notification',
503 $this->refinery->kindlyTo()->listOf(
504 $this->refinery->kindlyTo()->int()
505 )
506 );
507 }
508 if ($this->http->wrapper()->post()->has('passed')) {
509 $passed = $this->http->wrapper()->post()->retrieve(
510 'passed',
511 $this->refinery->kindlyTo()->listOf(
512 $this->refinery->kindlyTo()->int()
513 )
514 );
515 }
516 if ($this->http->wrapper()->post()->has('blocked')) {
517 $blocked = $this->http->wrapper()->post()->retrieve(
518 'blocked',
519 $this->refinery->kindlyTo()->listOf(
520 $this->refinery->kindlyTo()->int()
521 )
522 );
523 }
524 if ($this->http->wrapper()->post()->has('contact')) {
525 $contact = $this->http->wrapper()->post()->retrieve(
526 'contact',
527 $this->refinery->kindlyTo()->listOf(
528 $this->refinery->kindlyTo()->int()
529 )
530 );
531 }
532
533 // Determine whether the user has the 'edit_permission' permission
534 $hasEditPermissionAccess =
535 (
536 $this->access->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) or
537 $this->getMembersObject()->isAdmin($this->user->getId())
538 );
539
540 // Get all assignable local roles of the object, and
541 // determine the role id of the course administrator role.
542 $assignableLocalRoles = array();
543 $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
544 foreach ($this->getLocalTypeRole(false) as $title => $role_id) {
545 $assignableLocalRoles[$role_id] = $title;
546 }
547
548 $post_roles = [];
549 if ($this->http->wrapper()->post()->has('roles')) {
550 $post_roles = $this->http->wrapper()->post()->retrieve(
551 'roles',
552 $this->refinery->kindlyTo()->dictOf(
553 $this->refinery->kindlyTo()->dictOf(
554 $this->refinery->kindlyTo()->int()
555 )
556 )
557 );
558 }
559
560 // Validate the user ids and role ids in the post data
561 foreach ($participants as $usr_id) {
562 $memberIsAdmin = $this->rbacreview->isAssigned($usr_id, (int) $adminRoleId);
563
564 // If the current user doesn't have the 'edit_permission'
565 // permission, make sure he doesn't remove the course
566 // administrator role of members who are course administrator.
567 if (
568 !$hasEditPermissionAccess &&
569 $memberIsAdmin &&
570 (
571 !is_array($post_roles[$usr_id]) ||
572 !in_array($adminRoleId, $post_roles[$usr_id])
573 )
574 ) {
575 $post_roles[$usr_id][] = $adminRoleId;
576 }
577
578 // Validate the role ids in the post data
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');
583 }
584 if (!$hasEditPermissionAccess &&
585 $role_id == $adminRoleId &&
586 !$memberIsAdmin) {
587 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_perm'));
588 $this->ctrl->redirect($this, 'participants');
589 }
590 }
591 }
592
593 $has_admin = false;
594 foreach ($this->getMembersObject()->getAdmins() as $admin_id) {
595 if (!isset($post_roles[$admin_id])) {
596 $has_admin = true;
597 break;
598 }
599 if (in_array($adminRoleId, (array) $post_roles[$admin_id])) {
600 $has_admin = true;
601 break;
602 }
603 }
604
605 if (!$has_admin && is_array($post_roles)) {
606 // TODO PHP8 Review: Check change of SuperGlobals
607 foreach ($post_roles as $roleIdsToBeAssigned) {
608 if (in_array($adminRoleId, $roleIdsToBeAssigned)) {
609 $has_admin = true;
610 break;
611 }
612 }
613 }
614
615 if (!$has_admin) {
616 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($this->getParentObject()->getType() . '_min_one_admin'), true);
617 $this->ctrl->redirect($this, 'participants');
618 }
619
620 foreach ($participants as $usr_id) {
621 $this->getMembersObject()->updateRoleAssignments($usr_id, (array) $post_roles[$usr_id]);
622
623 // Disable notification for all of them
624 $this->getMembersObject()->updateNotification($usr_id, false);
625 if (($this->getMembersObject()->isTutor($usr_id) || $this->getMembersObject()->isAdmin($usr_id)) && in_array(
626 $usr_id,
627 $notifications
628 )) {
629 $this->getMembersObject()->updateNotification($usr_id, true);
630 }
631
632 $this->getMembersObject()->updateBlocked($usr_id, false);
633 if ((!$this->getMembersObject()->isAdmin($usr_id) && !$this->getMembersObject()->isTutor($usr_id)) && in_array(
634 $usr_id,
635 $blocked
636 )) {
637 $this->getMembersObject()->updateBlocked($usr_id, true);
638 }
639
640 if ($this instanceof ilCourseMembershipGUI) {
641 $this->getMembersObject()->updatePassed($usr_id, in_array($usr_id, $passed), true);
642 $this->getMembersObject()->sendNotification(
644 $usr_id
645 );
646 }
647
648 if (
649 ($this->getMembersObject()->isAdmin($usr_id) || $this->getMembersObject()->isTutor($usr_id)) &&
650 in_array($usr_id, $contact)
651 ) {
652 $this->getMembersObject()->updateContact($usr_id, true);
653 } else {
654 $this->getMembersObject()->updateContact($usr_id, false);
655 }
656
657 $this->updateLPFromStatus($usr_id, in_array($usr_id, $passed));
658 }
659 $this->tpl->setOnScreenMessage('success', $this->lng->txt("msg_obj_modified"), true);
660 $this->ctrl->redirect($this, "participants");
661 }
updateLPFromStatus(int $usr_id, bool $has_passed)

References ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilCourseMembershipMailNotification\TYPE_STATUS_CHANGED, and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilMembershipGUI::$access
protected

◆ $ctrl

ilCtrlInterface ilMembershipGUI::$ctrl
protected

Definition at line 36 of file class.ilMembershipGUI.php.

Referenced by getCtrl().

◆ $error

ilErrorHandling ilMembershipGUI::$error
protected

Definition at line 42 of file class.ilMembershipGUI.php.

◆ $http

GlobalHttpState ilMembershipGUI::$http
protected

Definition at line 33 of file class.ilMembershipGUI.php.

◆ $lng

ilLanguage ilMembershipGUI::$lng
protected

Definition at line 35 of file class.ilMembershipGUI.php.

Referenced by getLanguage().

◆ $logger

ilLogger ilMembershipGUI::$logger
protected

Definition at line 37 of file class.ilMembershipGUI.php.

Referenced by getLogger().

◆ $member_data

array ilMembershipGUI::$member_data = []
protected

◆ $participants

◆ $profile

Profile ilMembershipGUI::$profile
protected

Definition at line 48 of file class.ilMembershipGUI.php.

◆ $rbacreview

ilRbacReview ilMembershipGUI::$rbacreview
protected

Definition at line 46 of file class.ilMembershipGUI.php.

◆ $rbacsystem

ilRbacSystem ilMembershipGUI::$rbacsystem
protected

Definition at line 45 of file class.ilMembershipGUI.php.

◆ $refinery

Factory ilMembershipGUI::$refinery
protected

◆ $repository_gui

◆ $repository_object

ilObject ilMembershipGUI::$repository_object
private

Definition at line 31 of file class.ilMembershipGUI.php.

Referenced by getParentObject().

◆ $tabs

ilTabsGUI ilMembershipGUI::$tabs
protected

◆ $toolbar

ilToolbarGUI ilMembershipGUI::$toolbar
protected

Definition at line 44 of file class.ilMembershipGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilMembershipGUI::$tpl
protected

Definition at line 38 of file class.ilMembershipGUI.php.

◆ $tree

ilTree ilMembershipGUI::$tree
protected

Definition at line 47 of file class.ilMembershipGUI.php.

◆ $user

ilObjUser ilMembershipGUI::$user
protected

Definition at line 41 of file class.ilMembershipGUI.php.


The documentation for this class was generated from the following file: