ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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...
 
 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 27 of file class.ilMembershipGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 48 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().

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

Member Function Documentation

◆ activateSubTab()

ilMembershipGUI::activateSubTab ( string  $a_sub_tab)
protected

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

References ILIAS\Repository\tabs().

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

1510  : void
1511  {
1512  $this->tabs->activateSubTab($a_sub_tab);
1513  }
+ 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 977 of file class.ilMembershipGUI.php.

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

977  : void
978  {
979  $mail = new ilMail($this->user->getId());
980 
981  $member_tab_name = $this->getMemberTabName();
982 
983  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
984  'manage_members',
985  'manage_members',
986  $this->getParentObject()->getRefId()
987  );
988 
989  if ($has_manage_members_permission) {
990  $tabs->addTab(
991  'members',
992  $member_tab_name,
993  $this->ctrl->getLinkTarget($this, '')
994  );
995  } elseif (
996  $this->getParentObject()->getShowMembers() &&
997  $a_is_participant
998  ) {
999  $tabs->addTab(
1000  'members',
1001  $member_tab_name,
1002  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilusersgallerygui'), 'view')
1003  );
1004  } elseif (
1005  $this->getParentObject()->getMailToMembersType() === 1 &&
1006  $this->rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1007  $a_is_participant
1008  ) {
1009  $tabs->addTab(
1010  'members',
1011  $member_tab_name,
1012  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1013  );
1014  }
1015  }
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 1480 of file class.ilMembershipGUI.php.

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

1480  : void
1481  {
1482  // begin-patch clipboard
1483  $users = [];
1484  if ($this->http->wrapper()->post()->has('participants')) {
1485  $users = $this->initParticipantsFromPost();
1486  } elseif ($this->http->wrapper()->post()->has('subscribers')) {
1487  $users = $this->initSubscribersFromPost();
1488  } elseif ($this->http->wrapper()->post()->has('waiting')) {
1489  $users = $this->initWaitingListIdsFromPost();
1490  }
1491  // end-patch clipboard
1492  if (!count($users)) {
1493  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('select_one'), true);
1494  $this->ctrl->redirect($this, 'participants');
1495  }
1496  $clip = ilUserClipboard::getInstance($this->user->getId());
1497  $clip->add($users);
1498  $clip->save();
1499 
1500  $this->lng->loadLanguageModule('user');
1501  $this->tpl->setOnScreenMessage('success', $this->lng->txt('clipboard_user_added'), true);
1502  $this->ctrl->redirect($this, 'participants');
1503  }
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 1346 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.

1346  : void
1347  {
1348  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1349  if (!count($waiting_list_ids)) {
1350  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1351  $this->ctrl->redirect($this, 'participants');
1352  }
1353 
1354  $waiting_list = $this->initWaitingList();
1355 
1356  $added_users = 0;
1357  foreach ($waiting_list_ids as $user_id) {
1358  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId((int) $user_id, false)) {
1359  continue;
1360  }
1361  if ($this->getMembersObject()->isAssigned((int) $user_id)) {
1362  continue;
1363  }
1364 
1365  if ($this instanceof ilCourseMembershipGUI) {
1366  $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1367  $this->getMembersObject()->sendNotification(
1369  (int) $user_id,
1370  true
1371  );
1372  $this->getParentObject()->checkLPStatusSync((int) $user_id);
1373  }
1374  if ($this instanceof ilGroupMembershipGUI) {
1375  $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER);
1376  $this->getMembersObject()->sendNotification(
1378  (int) $user_id,
1379  true
1380  );
1381  }
1382  if ($this instanceof ilSessionMembershipGUI) {
1383  $this->getMembersObject()->register((int) $user_id);
1385  $noti->setRefId($this->getParentObject()->getRefId());
1386  $noti->setRecipients(array($user_id));
1388  $noti->send();
1389  }
1390 
1391  $waiting_list->removeFromList((int) $user_id);
1392  ++$added_users;
1393  }
1394 
1395  if ($added_users) {
1396  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_users_added"), true);
1397  } else {
1398  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_users_already_assigned"), true);
1399  }
1400  $this->ctrl->redirect($this, 'participants');
1401  }
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 1250 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.

1250  : void
1251  {
1252  $subscribers = $this->initSubscribersFromPost();
1253  if (!count($subscribers)) {
1254  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1255  $this->ctrl->redirect($this, 'participants');
1256  }
1257 
1258  if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1259  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1260  $this->ctrl->redirect($this, 'participants');
1261  } else {
1262  foreach ($subscribers as $usr_id) {
1263  if ($this instanceof ilCourseMembershipGUI) {
1264  $this->getMembersObject()->sendNotification(
1266  $usr_id
1267  );
1268  $this->getParentObject()->checkLPStatusSync($usr_id);
1269  }
1270  if ($this instanceof ilGroupMembershipGUI) {
1271  $this->getMembersObject()->sendNotification(
1273  $usr_id
1274  );
1275  }
1276  if ($this instanceof ilSessionMembershipGUI) {
1277  // todo refactor to participants
1279  $noti->setRefId($this->getParentObject()->getRefId());
1280  $noti->setRecipients(array($usr_id));
1282  $noti->send();
1283  }
1284  }
1285  }
1286  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_assigned"), true);
1287  $this->ctrl->redirect($this, 'participants');
1288  }
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 214 of file class.ilMembershipGUI.php.

References checkPermissionBool().

Referenced by showParticipantsToolbar().

214  : bool
215  {
216  return $this->checkPermissionBool('manage_members');
217  }
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 192 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().

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

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

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

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

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

Referenced by executeCommand().

203  : void
204  {
205  if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
206  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_permission'), true);
207  $this->ctrl->redirect($this->getParentGUI());
208  }
209  }
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 177 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().

181  : bool {
182  if ($a_ref_id === 0) {
183  $a_ref_id = $this->getParentObject()->getRefId();
184  }
185  return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
186  }
+ 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 1315 of file class.ilMembershipGUI.php.

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

1315  : void
1316  {
1317  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1318  if (!count($waiting_list_ids)) {
1319  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1320  $this->ctrl->redirect($this, 'participants');
1321  }
1322  $c_gui = new ilConfirmationGUI();
1323  // set confirm/cancel commands
1324  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1325  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1326  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1327  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1328 
1329  foreach ($waiting_list_ids as $waiting) {
1330  $name = ilObjUser::_lookupName($waiting);
1331 
1332  $c_gui->addItem(
1333  'waiting[]',
1334  (string) $name['user_id'],
1335  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1336  ilUtil::getImagePath('standard/icon_usr.svg')
1337  );
1338  }
1339 
1340  $this->tpl->setContent($c_gui->getHTML());
1341  }
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 1141 of file class.ilMembershipGUI.php.

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

1141  : void
1142  {
1143  $subscribers = $this->initSubscribersFromPost();
1144  if (!count($subscribers)) {
1145  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1146  $this->ctrl->redirect($this, 'participants');
1147  }
1148 
1149  $c_gui = new ilConfirmationGUI();
1150 
1151  // set confirm/cancel commands
1152  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1153  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1154  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1155  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1156 
1157  foreach ($subscribers as $subscriber) {
1158  $name = ilObjUser::_lookupName($subscriber);
1159 
1160  $c_gui->addItem(
1161  'subscribers[]',
1162  (string) $name['user_id'],
1163  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1164  ilUtil::getImagePath('standard/icon_usr.svg')
1165  );
1166  }
1167  $this->tpl->setContent($c_gui->getHTML());
1168  }
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 666 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().

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

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

1406  : void
1407  {
1408  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1409  if (!count($waiting_list_ids)) {
1410  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1411  $this->ctrl->redirect($this, 'participants');
1412  }
1413  $this->lng->loadLanguageModule('mmbr');
1414  $c_gui = new ilConfirmationGUI();
1415 
1416  // set confirm/cancel commands
1417  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1418  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1419  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1420  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1421 
1422  foreach ($waiting_list_ids as $waiting) {
1423  $name = ilObjUser::_lookupName($waiting);
1424 
1425  $c_gui->addItem(
1426  'waiting[]',
1427  (string) $name['user_id'],
1428  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1429  ilUtil::getImagePath('standard/icon_usr.svg')
1430  );
1431  }
1432  $this->tpl->setContent($c_gui->getHTML());
1433  }
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 1173 of file class.ilMembershipGUI.php.

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

1173  : void
1174  {
1175  $subscribers = $this->initSubscribersFromPost();
1176  if (!count($subscribers)) {
1177  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1178  $this->ctrl->redirect($this, 'participants');
1179  }
1180  $this->lng->loadLanguageModule('mmbr');
1181  $c_gui = new ilConfirmationGUI();
1182  // set confirm/cancel commands
1183  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1184  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1185  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1186  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1187 
1188  foreach ($subscribers as $subscriber_id) {
1189  $name = ilObjUser::_lookupName($subscriber_id);
1190 
1191  $c_gui->addItem(
1192  'subscribers[]',
1193  (string) $name['user_id'],
1194  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1195  ilUtil::getImagePath('standard/icon_usr.svg')
1196  );
1197  }
1198 
1199  $this->tpl->setContent($c_gui->getHTML());
1200  }
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 955 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by sendMailToSelectedUsers().

955  : string
956  {
957  return $this->getParentGUI()->createMailSignature();
958  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

Definition at line 731 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().

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

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

458  : void
459  {
460  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
461  $this->editParticipants(array($this->initMemberIdFromGet()));
462  }
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 468 of file class.ilMembershipGUI.php.

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

Referenced by editMember().

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

◆ executeCommand()

ilMembershipGUI::executeCommand ( )

Definition at line 229 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().

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

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

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

◆ getAttendanceListUserData()

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

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

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

◆ getCtrl()

ilMembershipGUI::getCtrl ( )
protected

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

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by executeCommand().

960  : string
961  {
962  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
963  'manage_members',
964  'manage_members',
965  $this->getParentObject()->getRefId()
966  );
967  if ($has_manage_members_permission) {
968  return 'participants';
969  }
970 
971  if ($this->getParentObject()->getShowMembers()) {
972  return 'jump2UsersGallery';
973  }
974  return 'mailMembersBtn';
975  }
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 1505 of file class.ilMembershipGUI.php.

References null.

Referenced by executeCommand(), and showParticipantsToolbar().

1505  : ?int
1506  {
1507  return null;
1508  }
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 127 of file class.ilMembershipGUI.php.

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getLocalRoles()

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

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

References getParentGUI().

Referenced by executeCommand().

1109  : array
1110  {
1111  return $this->getParentGUI()->getLocalRoles();
1112  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

ilMembershipGUI::getLogger ( )
protected

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

References $logger.

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

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected

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

Referenced by sendMailToSelectedUsers().

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

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected

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

References null.

Referenced by executeCommand().

161  {
162  return null;
163  }
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 152 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().

153  {
154  if ($this->participants instanceof ilParticipants) {
155  return $this->participants;
156  }
157  return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
158  }
static getInstance(int $a_ref_id)
ilParticipants $participants
Base class for course and group 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 1017 of file class.ilMembershipGUI.php.

References ILIAS\Repository\lng().

Referenced by addMemberTab().

1017  : string
1018  {
1019  return $this->lng->txt('members');
1020  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Definition at line 147 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().

147  : ilObject
148  {
150  }
+ Here is the caller graph for this function:

◆ getParticipantTableTitle()

ilMembershipGUI::getParticipantTableTitle ( )
protected

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

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

Referenced by participants().

421  : string
422  {
423  return $this->lng->txt($this->getParentObject()->getType() . '_mem_tbl_header');
424  }
+ 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 1583 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().

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

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

Referenced by editMember(), and sendMailToSelectedUsers().

90  : int
91  {
92  if ($this->http->wrapper()->query()->has('member_id')) {
93  return $this->http->wrapper()->query()->retrieve(
94  'member_id',
95  $this->refinery->kindlyTo()->int()
96  );
97  }
98  return 0;
99  }
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 77 of file class.ilMembershipGUI.php.

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

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

77  : array
78  {
79  if ($this->http->wrapper()->post()->has('participants')) {
80  return $this->http->wrapper()->post()->retrieve(
81  'participants',
82  $this->refinery->kindlyTo()->listOf(
83  $this->refinery->kindlyTo()->int()
84  )
85  );
86  }
87  return [];
88  }
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 101 of file class.ilMembershipGUI.php.

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

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

101  : array
102  {
103  if ($this->http->wrapper()->post()->has('subscribers')) {
104  return $this->http->wrapper()->post()->retrieve(
105  'subscribers',
106  $this->refinery->kindlyTo()->listOf(
107  $this->refinery->kindlyTo()->int()
108  )
109  );
110  }
111  return [];
112  }
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 1131 of file class.ilMembershipGUI.php.

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

Referenced by parseSubscriberTable().

1132  {
1133  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1134  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1135  return $subscriber;
1136  }
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 114 of file class.ilMembershipGUI.php.

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

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

114  : array
115  {
116  if ($this->http->wrapper()->post()->has('waiting')) {
117  return $this->http->wrapper()->post()->retrieve(
118  'waiting',
119  $this->refinery->kindlyTo()->listOf(
120  $this->refinery->kindlyTo()->int()
121  )
122  );
123  }
124  return [];
125  }
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 1578 of file class.ilMembershipGUI.php.

References ILIAS\Repository\ctrl().

Referenced by ilLearningSequenceMembershipGUI\members().

1578  : void
1579  {
1580  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1581  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

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

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

851  : void
852  {
853  $this->showMailToMemberToolbarButton($this->toolbar, 'mailMembersBtn');
854  }
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 824 of file class.ilMembershipGUI.php.

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

824  : void
825  {
826  $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
827  if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
828  return;
829  }
830 
831  $map = ilMapUtil::getMapGUI();
832  $map->setMapId("course_map")
833  ->setWidth("700px")
834  ->setHeight("500px")
835  ->setLatitude($this->getParentObject()->getLatitude())
836  ->setLongitude($this->getParentObject()->getLongitude())
837  ->setZoom($this->getParentObject()->getLocationZoom())
838  ->setEnableTypeControl(true)
839  ->setEnableNavigationControl(true)
840  ->setEnableCentralMarker(true);
841 
842  $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
843  foreach ($members as $user_id) {
844  $map->addUserMarker($user_id);
845  }
846 
847  $this->tpl->setContent($map->getHtml());
848  $this->tpl->setLeftContent($map->getUserListHtml());
849  }
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 1117 of file class.ilMembershipGUI.php.

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

Referenced by participants().

1118  {
1119  $subscribers = $this->getMembersObject()->getSubscribers();
1120  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1121  if (!count($filtered_subscribers)) {
1122  return null;
1123  }
1124  $subscriber = $this->initSubscriberTable();
1125  $subscriber->readSubscriberData(
1126  $filtered_subscribers
1127  );
1128  return $subscriber;
1129  }
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 1293 of file class.ilMembershipGUI.php.

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

Referenced by participants().

1294  {
1295  $wait = $this->initWaitingList();
1296 
1297  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1298  if (!count($wait_users)) {
1299  return null;
1300  }
1301 
1302  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1303  $waiting_table->setUserIds(
1304  $wait_users
1305  );
1306  $waiting_table->readUserData();
1307  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1308 
1309  return $waiting_table;
1310  }
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 390 of file class.ilMembershipGUI.php.

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

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

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

References participants().

434  : void
435  {
436  $table = $this->initParticipantTableGUI();
437  $table->resetOffset();
438  $table->writeFilterToSession();
439 
440  $this->participants();
441  }
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 446 of file class.ilMembershipGUI.php.

References participants().

446  : void
447  {
448  $table = $this->initParticipantTableGUI();
449  $table->resetOffset();
450  $table->resetFilter();
451 
452  $this->participants();
453  }
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 1561 of file class.ilMembershipGUI.php.

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

1561  : void
1562  {
1563  $this->tabs->clearTargets();
1564  $this->tabs->setBackTarget(
1565  $this->lng->txt('back'),
1566  $this->ctrl->getLinkTarget($this, 'jump2UsersGallery')
1567  );
1568 
1569  $list = $this->initAttendanceList();
1570  $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1571  $list->initFromSettings();
1572  $list->setCallback([$this, 'getAttendanceListUserData']);
1573  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1574  $list->getNonMemberUserData($this->member_data);
1575  $list->getFullscreenHTML();
1576  }
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 1518 of file class.ilMembershipGUI.php.

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

1518  : void
1519  {
1520  $this->checkPermission('read');
1521 
1522  $this->tabs->clearTargets();
1523 
1524  $this->tabs->setBackTarget(
1525  $this->lng->txt('back'),
1526  $this->ctrl->getLinkTarget($this, 'participants')
1527  );
1528 
1529  $list = $this->initAttendanceList();
1530  $form = $list->initForm('printMembersOutput');
1531  $this->tpl->setContent($form->getHTML());
1532  }
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 1537 of file class.ilMembershipGUI.php.

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

1537  : void
1538  {
1539  $this->tabs->clearTargets();
1540  $this->tabs->setBackTarget(
1541  $this->lng->txt('back'),
1542  $this->ctrl->getLinkTarget($this, 'participants')
1543  );
1544 
1545  $list = $this->initAttendanceList();
1546  $list->initFromForm();
1547  $list->setCallback([$this, 'getAttendanceListUserData']);
1548  $this->member_data = $this->getPrintMemberData(
1550  $this->getMembersObject()->getParticipants()
1551  )
1552  );
1553 
1554  $list->getNonMemberUserData($this->member_data);
1555  $list->getFullscreenHTML();
1556  }
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 1101 of file class.ilMembershipGUI.php.

References getParentGUI().

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

1101  : array
1102  {
1103  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1104  }
+ 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 1438 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.

1438  : void
1439  {
1440  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1441  if (!count($waiting_list_ids)) {
1442  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
1443  $this->ctrl->redirect($this, 'participants');
1444  }
1445 
1446  $waiting_list = $this->initWaitingList();
1447 
1448  foreach ($waiting_list_ids as $user_id) {
1449  $waiting_list->removeFromList((int) $user_id);
1450 
1451  if ($this instanceof ilCourseMembershipGUI) {
1452  $this->getMembersObject()->sendNotification(
1454  (int) $user_id,
1455  true
1456  );
1457  }
1458  if ($this instanceof ilGroupMembershipGUI) {
1459  $this->getMembersObject()->sendNotification(
1461  (int) $user_id,
1462  true
1463  );
1464  }
1465  if ($this instanceof ilSessionMembershipGUI) {
1467  $noti->setRefId($this->getParentObject()->getRefId());
1468  $noti->setRecipients(array($user_id));
1470  $noti->send();
1471  }
1472  }
1473  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_users_removed_from_list'), true);
1474  $this->ctrl->redirect($this, 'participants');
1475  }
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 1202 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.

1202  : void
1203  {
1204  $subscribers = $this->initSubscribersFromPost();
1205  if (!count($subscribers)) {
1206  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1207  $this->ctrl->redirect($this, 'participants');
1208  }
1209 
1210  if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1211  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1212  $this->ctrl->redirect($this, 'participants');
1213  } else {
1214  foreach ($subscribers as $usr_id) {
1215  if ($this instanceof ilCourseMembershipGUI) {
1216  $this->getMembersObject()->sendNotification(
1218  $usr_id
1219  );
1220  }
1221  if ($this instanceof ilGroupMembershipGUI) {
1222  $this->getMembersObject()->sendNotification(
1224  $usr_id
1225  );
1226  }
1227  if ($this instanceof ilSessionMembershipGUI) {
1229  $noti->setRefId($this->getParentObject()->getRefId());
1230  $noti->setRecipients(array($usr_id));
1232  $noti->send();
1233  }
1234  if ($this instanceof ilLearningSequenceMembershipGUI) {
1235  $this->getMembersObject()->sendNotification(
1237  $usr_id
1238  );
1239  }
1240  }
1241  }
1242 
1243  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_deleted"), true);
1244  $this->ctrl->redirect($this, 'participants');
1245  }
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 778 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().

778  : void
779  {
780  $participants = [];
781  if ($this->http->wrapper()->post()->has('participants')) {
783  } elseif ($this->http->wrapper()->post()->has('subscribers')) {
785  } elseif ($this->http->wrapper()->post()->has('waiting')) {
787  } elseif ($this->http->wrapper()->query()->has('member_id')) {
788  $participants = [$this->initMemberIdFromGet()];
789  }
790  if (!count($participants)) {
791  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
792  $this->ctrl->redirect($this, 'participants');
793  }
794 
795  $rcps = [];
796  foreach ($participants as $usr_id) {
797  $rcps[] = ilObjUser::_lookupLogin($usr_id);
798  }
799  $context_options = $this->getMailContextOptions();
800 
804  $this,
805  'participants',
806  array(),
807  array(
808  'type' => 'new',
809  'sig' => $this->createMailSignature()
810  ),
811  $context_options
812  )
813  );
814  }
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 1025 of file class.ilMembershipGUI.php.

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

Referenced by executeCommand().

1025  : void
1026  {
1027  if ($this->checkRbacOrPositionAccessBool(
1028  'manage_members',
1029  'manage_members',
1030  $this->getParentObject()->getRefId()
1031  )) {
1032  $tabs->addSubTabTarget(
1033  $this->getParentObject()->getType() . "_member_administration",
1034  $this->ctrl->getLinkTarget($this, 'participants'),
1035  "members",
1036  get_class($this)
1037  );
1038 
1039  // show group overview
1040  if ($this instanceof ilCourseMembershipGUI) {
1041  $tabs->addSubTabTarget(
1042  "crs_members_groups",
1043  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1044  "",
1045  "ilCourseParticipantsGroupsGUI"
1046  );
1047  }
1048 
1049  $children = $this->tree->getSubTree(
1050  $this->tree->getNodeData($this->getParentObject()->getRefId()),
1051  false,
1052  ['sess']
1053  );
1054  if (count($children)) {
1055  $tabs->addSubTabTarget(
1056  'events',
1057  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilsessionoverviewgui'), 'listSessions'),
1058  '',
1059  'ilsessionoverviewgui'
1060  );
1061  }
1062  $tabs->addSubTabTarget(
1063  $this->getParentObject()->getType() . '_members_gallery',
1064  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1065  'view',
1066  'ilUsersGalleryGUI'
1067  );
1068  } elseif ($this->getParentObject()->getShowMembers()) {
1069  // gallery
1070  $tabs->addSubTabTarget(
1071  $this->getParentObject()->getType() . '_members_gallery',
1072  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilUsersGalleryGUI')),
1073  'view',
1074  'ilUsersGalleryGUI'
1075  );
1076  }
1077 
1078  if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1079  $tabs->addSubTabTarget(
1080  $this->getParentObject()->getType() . '_members_map',
1081  $this->ctrl->getLinkTarget($this, 'membersMap'),
1082  "membersMap",
1083  get_class($this)
1084  );
1085  }
1086 
1087  if (ilPrivacySettings::getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1088  $tabs->addSubTabTarget(
1089  'export_members',
1090  $this->ctrl->getLinkTargetByClass(array(get_class($this), 'ilmemberexportgui'), 'show'),
1091  '',
1092  'ilmemberexportgui'
1093  );
1094  }
1095  }
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 922 of file class.ilMembershipGUI.php.

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

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

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

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

Referenced by executeCommand().

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

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

Referenced by updateParticipants().

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

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

Definition at line 488 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().

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

Referenced by getCtrl().

◆ $error

ilErrorHandling ilMembershipGUI::$error
protected

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

◆ $http

GlobalHttpState ilMembershipGUI::$http
protected

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

◆ $lng

ilLanguage ilMembershipGUI::$lng
protected

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

Referenced by getLanguage().

◆ $logger

ilLogger ilMembershipGUI::$logger
protected

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

Referenced by getLogger().

◆ $member_data

array ilMembershipGUI::$member_data = []
protected

◆ $participants

◆ $rbacreview

ilRbacReview ilMembershipGUI::$rbacreview
protected

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

◆ $rbacsystem

ilRbacSystem ilMembershipGUI::$rbacsystem
protected

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

◆ $refinery

Factory ilMembershipGUI::$refinery
protected

◆ $repository_gui

ilObjectGUI ilMembershipGUI::$repository_gui
private

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

Referenced by __construct(), and getParentGUI().

◆ $repository_object

ilObject ilMembershipGUI::$repository_object
private

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

Referenced by getParentObject().

◆ $tabs

ilTabsGUI ilMembershipGUI::$tabs
protected

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

◆ $toolbar

ilToolbarGUI ilMembershipGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilMembershipGUI::$tpl
protected

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

◆ $tree

ilTree ilMembershipGUI::$tree
protected

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

◆ $user

ilObjUser ilMembershipGUI::$user
protected

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


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