ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables 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...
 
 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 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  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:

Member Function Documentation

◆ activateSubTab()

ilMembershipGUI::activateSubTab ( string  $a_sub_tab)
protected

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

References ILIAS\Repository\tabs().

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

1506  : void
1507  {
1508  $this->tabs->activateSubTab($a_sub_tab);
1509  }
+ 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 973 of file class.ilMembershipGUI.php.

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

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

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

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

References 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.

1342  : void
1343  {
1344  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1345  if (!count($waiting_list_ids)) {
1346  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1347  $this->ctrl->redirect($this, 'participants');
1348  }
1349 
1350  $waiting_list = $this->initWaitingList();
1351 
1352  $added_users = 0;
1353  foreach ($waiting_list_ids as $user_id) {
1354  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId((int) $user_id, false)) {
1355  continue;
1356  }
1357  if ($this->getMembersObject()->isAssigned((int) $user_id)) {
1358  continue;
1359  }
1360 
1361  if ($this instanceof ilCourseMembershipGUI) {
1362  $this->getMembersObject()->add($user_id, ilParticipants::IL_CRS_MEMBER);
1363  $this->getMembersObject()->sendNotification(
1365  (int) $user_id,
1366  true
1367  );
1368  $this->getParentObject()->checkLPStatusSync((int) $user_id);
1369  }
1370  if ($this instanceof ilGroupMembershipGUI) {
1371  $this->getMembersObject()->add($user_id, ilParticipants::IL_GRP_MEMBER);
1372  $this->getMembersObject()->sendNotification(
1374  (int) $user_id,
1375  true
1376  );
1377  }
1378  if ($this instanceof ilSessionMembershipGUI) {
1379  $this->getMembersObject()->register((int) $user_id);
1381  $noti->setRefId($this->getParentObject()->getRefId());
1382  $noti->setRecipients(array($user_id));
1384  $noti->send();
1385  }
1386 
1387  $waiting_list->removeFromList((int) $user_id);
1388  ++$added_users;
1389  }
1390 
1391  if ($added_users) {
1392  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_users_added"), true);
1393  } else {
1394  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_users_already_assigned"), true);
1395  }
1396  $this->ctrl->redirect($this, 'participants');
1397  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 1246 of file class.ilMembershipGUI.php.

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

1246  : void
1247  {
1248  $subscribers = $this->initSubscribersFromPost();
1249  if (!count($subscribers)) {
1250  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1251  $this->ctrl->redirect($this, 'participants');
1252  }
1253 
1254  if (!$this->getMembersObject()->assignSubscribers($subscribers)) {
1255  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1256  $this->ctrl->redirect($this, 'participants');
1257  } else {
1258  foreach ($subscribers as $usr_id) {
1259  if ($this instanceof ilCourseMembershipGUI) {
1260  $this->getMembersObject()->sendNotification(
1262  $usr_id
1263  );
1264  $this->getParentObject()->checkLPStatusSync($usr_id);
1265  }
1266  if ($this instanceof ilGroupMembershipGUI) {
1267  $this->getMembersObject()->sendNotification(
1269  $usr_id
1270  );
1271  }
1272  if ($this instanceof ilSessionMembershipGUI) {
1273  // todo refactor to participants
1275  $noti->setRefId($this->getParentObject()->getRefId());
1276  $noti->setRecipients(array($usr_id));
1278  $noti->send();
1279  }
1280  }
1281  }
1282  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_assigned"), true);
1283  $this->ctrl->redirect($this, 'participants');
1284  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
assignSubscribers()
Do assignment of subscription request.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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\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 1311 of file class.ilMembershipGUI.php.

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

1311  : void
1312  {
1313  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1314  if (!count($waiting_list_ids)) {
1315  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_users_selected"), true);
1316  $this->ctrl->redirect($this, 'participants');
1317  }
1318  $c_gui = new ilConfirmationGUI();
1319  // set confirm/cancel commands
1320  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1321  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1322  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1323  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1324 
1325  foreach ($waiting_list_ids as $waiting) {
1326  $name = ilObjUser::_lookupName($waiting);
1327 
1328  $c_gui->addItem(
1329  'waiting[]',
1330  (string) $name['user_id'],
1331  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1332  ilUtil::getImagePath('icon_usr.svg')
1333  );
1334  }
1335 
1336  $this->tpl->setContent($c_gui->getHTML());
1337  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmAssignSubscribers()

ilMembershipGUI::confirmAssignSubscribers ( )

Show subscription confirmation.

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

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

1137  : void
1138  {
1139  $subscribers = $this->initSubscribersFromPost();
1140  if (!count($subscribers)) {
1141  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1142  $this->ctrl->redirect($this, 'participants');
1143  }
1144 
1145  $c_gui = new ilConfirmationGUI();
1146 
1147  // set confirm/cancel commands
1148  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1149  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1150  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1151  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1152 
1153  foreach ($subscribers as $subscriber) {
1154  $name = ilObjUser::_lookupName($subscriber);
1155 
1156  $c_gui->addItem(
1157  'subscribers[]',
1158  (string) $name['user_id'],
1159  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1160  ilUtil::getImagePath('icon_usr.svg')
1161  );
1162  }
1163  $this->tpl->setContent($c_gui->getHTML());
1164  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

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

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

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

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

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

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

1402  : void
1403  {
1404  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1405  if (!count($waiting_list_ids)) {
1406  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
1407  $this->ctrl->redirect($this, 'participants');
1408  }
1409  $this->lng->loadLanguageModule('mmbr');
1410  $c_gui = new ilConfirmationGUI();
1411 
1412  // set confirm/cancel commands
1413  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1414  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1415  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1416  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1417 
1418  foreach ($waiting_list_ids as $waiting) {
1419  $name = ilObjUser::_lookupName($waiting);
1420 
1421  $c_gui->addItem(
1422  'waiting[]',
1423  (string) $name['user_id'],
1424  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1425  ilUtil::getImagePath('icon_usr.svg')
1426  );
1427  }
1428  $this->tpl->setContent($c_gui->getHTML());
1429  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ confirmRefuseSubscribers()

ilMembershipGUI::confirmRefuseSubscribers ( )

Refuse subscriber confirmation.

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

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

1169  : void
1170  {
1171  $subscribers = $this->initSubscribersFromPost();
1172  if (!count($subscribers)) {
1173  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1174  $this->ctrl->redirect($this, 'participants');
1175  }
1176  $this->lng->loadLanguageModule('mmbr');
1177  $c_gui = new ilConfirmationGUI();
1178  // set confirm/cancel commands
1179  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1180  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1181  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1182  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1183 
1184  foreach ($subscribers as $subscriber_id) {
1185  $name = ilObjUser::_lookupName($subscriber_id);
1186 
1187  $c_gui->addItem(
1188  'subscribers[]',
1189  (string) $name['user_id'],
1190  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1191  ilUtil::getImagePath('icon_usr.svg')
1192  );
1193  }
1194 
1195  $this->tpl->setContent($c_gui->getHTML());
1196  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _lookupName(int $a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:247
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ createMailSignature()

ilMembershipGUI::createMailSignature ( )

Create Mail signature.

Todo:
better implementation

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

References getParentGUI().

Referenced by sendMailToSelectedUsers().

951  : string
952  {
953  return $this->getParentGUI()->createMailSignature();
954  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

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

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

Referenced by ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses().

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

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

454  : void
455  {
456  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
457  $this->editParticipants(array($this->initMemberIdFromGet()));
458  }
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 464 of file class.ilMembershipGUI.php.

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

Referenced by editMember().

464  : void
465  {
466  if (!$post_participants) {
467  $post_participants = $this->initParticipantsFromPost();
468  }
469 
470  $real_participants = $this->getMembersObject()->getParticipants();
471  $participants = array_intersect($post_participants, $real_participants);
472 
473  if (!count($participants)) {
474  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
475  $this->ctrl->redirect($this, 'participants');
476  }
477  $table = $this->initEditParticipantTableGUI($participants);
478  $this->tpl->setContent($table->getHTML());
479  }
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() === 0 ||
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isAdmin(int $a_usr_id)
check if user is admin
Class ilMailMemberSearchGUI.
$provider
Definition: ltitoken.php:83
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 422 of file class.ilMembershipGUI.php.

422  : array
423  {
424  return [];
425  }

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by executeCommand().

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

Referenced by executeCommand(), and showParticipantsToolbar().

1501  : ?int
1502  {
1503  return null;
1504  }
+ 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 1105 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by executeCommand().

1105  : array
1106  {
1107  return $this->getParentGUI()->getLocalRoles();
1108  }
+ 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  }

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected

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

Referenced by sendMailToSelectedUsers().

812  : array
813  {
814  return [];
815  }
+ Here is the caller graph for this function:

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected

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

Referenced by executeCommand().

162  {
163  return null;
164  }
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
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 1013 of file class.ilMembershipGUI.php.

References ILIAS\Repository\lng().

Referenced by addMemberTab().

1013  : string
1014  {
1015  return $this->lng->txt('members');
1016  }
+ 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(), 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:

◆ initAttendanceList()

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

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

1579  : ?ilAttendanceList
1580  {
1581  global $DIC;
1582 
1583  $waiting_list = $this->initWaitingList();
1584 
1585  if ($this instanceof ilSessionMembershipGUI) {
1586  $member_id = $DIC->repositoryTree()->checkForParentType(
1587  $this->getParentObject()->getRefId(),
1588  'grp'
1589  );
1590  if (!$member_id) {
1591  $member_id = $DIC->repositoryTree()->checkForParentType(
1592  $this->getParentObject()->getRefId(),
1593  'crs'
1594  );
1595  }
1596  if (!$member_id) {
1597  $DIC->logger()->sess()->warning('Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
1598  $member_id = $this->getParentObject()->getRefId();
1599  }
1600  $part = ilParticipants::getInstance($member_id);
1601 
1602  $list = new ilAttendanceList(
1603  $this,
1604  $this->getParentObject(),
1605  $part,
1606  $waiting_list
1607  );
1608  } else {
1609  $list = new ilAttendanceList(
1610  $this,
1611  $this->getParentObject(),
1612  $this->getMembersObject(),
1613  $waiting_list
1614  );
1615  }
1616  $list->setId($this->getParentObject()->getType() . '_memlist_' . $this->getParentObject()->getId());
1617 
1618  $list->setTitle(
1619  $this->lng->txt($this->getParentObject()->getType() . '_members_print_title'),
1620  $this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle()
1621  );
1622 
1623  $show_tracking =
1624  (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
1625  if ($show_tracking) {
1626  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
1627  $show_tracking = $olp->isActive();
1628  }
1629  if ($show_tracking && $this->getParentObject()->getType() !== 'sess') {
1630  $list->addPreset('progress', $this->lng->txt('learning_progress'), true);
1631  }
1632 
1633  $privacy = ilPrivacySettings::getInstance();
1634  if ($privacy->enabledAccessTimesByType($this->getParentObject()->getType())) {
1635  $list->addPreset('access', $this->lng->txt('last_access'), true);
1636  }
1637 
1638  switch ($this->getParentObject()->getType()) {
1639  case 'crs':
1640  $list->addPreset('status', $this->lng->txt('crs_status'), true);
1641  $list->addPreset('passed', $this->lng->txt('crs_passed'), true);
1642  break;
1643 
1644  case 'sess':
1645  $list->addPreset('mark', $this->lng->txt('trac_mark'), true);
1646  $list->addPreset('comment', $this->lng->txt('trac_comment'), true);
1647  if ($this->getParentObject()->enabledRegistration()) {
1648  $list->addPreset('registered', $this->lng->txt('event_tbl_registered'), true);
1649  }
1650  $list->addPreset('participated', $this->lng->txt('event_tbl_participated'), true);
1651  $list->addBlank($this->lng->txt('sess_signature'));
1652 
1653  $list->addUserFilter('registered', $this->lng->txt('event_list_registered_only'));
1654  break;
1655 
1656  case 'grp':
1657  default:
1658  break;
1659  }
1660  return $list;
1661  }
static getInstance(int $a_ref_id)
Base class for attendance lists.
global $DIC
Definition: feed.php:28
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 1127 of file class.ilMembershipGUI.php.

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

Referenced by parseSubscriberTable().

1128  {
1129  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1130  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1131  return $subscriber;
1132  }
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 1574 of file class.ilMembershipGUI.php.

References ILIAS\Repository\ctrl().

1574  : void
1575  {
1576  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1577  }
+ Here is the call graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

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

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

847  : void
848  {
849  $this->showMailToMemberToolbarButton($this->toolbar, 'mailMembersBtn');
850  }
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 820 of file class.ilMembershipGUI.php.

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

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

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

Referenced by participants().

1114  {
1115  $subscribers = $this->getMembersObject()->getSubscribers();
1116  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1117  if (!count($filtered_subscribers)) {
1118  return null;
1119  }
1120  $subscriber = $this->initSubscriberTable();
1121  $subscriber->readSubscriberData(
1122  $filtered_subscribers
1123  );
1124  return $subscriber;
1125  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
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 1289 of file class.ilMembershipGUI.php.

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

Referenced by participants().

1290  {
1291  $wait = $this->initWaitingList();
1292 
1293  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1294  if (!count($wait_users)) {
1295  return null;
1296  }
1297 
1298  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1299  $waiting_table->setUserIds(
1300  $wait_users
1301  );
1302  $waiting_table->readUserData();
1303  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1304 
1305  return $waiting_table;
1306  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
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(), ILIAS\Repository\lng(), parseSubscriberTable(), parseWaitingListTable(), and showParticipantsToolbar().

Referenced by getMembersObject(), 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->lng->txt($this->getParentObject()->getType() . '_mem_tbl_header'));
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 430 of file class.ilMembershipGUI.php.

References participants().

430  : void
431  {
432  $table = $this->initParticipantTableGUI();
433  $table->resetOffset();
434  $table->writeFilterToSession();
435 
436  $this->participants();
437  }
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 442 of file class.ilMembershipGUI.php.

References participants().

442  : void
443  {
444  $table = $this->initParticipantTableGUI();
445  $table->resetOffset();
446  $table->resetFilter();
447 
448  $this->participants();
449  }
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 1557 of file class.ilMembershipGUI.php.

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

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

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

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

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

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

References getParentGUI().

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

1097  : array
1098  {
1099  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1100  }
+ 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 1434 of file class.ilMembershipGUI.php.

References 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.

1434  : void
1435  {
1436  $waiting_list_ids = $this->initWaitingListIdsFromPost();
1437  if (!count($waiting_list_ids)) {
1438  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
1439  $this->ctrl->redirect($this, 'participants');
1440  }
1441 
1442  $waiting_list = $this->initWaitingList();
1443 
1444  foreach ($waiting_list_ids as $user_id) {
1445  $waiting_list->removeFromList((int) $user_id);
1446 
1447  if ($this instanceof ilCourseMembershipGUI) {
1448  $this->getMembersObject()->sendNotification(
1450  (int) $user_id,
1451  true
1452  );
1453  }
1454  if ($this instanceof ilGroupMembershipGUI) {
1455  $this->getMembersObject()->sendNotification(
1457  (int) $user_id,
1458  true
1459  );
1460  }
1461  if ($this instanceof ilSessionMembershipGUI) {
1463  $noti->setRefId($this->getParentObject()->getRefId());
1464  $noti->setRecipients(array($user_id));
1466  $noti->send();
1467  }
1468  }
1469  $this->tpl->setOnScreenMessage('success', $this->lng->txt('crs_users_removed_from_list'), true);
1470  $this->ctrl->redirect($this, 'participants');
1471  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
GUI class for membership features.
+ Here is the call graph for this function:

◆ refuseSubscribers()

ilMembershipGUI::refuseSubscribers ( )
protected

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

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

1198  : void
1199  {
1200  $subscribers = $this->initSubscribersFromPost();
1201  if (!count($subscribers)) {
1202  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_no_subscribers_selected"), true);
1203  $this->ctrl->redirect($this, 'participants');
1204  }
1205 
1206  if (!$this->getMembersObject()->deleteSubscribers($subscribers)) {
1207  $this->tpl->setOnScreenMessage('failure', $this->error->getMessage(), true);
1208  $this->ctrl->redirect($this, 'participants');
1209  } else {
1210  foreach ($subscribers as $usr_id) {
1211  if ($this instanceof ilCourseMembershipGUI) {
1212  $this->getMembersObject()->sendNotification(
1214  $usr_id
1215  );
1216  }
1217  if ($this instanceof ilGroupMembershipGUI) {
1218  $this->getMembersObject()->sendNotification(
1220  $usr_id
1221  );
1222  }
1223  if ($this instanceof ilSessionMembershipGUI) {
1225  $noti->setRefId($this->getParentObject()->getRefId());
1226  $noti->setRecipients(array($usr_id));
1228  $noti->send();
1229  }
1230  if ($this instanceof ilLearningSequenceMembershipGUI) {
1231  $this->getMembersObject()->sendNotification(
1233  $usr_id
1234  );
1235  }
1236  }
1237  }
1238 
1239  $this->tpl->setOnScreenMessage('success', $this->lng->txt("crs_subscribers_deleted"), true);
1240  $this->ctrl->redirect($this, 'participants');
1241  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 774 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().

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

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

Referenced by executeCommand().

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

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

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

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

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

Referenced by executeCommand().

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

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

Referenced by updateParticipants().

655  : void
656  {
657  }
+ Here is the caller graph for this function:

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

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

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

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

◆ $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: