ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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)
 Constructor. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 getParentObject ()
 Get parent object. More...
 
 getMembersObject ()
 Get member object. More...
 
 filterUserIdsByRbacOrPositionOfCurrentUser ($a_user_ids)
 Filter user ids by access. More...
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 
 addMemberTab (ilTabsGUI $tabs, $a_is_participant=false)
 add member tab More...
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 Get parent roles. More...
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request type $rbacsystem type $ilErr. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list type $rbacsystem. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 checkPermissionBool ($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
 Check permission. More...
 
 checkRbacOrPositionAccessBool ($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
 Check if rbac or position access is granted. More...
 
 checkPermission ($a_permission, $a_cmd="")
 Check permission If not granted redirect to parent gui. More...
 
 checkRbacOrPermissionAccess ($a_rbac_perm, $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 ($post_participants=array())
 Edit participants. More...
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 Send mail to selected users. More...
 
 getMailContextOptions ()
 Get mail context options. More...
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 Mail to members view type $ilToolbar. More...
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMemberExportToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show member export button. More...
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show mail to member toolbar button. More...
 
 getDefaultCommand ()
 Get default command. More...
 
 getMemberTabName ()
 Get member tab name. More...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 refuseSubscribers ()
 Refuse subscribers type $rbacsystem. More...
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 printMembers ()
 Print members. More...
 
 printMembersOutput ()
 print members output More...
 
 printForMembersOutput ()
 print members output More...
 
 jump2UsersGallery ()
 

Protected Attributes

 $lng = null
 
 $ctrl = null
 
 $logger = null
 
 $tpl
 
 $access
 

Private Attributes

 $repository_object = null
 
 $repository_gui = null
 

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
ilObject$repository_obj

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

References $DIC, $GLOBALS, $repository_gui, and getParentObject().

54  {
55  global $DIC;
56 
57  $this->repository_gui = $repository_gui;
58  $this->repository_object = $repository_obj;
59 
60  $this->lng = $GLOBALS['DIC']->language();
61  $this->lng->loadLanguageModule('crs');
62  $this->lng->loadLanguageModule($this->getParentObject()->getType());
63  $this->tpl = $GLOBALS['DIC']->ui()->mainTemplate();
64  $this->ctrl = $GLOBALS['DIC']->ctrl();
65  $this->logger = $DIC->logger()->mmbr();
66  $this->access = $GLOBALS['DIC']->access();
67  }
global $DIC
Definition: saml.php:7
getParentObject()
Get parent object.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

Member Function Documentation

◆ addMemberTab()

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

add member tab

Parameters
ilTabsGUI$tabs

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

References $DIC, $GLOBALS, ilTabsGUI\addTab(), checkRbacOrPositionAccessBool(), getMemberTabName(), and getParentObject().

999  {
1000  global $DIC;
1001 
1002  $ilAccess = $DIC['ilAccess'];
1003 
1004  include_once './Services/Mail/classes/class.ilMail.php';
1005  $mail = new ilMail($GLOBALS['DIC']['ilUser']->getId());
1006 
1007  $member_tab_name = $this->getMemberTabName();
1008 
1009  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
1010  'manage_members',
1011  'manage_members',
1012  $this->getParentObject()->getRefId()
1013  );
1014 
1015  if ($has_manage_members_permission) {
1016  $tabs->addTab(
1017  'members',
1018  $member_tab_name,
1019  $this->ctrl->getLinkTarget($this, '')
1020  );
1021  } elseif (
1022  (bool) $this->getParentObject()->getShowMembers() && $a_is_participant
1023  ) {
1024  $tabs->addTab(
1025  'members',
1026  $member_tab_name,
1027  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilusersgallerygui'), 'view')
1028  );
1029  } elseif (
1030  $this->getParentObject()->getMailToMembersType() == 1 &&
1031  $GLOBALS['DIC']['rbacsystem']->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1032  $a_is_participant
1033  ) {
1034  $tabs->addTab(
1035  'members',
1036  $member_tab_name,
1037  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1038  );
1039  }
1040  }
global $DIC
Definition: saml.php:7
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
getParentObject()
Get parent object.
getMemberTabName()
Get member tab name.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

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

References $_POST, $GLOBALS, $users, ilUserClipboard\getInstance(), and ilUtil\sendFailure().

1545  {
1546  $users = (array) $_POST['participants'];
1547  if (!count($users)) {
1548  ilUtil::sendFailure($this->lng->txt('select_one'), true);
1549  $this->ctrl->redirect($this, 'participants');
1550  }
1551  include_once './Services/User/classes/class.ilUserClipboard.php';
1552  $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
1553  $clip->add($users);
1554  $clip->save();
1555 
1556  $this->lng->loadLanguageModule('user');
1557  ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
1558  $this->ctrl->redirect($this, 'participants');
1559  }
static getInstance($a_usr_id)
Get singelton instance.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ assignFromWaitingList()

ilMembershipGUI::assignFromWaitingList ( )

Assign from waiting list type $rbacsystem.

Returns
boolean

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

References $_POST, ilObjectFactory\getInstanceByObjId(), getMembersObject(), getParentObject(), IL_CRS_MEMBER, IL_GRP_MEMBER, ilUtil\sendFailure(), ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

1409  {
1410  if (!array_key_exists('waiting', $_POST) || !count($_POST["waiting"])) {
1411  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1412  $this->ctrl->redirect($this, 'participants');
1413  }
1414 
1415  $waiting_list = $this->initWaitingList();
1416 
1417  $added_users = 0;
1418  foreach ($_POST["waiting"] as $user_id) {
1419  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1420  continue;
1421  }
1422  if ($this->getMembersObject()->isAssigned($user_id)) {
1423  continue;
1424  }
1425 
1426  if ($this instanceof ilCourseMembershipGUI) {
1427  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
1428  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
1429  $this->getParentObject()->checkLPStatusSync($user_id);
1430  }
1431  if ($this instanceof ilGroupMembershipGUI) {
1432  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1433  $this->getMembersObject()->add($user_id, IL_GRP_MEMBER);
1434  $this->getMembersObject()->sendNotification(
1436  $user_id,
1437  true
1438  );
1439  }
1440  if ($this instanceof ilSessionMembershipGUI) {
1441  $this->getMembersObject()->register($user_id);
1443  $noti->setRefId($this->getParentObject()->getRefId());
1444  $noti->setRecipients(array($user_id));
1446  $noti->send();
1447  }
1448 
1449  $waiting_list->removeFromList($user_id);
1450  ++$added_users;
1451  }
1452 
1453  if ($added_users) {
1454  ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
1455  $this->ctrl->redirect($this, 'participants');
1456  } else {
1457  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
1458  $this->ctrl->redirect($this, 'participants');
1459  }
1460  }
getMembersObject()
Get member object.
const IL_GRP_MEMBER
const IL_CRS_MEMBER
GUI class for membership features.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
GUI class for membership features.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ assignSubscribers()

ilMembershipGUI::assignSubscribers ( )

Do assignment of subscription request type $rbacsystem type $ilErr.

Returns
boolean

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

References $_POST, $DIC, $ilErr, getMembersObject(), getParentObject(), ilUtil\sendFailure(), ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER.

1302  {
1303  global $DIC;
1304 
1305  $ilErr = $DIC['ilErr'];
1306 
1307  if (!is_array($_POST["subscribers"])) {
1308  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1309  $this->ctrl->redirect($this, 'participants');
1310  }
1311 
1312  if (!$this->getMembersObject()->assignSubscribers($_POST["subscribers"])) {
1313  ilUtil::sendFailure($ilErr->getMessage(), true);
1314  $this->ctrl->redirect($this, 'participants');
1315  } else {
1316  foreach ($_POST["subscribers"] as $usr_id) {
1317  if ($this instanceof ilCourseMembershipGUI) {
1318  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER, $usr_id);
1319  $this->getParentObject()->checkLPStatusSync($usr_id);
1320  }
1321  if ($this instanceof ilGroupMembershipGUI) {
1322  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1323  $this->getMembersObject()->sendNotification(
1325  $usr_id
1326  );
1327  }
1328  if ($this instanceof ilSessionMembershipGUI) {
1329  // todo refactor to participants
1330  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1332  $noti->setRefId($this->getParentObject()->getRefId());
1333  $noti->setRecipients(array($usr_id));
1335  $noti->send();
1336  }
1337  }
1338  }
1339  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_assigned"), true);
1340  $this->ctrl->redirect($this, 'participants');
1341  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
assignSubscribers()
Do assignment of subscription request type $rbacsystem type $ilErr.
GUI class for membership features.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
GUI class for membership features.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ canAddOrSearchUsers()

ilMembershipGUI::canAddOrSearchUsers ( )
protected

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

Returns
bool

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

References checkPermissionBool().

Referenced by showParticipantsToolbar().

197  {
198  return $this->checkPermissionBool('manage_members');
199  }
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
Check permission.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermission()

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

Check permission If not granted redirect to parent gui.

Parameters
string$a_permission
string$a_cmd

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

References checkPermissionBool(), getParentGUI(), and ilUtil\sendFailure().

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

169  {
170  if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
171  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
172  $this->ctrl->redirect($this->getParentGUI());
173  }
174  }
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
Check permission.
getParentGUI()
Get parent gui.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissionBool()

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

Check permission.

Parameters
type$a_permission
type$a_cmd
type$a_type
type$a_ref_id

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

References getParentObject().

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

140  {
141  if (!$a_ref_id) {
142  $a_ref_id = $this->getParentObject()->getRefId();
143  }
144  return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
145  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRbacOrPermissionAccess()

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

check rbac or position access

Parameters
$a_rbac_perm
$a_pos_perm

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

References checkRbacOrPositionAccessBool(), getParentGUI(), and ilUtil\sendFailure().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

183  {
184  if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
185  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
186  $this->ctrl->redirect($this->getParentGUI());
187  }
188  }
getParentGUI()
Get parent gui.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkRbacOrPositionAccessBool()

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

Check if rbac or position access is granted.

Parameters
string$a_rbac_perm
string$a_pos_perm
int$a_ref_id

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

References getParentObject().

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

154  {
155  if (!$a_ref_id) {
156  $a_ref_id = $this->getParentObject()->getRefId();
157  }
158  return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
159  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmAssignFromWaitingList()

ilMembershipGUI::confirmAssignFromWaitingList ( )

Assign from waiting list (confirmatoin)

Returns
boolean

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

References $_POST, $name, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1372  {
1373  if (!is_array($_POST["waiting"])) {
1374  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1375  $this->ctrl->redirect($this, 'participants');
1376  }
1377 
1378 
1379  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1380  $c_gui = new ilConfirmationGUI();
1381 
1382  // set confirm/cancel commands
1383  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1384  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1385  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1386  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1387 
1388  foreach ($_POST["waiting"] as $waiting) {
1389  $name = ilObjUser::_lookupName($waiting);
1390 
1391  $c_gui->addItem(
1392  'waiting[]',
1393  $name['user_id'],
1394  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1395  ilUtil::getImagePath('icon_usr.svg')
1396  );
1397  }
1398 
1399  $this->tpl->setContent($c_gui->getHTML());
1400  return true;
1401  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmAssignSubscribers()

ilMembershipGUI::confirmAssignSubscribers ( )

Show subscription confirmation.

Returns
boolean

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

References $_POST, $name, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1177  {
1178  if (!is_array($_POST["subscribers"])) {
1179  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1180  $this->ctrl->redirect($this, 'participants');
1181  }
1182 
1183  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1184  $c_gui = new ilConfirmationGUI();
1185 
1186  // set confirm/cancel commands
1187  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1188  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1189  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1190  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1191 
1192  foreach ($_POST["subscribers"] as $subscribers) {
1193  $name = ilObjUser::_lookupName($subscribers);
1194 
1195  $c_gui->addItem(
1196  'subscribers[]',
1197  $name['user_id'],
1198  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1199  ilUtil::getImagePath('icon_usr.svg')
1200  );
1201  }
1202 
1203  $this->tpl->setContent($c_gui->getHTML());
1204  return true;
1205  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

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

References $_POST, $DIC, $GLOBALS, $ilUser, $name, ilObjUser\_lookupName(), checkPermissionBool(), ilUtil\getImagePath(), getMembersObject(), ilUtil\sendFailure(), and ilUtil\sendInfo().

624  {
625  global $DIC;
626 
627  $ilAccess = $DIC['ilAccess'];
628  $ilUser = $DIC['ilUser'];
629 
630  $participants = (array) $_POST['participants'];
631 
632  if (!count($participants)) {
633  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
634  $this->ctrl->redirect($this, 'participants');
635  }
636 
637  // Check last admin
638  if (!$this->getMembersObject()->checkLastAdmin($participants)) {
639  ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
640  $this->ctrl->redirect($this, 'participants');
641  }
642 
643  // if only position access is granted, show additional info
644  if (!$this->checkPermissionBool('manage_members')) {
645  $this->lng->loadLanguageModule('rbac');
646  ilUtil::sendInfo($this->lng->txt('rbac_info_only_position_access'));
647  }
648 
649 
650  // Access check for admin deletion
651  if (
652  !$ilAccess->checkAccess(
653  'edit_permission',
654  '',
655  $this->getParentObject()->getRefId()
656  ) &&
657  !$this->getMembersObject()->isAdmin($GLOBALS['DIC']['ilUser']->getId())
658  ) {
659  foreach ($participants as $usr_id) {
660  if ($this->getMembersObject()->isAdmin($usr_id)) {
661  ilUtil::sendFailure($this->lng->txt("msg_no_perm_perm"), true);
662  $this->ctrl->redirect($this, 'participants');
663  }
664  }
665  }
666 
667 
668  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
669  $confirm = new ilConfirmationGUI();
670  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
671  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
672  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
673  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
674 
675  foreach ($participants as $usr_id) {
676  $name = ilObjUser::_lookupName($usr_id);
677 
678  $confirm->addItem(
679  'participants[]',
680  $name['user_id'],
681  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
682  ilUtil::getImagePath('icon_usr.svg')
683  );
684  }
685 
686  $this->tpl->setContent($confirm->getHTML());
687  }
static _lookupName($a_user_id)
lookup user name
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
Check permission.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

Returns
boolean

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

References $_POST, $name, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1467  {
1468  if (!is_array($_POST["waiting"])) {
1469  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1470  $this->ctrl->redirect($this, 'participants');
1471  }
1472 
1473  $this->lng->loadLanguageModule('mmbr');
1474 
1475  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1476  $c_gui = new ilConfirmationGUI();
1477 
1478  // set confirm/cancel commands
1479  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1480  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1481  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1482  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1483 
1484  foreach ($_POST["waiting"] as $waiting) {
1485  $name = ilObjUser::_lookupName($waiting);
1486 
1487  $c_gui->addItem(
1488  'waiting[]',
1489  $name['user_id'],
1490  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1491  ilUtil::getImagePath('icon_usr.svg')
1492  );
1493  }
1494 
1495  $this->tpl->setContent($c_gui->getHTML());
1496  return true;
1497  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRefuseSubscribers()

ilMembershipGUI::confirmRefuseSubscribers ( )

Refuse subscriber confirmation.

Returns
boolean

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

References $_POST, $name, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

1212  {
1213  if (!is_array($_POST["subscribers"])) {
1214  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1215  $this->ctrl->redirect($this, 'participants');
1216  }
1217 
1218  $this->lng->loadLanguageModule('mmbr');
1219 
1220  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1221  $c_gui = new ilConfirmationGUI();
1222 
1223  // set confirm/cancel commands
1224  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1225  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1226  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1227  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1228 
1229  foreach ($_POST["subscribers"] as $subscribers) {
1230  $name = ilObjUser::_lookupName($subscribers);
1231 
1232  $c_gui->addItem(
1233  'subscribers[]',
1234  $name['user_id'],
1235  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1236  ilUtil::getImagePath('icon_usr.svg')
1237  );
1238  }
1239 
1240  $this->tpl->setContent($c_gui->getHTML());
1241  return true;
1242  }
static _lookupName($a_user_id)
lookup user name
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ createMailSignature()

ilMembershipGUI::createMailSignature ( )
Todo:
better implementation Create Mail signature

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

References getParentGUI().

Referenced by sendMailToSelectedUsers().

968  {
969  return $this->getParentGUI()->createMailSignature();
970  }
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deleteParticipants()

ilMembershipGUI::deleteParticipants ( )
protected

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

References $_POST, $DIC, $GLOBALS, $ilUser, getMembersObject(), getParentObject(), ilUtil\sendFailure(), ilLearningSequenceMembershipMailNotification\TYPE_DISMISS_MEMBER, and ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER.

690  {
691  global $DIC;
692 
693  $rbacreview = $DIC['rbacreview'];
694  $rbacsystem = $DIC['rbacsystem'];
695  $ilAccess = $DIC['ilAccess'];
696  $ilUser = $DIC['ilUser'];
697 
698  $participants = (array) $_POST['participants'];
699 
700  if (!is_array($participants) or !count($participants)) {
701  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
702  $this->ctrl->redirect($this, 'participants');
703  }
704 
705  // If the user doesn't have the edit_permission and is not administrator, he may not remove
706  // members who have the course administrator role
707  if (
708  !$ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
709  !$this->getMembersObject()->isAdmin($GLOBALS['DIC']['ilUser']->getId())
710  ) {
711  foreach ($participants as $part) {
712  if ($this->getMembersObject()->isAdmin($part)) {
713  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'), true);
714  $this->ctrl->redirect($this, 'participants');
715  }
716  }
717  }
718 
719  if (!$this->getMembersObject()->deleteParticipants($participants)) {
720  ilUtil::sendFailure('Error deleting participants.', true);
721  $this->ctrl->redirect($this, 'participants');
722  } else {
723  foreach ((array) $_POST["participants"] as $usr_id) {
724  $mail_type = 0;
725  // @todo more generic
726  switch ($this->getParentObject()->getType()) {
727  case 'crs':
728  $mail_type = $this->getMembersObject()->NOTIFY_DISMISS_MEMBER;
729  break;
730  case 'grp':
731  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
733  break;
734  case 'lso':
736  break;
737  }
738  $this->getMembersObject()->sendNotification($mail_type, $usr_id);
739  }
740  }
741  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
742  $this->ctrl->redirect($this, "participants");
743 
744  return true;
745  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ editMember()

ilMembershipGUI::editMember ( )
protected

Edit one participant.

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

References editParticipants(), and getParentObject().

460  {
461  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
462  return $this->editParticipants(array($_REQUEST['member_id']));
463  }
getParentObject()
Get parent object.
editParticipants($post_participants=array())
Edit participants.
+ Here is the call graph for this function:

◆ editParticipants()

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

Edit participants.

Parameters
array$post_participants

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

References $_POST, $table, getMembersObject(), and ilUtil\sendFailure().

Referenced by editMember().

470  {
471  if (!$post_participants) {
472  $post_participants = (array) $_POST['participants'];
473  }
474 
475  $real_participants = $this->getMembersObject()->getParticipants();
476  $participants = array_intersect((array) $post_participants, (array) $real_participants);
477 
478  if (!count($participants)) {
479  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
480  $this->ctrl->redirect($this, 'participants');
481  }
482  $table = $this->initEditParticipantTableGUI($participants);
483  $this->tpl->setContent($table->getHTML());
484  return true;
485  }
getMembersObject()
Get member object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if(empty($password)) $table
Definition: pwgen.php:24
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser (   $a_user_ids)

◆ getCtrl()

ilMembershipGUI::getCtrl ( )
protected
Returns
ilCtrl

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

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

81  {
82  return $this->ctrl;
83  }
+ Here is the caller graph for this function:

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

Get default command.

Returns
string

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

977  {
978  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
979  'manage_members',
980  'manage_members',
981  $this->getParentObject()->getRefId()
982  );
983  if ($has_manage_members_permission) {
984  return 'participants';
985  }
986 
987  if ($this->getParentObject()->getShowMembers()) {
988  return 'jump2UsersGallery';
989  }
990  return 'mailMembersBtn';
991  }
getParentObject()
Get parent object.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultRole()

ilMembershipGUI::getDefaultRole ( )
protected
Returns
null

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

References $GLOBALS, and $tabs.

Referenced by showParticipantsToolbar().

1565  {
1566  return null;
1567  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected
Returns
ilLanguage

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

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

73  {
74  return $this->lng;
75  }
+ Here is the caller graph for this function:

◆ getLocalRoles()

ilMembershipGUI::getLocalRoles ( )

Get parent roles.

Returns
type

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

References getParentGUI().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1141  {
1142  return $this->getParentGUI()->getLocalRoles();
1143  }
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLogger()

ilMembershipGUI::getLogger ( )
protected
Returns

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

References $logger.

89  {
90  return $this->logger;
91  }

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected

Get mail context options.

Returns
array

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

Referenced by sendMailToSelectedUsers().

795  {
796  $context_options = [];
797  return $context_options;
798  }
+ Here is the caller graph for this function:

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected
Returns
null

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

128  {
129  return null;
130  }
+ Here is the caller graph for this function:

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

Get member object.

Returns
ilParticipants

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

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

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

117  {
118  if ($this->participants instanceof ilParticipants) {
119  return $this->participants;
120  }
121  return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
122  }
static getInstance($a_ref_id)
Get instance by ref_id.
participants()
Show participant table, subscriber table, wating list table;.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMemberTabName()

ilMembershipGUI::getMemberTabName ( )
protected

Get member tab name.

Returns
string

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

Referenced by addMemberTab().

1047  {
1048  return $this->lng->txt('members');
1049  }
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Get parent object.

Returns
ilObject

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

References $repository_object.

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

108  {
110  }
+ Here is the caller graph for this function:

◆ initSubscriberTable()

ilMembershipGUI::initSubscriberTable ( )
protected
Returns

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

References getParentObject().

Referenced by parseSubscriberTable().

1166  {
1167  $subscriber = new \ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1168  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1169  return $subscriber;
1170  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ jump2UsersGallery()

ilMembershipGUI::jump2UsersGallery ( )
protected

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

References $DIC, $list, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilPrivacySettings\_getInstance(), ilObjectLP\getInstance(), ilParticipants\getInstance(), getMembersObject(), and getParentObject().

1650  {
1651  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1652  }
+ Here is the call graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

Mail to members view type $ilToolbar.

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

References $DIC, $GLOBALS, and showMailToMemberToolbarButton().

841  {
842  global $DIC;
843 
844  $ilToolbar = $DIC['ilToolbar'];
845 
846  $this->showMailToMemberToolbarButton($GLOBALS['DIC']['ilToolbar'], 'mailMembersBtn');
847  }
global $DIC
Definition: saml.php:7
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

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

References $DIC, $map, $tpl, ilParticipants\getInstanceByObjId(), ilMapUtil\getMapGUI(), getParentObject(), and ilMapUtil\isActivated().

805  {
806  global $DIC;
807 
808  $tpl = $DIC['tpl'];
809  $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
810  include_once("./Services/Maps/classes/class.ilMapUtil.php");
811  if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
812  return;
813  }
814 
816  $map->setMapId("course_map")
817  ->setWidth("700px")
818  ->setHeight("500px")
819  ->setLatitude($this->getParentObject()->getLatitude())
820  ->setLongitude($this->getParentObject()->getLongitude())
821  ->setZoom($this->getParentObject()->getLocationZoom())
822  ->setEnableTypeControl(true)
823  ->setEnableNavigationControl(true)
824  ->setEnableCentralMarker(true);
825 
826  include_once './Services/Membership/classes/class.ilParticipants.php';
827  $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
828  foreach ((array) $members as $user_id) {
829  $map->addUserMarker($user_id);
830  }
831 
832  $tpl->setContent($map->getHTML());
833  $tpl->setLeftContent($map->getUserListHTML());
834  }
global $DIC
Definition: saml.php:7
static getMapGUI()
Get an instance of the GUI class.
static isActivated()
Checks whether Map feature is activated.
getParentObject()
Get parent object.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ Here is the call graph for this function:

◆ parseSubscriberTable()

ilMembershipGUI::parseSubscriberTable ( )
protected

Parse table of subscription request.

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

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

Referenced by participants().

1149  {
1150  $subscribers = $this->getMembersObject()->getSubscribers();
1151  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1152  if (!count($filtered_subscribers)) {
1153  return null;
1154  }
1155  $subscriber = $this->initSubscriberTable();
1156  $subscriber->readSubscriberData(
1157  $filtered_subscribers
1158  );
1159  return $subscriber;
1160  }
getMembersObject()
Get member object.
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
+ 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.

Returns
ilWaitingListTableGUI

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

References filterUserIdsByRbacOrPositionOfCurrentUser(), and getParentObject().

Referenced by participants().

1348  {
1349  $wait = $this->initWaitingList();
1350 
1351  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1352  if (!count($wait_users)) {
1353  return null;
1354  }
1355 
1356  include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
1357  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1358  $waiting_table->setUserIds(
1359  $wait_users
1360  );
1361  $waiting_table->readUserData();
1362  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1363 
1364  return $waiting_table;
1365  }
GUI class for course/group waiting list.
getParentObject()
Get parent object.
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
+ 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 400 of file class.ilMembershipGUI.php.

References $table, getParentObject(), parseSubscriberTable(), parseWaitingListTable(), and showParticipantsToolbar().

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

401  {
402  $this->initParticipantTemplate();
403  $this->showParticipantsToolbar();
404  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
405 
406  // show waiting list table
407  $waiting = $this->parseWaitingListTable();
408  if ($waiting instanceof ilWaitingListTableGUI) {
409  $this->tpl->setVariable('TABLE_WAIT', $waiting->getHTML());
410  }
411 
412  // show subscriber table
413  $subscriber = $this->parseSubscriberTable();
414  if ($subscriber instanceof ilSubscriberTableGUI) {
415  $this->tpl->setVariable('TABLE_SUB', $subscriber->getHTML());
416  }
417 
418  // show member table
419  $table = $this->initParticipantTableGUI();
420  $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_mem_tbl_header'));
421  $table->setFormAction($this->ctrl->getFormAction($this));
422  $table->parse();
423 
424  // filter commands
425  $table->setFilterCommand('participantsApplyFilter');
426  $table->setResetCommand('participantsResetFilter');
427 
428  $this->tpl->setVariable('MEMBERS', $table->getHTML());
429  }
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.
getParentObject()
Get parent object.
if(empty($password)) $table
Definition: pwgen.php:24
+ 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 $table, and participants().

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;.
if(empty($password)) $table
Definition: pwgen.php:24
+ 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 $table, and participants().

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;.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ printForMembersOutput()

ilMembershipGUI::printForMembersOutput ( )
protected

print members output

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

References $form, $list, exit, getMembersObject(), and getParentObject().

1632  {
1633  $list = $this->initAttendanceList();
1634  $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1635  $list->setId(0);
1636  $form = $list->initForm('printForMembersOutput');
1637  $list->initFromForm();
1638  $list->setCallback(array($this, 'getAttendanceListUserData'));
1639  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1640  $list->getNonMemberUserData($this->member_data);
1641 
1642  $list->getFullscreenHTML();
1643  exit();
1644  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getMembersObject()
Get member object.
if(isset($_POST['submit'])) $form
exit
Definition: backend.php:16
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ printMembers()

ilMembershipGUI::printMembers ( )
protected

Print members.

Todo:
: refactor to own class

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

References $DIC, $form, $list, and checkPermission().

1589  {
1590  global $DIC;
1591 
1592  $ilTabs = $DIC['ilTabs'];
1593 
1594  $this->checkPermission('read');
1595 
1596  $ilTabs->clearTargets();
1597 
1598  $ilTabs->setBackTarget(
1599  $this->lng->txt('back'),
1600  $this->ctrl->getLinkTarget($this, 'participants')
1601  );
1602 
1603  $list = $this->initAttendanceList();
1604  $form = $list->initForm('printMembersOutput');
1605  $this->tpl->setContent($form->getHTML());
1606  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
if(isset($_POST['submit'])) $form
+ Here is the call graph for this function:

◆ printMembersOutput()

ilMembershipGUI::printMembersOutput ( )
protected

print members output

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

References $list, exit, filterUserIdsByRbacOrPositionOfCurrentUser(), and getMembersObject().

1612  {
1613  $list = $this->initAttendanceList();
1614  $list->initFromForm();
1615  $list->setCallback(array($this, 'getAttendanceListUserData'));
1616  $this->member_data = $this->getPrintMemberData(
1618  $this->getMembersObject()->getParticipants()
1619  )
1620  );
1621 
1622  $list->getNonMemberUserData($this->member_data);
1623 
1624  $list->getFullscreenHTML();
1625  exit();
1626  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getMembersObject()
Get member object.
exit
Definition: backend.php:16
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
+ Here is the call graph for this function:

◆ readMemberData()

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

Required for member table guis.

Has to be refactored and should be locate in ilObjCourse, ilObjGroup instead of GUI

Returns
array

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

References getParentGUI().

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

1132  {
1133  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1134  }
getParentGUI()
Get parent gui.
if(! $in) $columns
Definition: Utf8Test.php:45
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refuseFromList()

ilMembershipGUI::refuseFromList ( )
protected

refuse from waiting list

public

Returns

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

References $_POST, getMembersObject(), getParentObject(), ilUtil\sendFailure(), ilSessionMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, and ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

1506  {
1507  if (!array_key_exists('waiting', $_POST) || !count($_POST['waiting'])) {
1508  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
1509  $this->ctrl->redirect($this, 'participants');
1510  }
1511 
1512  $waiting_list = $this->initWaitingList();
1513 
1514  foreach ($_POST["waiting"] as $user_id) {
1515  $waiting_list->removeFromList($user_id);
1516 
1517  if ($this instanceof ilCourseMembershipGUI) {
1518  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $user_id, true);
1519  }
1520  if ($this instanceof ilGroupMembershipGUI) {
1521  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1522  $this->getMembersObject()->sendNotification(
1524  $user_id,
1525  true
1526  );
1527  }
1528  if ($this instanceof ilSessionMembershipGUI) {
1529  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1531  $noti->setRefId($this->getParentObject()->getRefId());
1532  $noti->setRecipients(array($user_id));
1534  $noti->send();
1535  }
1536  }
1537  ilUtil::sendSuccess($this->lng->txt('crs_users_removed_from_list'), true);
1538  $this->ctrl->redirect($this, 'participants');
1539  }
getMembersObject()
Get member object.
GUI class for membership features.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
GUI class for membership features.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ refuseSubscribers()

ilMembershipGUI::refuseSubscribers ( )
protected

Refuse subscribers type $rbacsystem.

Returns
boolean

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

References $_POST, $DIC, $GLOBALS, getMembersObject(), getParentObject(), ilUtil\sendFailure(), ilLearningSequenceMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilSessionMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, and ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER.

1250  {
1251  global $DIC;
1252 
1253  $rbacsystem = $DIC['rbacsystem'];
1254 
1255  if (!$_POST['subscribers']) {
1256  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1257  $this->ctrl->redirect($this, 'participants');
1258  }
1259 
1260  if (!$this->getMembersObject()->deleteSubscribers($_POST["subscribers"])) {
1261  ilUtil::sendFailure($GLOBALS['DIC']['ilErr']->getMessage(), true);
1262  $this->ctrl->redirect($this, 'participants');
1263  } else {
1264  foreach ($_POST['subscribers'] as $usr_id) {
1265  if ($this instanceof ilCourseMembershipGUI) {
1266  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $usr_id);
1267  }
1268  if ($this instanceof ilGroupMembershipGUI) {
1269  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1270  $this->getMembersObject()->sendNotification(
1272  $usr_id
1273  );
1274  }
1275  if ($this instanceof ilSessionMembershipGUI) {
1277  $noti->setRefId($this->getParentObject()->getRefId());
1278  $noti->setRecipients(array($usr_id));
1280  $noti->send();
1281  }
1282  if ($this instanceof ilLearningSequenceMembershipGUI) {
1283  $this->getMembersObject()->sendNotification(
1285  $usr_id
1286  );
1287  }
1288  }
1289  }
1290 
1291  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_deleted"), true);
1292  $this->ctrl->redirect($this, 'participants');
1293  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
GUI class for membership features.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
GUI class for membership features.
getParentObject()
Get parent object.
$_POST["username"]
GUI class for learning sequence membership features.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

Send mail to selected users.

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

References $_GET, $_POST, ilObjUser\_lookupLogin(), createMailSignature(), getMailContextOptions(), ilMailFormCall\getRedirectTarget(), ilUtil\redirect(), ilUtil\sendFailure(), and ilMailFormCall\setRecipients().

751  {
752  $participants = [];
753  if ($_POST['participants']) {
754  $participants = (array) $_POST['participants'];
755  } elseif ($_GET['member_id']) {
756  $participants = array($_GET['member_id']);
757  } elseif ($_POST['subscribers']) {
758  $participants = (array) $_POST['subscribers'];
759  } elseif ($_POST['waiting']) {
760  $participants = (array) $_POST['waiting'];
761  }
762 
763  if (!count($participants)) {
764  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
765  $this->ctrl->redirect($this, 'participants');
766  }
767 
768  foreach ($participants as $usr_id) {
769  $rcps[] = ilObjUser::_lookupLogin($usr_id);
770  }
771 
772 
773  $context_options = $this->getMailContextOptions();
774 
778  $this,
779  'participants',
780  array(),
781  array(
782  'type' => 'new',
783  'sig' => $this->createMailSignature()
784  ),
785  $context_options
786  )
787  );
788  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
getMailContextOptions()
Get mail context options.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
static setRecipients(array $recipients)
static redirect($a_script)
$_POST["username"]
+ Here is the call graph for this function:

◆ setSubTabs()

ilMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

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

References $DIC, $tree, ilPrivacySettings\_getInstance(), ilTabsGUI\addSubTabTarget(), checkRbacOrPositionAccessBool(), getParentObject(), and ilMapUtil\isActivated().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1055  {
1056  global $DIC;
1057 
1058  $ilAccess = $DIC['ilAccess'];
1059 
1060  if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members', $this->getParentObject()->getRefId())) {
1061  $tabs->addSubTabTarget(
1062  $this->getParentObject()->getType() . "_member_administration",
1063  $this->ctrl->getLinkTarget($this, 'participants'),
1064  "members",
1065  get_class($this)
1066  );
1067 
1068  // show group overview
1069  if ($this instanceof ilCourseMembershipGUI) {
1070  $tabs->addSubTabTarget(
1071  "crs_members_groups",
1072  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1073  "",
1074  "ilCourseParticipantsGroupsGUI"
1075  );
1076  }
1077 
1078  $tree = $DIC->repositoryTree();
1079  $children = (array) $tree->getSubTree($tree->getNodeData($this->getParentObject()->getRefId()), false, 'sess');
1080  if (count($children)) {
1081  $tabs->addSubTabTarget(
1082  'events',
1083  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilsessionoverviewgui'), 'listSessions'),
1084  '',
1085  'ilsessionoverviewgui'
1086  );
1087  }
1088 
1089  $tabs->addSubTabTarget(
1090  $this->getParentObject()->getType() . '_members_gallery',
1091  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1092  'view',
1093  'ilUsersGalleryGUI'
1094  );
1095  } elseif ($this->getParentObject()->getShowMembers()) {
1096  // gallery
1097  $tabs->addSubTabTarget(
1098  $this->getParentObject()->getType() . '_members_gallery',
1099  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1100  'view',
1101  'ilUsersGalleryGUI'
1102  );
1103  }
1104 
1105  include_once './Services/Maps/classes/class.ilMapUtil.php';
1106  if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1107  $tabs->addSubTabTarget(
1108  $this->getParentObject()->getType() . '_members_map',
1109  $this->ctrl->getLinkTarget($this, 'membersMap'),
1110  "membersMap",
1111  get_class($this)
1112  );
1113  }
1114 
1115  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1116  if (ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1117  $tabs->addSubTabTarget(
1118  'export_members',
1119  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilmemberexportgui'), 'show'),
1120  '',
1121  'ilmemberexportgui'
1122  );
1123  }
1124  }
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
global $DIC
Definition: saml.php:7
static isActivated()
Checks whether Map feature is activated.
static _getInstance()
Get instance of ilPrivacySettings.
getParentObject()
Get parent object.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMailToMemberToolbarButton()

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

Show mail to member toolbar button.

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

References $DIC, $ilUser, ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), and getParentObject().

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

932  {
933  global $DIC;
934 
935  $ilUser = $DIC['ilUser'];
936  $rbacsystem = $DIC['rbacsystem'];
937  $ilAccess = $DIC['ilAccess'];
938  include_once 'Services/Mail/classes/class.ilMail.php';
939  $mail = new ilMail($ilUser->getId());
940 
941  if (
942  ($this->getParentObject()->getMailToMembersType() == 1) ||
943  (
944  $ilAccess->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
945  $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
946  )
947  ) {
948  if ($a_separator) {
949  $toolbar->addSeparator();
950  }
951 
952  if ($a_back_cmd) {
953  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
954  }
955 
956  $toolbar->addButton(
957  $this->lng->txt("mail_members"),
958  $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
959  );
960  }
961  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
addSeparator()
Add separator.
addButton( $a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
getParentObject()
Get parent object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showMemberExportToolbarButton()

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

Show member export button.

Parameters
ilToolbarGUI$toolbar
type$a_back_cmd
type$a_separator

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

References ilToolbarGUI\addButton(), ilToolbarGUI\addSeparator(), and getParentObject().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

906  {
907  if (
908  $this->getParentObject()->getType() == 'crs' &&
909  $this->getParentObject()->getShowMembersExport()) {
910  if ($a_separator) {
911  $toolbar->addSeparator();
912  }
913 
914  if ($a_back_cmd) {
915  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
916  }
917  $toolbar->addButton(
918  $this->lng->txt($this->getParentObject()->getType() . '_print_list'),
919  $this->ctrl->getLinkTarget($this, 'printForMembersOutput')
920  );
921  }
922  }
addSeparator()
Add separator.
addButton( $a_txt, $a_cmd, $a_target="", $a_acc_key="", $a_additional_attrs='', $a_id="", $a_class='submit')
Add button to toolbar.
getParentObject()
Get parent object.
+ 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 $DIC, canAddOrSearchUsers(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), getParentGUI(), and showMailToMemberToolbarButton().

Referenced by participants().

856  {
857  global $DIC;
858 
859  $ilToolbar = $DIC['ilToolbar'];
860 
861  if ($this->canAddOrSearchUsers()) {
862  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
864  $this,
865  $ilToolbar,
866  array(
867  'auto_complete_name' => $this->lng->txt('user'),
868  'user_type' => $this->getParentGUI()->getLocalRoles(),
869  'user_type_default' => $this->getDefaultRole(),
870  'submit_name' => $this->lng->txt('add')
871  )
872  );
873 
874  // spacer
875  $ilToolbar->addSeparator();
876 
877  // search button
878  $ilToolbar->addButton(
879  $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
880  $this->ctrl->getLinkTargetByClass(
881  'ilRepositorySearchGUI',
882  'start'
883  )
884  );
885 
886  // separator
887  $ilToolbar->addSeparator();
888  }
889 
890  // print button
891  $ilToolbar->addButton(
892  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
893  $this->ctrl->getLinkTarget($this, 'printMembers')
894  );
895 
896  $this->showMailToMemberToolbarButton($ilToolbar, 'participants', false);
897  }
global $DIC
Definition: saml.php:7
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
getParentGUI()
Get parent gui.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
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:

◆ updateParticipants()

ilMembershipGUI::updateParticipants ( )

update members

public

Parameters

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

References $_POST, $DIC, $ilUser, $title, getMembersObject(), getParentObject(), and ilUtil\sendFailure().

495  {
496  global $DIC;
497 
498  $rbacsystem = $DIC['rbacsystem'];
499  $rbacreview = $DIC['rbacreview'];
500  $ilUser = $DIC['ilUser'];
501  $ilAccess = $DIC['ilAccess'];
502 
503  if (!array_key_exists('participants', $_POST) || !count($_POST['participants'])) {
504  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
505  $this->ctrl->redirect($this, 'participants');
506  }
507 
508  $notifications = $_POST['notification'] ? $_POST['notification'] : array();
509  $passed = $_POST['passed'] ? $_POST['passed'] : array();
510  $blocked = $_POST['blocked'] ? $_POST['blocked'] : array();
511  $contact = $_POST['contact'] ? $_POST['contact'] : array();
512 
513  // Determine whether the user has the 'edit_permission' permission
514  $hasEditPermissionAccess =
515  (
516  $ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) or
517  $this->getMembersObject()->isAdmin($ilUser->getId())
518  );
519 
520  // Get all assignable local roles of the object, and
521  // determine the role id of the course administrator role.
522  $assignableLocalRoles = array();
523  $adminRoleId = $this->getParentObject()->getDefaultAdminRole();
524  foreach ($this->getLocalTypeRole(false) as $title => $role_id) {
525  $assignableLocalRoles[$role_id] = $title;
526  }
527 
528  // Validate the user ids and role ids in the post data
529  foreach ($_POST['participants'] as $usr_id) {
530  $memberIsAdmin = $rbacreview->isAssigned($usr_id, $adminRoleId);
531 
532  // If the current user doesn't have the 'edit_permission'
533  // permission, make sure he doesn't remove the course
534  // administrator role of members who are course administrator.
535  if (!$hasEditPermissionAccess && $memberIsAdmin &&
536  !in_array($adminRoleId, $_POST['roles'][$usr_id])
537  ) {
538  $_POST['roles'][$usr_id][] = $adminRoleId;
539  }
540 
541  // Validate the role ids in the post data
542  foreach ((array) $_POST['roles'][$usr_id] as $role_id) {
543  if (!array_key_exists($role_id, $assignableLocalRoles)) {
544  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'), true);
545  $this->ctrl->redirect($this, 'participants');
546  }
547  if (!$hasEditPermissionAccess &&
548  $role_id == $adminRoleId &&
549  !$memberIsAdmin) {
550  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'));
551  $this->ctrl->redirect($this, 'participants');
552  }
553  }
554  }
555 
556  $has_admin = false;
557  foreach ($this->getMembersObject()->getAdmins() as $admin_id) {
558  if (!isset($_POST['roles'][$admin_id])) {
559  $has_admin = true;
560  break;
561  }
562  if (in_array($adminRoleId, $_POST['roles'][$admin_id])) {
563  $has_admin = true;
564  break;
565  }
566  }
567 
568  if (!$has_admin && is_array($_POST['roles'])) {
569  foreach ($_POST['roles'] as $usrId => $roleIdsToBeAssigned) {
570  if (in_array($adminRoleId, $roleIdsToBeAssigned)) {
571  $has_admin = true;
572  break;
573  }
574  }
575  }
576 
577  if (!$has_admin) {
578  ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType() . '_min_one_admin'), true);
579  $this->ctrl->redirect($this, 'participants');
580  }
581 
582  foreach ($_POST['participants'] as $usr_id) {
583  $this->getMembersObject()->updateRoleAssignments($usr_id, (array) $_POST['roles'][$usr_id]);
584 
585  // Disable notification for all of them
586  $this->getMembersObject()->updateNotification($usr_id, 0);
587  if (($this->getMembersObject()->isTutor($usr_id) or $this->getMembersObject()->isAdmin($usr_id)) and in_array($usr_id, $notifications)) {
588  $this->getMembersObject()->updateNotification($usr_id, 1);
589  }
590 
591  $this->getMembersObject()->updateBlocked($usr_id, 0);
592  if ((!$this->getMembersObject()->isAdmin($usr_id) and !$this->getMembersObject()->isTutor($usr_id)) and in_array($usr_id, $blocked)) {
593  $this->getMembersObject()->updateBlocked($usr_id, 1);
594  }
595 
596  if ($this instanceof ilCourseMembershipGUI) {
597  $this->getMembersObject()->updatePassed($usr_id, in_array($usr_id, $passed), true);
598  $this->getMembersObject()->sendNotification(
599  $this->getMembersObject()->NOTIFY_STATUS_CHANGED,
600  $usr_id
601  );
602  }
603 
604  if (
605  ($this->getMembersObject()->isAdmin($usr_id) ||
606  $this->getMembersObject()->isTutor($usr_id)) &&
607  in_array($usr_id, $contact)
608  ) {
609  $this->getMembersObject()->updateContact($usr_id, true);
610  } else {
611  $this->getMembersObject()->updateContact($usr_id, false);
612  }
613 
614  $this->updateLPFromStatus($usr_id, in_array($usr_id, $passed));
615  }
616  ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
617  $this->ctrl->redirect($this, "participants");
618  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilMembershipGUI::$access
protected

◆ $ctrl

ilMembershipGUI::$ctrl = null
protected

◆ $lng

ilMembershipGUI::$lng = null
protected

◆ $logger

ilMembershipGUI::$logger = null
protected

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

Referenced by getLogger().

◆ $repository_gui

ilMembershipGUI::$repository_gui = null
private

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

Referenced by __construct(), and getParentGUI().

◆ $repository_object

ilMembershipGUI::$repository_object = null
private

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

Referenced by getParentObject().

◆ $tpl

ilMembershipGUI::$tpl
protected

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

Referenced by membersMap().


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