ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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
 
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 28 of file class.ilMembershipGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

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

50  {
51  global $DIC;
52 
53  $this->repository_gui = $repository_gui;
54  $this->repository_object = $repository_obj;
55 
56  $this->lng = $DIC->language();
57  $this->lng->loadLanguageModule('crs');
58  $this->lng->loadLanguageModule($this->getParentObject()->getType());
59  $this->tpl = $DIC->ui()->mainTemplate();
60  $this->ctrl = $DIC->ctrl();
61  $this->lng->loadLanguageModule('trac');
62  $this->logger = $DIC->logger()->mmbr();
63  $this->access = $DIC->access();
64  $this->user = $DIC->user();
65  $this->error = $DIC['ilErr'];
66  $this->tabs = $DIC->tabs();
67  $this->toolbar = $DIC->toolbar();
68  $this->rbacsystem = $DIC->rbac()->system();
69  $this->rbacreview = $DIC->rbac()->review();
70  $this->tree = $DIC->repositoryTree();
71  $this->http = $DIC->http();
72  $this->refinery = $DIC->refinery();
73  }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26
+ Here is the call graph for this function:

Member Function Documentation

◆ activateSubTab()

ilMembershipGUI::activateSubTab ( string  $a_sub_tab)
protected

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

References ILIAS\Repository\tabs().

Referenced by editMember(), executeCommand(), membersMap(), and participants().

1516  : void
1517  {
1518  $this->tabs->activateSubTab($a_sub_tab);
1519  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addMemberTab()

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

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

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

983  : void
984  {
985  $mail = new ilMail($this->user->getId());
986 
987  $member_tab_name = $this->getMemberTabName();
988 
989  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
990  'manage_members',
991  'manage_members',
992  $this->getParentObject()->getRefId()
993  );
994 
995  if ($has_manage_members_permission) {
996  $tabs->addTab(
997  'members',
998  $member_tab_name,
999  $this->ctrl->getLinkTarget($this, '')
1000  );
1001  } elseif (
1002  $this->getParentObject()->getShowMembers() &&
1003  $a_is_participant
1004  ) {
1005  $tabs->addTab(
1006  'members',
1007  $member_tab_name,
1008  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilusersgallerygui'), 'view')
1009  );
1010  } elseif (
1011  $this->getParentObject()->getMailToMembersType() === 1 &&
1012  $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1013  $a_is_participant
1014  ) {
1015  $tabs->addTab(
1016  'members',
1017  $member_tab_name,
1018  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1019  );
1020  }
1021  }
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.
+ Here is the call graph for this function:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

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

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

1486  : void
1487  {
1488  // begin-patch clipboard
1489  $users = [];
1490  if ($this->http->wrapper()->post()->has('participants')) {
1491  $users = $this->initParticipantsFromPost();
1492  } elseif ($this->http->wrapper()->post()->has('subscribers')) {
1493  $users = $this->initSubscribersFromPost();
1494  } elseif ($this->http->wrapper()->post()->has('waiting')) {
1495  $users = $this->initWaitingListIdsFromPost();
1496  }
1497  // end-patch clipboard
1498  if (!count($users)) {
1499  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1500  $this->ctrl->redirect($this, 'participants');
1501  }
1502  $clip = ilUserClipboard::getInstance($this->user->getId());
1503  $clip->add($users);
1504  $clip->save();
1505 
1506  $this->lng->loadLanguageModule('user');
1507  $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
1508  $this->ctrl->redirect($this, 'participants');
1509  }
static http()
Fetches the global http state from ILIAS.
static getInstance(int $a_usr_id)
+ Here is the call graph for this function:

◆ assignFromWaitingList()

ilMembershipGUI::assignFromWaitingList ( )

Assign from waiting list.

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

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

1352  : void
1353  {
1354  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1355  if (!count($waiting_list_ids)) {
1356  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1357  $this->ctrl->redirect($this, 'participants');
1358  }
1359 
1360  $waiting_list = $this->initWaitingList();
1361 
1362  $added_users = 0;
1363  foreach ($waiting_list_ids as $user_id) {
1364  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId((int) $user_id, false)) {
1365  continue;
1366  }
1367  if ($this->getMembersObject()->isAssigned((int) $user_id)) {
1368  continue;
1369  }
1370 
1371  if ($this instanceof ilCourseMembershipGUI) {
1372  $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1373  $this->getMembersObject()->sendNotification(
1375  (int) $user_id,
1376  true
1377  );
1378  $this->getParentObject()->checkLPStatusSync((int) $user_id);
1379  }
1380  if ($this instanceof ilGroupMembershipGUI) {
1381  $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER);
1382  $this->getMembersObject()->sendNotification(
1384  (int) $user_id,
1385  true
1386  );
1387  }
1388  if ($this instanceof ilSessionMembershipGUI) {
1389  $this->getMembersObject()->register((int) $user_id);
1391  $noti->setRefId($this->getParentObject()->getRefId());
1392  $noti->setRecipients(array($user_id));
1394  $noti->send();
1395  }
1396 
1397  $waiting_list->removeFromList((int) $user_id);
1398  ++$added_users;
1399  }
1400 
1401  if ($added_users) {
1402  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_users_added"), true);
1403  } else {
1404  $this->tpl->setOnScreenMessage('info', $this->lng->txt("crs_users_already_assigned"), true);
1405  }
1406  $this->ctrl->redirect($this, 'participants');
1407  }
GUI class for membership features.
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
+ Here is the call graph for this function:

◆ assignSubscribers()

ilMembershipGUI::assignSubscribers ( )

Do assignment of subscription request.

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

References ILIAS\Repository\ctrl(), getMembersObject(), getParentObject(), initSubscribersFromPost(), ILIAS\Repository\lng(), ilCourseMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

1256  : void
1257  {
1258  $subscribers = $this->initSubscribersFromPost();
1259  if (!count($subscribers)) {
1260  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1261  $this->ctrl->redirect($this, 'participants');
1262  }
1263 
1264  if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1265  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1266  $this->ctrl->redirect($this, 'participants');
1267  } else {
1268  foreach ($subscribers as $usr_id) {
1269  if ($this instanceof ilCourseMembershipGUI) {
1270  $this->getMembersObject()->sendNotification(
1272  $usr_id
1273  );
1274  $this->getParentObject()->checkLPStatusSync($usr_id);
1275  }
1276  if ($this instanceof ilGroupMembershipGUI) {
1277  $this->getMembersObject()->sendNotification(
1279  $usr_id
1280  );
1281  }
1282  if ($this instanceof ilSessionMembershipGUI) {
1283  // todo refactor to participants
1285  $noti->setRefId($this->getParentObject()->getRefId());
1286  $noti->setRecipients(array($usr_id));
1288  $noti->send();
1289  }
1290  }
1291  }
1292  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_assigned"), true);
1293  $this->ctrl->redirect($this, 'participants');
1294  }
assignSubscribers()
Do assignment of subscription request.
GUI class for membership features.
GUI class for membership features.
+ Here is the call graph for this function:

◆ canAddOrSearchUsers()

ilMembershipGUI::canAddOrSearchUsers ( )
protected

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

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

References checkPermissionBool().

Referenced by showParticipantsToolbar().

215  : bool
216  {
217  return $this->checkPermissionBool('manage_members');
218  }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermission()

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

Check permission If not granted redirect to parent gui.

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

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

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

193  : void
194  {
195  if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
196  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
197  $this->ctrl->redirect($this->getParentGUI());
198  }
199  }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
+ 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 166 of file class.ilMembershipGUI.php.

References ILIAS\Repository\access(), and getParentObject().

Referenced by canAddOrSearchUsers(), checkPermission(), ilSessionMembershipGUI\checkRbacOrPositionAccessBool(), and confirmDeleteParticipants().

171  : bool {
172  if ($a_ref_id === 0) {
173  $a_ref_id = $this->getParentObject()->getRefId();
174  }
175  return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
176  }
+ 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 204 of file class.ilMembershipGUI.php.

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

Referenced by executeCommand().

204  : void
205  {
206  if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
207  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
208  $this->ctrl->redirect($this->getParentGUI());
209  }
210  }
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRbacOrPositionAccessBool()

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

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

References ILIAS\Repository\access(), and getParentObject().

Referenced by addMemberTab(), ilCourseMembershipGUI\assignMembers(), checkRbacOrPermissionAccess(), executeCommand(), getDefaultCommand(), ilLearningSequenceMembershipGUI\members(), ilLearningSequenceMembershipGUI\printMembers(), ilLearningSequenceMembershipGUI\setSubTabs(), and setSubTabs().

182  : bool {
183  if ($a_ref_id === 0) {
184  $a_ref_id = $this->getParentObject()->getRefId();
185  }
186  return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
187  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmAssignFromWaitingList()

ilMembershipGUI::confirmAssignFromWaitingList ( )

Assign from waiting list (confirmatoin)

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

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

1321  : void
1322  {
1323  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1324  if (!count($waiting_list_ids)) {
1325  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1326  $this->ctrl->redirect($this, 'participants');
1327  }
1328  $c_gui = new ilConfirmationGUI();
1329  // set confirm/cancel commands
1330  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1331  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1332  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1333  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1334 
1335  foreach ($waiting_list_ids as $waiting) {
1336  $name = ilObjUser::_lookupName($waiting);
1337 
1338  $c_gui->addItem(
1339  'waiting[]',
1340  (string) $name['user_id'],
1341  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1342  ilUtil::getImagePath('standard/icon_usr.svg')
1343  );
1344  }
1345 
1346  $this->tpl->setContent($c_gui->getHTML());
1347  }
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ confirmAssignSubscribers()

ilMembershipGUI::confirmAssignSubscribers ( )

Show subscription confirmation.

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

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

1147  : void
1148  {
1149  $subscribers = $this->initSubscribersFromPost();
1150  if (!count($subscribers)) {
1151  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1152  $this->ctrl->redirect($this, 'participants');
1153  }
1154 
1155  $c_gui = new ilConfirmationGUI();
1156 
1157  // set confirm/cancel commands
1158  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1159  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1160  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1161  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1162 
1163  foreach ($subscribers as $subscriber) {
1164  $name = ilObjUser::_lookupName($subscriber);
1165 
1166  $c_gui->addItem(
1167  'subscribers[]',
1168  (string) $name['user_id'],
1169  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1170  ilUtil::getImagePath('standard/icon_usr.svg')
1171  );
1172  }
1173  $this->tpl->setContent($c_gui->getHTML());
1174  }
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

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

References $participants, ilObjUser\_lookupName(), ILIAS\Repository\access(), checkPermissionBool(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), getMembersObject(), initParticipantsFromPost(), ilCourseReferencePathInfo\isReferenceMemberUpdateConfirmationRequired(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

667  : void
668  {
670 
671  if (!count($participants)) {
672  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
673  $this->ctrl->redirect($this, 'participants');
674  }
675 
676  // Check last admin
677  if (!$this->getMembersObject()->checkLastAdmin($participants)) {
678  $this->tpl->setOnScreenMessage('failure', $this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
679  $this->ctrl->redirect($this, 'participants');
680  }
681 
682  // if only position access is granted, show additional info
683  if (!$this->checkPermissionBool('manage_members')) {
684  $this->lng->loadLanguageModule('rbac');
685  $this->tpl->setOnScreenMessage('info', $this->lng->txt('rbac_info_only_position_access'));
686  }
687 
688  // Access check for admin deletion
689  if (
690  !$this->access->checkAccess(
691  'edit_permission',
692  '',
693  $this->getParentObject()->getRefId()
694  ) &&
695  !$this->getMembersObject()->isAdmin($this->user->getId())
696  ) {
697  foreach ($participants as $usr_id) {
698  if ($this->getMembersObject()->isAdmin($usr_id)) {
699  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_perm_perm"), true);
700  $this->ctrl->redirect($this, 'participants');
701  }
702  }
703  }
704 
706  $this->repository_object->getRefId(),
708  )) {
709  $this->showDeleteParticipantsConfirmationWithLinkedCourses($participants);
710  return;
711  }
712 
713  $confirm = new ilConfirmationGUI();
714  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
715  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
716  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
717  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
718 
719  foreach ($participants as $usr_id) {
720  $name = ilObjUser::_lookupName($usr_id);
721 
722  $confirm->addItem(
723  'participants[]',
724  (string) $name['user_id'],
725  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
726  ilUtil::getImagePath('standard/icon_usr.svg')
727  );
728  }
729  $this->tpl->setContent($confirm->getHTML());
730  }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
static _lookupName(int $a_user_id)
lookup user name
static isReferenceMemberUpdateConfirmationRequired(int $course_ref_id, array $participants)
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilParticipants $participants
+ Here is the call graph for this function:

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

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

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

1412  : void
1413  {
1414  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1415  if (!count($waiting_list_ids)) {
1416  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1417  $this->ctrl->redirect($this, 'participants');
1418  }
1419  $this->lng->loadLanguageModule('mmbr');
1420  $c_gui = new ilConfirmationGUI();
1421 
1422  // set confirm/cancel commands
1423  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1424  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1425  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1426  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1427 
1428  foreach ($waiting_list_ids as $waiting) {
1429  $name = ilObjUser::_lookupName($waiting);
1430 
1431  $c_gui->addItem(
1432  'waiting[]',
1433  (string) $name['user_id'],
1434  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1435  ilUtil::getImagePath('standard/icon_usr.svg')
1436  );
1437  }
1438  $this->tpl->setContent($c_gui->getHTML());
1439  }
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ confirmRefuseSubscribers()

ilMembershipGUI::confirmRefuseSubscribers ( )

Refuse subscriber confirmation.

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

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

1179  : void
1180  {
1181  $subscribers = $this->initSubscribersFromPost();
1182  if (!count($subscribers)) {
1183  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1184  $this->ctrl->redirect($this, 'participants');
1185  }
1186  $this->lng->loadLanguageModule('mmbr');
1187  $c_gui = new ilConfirmationGUI();
1188  // set confirm/cancel commands
1189  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1190  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1191  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1192  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1193 
1194  foreach ($subscribers as $subscriber_id) {
1195  $name = ilObjUser::_lookupName($subscriber_id);
1196 
1197  $c_gui->addItem(
1198  'subscribers[]',
1199  (string) $name['user_id'],
1200  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1201  ilUtil::getImagePath('standard/icon_usr.svg')
1202  );
1203  }
1204 
1205  $this->tpl->setContent($c_gui->getHTML());
1206  }
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:

◆ createMailSignature()

ilMembershipGUI::createMailSignature ( )

Create Mail signature.

Todo:
better implementation

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

References getParentGUI().

Referenced by sendMailToSelectedUsers().

961  : string
962  {
963  return $this->getParentGUI()->createMailSignature();
964  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

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

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

Referenced by ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses().

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

References activateSubTab(), editParticipants(), getParentObject(), and initMemberIdFromGet().

459  : void
460  {
461  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
462  $this->editParticipants(array($this->initMemberIdFromGet()));
463  }
editParticipants(array $post_participants=array())
Edit participants.
activateSubTab(string $a_sub_tab)
+ Here is the call graph for this function:

◆ editParticipants()

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

Edit participants.

Parameters
int[]$post_participants

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

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

Referenced by editMember().

469  : void
470  {
471  if (!$post_participants) {
472  $post_participants = $this->initParticipantsFromPost();
473  }
474 
475  $real_participants = $this->getMembersObject()->getParticipants();
476  $participants = array_intersect($post_participants, $real_participants);
477 
478  if (!count($participants)) {
479  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
480  $this->ctrl->redirect($this, 'participants');
481  }
482  $table = $this->initEditParticipantTableGUI($participants);
483  $this->tpl->setContent($table->getHTML());
484  }
ilParticipants $participants
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilMembershipGUI::executeCommand ( )

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

References $provider, ilParticipants\_isParticipant(), ILIAS\Repository\access(), activateSubTab(), checkPermission(), checkRbacOrPermissionAccess(), checkRbacOrPositionAccessBool(), ILIAS\Repository\ctrl(), getDefaultCommand(), getDefaultRole(), ILIAS\Survey\Mode\getId(), ilParticipants\getInstance(), getLocalRoles(), getMailMemberRoles(), getMembersObject(), getParentGUI(), getParentObject(), ilParticipants\isAdmin(), ILIAS\Repository\lng(), ilCourseConstants\MAIL_ALLOWED_ALL, setSubTabs(), showMailToMemberToolbarButton(), showMemberExportToolbarButton(), ILIAS\Repository\tabs(), ILIAS\Repository\toolbar(), and ILIAS\Repository\user().

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

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

Referenced by parseSubscriberTable(), parseWaitingListTable(), and printMembersOutput().

225  : array
226  {
227  return $a_user_ids;
228  }
+ Here is the caller graph for this function:

◆ getAttendanceListUserData()

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

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

427  : array
428  {
429  return [];
430  }

◆ getCtrl()

ilMembershipGUI::getCtrl ( )
protected

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

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

134  {
135  return $this->ctrl;
136  }
ilCtrlInterface $ctrl
+ Here is the caller graph for this function:

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by executeCommand().

966  : string
967  {
968  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
969  'manage_members',
970  'manage_members',
971  $this->getParentObject()->getRefId()
972  );
973  if ($has_manage_members_permission) {
974  return 'participants';
975  }
976 
977  if ($this->getParentObject()->getShowMembers()) {
978  return 'jump2UsersGallery';
979  }
980  return 'mailMembersBtn';
981  }
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultRole()

ilMembershipGUI::getDefaultRole ( )
protected

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

References null.

Referenced by executeCommand(), and showParticipantsToolbar().

1511  : ?int
1512  {
1513  return null;
1514  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected

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

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

128  : ilLanguage
129  {
130  return $this->lng;
131  }
+ Here is the caller graph for this function:

◆ getLocalRoles()

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

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

References getParentGUI().

Referenced by executeCommand().

1115  : array
1116  {
1117  return $this->getParentGUI()->getLocalRoles();
1118  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

ilMembershipGUI::getLogger ( )
protected

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

References $logger.

138  : ilLogger
139  {
140  return $this->logger;
141  }

◆ getMailButtonLabel()

ilMembershipGUI::getMailButtonLabel ( )
protected

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

References ILIAS\Repository\lng().

Referenced by showMailToMemberToolbarButton().

952  : string
953  {
954  return $this->lng->txt("mail_members");
955  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected

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

Referenced by sendMailToSelectedUsers().

817  : array
818  {
819  return [];
820  }
+ Here is the caller graph for this function:

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected

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

References null.

Referenced by executeCommand().

162  {
163  return null;
164  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilAbstractMailMemberRoles.
+ Here is the caller graph for this function:

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

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

References $participants, ilParticipants\getInstance(), getParentObject(), and participants().

Referenced by assignFromWaitingList(), ilGroupMembershipGUI\assignMembers(), ilCourseMembershipGUI\assignMembers(), assignSubscribers(), confirmDeleteParticipants(), ilSessionMembershipGUI\deleteParticipants(), deleteParticipants(), ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses(), editParticipants(), executeCommand(), ilSessionMembershipGUI\getAttendanceListUserData(), ilCourseMembershipGUI\getPrintMemberData(), initAttendanceList(), parseSubscriberTable(), printForMembersOutput(), printMembersOutput(), refuseFromList(), refuseSubscribers(), updateParticipants(), ilGroupMembershipGUI\updateParticipantsStatus(), and ilCourseMembershipGUI\updateParticipantsStatus().

154  {
155  if ($this->participants instanceof ilParticipants) {
156  return $this->participants;
157  }
158  return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
159  }
static getInstance(int $a_ref_id)
ilParticipants $participants
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberTabName()

ilMembershipGUI::getMemberTabName ( )
protected

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

References ILIAS\Repository\lng().

Referenced by addMemberTab().

1023  : string
1024  {
1025  return $this->lng->txt('members');
1026  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

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

References $repository_object.

Referenced by __construct(), addMemberTab(), assignFromWaitingList(), ilGroupMembershipGUI\assignMembers(), ilCourseMembershipGUI\assignMembers(), assignSubscribers(), checkPermissionBool(), ilSessionMembershipGUI\checkRbacOrPositionAccessBool(), checkRbacOrPositionAccessBool(), ilSessionMembershipGUI\deleteParticipants(), deleteParticipants(), ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses(), editMember(), executeCommand(), ilCourseMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), ilGroupMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), getDefaultCommand(), ilGroupMembershipGUI\getLocalTypeRole(), ilCourseMembershipGUI\getLocalTypeRole(), ilCourseMembershipGUI\getMailContextOptions(), ilGroupMembershipGUI\getMailContextOptions(), ilSessionMembershipGUI\getMailContextOptions(), getMembersObject(), ilSessionMembershipGUI\getMemberTabName(), ilSessionMembershipGUI\getParticipantTableTitle(), getParticipantTableTitle(), ilCourseMembershipGUI\getPrintMemberData(), initAttendanceList(), ilGroupMembershipGUI\initEditParticipantTableGUI(), ilCourseMembershipGUI\initEditParticipantTableGUI(), ilSessionMembershipGUI\initParticipantTableGUI(), ilGroupMembershipGUI\initParticipantTableGUI(), ilCourseMembershipGUI\initParticipantTableGUI(), ilSessionMembershipGUI\initSubscriberTable(), initSubscriberTable(), ilSessionMembershipGUI\initWaitingList(), ilGroupMembershipGUI\initWaitingList(), ilCourseMembershipGUI\initWaitingList(), membersMap(), parseWaitingListTable(), participants(), printForMembersOutput(), refuseFromList(), refuseSubscribers(), setSubTabs(), ilCourseMembershipGUI\showDeleteParticipantsConfirmationWithLinkedCourses(), showMailToMemberToolbarButton(), showMemberExportToolbarButton(), ilSessionMembershipGUI\updateMembers(), and updateParticipants().

148  : ilObject
149  {
151  }
+ Here is the caller graph for this function:

◆ getParticipantTableTitle()

ilMembershipGUI::getParticipantTableTitle ( )
protected

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

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

Referenced by participants().

422  : string
423  {
424  return $this->lng->txt($this->getParentObject()->getType() . '_mem_tbl_header');
425  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initAttendanceList()

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

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

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

Referenced by printForMembersOutput(), ilLearningSequenceMembershipGUI\printMembers(), printMembers(), and printMembersOutput().

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

◆ initMemberIdFromGet()

ilMembershipGUI::initMemberIdFromGet ( )
protected

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

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

Referenced by editMember(), and sendMailToSelectedUsers().

91  : int
92  {
93  if ($this->http->wrapper()->query()->has('member_id')) {
94  return $this->http->wrapper()->query()->retrieve(
95  'member_id',
96  $this->refinery->kindlyTo()->int()
97  );
98  }
99  return 0;
100  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initParticipantsFromPost()

ilMembershipGUI::initParticipantsFromPost ( )
protected
Returns
int[]

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

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

Referenced by addToClipboard(), confirmDeleteParticipants(), deleteParticipants(), ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses(), editParticipants(), sendMailToSelectedUsers(), and updateParticipants().

78  : array
79  {
80  if ($this->http->wrapper()->post()->has('participants')) {
81  return $this->http->wrapper()->post()->retrieve(
82  'participants',
83  $this->refinery->kindlyTo()->listOf(
84  $this->refinery->kindlyTo()->int()
85  )
86  );
87  }
88  return [];
89  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubscribersFromPost()

ilMembershipGUI::initSubscribersFromPost ( )
protected

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

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

Referenced by addToClipboard(), assignSubscribers(), confirmAssignSubscribers(), confirmRefuseSubscribers(), refuseSubscribers(), and sendMailToSelectedUsers().

102  : array
103  {
104  if ($this->http->wrapper()->post()->has('subscribers')) {
105  return $this->http->wrapper()->post()->retrieve(
106  'subscribers',
107  $this->refinery->kindlyTo()->listOf(
108  $this->refinery->kindlyTo()->int()
109  )
110  );
111  }
112  return [];
113  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSubscriberTable()

ilMembershipGUI::initSubscriberTable ( )
protected

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

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

Referenced by parseSubscriberTable().

1138  {
1139  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1140  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1141  return $subscriber;
1142  }
GUI class for course/group subscriptions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initWaitingListIdsFromPost()

ilMembershipGUI::initWaitingListIdsFromPost ( )
protected

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

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

Referenced by addToClipboard(), assignFromWaitingList(), confirmAssignFromWaitingList(), confirmRefuseFromList(), refuseFromList(), and sendMailToSelectedUsers().

115  : array
116  {
117  if ($this->http->wrapper()->post()->has('waiting')) {
118  return $this->http->wrapper()->post()->retrieve(
119  'waiting',
120  $this->refinery->kindlyTo()->listOf(
121  $this->refinery->kindlyTo()->int()
122  )
123  );
124  }
125  return [];
126  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jump2UsersGallery()

ilMembershipGUI::jump2UsersGallery ( )
protected

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

References ILIAS\Repository\ctrl().

Referenced by ilLearningSequenceMembershipGUI\members().

1584  : void
1585  {
1586  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1587  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

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

References showMailToMemberToolbarButton(), and ILIAS\Repository\toolbar().

852  : void
853  {
854  $this->showMailToMemberToolbarButton($this->toolbar, 'mailMembersBtn');
855  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
Show mail to member toolbar button.
+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

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

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

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

◆ parseSubscriberTable()

ilMembershipGUI::parseSubscriberTable ( )
protected

Parse table of subscription request.

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

References filterUserIdsByRbacOrPositionOfCurrentUser(), getMembersObject(), initSubscriberTable(), and null.

Referenced by participants().

1124  {
1125  $subscribers = $this->getMembersObject()->getSubscribers();
1126  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1127  if (!count($filtered_subscribers)) {
1128  return null;
1129  }
1130  $subscriber = $this->initSubscriberTable();
1131  $subscriber->readSubscriberData(
1132  $filtered_subscribers
1133  );
1134  return $subscriber;
1135  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
GUI class for course/group subscriptions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseWaitingListTable()

ilMembershipGUI::parseWaitingListTable ( )
protected

Parse table of subscription request.

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

References filterUserIdsByRbacOrPositionOfCurrentUser(), getParentObject(), ILIAS\Repository\lng(), and null.

Referenced by participants().

1300  {
1301  $wait = $this->initWaitingList();
1302 
1303  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1304  if (!count($wait_users)) {
1305  return null;
1306  }
1307 
1308  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1309  $waiting_table->setUserIds(
1310  $wait_users
1311  );
1312  $waiting_table->readUserData();
1313  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1314 
1315  return $waiting_table;
1316  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
GUI class for course/group waiting list.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ participants()

ilMembershipGUI::participants ( )
protected

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

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

References activateSubTab(), ILIAS\Repository\ctrl(), getParentObject(), getParticipantTableTitle(), parseSubscriberTable(), parseWaitingListTable(), and showParticipantsToolbar().

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

391  : void
392  {
393  $this->initParticipantTemplate();
394  $this->showParticipantsToolbar();
395  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
396 
397  // show waiting list table
398  $waiting = $this->parseWaitingListTable();
399  if ($waiting instanceof ilWaitingListTableGUI) {
400  $this->tpl->setVariable('TABLE_WAIT', $waiting->getHTML());
401  }
402 
403  // show subscriber table
404  $subscriber = $this->parseSubscriberTable();
405  if ($subscriber instanceof ilSubscriberTableGUI) {
406  $this->tpl->setVariable('TABLE_SUB', $subscriber->getHTML());
407  }
408 
409  // show member table
410  $table = $this->initParticipantTableGUI();
411  $table->setTitle($this->getParticipantTableTitle());
412  $table->setFormAction($this->ctrl->getFormAction($this));
413  $table->parse();
414 
415  // filter commands
416  $table->setFilterCommand('participantsApplyFilter');
417  $table->setResetCommand('participantsResetFilter');
418 
419  $this->tpl->setVariable('MEMBERS', $table->getHTML());
420  }
parseWaitingListTable()
Parse table of subscription request.
GUI class for course/group subscriptions.
showParticipantsToolbar()
Show participants toolbar.
parseSubscriberTable()
Parse table of subscription request.
GUI class for course/group waiting list.
activateSubTab(string $a_sub_tab)
+ 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 435 of file class.ilMembershipGUI.php.

References participants().

435  : void
436  {
437  $table = $this->initParticipantTableGUI();
438  $table->resetOffset();
439  $table->writeFilterToSession();
440 
441  $this->participants();
442  }
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:

◆ participantsResetFilter()

ilMembershipGUI::participantsResetFilter ( )
protected

reset participants filter

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

References participants().

447  : void
448  {
449  $table = $this->initParticipantTableGUI();
450  $table->resetOffset();
451  $table->resetFilter();
452 
453  $this->participants();
454  }
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:

◆ printForMembersOutput()

ilMembershipGUI::printForMembersOutput ( )
protected

print members output

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

References ILIAS\Repository\ctrl(), getMembersObject(), getParentObject(), initAttendanceList(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

1567  : void
1568  {
1569  $this->tabs->clearTargets();
1570  $this->tabs->setBackTarget(
1571  $this->lng->txt('back'),
1572  $this->ctrl->getLinkTarget($this, 'jump2UsersGallery')
1573  );
1574 
1575  $list = $this->initAttendanceList();
1576  $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1577  $list->initFromSettings();
1578  $list->setCallback([$this, 'getAttendanceListUserData']);
1579  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1580  $list->getNonMemberUserData($this->member_data);
1581  $list->getFullscreenHTML();
1582  }
initAttendanceList(bool $a_for_members=false)
+ Here is the call graph for this function:

◆ printMembers()

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

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

References checkPermission(), ILIAS\Repository\ctrl(), initAttendanceList(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

1524  : void
1525  {
1526  $this->checkPermission('read');
1527 
1528  $this->tabs->clearTargets();
1529 
1530  $this->tabs->setBackTarget(
1531  $this->lng->txt('back'),
1532  $this->ctrl->getLinkTarget($this, 'participants')
1533  );
1534 
1535  $list = $this->initAttendanceList();
1536  $form = $list->initForm('printMembersOutput');
1537  $this->tpl->setContent($form->getHTML());
1538  }
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
initAttendanceList(bool $a_for_members=false)
+ Here is the call graph for this function:

◆ printMembersOutput()

ilMembershipGUI::printMembersOutput ( )
protected

print members output

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

References ILIAS\Repository\ctrl(), filterUserIdsByRbacOrPositionOfCurrentUser(), getMembersObject(), initAttendanceList(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

1543  : void
1544  {
1545  $this->tabs->clearTargets();
1546  $this->tabs->setBackTarget(
1547  $this->lng->txt('back'),
1548  $this->ctrl->getLinkTarget($this, 'participants')
1549  );
1550 
1551  $list = $this->initAttendanceList();
1552  $list->initFromForm();
1553  $list->setCallback([$this, 'getAttendanceListUserData']);
1554  $this->member_data = $this->getPrintMemberData(
1556  $this->getMembersObject()->getParticipants()
1557  )
1558  );
1559 
1560  $list->getNonMemberUserData($this->member_data);
1561  $list->getFullscreenHTML();
1562  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
initAttendanceList(bool $a_for_members=false)
+ 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 1107 of file class.ilMembershipGUI.php.

References getParentGUI().

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

1107  : array
1108  {
1109  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1110  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refuseFromList()

ilMembershipGUI::refuseFromList ( )
protected

refuse from waiting list

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

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

1444  : void
1445  {
1446  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1447  if (!count($waiting_list_ids)) {
1448  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
1449  $this->ctrl->redirect($this, 'participants');
1450  }
1451 
1452  $waiting_list = $this->initWaitingList();
1453 
1454  foreach ($waiting_list_ids as $user_id) {
1455  $waiting_list->removeFromList((int) $user_id);
1456 
1457  if ($this instanceof ilCourseMembershipGUI) {
1458  $this->getMembersObject()->sendNotification(
1460  (int) $user_id,
1461  true
1462  );
1463  }
1464  if ($this instanceof ilGroupMembershipGUI) {
1465  $this->getMembersObject()->sendNotification(
1467  (int) $user_id,
1468  true
1469  );
1470  }
1471  if ($this instanceof ilSessionMembershipGUI) {
1473  $noti->setRefId($this->getParentObject()->getRefId());
1474  $noti->setRecipients(array($user_id));
1476  $noti->send();
1477  }
1478  }
1479  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_users_removed_from_list'), true);
1480  $this->ctrl->redirect($this, 'participants');
1481  }
GUI class for membership features.
GUI class for membership features.
+ Here is the call graph for this function:

◆ refuseSubscribers()

ilMembershipGUI::refuseSubscribers ( )
protected

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

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

1208  : void
1209  {
1210  $subscribers = $this->initSubscribersFromPost();
1211  if (!count($subscribers)) {
1212  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1213  $this->ctrl->redirect($this, 'participants');
1214  }
1215 
1216  if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1217  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1218  $this->ctrl->redirect($this, 'participants');
1219  } else {
1220  foreach ($subscribers as $usr_id) {
1221  if ($this instanceof ilCourseMembershipGUI) {
1222  $this->getMembersObject()->sendNotification(
1224  $usr_id
1225  );
1226  }
1227  if ($this instanceof ilGroupMembershipGUI) {
1228  $this->getMembersObject()->sendNotification(
1230  $usr_id
1231  );
1232  }
1233  if ($this instanceof ilSessionMembershipGUI) {
1235  $noti->setRefId($this->getParentObject()->getRefId());
1236  $noti->setRecipients(array($usr_id));
1238  $noti->send();
1239  }
1240  if ($this instanceof ilLearningSequenceMembershipGUI) {
1241  $this->getMembersObject()->sendNotification(
1243  $usr_id
1244  );
1245  }
1246  }
1247  }
1248 
1249  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_deleted"), true);
1250  $this->ctrl->redirect($this, 'participants');
1251  }
GUI class for membership features.
GUI class for membership features.
GUI class for learning sequence membership features.
+ Here is the call graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

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

References ilObjUser\_lookupLogin(), createMailSignature(), ILIAS\Repository\ctrl(), getMailContextOptions(), ilMailFormCall\getRedirectTarget(), ILIAS\FileDelivery\http(), initMemberIdFromGet(), initParticipantsFromPost(), initSubscribersFromPost(), initWaitingListIdsFromPost(), ILIAS\Repository\lng(), ilUtil\redirect(), and ilMailFormCall\setRecipients().

779  : void
780  {
781  $participants = [];
782  if ($this->http->wrapper()->post()->has('participants')) {
784  } elseif ($this->http->wrapper()->post()->has('subscribers')) {
786  } elseif ($this->http->wrapper()->post()->has('waiting')) {
788  } elseif ($this->http->wrapper()->query()->has('member_id')) {
789  $participants = [$this->initMemberIdFromGet()];
790  }
791  if (!count($participants)) {
792  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
793  $this->ctrl->redirect($this, 'participants');
794  }
795 
796  $rcps = [];
797  foreach ($participants as $usr_id) {
798  $rcps[] = ilObjUser::_lookupLogin($usr_id);
799  }
800  $context_options = $this->getMailContextOptions();
801 
805  $this,
806  'participants',
807  array(),
808  array(
809  'type' => 'new',
810  'sig' => $this->createMailSignature()
811  ),
812  $context_options
813  )
814  );
815  }
static http()
Fetches the global http state from ILIAS.
createMailSignature()
Create Mail signature.
ilParticipants $participants
static redirect(string $a_script)
static setRecipients(array $recipients, string $type='to')
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:

◆ setSubTabs()

ilMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

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

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

Referenced by executeCommand().

1031  : void
1032  {
1033  if ($this->checkRbacOrPositionAccessBool(
1034  'manage_members',
1035  'manage_members',
1036  $this->getParentObject()->getRefId()
1037  )) {
1038  $tabs->addSubTabTarget(
1039  $this->getParentObject()->getType() . "_member_administration",
1040  $this->ctrl->getLinkTarget($this, 'participants'),
1041  "members",
1042  get_class($this)
1043  );
1044 
1045  // show group overview
1046  if ($this instanceof ilCourseMembershipGUI) {
1047  $tabs->addSubTabTarget(
1048  "crs_members_groups",
1049  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1050  "",
1051  "ilCourseParticipantsGroupsGUI"
1052  );
1053  }
1054 
1055  $children = $this->tree->getSubTree(
1056  $this->tree->getNodeData($this->getParentObject()->getRefId()),
1057  false,
1058  ['sess']
1059  );
1060  if (count($children)) {
1061  $tabs->addSubTabTarget(
1062  'events',
1063  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilsessionoverviewgui'), 'listSessions'),
1064  '',
1065  'ilsessionoverviewgui'
1066  );
1067  }
1068  $tabs->addSubTabTarget(
1069  $this->getParentObject()->getType() . '_members_gallery',
1070  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1071  'view',
1072  'ilUsersGalleryGUI'
1073  );
1074  } elseif ($this->getParentObject()->getShowMembers()) {
1075  // gallery
1076  $tabs->addSubTabTarget(
1077  $this->getParentObject()->getType() . '_members_gallery',
1078  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1079  'view',
1080  'ilUsersGalleryGUI'
1081  );
1082  }
1083 
1084  if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1085  $tabs->addSubTabTarget(
1086  $this->getParentObject()->getType() . '_members_map',
1087  $this->ctrl->getLinkTarget($this, 'membersMap'),
1088  "membersMap",
1089  get_class($this)
1090  );
1091  }
1092 
1093  if (ilPrivacySettings::getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1094  $tabs->addSubTabTarget(
1095  'export_members',
1096  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilmemberexportgui'), 'show'),
1097  '',
1098  'ilmemberexportgui'
1099  );
1100  }
1101  }
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
static isActivated()
Checks whether Map feature is activated.
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
+ Here is the call graph for this function:
+ Here is the caller 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 923 of file class.ilMembershipGUI.php.

References ILIAS\Repository\access(), ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), ILIAS\Repository\ctrl(), getMailButtonLabel(), getParentObject(), null, and ILIAS\Repository\user().

Referenced by executeCommand(), mailMembersBtn(), ilLearningSequenceMembershipGUI\showParticipantsToolbar(), and showParticipantsToolbar().

927  : void {
928  $mail = new ilMail($this->user->getId());
929 
930  if (
931  ($this->getParentObject()->getMailToMembersType() === 1) ||
932  (
933  $this->access->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
934  $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
935  )
936  ) {
937  if ($a_separator) {
938  $toolbar->addSeparator();
939  }
940 
941  if ($a_back_cmd !== null) {
942  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
943  }
944 
945  $toolbar->addButton(
946  $this->getMailButtonLabel(),
947  $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
948  );
949  }
950  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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')
+ 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 898 of file class.ilMembershipGUI.php.

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

Referenced by executeCommand().

902  : void {
903  if (
904  $this->getParentObject()->getType() === 'crs' &&
905  $this->getParentObject()->getShowMembersExport()) {
906  if ($a_separator) {
907  $toolbar->addSeparator();
908  }
909 
910  if ($a_back_cmd) {
911  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
912  }
913  $toolbar->addButton(
914  $this->lng->txt($this->getParentObject()->getType() . '_print_list'),
915  $this->ctrl->getLinkTarget($this, 'printForMembersOutput')
916  );
917  }
918  }
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')
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showParticipantsToolbar()

ilMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

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

References canAddOrSearchUsers(), ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), getParentGUI(), ILIAS\Repository\lng(), showMailToMemberToolbarButton(), and ILIAS\Repository\toolbar().

Referenced by participants().

860  : void
861  {
862  if ($this->canAddOrSearchUsers()) {
864  $this,
865  $this->toolbar,
866  array(
867  'auto_complete_name' => $this->lng->txt('user'),
868  'user_type' => $this->getParentGUI()->getLocalRoles(),
869  'user_type_default' => $this->getDefaultRole(),
870  'submit_name' => $this->lng->txt('add')
871  )
872  );
873 
874  // spacer
875  $this->toolbar->addSeparator();
876 
877  // search button
878  $this->toolbar->addButton(
879  $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
880  $this->ctrl->getLinkTargetByClass(
881  'ilRepositorySearchGUI',
882  'start'
883  )
884  );
885 
886  // separator
887  $this->toolbar->addSeparator();
888  }
889 
890  // print button
891  $this->toolbar->addButton(
892  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
893  $this->ctrl->getLinkTarget($this, 'printMembers')
894  );
895  $this->showMailToMemberToolbarButton($this->toolbar, 'participants', false);
896  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
Show mail to member toolbar button.
static fillAutoCompleteToolbar(object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt(&#39;user&#39;), auto_complete_size = 15, user_type = array(ilCoursePar...
canAddOrSearchUsers()
Check if current user is allowed to add / search users.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateLPFromStatus()

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

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

Referenced by updateParticipants().

660  : void
661  {
662  }
+ Here is the caller graph for this function:

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

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

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

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

Field Documentation

◆ $access

ilAccessHandler ilMembershipGUI::$access
protected

◆ $ctrl

ilCtrlInterface ilMembershipGUI::$ctrl
protected

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

Referenced by getCtrl().

◆ $error

ilErrorHandling ilMembershipGUI::$error
protected

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

◆ $http

GlobalHttpState ilMembershipGUI::$http
protected

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

◆ $lng

ilLanguage ilMembershipGUI::$lng
protected

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

Referenced by getLanguage().

◆ $logger

ilLogger ilMembershipGUI::$logger
protected

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

Referenced by getLogger().

◆ $member_data

array ilMembershipGUI::$member_data = []
protected

◆ $participants

◆ $rbacreview

ilRbacReview ilMembershipGUI::$rbacreview
protected

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

◆ $rbacsystem

ilRbacSystem ilMembershipGUI::$rbacsystem
protected

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

◆ $refinery

Factory ilMembershipGUI::$refinery
protected

◆ $repository_gui

ilObjectGUI ilMembershipGUI::$repository_gui
private

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

Referenced by __construct(), and getParentGUI().

◆ $repository_object

ilObject ilMembershipGUI::$repository_object
private

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

Referenced by getParentObject().

◆ $tabs

ilTabsGUI ilMembershipGUI::$tabs
protected

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

◆ $toolbar

ilToolbarGUI ilMembershipGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilMembershipGUI::$tpl
protected

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

◆ $tree

ilTree ilMembershipGUI::$tree
protected

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

◆ $user

ilObjUser ilMembershipGUI::$user
protected

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


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