ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
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->lng->loadLanguageModule('mmbr');
65 $this->logger = $DIC->logger()->mmbr();
66 $this->access = $DIC->access();
67 $this->user = $DIC->user();
68 $this->error = $DIC['ilErr'];
69 $this->tabs = $DIC->tabs();
70 $this->toolbar = $DIC->toolbar();
71 $this->rbacsystem = $DIC->rbac()->system();
72 $this->rbacreview = $DIC->rbac()->review();
73 $this->tree = $DIC->repositoryTree();
74 $this->http = $DIC->http();
75 $this->refinery = $DIC->refinery();
76 $this->profile = $DIC['user']->getProfile();
77 }
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 1523 of file class.ilMembershipGUI.php.

1523 : void
1524 {
1525 $this->tabs->activateSubTab($a_sub_tab);
1526 }

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 992 of file class.ilMembershipGUI.php.

992 : void
993 {
994 $mail = new ilMail($this->user->getId());
995
996 $member_tab_name = $this->getMemberTabName();
997
998 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
999 'manage_members',
1000 'manage_members',
1001 $this->getParentObject()->getRefId()
1002 );
1003
1004 if ($has_manage_members_permission) {
1005 $tabs->addTab(
1006 'members',
1007 $member_tab_name,
1008 $this->ctrl->getLinkTarget($this, '')
1009 );
1010 } elseif (
1011 $this->getParentObject()->getShowMembers() &&
1012 $a_is_participant
1013 ) {
1014 $tabs->addTab(
1015 'members',
1016 $member_tab_name,
1017 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilusersgallerygui'), 'view')
1018 );
1019 } elseif (
1020 $this->getParentObject()->getMailToMembersType() === 1 &&
1021 $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1022 $a_is_participant
1023 ) {
1024 $tabs->addTab(
1025 'members',
1026 $member_tab_name,
1027 $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1028 );
1029 }
1030 }
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 1493 of file class.ilMembershipGUI.php.

1493 : void
1494 {
1495 // begin-patch clipboard
1496 $users = [];
1497 if ($this->http->wrapper()->post()->has('participants')) {
1498 $users = $this->initParticipantsFromPost();
1499 } elseif ($this->http->wrapper()->post()->has('subscribers')) {
1500 $users = $this->initSubscribersFromPost();
1501 } elseif ($this->http->wrapper()->post()->has('waiting')) {
1502 $users = $this->initWaitingListIdsFromPost();
1503 }
1504 // end-patch clipboard
1505 if (!count($users)) {
1506 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1507 $this->ctrl->redirect($this, 'participants');
1508 }
1509 $clip = ilUserClipboard::getInstance($this->user->getId());
1510 $clip->add($users);
1511 $clip->save();
1512
1513 $this->lng->loadLanguageModule('user');
1514 $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
1515 $this->ctrl->redirect($this, 'participants');
1516 }
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 1360 of file class.ilMembershipGUI.php.

1360 : void
1361 {
1362 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1363 if (!count($waiting_list_ids)) {
1364 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1365 $this->ctrl->redirect($this, 'participants');
1366 }
1367
1368 $waiting_list = $this->initWaitingList();
1369
1370 $added_users = 0;
1371 foreach ($waiting_list_ids as $user_id) {
1372 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId((int) $user_id, false)) {
1373 continue;
1374 }
1375 if ($this->getMembersObject()->isAssigned((int) $user_id)) {
1376 continue;
1377 }
1378
1379 if ($this instanceof ilCourseMembershipGUI) {
1380 $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1381 $this->getMembersObject()->sendNotification(
1383 (int) $user_id,
1384 true
1385 );
1386 $this->getParentObject()->checkLPStatusSync((int) $user_id);
1387 }
1388 if ($this instanceof ilGroupMembershipGUI) {
1389 $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER);
1390 $this->getMembersObject()->sendNotification(
1392 (int) $user_id,
1393 true
1394 );
1395 }
1396 if ($this instanceof ilSessionMembershipGUI) {
1397 $this->getMembersObject()->register((int) $user_id);
1399 $noti->setRefId($this->getParentObject()->getRefId());
1400 $noti->setRecipients(array($user_id));
1402 $noti->send();
1403 }
1404
1405 $waiting_list->removeFromList((int) $user_id);
1406 ++$added_users;
1407 }
1408
1409 if ($added_users) {
1410 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_users_added"), true);
1411 } else {
1412 $this->tpl->setOnScreenMessage('info', $this->lng->txt("crs_users_already_assigned"), true);
1413 }
1414 $this->ctrl->redirect($this, 'participants');
1415 }
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 1264 of file class.ilMembershipGUI.php.

1264 : void
1265 {
1266 $subscribers = $this->initSubscribersFromPost();
1267 if (!count($subscribers)) {
1268 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1269 $this->ctrl->redirect($this, 'participants');
1270 }
1271
1272 if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1273 $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1274 $this->ctrl->redirect($this, 'participants');
1275 } else {
1276 foreach ($subscribers as $usr_id) {
1277 if ($this instanceof ilCourseMembershipGUI) {
1278 $this->getMembersObject()->sendNotification(
1280 $usr_id
1281 );
1282 $this->getParentObject()->checkLPStatusSync($usr_id);
1283 }
1284 if ($this instanceof ilGroupMembershipGUI) {
1285 $this->getMembersObject()->sendNotification(
1287 $usr_id
1288 );
1289 }
1290 if ($this instanceof ilSessionMembershipGUI) {
1291 // todo refactor to participants
1293 $noti->setRefId($this->getParentObject()->getRefId());
1294 $noti->setRecipients(array($usr_id));
1296 $noti->send();
1297 }
1298 }
1299 }
1300 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_assigned"), true);
1301 $this->ctrl->redirect($this, 'participants');
1302 }
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 219 of file class.ilMembershipGUI.php.

219 : bool
220 {
221 return $this->checkPermissionBool('manage_members');
222 }
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 197 of file class.ilMembershipGUI.php.

197 : void
198 {
199 if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
200 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
201 $this->ctrl->redirect($this->getParentGUI());
202 }
203 }

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 170 of file class.ilMembershipGUI.php.

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

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 208 of file class.ilMembershipGUI.php.

208 : void
209 {
210 if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
211 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
212 $this->ctrl->redirect($this->getParentGUI());
213 }
214 }

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 182 of file class.ilMembershipGUI.php.

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

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 1329 of file class.ilMembershipGUI.php.

1329 : void
1330 {
1331 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1332 if (!count($waiting_list_ids)) {
1333 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1334 $this->ctrl->redirect($this, 'participants');
1335 }
1336 $c_gui = new ilConfirmationGUI();
1337 // set confirm/cancel commands
1338 $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1339 $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1340 $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1341 $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1342
1343 foreach ($waiting_list_ids as $waiting) {
1344 $name = ilObjUser::_lookupName($waiting);
1345
1346 $c_gui->addItem(
1347 'waiting[]',
1348 (string) $name['user_id'],
1349 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1350 ilUtil::getImagePath('standard/icon_usr.svg')
1351 );
1352 }
1353
1354 $this->tpl->setContent($c_gui->getHTML());
1355 }
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 1156 of file class.ilMembershipGUI.php.

1156 : void
1157 {
1158 $subscribers = $this->initSubscribersFromPost();
1159 if (!count($subscribers)) {
1160 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1161 $this->ctrl->redirect($this, 'participants');
1162 }
1163
1164 $c_gui = new ilConfirmationGUI();
1165
1166 // set confirm/cancel commands
1167 $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1168 $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1169 $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1170 $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1171
1172 foreach ($subscribers as $subscriber) {
1173 $name = ilObjUser::_lookupName($subscriber);
1174
1175 $c_gui->addItem(
1176 'subscribers[]',
1177 (string) $name['user_id'],
1178 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1179 ilUtil::getImagePath('standard/icon_usr.svg')
1180 );
1181 }
1182 $this->tpl->setContent($c_gui->getHTML());
1183 }

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 676 of file class.ilMembershipGUI.php.

676 : void
677 {
679
680 if (!count($participants)) {
681 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
682 $this->ctrl->redirect($this, 'participants');
683 }
684
685 // Check last admin
686 if (!$this->getMembersObject()->checkLastAdmin($participants)) {
687 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
688 $this->ctrl->redirect($this, 'participants');
689 }
690
691 // if only position access is granted, show additional info
692 if (!$this->checkPermissionBool('manage_members')) {
693 $this->lng->loadLanguageModule('rbac');
694 $this->tpl->setOnScreenMessage('info', $this->lng->txt('rbac_info_only_position_access'));
695 }
696
697 // Access check for admin deletion
698 if (
699 !$this->access->checkAccess(
700 'edit_permission',
701 '',
702 $this->getParentObject()->getRefId()
703 ) &&
704 !$this->getMembersObject()->isAdmin($this->user->getId())
705 ) {
706 foreach ($participants as $usr_id) {
707 if ($this->getMembersObject()->isAdmin($usr_id)) {
708 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_perm_perm"), true);
709 $this->ctrl->redirect($this, 'participants');
710 }
711 }
712 }
713
715 $this->repository_object->getRefId(),
717 )) {
718 $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
719 return;
720 }
721
722 $confirm = new ilConfirmationGUI();
723 $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
724 $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
725 $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
726 $confirm->setCancel($this->lng->txt('cancel'), 'participants');
727
728 foreach ($participants as $usr_id) {
729 $name = ilObjUser::_lookupName($usr_id);
730
731 $confirm->addItem(
732 'participants[]',
733 (string) $name['user_id'],
734 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
735 ilUtil::getImagePath('standard/icon_usr.svg')
736 );
737 }
738 $this->tpl->setContent($confirm->getHTML());
739 }
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 1420 of file class.ilMembershipGUI.php.

1420 : void
1421 {
1422 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1423 if (!count($waiting_list_ids)) {
1424 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1425 $this->ctrl->redirect($this, 'participants');
1426 }
1427 $c_gui = new ilConfirmationGUI();
1428
1429 // set confirm/cancel commands
1430 $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1431 $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1432 $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1433 $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1434
1435 foreach ($waiting_list_ids as $waiting) {
1436 $name = ilObjUser::_lookupName($waiting);
1437
1438 $c_gui->addItem(
1439 'waiting[]',
1440 (string) $name['user_id'],
1441 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1442 ilUtil::getImagePath('standard/icon_usr.svg')
1443 );
1444 }
1445 $this->tpl->setContent($c_gui->getHTML());
1446 }

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 1188 of file class.ilMembershipGUI.php.

1188 : void
1189 {
1190 $subscribers = $this->initSubscribersFromPost();
1191 if (!count($subscribers)) {
1192 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1193 $this->ctrl->redirect($this, 'participants');
1194 }
1195 $c_gui = new ilConfirmationGUI();
1196 // set confirm/cancel commands
1197 $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1198 $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1199 $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1200 $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1201
1202 foreach ($subscribers as $subscriber_id) {
1203 $name = ilObjUser::_lookupName($subscriber_id);
1204
1205 $c_gui->addItem(
1206 'subscribers[]',
1207 (string) $name['user_id'],
1208 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1209 ilUtil::getImagePath('standard/icon_usr.svg')
1210 );
1211 }
1212
1213 $this->tpl->setContent($c_gui->getHTML());
1214 }

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 970 of file class.ilMembershipGUI.php.

970 : string
971 {
972 return $this->getParentGUI()->createMailSignature();
973 }

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

Reimplemented in ilSessionMembershipGUI.

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

741 : void
742 {
744 if (!count($participants)) {
745 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
746 $this->ctrl->redirect($this, 'participants');
747 }
748
749 // If the user doesn't have the edit_permission and is not administrator, he may not remove
750 // members who have the course administrator role
751 if (
752 !$this->access->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
753 !$this->getMembersObject()->isAdmin($this->user->getId())
754 ) {
755 foreach ($participants as $part) {
756 if ($this->getMembersObject()->isAdmin($part)) {
757 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_no_perm_perm'), true);
758 $this->ctrl->redirect($this, 'participants');
759 }
760 }
761 }
762
764 $this->tpl->setOnScreenMessage('failure', 'Error deleting participants.', true);
765 $this->ctrl->redirect($this, 'participants');
766 } else {
767 foreach ($participants as $usr_id) {
768 $mail_type = 0;
769 // @todo more generic
770 switch ($this->getParentObject()->getType()) {
771 case 'crs':
773 break;
774 case 'grp':
776 break;
777 case 'lso':
779 break;
780 }
781 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
782 }
783 }
784 $this->tpl->setOnScreenMessage('success', $this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
785 $this->ctrl->redirect($this, "participants");
786 }

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 463 of file class.ilMembershipGUI.php.

463 : void
464 {
465 $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
466 $this->editParticipants(array($this->initMemberIdFromGet()));
467 }
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 473 of file class.ilMembershipGUI.php.

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

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

+ Here is the call graph for this function:

◆ executeCommand()

ilMembershipGUI::executeCommand ( )

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

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

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

◆ getAttendanceListUserData()

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

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, ilLearningSequenceMembershipGUI, and ilSessionMembershipGUI.

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

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

◆ getCtrl()

ilMembershipGUI::getCtrl ( )
protected

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

138 {
139 return $this->ctrl;
140 }
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 975 of file class.ilMembershipGUI.php.

975 : string
976 {
977 $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
978 'manage_members',
979 'manage_members',
980 $this->getParentObject()->getRefId()
981 );
982 if ($has_manage_members_permission) {
983 return 'participants';
984 }
985
986 if ($this->getParentObject()->getShowMembers()) {
987 return 'jump2UsersGallery';
988 }
989 return 'mailMembersBtn';
990 }

◆ getDefaultRole()

ilMembershipGUI::getDefaultRole ( )
protected

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, and ilLearningSequenceMembershipGUI.

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

1518 : ?int
1519 {
1520 return null;
1521 }

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected

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

132 : ilLanguage
133 {
134 return $this->lng;
135 }
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 1124 of file class.ilMembershipGUI.php.

1124 : array
1125 {
1126 return $this->getParentGUI()->getLocalRoles();
1127 }

◆ getLogger()

ilMembershipGUI::getLogger ( )
protected

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

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

References $logger.

◆ getMailButtonLabel()

ilMembershipGUI::getMailButtonLabel ( )
protected

Reimplemented in ilSessionMembershipGUI.

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

961 : string
962 {
963 return $this->lng->txt("mail_members");
964 }

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 826 of file class.ilMembershipGUI.php.

826 : array
827 {
828 return [];
829 }

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected

Reimplemented in ilCourseMembershipGUI, ilGroupMembershipGUI, ilLearningSequenceMembershipGUI, and ilSessionMembershipGUI.

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

166 {
167 return null;
168 }
Class ilAbstractMailMemberRoles.

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

◆ getMemberTabName()

ilMembershipGUI::getMemberTabName ( )
protected

Reimplemented in ilSessionMembershipGUI.

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

1032 : string
1033 {
1034 return $this->lng->txt('members');
1035 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Reimplemented in ilLearningSequenceMembershipGUI.

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

152 : ilObject
153 {
155 }
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 426 of file class.ilMembershipGUI.php.

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

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initAttendanceList()

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

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

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

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

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 82 of file class.ilMembershipGUI.php.

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

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 106 of file class.ilMembershipGUI.php.

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

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 1146 of file class.ilMembershipGUI.php.

1147 {
1148 $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1149 $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1150 return $subscriber;
1151 }
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 119 of file class.ilMembershipGUI.php.

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

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

+ Here is the call graph for this function:

◆ jump2UsersGallery()

ilMembershipGUI::jump2UsersGallery ( )
protected

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

1591 : void
1592 {
1593 $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1594 }

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 861 of file class.ilMembershipGUI.php.

861 : void
862 {
863 $this->showMailToMemberToolbarButton($this->toolbar, 'mailMembersBtn');
864 }

References ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

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

834 : void
835 {
836 $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
837 if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
838 return;
839 }
840
841 $map = ilMapUtil::getMapGUI();
842 $map->setMapId("course_map")
843 ->setWidth("700px")
844 ->setHeight("500px")
845 ->setLatitude($this->getParentObject()->getLatitude())
846 ->setLongitude($this->getParentObject()->getLongitude())
847 ->setZoom($this->getParentObject()->getLocationZoom())
848 ->setEnableTypeControl(true)
849 ->setEnableNavigationControl(true)
850 ->setEnableCentralMarker(true);
851
852 $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
853 foreach ($members as $user_id) {
854 $map->addUserMarker($user_id);
855 }
856
857 $this->tpl->setContent($map->getHtml());
858 $this->tpl->setLeftContent($map->getUserListHtml());
859 }
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 1132 of file class.ilMembershipGUI.php.

1133 {
1134 $subscribers = $this->getMembersObject()->getSubscribers();
1135 $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1136 if (!count($filtered_subscribers)) {
1137 return null;
1138 }
1139 $subscriber = $this->initSubscriberTable();
1140 $subscriber->readSubscriberData(
1141 $filtered_subscribers
1142 );
1143 return $subscriber;
1144 }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.

◆ parseWaitingListTable()

ilMembershipGUI::parseWaitingListTable ( )
protected

Parse table of subscription request.

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

1308 {
1309 $wait = $this->initWaitingList();
1310
1311 $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1312 if (!count($wait_users)) {
1313 return null;
1314 }
1315
1316 $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1317 $waiting_table->setUserIds(
1318 $wait_users
1319 );
1320 $waiting_table->readUserData();
1321 $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1322
1323 return $waiting_table;
1324 }
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 395 of file class.ilMembershipGUI.php.

395 : void
396 {
397 $this->initParticipantTemplate();
399 $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
400
401 // show waiting list table
402 $waiting = $this->parseWaitingListTable();
403 if ($waiting instanceof ilWaitingListTableGUI) {
404 $this->tpl->setVariable('TABLE_WAIT', $waiting->getHTML());
405 }
406
407 // show subscriber table
408 $subscriber = $this->parseSubscriberTable();
409 if ($subscriber instanceof ilSubscriberTableGUI) {
410 $this->tpl->setVariable('TABLE_SUB', $subscriber->getHTML());
411 }
412
413 // show member table
414 $table = $this->initParticipantTableGUI();
415 $table->setTitle($this->getParticipantTableTitle());
416 $table->setFormAction($this->ctrl->getFormAction($this));
417 $table->parse();
418
419 // filter commands
420 $table->setFilterCommand('participantsApplyFilter');
421 $table->setResetCommand('participantsResetFilter');
422
423 $this->tpl->setVariable('MEMBERS', $table->getHTML());
424 }
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 439 of file class.ilMembershipGUI.php.

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

◆ participantsResetFilter()

ilMembershipGUI::participantsResetFilter ( )
protected

reset participants filter

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

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

◆ printForMembersOutput()

ilMembershipGUI::printForMembersOutput ( )
protected

print members output

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

1574 : void
1575 {
1576 $this->tabs->clearTargets();
1577 $this->tabs->setBackTarget(
1578 $this->lng->txt('back'),
1579 $this->ctrl->getLinkTarget($this, 'jump2UsersGallery')
1580 );
1581
1582 $list = $this->initAttendanceList();
1583 $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1584 $list->initFromSettings();
1585 $list->setCallback([$this, 'getAttendanceListUserData']);
1586 $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1587 $list->getNonMemberUserData($this->member_data);
1588 $list->getFullscreenHTML();
1589 }
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 1531 of file class.ilMembershipGUI.php.

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

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 1550 of file class.ilMembershipGUI.php.

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

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 1116 of file class.ilMembershipGUI.php.

1116 : array
1117 {
1118 return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1119 }

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 1451 of file class.ilMembershipGUI.php.

1451 : void
1452 {
1453 $waiting_list_ids = $this->initWaitingListIdsFromPost();
1454 if (!count($waiting_list_ids)) {
1455 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
1456 $this->ctrl->redirect($this, 'participants');
1457 }
1458
1459 $waiting_list = $this->initWaitingList();
1460
1461 foreach ($waiting_list_ids as $user_id) {
1462 $waiting_list->removeFromList((int) $user_id);
1463
1464 if ($this instanceof ilCourseMembershipGUI) {
1465 $this->getMembersObject()->sendNotification(
1467 (int) $user_id,
1468 true
1469 );
1470 }
1471 if ($this instanceof ilGroupMembershipGUI) {
1472 $this->getMembersObject()->sendNotification(
1474 (int) $user_id,
1475 true
1476 );
1477 }
1478 if ($this instanceof ilSessionMembershipGUI) {
1480 $noti->setRefId($this->getParentObject()->getRefId());
1481 $noti->setRecipients(array($user_id));
1483 $noti->send();
1484 }
1485 }
1486 $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_users_removed_from_list'), true);
1487 $this->ctrl->redirect($this, 'participants');
1488 }

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 1216 of file class.ilMembershipGUI.php.

1216 : void
1217 {
1218 $subscribers = $this->initSubscribersFromPost();
1219 if (!count($subscribers)) {
1220 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1221 $this->ctrl->redirect($this, 'participants');
1222 }
1223
1224 if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1225 $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1226 $this->ctrl->redirect($this, 'participants');
1227 } else {
1228 foreach ($subscribers as $usr_id) {
1229 if ($this instanceof ilCourseMembershipGUI) {
1230 $this->getMembersObject()->sendNotification(
1232 $usr_id
1233 );
1234 }
1235 if ($this instanceof ilGroupMembershipGUI) {
1236 $this->getMembersObject()->sendNotification(
1238 $usr_id
1239 );
1240 }
1241 if ($this instanceof ilSessionMembershipGUI) {
1243 $noti->setRefId($this->getParentObject()->getRefId());
1244 $noti->setRecipients(array($usr_id));
1246 $noti->send();
1247 }
1248 if ($this instanceof ilLearningSequenceMembershipGUI) {
1249 $this->getMembersObject()->sendNotification(
1251 $usr_id
1252 );
1253 }
1254 }
1255 }
1256
1257 $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_deleted"), true);
1258 $this->ctrl->redirect($this, 'participants');
1259 }
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 788 of file class.ilMembershipGUI.php.

788 : void
789 {
790 $participants = [];
791 if ($this->http->wrapper()->post()->has('participants')) {
793 } elseif ($this->http->wrapper()->post()->has('subscribers')) {
795 } elseif ($this->http->wrapper()->post()->has('waiting')) {
797 } elseif ($this->http->wrapper()->query()->has('member_id')) {
799 }
800 if (!count($participants)) {
801 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
802 $this->ctrl->redirect($this, 'participants');
803 }
804
805 $rcps = [];
806 foreach ($participants as $usr_id) {
807 $rcps[] = ilObjUser::_lookupLogin($usr_id);
808 }
809 $context_options = $this->getMailContextOptions();
810
814 $this,
815 'participants',
816 array(),
817 array(
818 'type' => 'new',
819 'sig' => $this->createMailSignature()
820 ),
821 $context_options
822 )
823 );
824 }
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 1040 of file class.ilMembershipGUI.php.

1040 : void
1041 {
1043 'manage_members',
1044 'manage_members',
1045 $this->getParentObject()->getRefId()
1046 )) {
1048 $this->getParentObject()->getType() . "_member_administration",
1049 $this->ctrl->getLinkTarget($this, 'participants'),
1050 "members",
1051 get_class($this)
1052 );
1053
1054 // show group overview
1055 if ($this instanceof ilCourseMembershipGUI) {
1057 "crs_members_groups",
1058 $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1059 "",
1060 "ilCourseParticipantsGroupsGUI"
1061 );
1062 }
1063
1064 $children = $this->tree->getSubTree(
1065 $this->tree->getNodeData($this->getParentObject()->getRefId()),
1066 false,
1067 ['sess']
1068 );
1069 if (count($children)) {
1071 'events',
1072 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilsessionoverviewgui'), 'listSessions'),
1073 '',
1074 'ilsessionoverviewgui'
1075 );
1076 }
1078 $this->getParentObject()->getType() . '_members_gallery',
1079 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1080 'view',
1081 'ilUsersGalleryGUI'
1082 );
1083 } elseif ($this->getParentObject()->getShowMembers()) {
1084 // gallery
1086 $this->getParentObject()->getType() . '_members_gallery',
1087 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1088 'view',
1089 'ilUsersGalleryGUI'
1090 );
1091 }
1092
1093 if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1095 $this->getParentObject()->getType() . '_members_map',
1096 $this->ctrl->getLinkTarget($this, 'membersMap'),
1097 "membersMap",
1098 get_class($this)
1099 );
1100 }
1101
1102 if (ilPrivacySettings::getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1104 'export_members',
1105 $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilmemberexportgui'), 'show'),
1106 '',
1107 'ilmemberexportgui'
1108 );
1109 }
1110 }
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 932 of file class.ilMembershipGUI.php.

936 : void {
937 $mail = new ilMail($this->user->getId());
938
939 if (
940 ($this->getParentObject()->getMailToMembersType() === 1) ||
941 (
942 $this->access->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
943 $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
944 )
945 ) {
946 if ($a_separator) {
948 }
949
950 if ($a_back_cmd !== null) {
951 $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
952 }
953
955 $this->getMailButtonLabel(),
956 $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
957 );
958 }
959 }
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 907 of file class.ilMembershipGUI.php.

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

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 869 of file class.ilMembershipGUI.php.

869 : void
870 {
871 if ($this->canAddOrSearchUsers()) {
873 $this,
874 $this->toolbar,
875 array(
876 'auto_complete_name' => $this->lng->txt('user'),
877 'user_type' => $this->getParentGUI()->getLocalRoles(),
878 'user_type_default' => $this->getDefaultRole(),
879 'submit_name' => $this->lng->txt('add')
880 )
881 );
882
883 // spacer
884 $this->toolbar->addSeparator();
885
886 // search button
887 $this->toolbar->addButton(
888 $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
889 $this->ctrl->getLinkTargetByClass(
890 'ilRepositorySearchGUI',
891 'start'
892 )
893 );
894
895 // separator
896 $this->toolbar->addSeparator();
897 }
898
899 // print button
900 $this->toolbar->addButton(
901 $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
902 $this->ctrl->getLinkTarget($this, 'printMembers')
903 );
904 $this->showMailToMemberToolbarButton($this->toolbar, 'participants', false);
905 }
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 669 of file class.ilMembershipGUI.php.

669 : void
670 {
671 }

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

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

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