ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 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 ()
 
 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->lng->loadLanguageModule('trac');
64  $this->tpl = $GLOBALS['DIC']->ui()->mainTemplate();
65  $this->ctrl = $GLOBALS['DIC']->ctrl();
66  $this->logger = $DIC->logger()->mmbr();
67  $this->access = $GLOBALS['DIC']->access();
68  }
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
getParentObject()
Get parent object.
+ 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
bool$a_is_participant

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

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

1005  {
1006  global $DIC;
1007 
1008  $ilAccess = $DIC['ilAccess'];
1009 
1010  include_once './Services/Mail/classes/class.ilMail.php';
1011  $mail = new ilMail($GLOBALS['DIC']['ilUser']->getId());
1012 
1013  $member_tab_name = $this->getMemberTabName();
1014 
1015  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
1016  'manage_members',
1017  'manage_members',
1018  $this->getParentObject()->getRefId()
1019  );
1020 
1021  if ($has_manage_members_permission) {
1022  $tabs->addTab(
1023  'members',
1024  $member_tab_name,
1025  $this->ctrl->getLinkTarget($this, '')
1026  );
1027  } elseif (
1028  (bool) $this->getParentObject()->getShowMembers() && $a_is_participant
1029  ) {
1030  $tabs->addTab(
1031  'members',
1032  $member_tab_name,
1033  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilusersgallerygui'), 'view')
1034  );
1035  } elseif (
1036  $this->getParentObject()->getMailToMembersType() == 1 &&
1037  $GLOBALS['DIC']['rbacsystem']->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
1038  $a_is_participant
1039  ) {
1040  $tabs->addTab(
1041  'members',
1042  $member_tab_name,
1043  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
1044  );
1045  }
1046  }
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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.
+ Here is the call graph for this function:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

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

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

1551  {
1552  // begin-patch clipboard
1553  $users = [];
1554  if (isset($_POST['participants'])) {
1555  $users = (array) $_POST['participants'];
1556  } elseif (isset($_POST['subscribers'])) {
1557  $users = (array) $_POST['subscribers'];
1558  } elseif (isset($_POST['waiting'])) {
1559  $users = (array) $_POST['waiting'];
1560  }
1561  // end-patch clipboard
1562  if (!count($users)) {
1563  ilUtil::sendFailure($this->lng->txt('select_one'), true);
1564  $this->ctrl->redirect($this, 'participants');
1565  }
1566  include_once './Services/User/classes/class.ilUserClipboard.php';
1567  $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
1568  $clip->add($users);
1569  $clip->save();
1570 
1571  $this->lng->loadLanguageModule('user');
1572  ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
1573  $this->ctrl->redirect($this, 'participants');
1574  }
static getInstance($a_usr_id)
Get singelton instance.
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ assignFromWaitingList()

ilMembershipGUI::assignFromWaitingList ( )

Assign from waiting list type $rbacsystem.

Returns
boolean

Definition at line 1414 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.

1415  {
1416  if (!array_key_exists('waiting', $_POST) || !count($_POST["waiting"])) {
1417  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1418  $this->ctrl->redirect($this, 'participants');
1419  }
1420 
1421  $waiting_list = $this->initWaitingList();
1422 
1423  $added_users = 0;
1424  foreach ($_POST["waiting"] as $user_id) {
1425  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1426  continue;
1427  }
1428  if ($this->getMembersObject()->isAssigned($user_id)) {
1429  continue;
1430  }
1431 
1432  if ($this instanceof ilCourseMembershipGUI) {
1433  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
1434  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
1435  $this->getParentObject()->checkLPStatusSync($user_id);
1436  }
1437  if ($this instanceof ilGroupMembershipGUI) {
1438  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1439  $this->getMembersObject()->add($user_id, IL_GRP_MEMBER);
1440  $this->getMembersObject()->sendNotification(
1442  $user_id,
1443  true
1444  );
1445  }
1446  if ($this instanceof ilSessionMembershipGUI) {
1447  $this->getMembersObject()->register($user_id);
1449  $noti->setRefId($this->getParentObject()->getRefId());
1450  $noti->setRecipients(array($user_id));
1452  $noti->send();
1453  }
1454 
1455  $waiting_list->removeFromList($user_id);
1456  ++$added_users;
1457  }
1458 
1459  if ($added_users) {
1460  ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
1461  $this->ctrl->redirect($this, 'participants');
1462  } else {
1463  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
1464  $this->ctrl->redirect($this, 'participants');
1465  }
1466  }
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 1307 of file class.ilMembershipGUI.php.

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

1308  {
1309  global $DIC;
1310 
1311  $ilErr = $DIC['ilErr'];
1312 
1313  if (!is_array($_POST["subscribers"])) {
1314  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1315  $this->ctrl->redirect($this, 'participants');
1316  }
1317 
1318  if (!$this->getMembersObject()->assignSubscribers($_POST["subscribers"])) {
1319  ilUtil::sendFailure($ilErr->getMessage(), true);
1320  $this->ctrl->redirect($this, 'participants');
1321  } else {
1322  foreach ($_POST["subscribers"] as $usr_id) {
1323  if ($this instanceof ilCourseMembershipGUI) {
1324  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER, $usr_id);
1325  $this->getParentObject()->checkLPStatusSync($usr_id);
1326  }
1327  if ($this instanceof ilGroupMembershipGUI) {
1328  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1329  $this->getMembersObject()->sendNotification(
1331  $usr_id
1332  );
1333  }
1334  if ($this instanceof ilSessionMembershipGUI) {
1335  // todo refactor to participants
1336  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1338  $noti->setRefId($this->getParentObject()->getRefId());
1339  $noti->setRecipients(array($usr_id));
1341  $noti->send();
1342  }
1343  }
1344  }
1345  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_assigned"), true);
1346  $this->ctrl->redirect($this, 'participants');
1347  }
getMembersObject()
Get member object.
$ilErr
Definition: raiseError.php:18
assignSubscribers()
Do assignment of subscription request type $rbacsystem type $ilErr.
GUI class for membership features.
global $DIC
Definition: goto.php:24
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 197 of file class.ilMembershipGUI.php.

References checkPermissionBool().

Referenced by showParticipantsToolbar().

198  {
199  return $this->checkPermissionBool('manage_members');
200  }
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 169 of file class.ilMembershipGUI.php.

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

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

170  {
171  if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
172  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
173  $this->ctrl->redirect($this->getParentGUI());
174  }
175  }
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 140 of file class.ilMembershipGUI.php.

References getParentObject().

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

141  {
142  if (!$a_ref_id) {
143  $a_ref_id = $this->getParentObject()->getRefId();
144  }
145  return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
146  }
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 183 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

184  {
185  if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
186  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
187  $this->ctrl->redirect($this->getParentGUI());
188  }
189  }
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 154 of file class.ilMembershipGUI.php.

References getParentObject().

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

155  {
156  if (!$a_ref_id) {
157  $a_ref_id = $this->getParentObject()->getRefId();
158  }
159  return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
160  }
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 1377 of file class.ilMembershipGUI.php.

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

1378  {
1379  if (!is_array($_POST["waiting"])) {
1380  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1381  $this->ctrl->redirect($this, 'participants');
1382  }
1383 
1384 
1385  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1386  $c_gui = new ilConfirmationGUI();
1387 
1388  // set confirm/cancel commands
1389  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1390  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1391  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1392  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1393 
1394  foreach ($_POST["waiting"] as $waiting) {
1395  $name = ilObjUser::_lookupName($waiting);
1396 
1397  $c_gui->addItem(
1398  'waiting[]',
1399  $name['user_id'],
1400  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1401  ilUtil::getImagePath('icon_usr.svg')
1402  );
1403  }
1404 
1405  $this->tpl->setContent($c_gui->getHTML());
1406  return true;
1407  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:230
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 1182 of file class.ilMembershipGUI.php.

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

1183  {
1184  if (!is_array($_POST["subscribers"])) {
1185  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1186  $this->ctrl->redirect($this, 'participants');
1187  }
1188 
1189  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1190  $c_gui = new ilConfirmationGUI();
1191 
1192  // set confirm/cancel commands
1193  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1194  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1195  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1196  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1197 
1198  foreach ($_POST["subscribers"] as $subscribers) {
1199  $name = ilObjUser::_lookupName($subscribers);
1200 
1201  $c_gui->addItem(
1202  'subscribers[]',
1203  $name['user_id'],
1204  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1205  ilUtil::getImagePath('icon_usr.svg')
1206  );
1207  }
1208 
1209  $this->tpl->setContent($c_gui->getHTML());
1210  return true;
1211  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:230
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 625 of file class.ilMembershipGUI.php.

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

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

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

Returns
boolean

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

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

1473  {
1474  if (!is_array($_POST["waiting"])) {
1475  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1476  $this->ctrl->redirect($this, 'participants');
1477  }
1478 
1479  $this->lng->loadLanguageModule('mmbr');
1480 
1481  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1482  $c_gui = new ilConfirmationGUI();
1483 
1484  // set confirm/cancel commands
1485  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1486  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1487  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1488  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1489 
1490  foreach ($_POST["waiting"] as $waiting) {
1491  $name = ilObjUser::_lookupName($waiting);
1492 
1493  $c_gui->addItem(
1494  'waiting[]',
1495  $name['user_id'],
1496  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1497  ilUtil::getImagePath('icon_usr.svg')
1498  );
1499  }
1500 
1501  $this->tpl->setContent($c_gui->getHTML());
1502  return true;
1503  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:230
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 1217 of file class.ilMembershipGUI.php.

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

1218  {
1219  if (!is_array($_POST["subscribers"])) {
1220  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1221  $this->ctrl->redirect($this, 'participants');
1222  }
1223 
1224  $this->lng->loadLanguageModule('mmbr');
1225 
1226  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1227  $c_gui = new ilConfirmationGUI();
1228 
1229  // set confirm/cancel commands
1230  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1231  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1232  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1233  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1234 
1235  foreach ($_POST["subscribers"] as $subscribers) {
1236  $name = ilObjUser::_lookupName($subscribers);
1237 
1238  $c_gui->addItem(
1239  'subscribers[]',
1240  $name['user_id'],
1241  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1242  ilUtil::getImagePath('icon_usr.svg')
1243  );
1244  }
1245 
1246  $this->tpl->setContent($c_gui->getHTML());
1247  return true;
1248  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:230
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 973 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by sendMailToSelectedUsers().

974  {
975  return $this->getParentGUI()->createMailSignature();
976  }
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 697 of file class.ilMembershipGUI.php.

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

Referenced by ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses().

698  {
699  global $DIC;
700 
701  $rbacreview = $DIC['rbacreview'];
702  $rbacsystem = $DIC['rbacsystem'];
703  $ilAccess = $DIC['ilAccess'];
704  $ilUser = $DIC['ilUser'];
705 
706  $participants = (array) $_POST['participants'];
707 
708  if (!is_array($participants) or !count($participants)) {
709  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
710  $this->ctrl->redirect($this, 'participants');
711  }
712 
713  // If the user doesn't have the edit_permission and is not administrator, he may not remove
714  // members who have the course administrator role
715  if (
716  !$ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
717  !$this->getMembersObject()->isAdmin($GLOBALS['DIC']['ilUser']->getId())
718  ) {
719  foreach ($participants as $part) {
720  if ($this->getMembersObject()->isAdmin($part)) {
721  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'), true);
722  $this->ctrl->redirect($this, 'participants');
723  }
724  }
725  }
726 
727  if (!$this->getMembersObject()->deleteParticipants($participants)) {
728  ilUtil::sendFailure('Error deleting participants.', true);
729  $this->ctrl->redirect($this, 'participants');
730  } else {
731  foreach ((array) $_POST["participants"] as $usr_id) {
732  $mail_type = 0;
733  // @todo more generic
734  switch ($this->getParentObject()->getType()) {
735  case 'crs':
736  $mail_type = $this->getMembersObject()->NOTIFY_DISMISS_MEMBER;
737  break;
738  case 'grp':
739  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
741  break;
742  case 'lso':
744  break;
745  }
746  $this->getMembersObject()->sendNotification($mail_type, $usr_id);
747  }
748  }
749  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
750  $this->ctrl->redirect($this, "participants");
751 
752  return true;
753  }
getMembersObject()
Get member object.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ 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 462 of file class.ilMembershipGUI.php.

References editParticipants(), and getParentObject().

463  {
464  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
465  return $this->editParticipants(array($_REQUEST['member_id']));
466  }
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 472 of file class.ilMembershipGUI.php.

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

Referenced by editMember().

473  {
474  if (!$post_participants) {
475  $post_participants = (array) $_POST['participants'];
476  }
477 
478  $real_participants = $this->getMembersObject()->getParticipants();
479  $participants = array_intersect((array) $post_participants, (array) $real_participants);
480 
481  if (!count($participants)) {
482  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
483  $this->ctrl->redirect($this, 'participants');
484  }
485  $table = $this->initEditParticipantTableGUI($participants);
486  $this->tpl->setContent($table->getHTML());
487  return true;
488  }
getMembersObject()
Get member object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_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 81 of file class.ilMembershipGUI.php.

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

Get default command.

Returns
string

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

983  {
984  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
985  'manage_members',
986  'manage_members',
987  $this->getParentObject()->getRefId()
988  );
989  if ($has_manage_members_permission) {
990  return 'participants';
991  }
992 
993  if ($this->getParentObject()->getShowMembers()) {
994  return 'jump2UsersGallery';
995  }
996  return 'mailMembersBtn';
997  }
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 1579 of file class.ilMembershipGUI.php.

References $GLOBALS.

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser(), and showParticipantsToolbar().

1580  {
1581  return null;
1582  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected
Returns
ilLanguage

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

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getLocalRoles()

ilMembershipGUI::getLocalRoles ( )

Get parent roles.

Returns
type

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

References getParentGUI().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1147  {
1148  return $this->getParentGUI()->getLocalRoles();
1149  }
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 89 of file class.ilMembershipGUI.php.

References $logger.

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

◆ getMailContextOptions()

ilMembershipGUI::getMailContextOptions ( )
protected
Returns
array

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

Referenced by sendMailToSelectedUsers().

801  : array
802  {
803  return [];
804  }
+ Here is the caller graph for this function:

◆ getMailMemberRoles()

ilMembershipGUI::getMailMemberRoles ( )
protected
Returns
null

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

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

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

Get member object.

Returns
ilParticipants

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

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

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

118  {
119  if ($this->participants instanceof ilParticipants) {
120  return $this->participants;
121  }
122  return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
123  }
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 1052 of file class.ilMembershipGUI.php.

Referenced by addMemberTab().

1053  {
1054  return $this->lng->txt('members');
1055  }
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Get parent object.

Returns
ilObject

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

References $repository_object.

Referenced by __construct(), addMemberTab(), assignFromWaitingList(), ilGroupMembershipGUI\assignMembers(), ilLearningSequenceMembershipGUI\assignMembers(), ilCourseMembershipGUI\assignMembers(), assignSubscribers(), checkPermissionBool(), ilSessionMembershipGUI\checkRbacOrPositionAccessBool(), checkRbacOrPositionAccessBool(), ilSessionMembershipGUI\deleteParticipants(), deleteParticipants(), ilCourseMembershipGUI\deleteParticipantsWithLinkedCourses(), editMember(), ilCourseMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), ilGroupMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), ilLearningSequenceMembershipGUI\filterUserIdsByRbacOrPositionOfCurrentUser(), filterUserIdsByRbacOrPositionOfCurrentUser(), getDefaultCommand(), ilLearningSequenceMembershipGUI\getDefaultRole(), ilGroupMembershipGUI\getLocalTypeRole(), ilLearningSequenceMembershipGUI\getLocalTypeRole(), ilCourseMembershipGUI\getLocalTypeRole(), ilCourseMembershipGUI\getMailContextOptions(), ilGroupMembershipGUI\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(), ilCourseMembershipGUI\showDeleteParticipantsConfirmationWithLinkedCourses(), showMailToMemberToolbarButton(), showMemberExportToolbarButton(), ilSessionMembershipGUI\updateMembers(), updateParticipants(), and ilLearningSequenceMembershipGUI\updateParticipantsStatus().

109  {
111  }
+ Here is the caller graph for this function:

◆ initSubscriberTable()

ilMembershipGUI::initSubscriberTable ( )
protected
Returns

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

References getParentObject().

Referenced by parseSubscriberTable().

1172  {
1173  $subscriber = new \ilSubscriberTableGUI($this, $this->getParentObject(), true, true);
1174  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1175  return $subscriber;
1176  }
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 1679 of file class.ilMembershipGUI.php.

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

1680  {
1681  $this->ctrl->redirectByClass('ilUsersGalleryGUI');
1682  }
+ Here is the call graph for this function:

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

Mail to members view type $ilToolbar.

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

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

847  {
848  global $DIC;
849 
850  $ilToolbar = $DIC['ilToolbar'];
851 
852  $this->showMailToMemberToolbarButton($GLOBALS['DIC']['ilToolbar'], 'mailMembersBtn');
853  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

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

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

811  {
812  global $DIC;
813 
814  $tpl = $DIC['tpl'];
815  $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
816  include_once("./Services/Maps/classes/class.ilMapUtil.php");
817  if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
818  return;
819  }
820 
821  $map = ilMapUtil::getMapGUI();
822  $map->setMapId("course_map")
823  ->setWidth("700px")
824  ->setHeight("500px")
825  ->setLatitude($this->getParentObject()->getLatitude())
826  ->setLongitude($this->getParentObject()->getLongitude())
827  ->setZoom($this->getParentObject()->getLocationZoom())
828  ->setEnableTypeControl(true)
829  ->setEnableNavigationControl(true)
830  ->setEnableCentralMarker(true);
831 
832  include_once './Services/Membership/classes/class.ilParticipants.php';
833  $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
834  foreach ((array) $members as $user_id) {
835  $map->addUserMarker($user_id);
836  }
837 
838  $tpl->setContent($map->getHTML());
839  $tpl->setLeftContent($map->getUserListHTML());
840  }
static getMapGUI()
Get an instance of the GUI class.
global $DIC
Definition: goto.php:24
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 1154 of file class.ilMembershipGUI.php.

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

Referenced by participants().

1155  {
1156  $subscribers = $this->getMembersObject()->getSubscribers();
1157  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1158  if (!count($filtered_subscribers)) {
1159  return null;
1160  }
1161  $subscriber = $this->initSubscriberTable();
1162  $subscriber->readSubscriberData(
1163  $filtered_subscribers
1164  );
1165  return $subscriber;
1166  }
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 1353 of file class.ilMembershipGUI.php.

References filterUserIdsByRbacOrPositionOfCurrentUser(), and getParentObject().

Referenced by participants().

1354  {
1355  $wait = $this->initWaitingList();
1356 
1357  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1358  if (!count($wait_users)) {
1359  return null;
1360  }
1361 
1362  include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
1363  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1364  $waiting_table->setUserIds(
1365  $wait_users
1366  );
1367  $waiting_table->readUserData();
1368  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1369 
1370  return $waiting_table;
1371  }
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 403 of file class.ilMembershipGUI.php.

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

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

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

References participants().

438  {
439  $table = $this->initParticipantTableGUI();
440  $table->resetOffset();
441  $table->writeFilterToSession();
442 
443  $this->participants();
444  }
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 449 of file class.ilMembershipGUI.php.

References participants().

450  {
451  $table = $this->initParticipantTableGUI();
452  $table->resetOffset();
453  $table->resetFilter();
454 
455  $this->participants();
456  }
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 1653 of file class.ilMembershipGUI.php.

References $DIC, getMembersObject(), and getParentObject().

1654  {
1655  global $DIC;
1656 
1657  $tabs = $DIC->tabs();
1658  $tabs->clearTargets();
1659  $tabs->setBackTarget(
1660  $this->lng->txt('back'),
1661  $this->ctrl->getLinkTarget($this, 'jump2UsersGallery')
1662  );
1663 
1664  $list = $this->initAttendanceList();
1665  $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1666  $list->setId(0);
1667  $form = $list->initForm('printForMembersOutput');
1668  $list->initFromForm();
1669  $list->setCallback(array($this, 'getAttendanceListUserData'));
1670  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1671  $list->getNonMemberUserData($this->member_data);
1672 
1673  $list->getFullscreenHTML();
1674  }
getMembersObject()
Get member object.
global $DIC
Definition: goto.php:24
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 1603 of file class.ilMembershipGUI.php.

References $DIC, and checkPermission().

1604  {
1605  global $DIC;
1606 
1607  $ilTabs = $DIC['ilTabs'];
1608 
1609  $this->checkPermission('read');
1610 
1611  $ilTabs->clearTargets();
1612 
1613  $ilTabs->setBackTarget(
1614  $this->lng->txt('back'),
1615  $this->ctrl->getLinkTarget($this, 'participants')
1616  );
1617 
1618  $list = $this->initAttendanceList();
1619  $form = $list->initForm('printMembersOutput');
1620  $this->tpl->setContent($form->getHTML());
1621  }
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ printMembersOutput()

ilMembershipGUI::printMembersOutput ( )
protected

print members output

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

References $DIC, filterUserIdsByRbacOrPositionOfCurrentUser(), and getMembersObject().

1627  {
1628  global $DIC;
1629 
1630  $tabs = $DIC->tabs();
1631  $tabs->clearTargets();
1632  $tabs->setBackTarget(
1633  $this->lng->txt('back'),
1634  $this->ctrl->getLinkTarget($this, 'participants')
1635  );
1636 
1637  $list = $this->initAttendanceList();
1638  $list->initFromForm();
1639  $list->setCallback(array($this, 'getAttendanceListUserData'));
1640  $this->member_data = $this->getPrintMemberData(
1642  $this->getMembersObject()->getParticipants()
1643  )
1644  );
1645 
1646  $list->getNonMemberUserData($this->member_data);
1647  $list->getFullscreenHTML();
1648  }
getMembersObject()
Get member object.
global $DIC
Definition: goto.php:24
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 1137 of file class.ilMembershipGUI.php.

References getParentGUI().

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

1138  {
1139  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1140  }
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 1511 of file class.ilMembershipGUI.php.

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

1512  {
1513  if (!array_key_exists('waiting', $_POST) || !count($_POST['waiting'])) {
1514  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
1515  $this->ctrl->redirect($this, 'participants');
1516  }
1517 
1518  $waiting_list = $this->initWaitingList();
1519 
1520  foreach ($_POST["waiting"] as $user_id) {
1521  $waiting_list->removeFromList($user_id);
1522 
1523  if ($this instanceof ilCourseMembershipGUI) {
1524  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $user_id, true);
1525  }
1526  if ($this instanceof ilGroupMembershipGUI) {
1527  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1528  $this->getMembersObject()->sendNotification(
1530  $user_id,
1531  true
1532  );
1533  }
1534  if ($this instanceof ilSessionMembershipGUI) {
1535  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1537  $noti->setRefId($this->getParentObject()->getRefId());
1538  $noti->setRecipients(array($user_id));
1540  $noti->send();
1541  }
1542  }
1543  ilUtil::sendSuccess($this->lng->txt('crs_users_removed_from_list'), true);
1544  $this->ctrl->redirect($this, 'participants');
1545  }
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 1255 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.

1256  {
1257  global $DIC;
1258 
1259  $rbacsystem = $DIC['rbacsystem'];
1260 
1261  if (!$_POST['subscribers']) {
1262  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1263  $this->ctrl->redirect($this, 'participants');
1264  }
1265 
1266  if (!$this->getMembersObject()->deleteSubscribers($_POST["subscribers"])) {
1267  ilUtil::sendFailure($GLOBALS['DIC']['ilErr']->getMessage(), true);
1268  $this->ctrl->redirect($this, 'participants');
1269  } else {
1270  foreach ($_POST['subscribers'] as $usr_id) {
1271  if ($this instanceof ilCourseMembershipGUI) {
1272  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $usr_id);
1273  }
1274  if ($this instanceof ilGroupMembershipGUI) {
1275  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1276  $this->getMembersObject()->sendNotification(
1278  $usr_id
1279  );
1280  }
1281  if ($this instanceof ilSessionMembershipGUI) {
1283  $noti->setRefId($this->getParentObject()->getRefId());
1284  $noti->setRecipients(array($usr_id));
1286  $noti->send();
1287  }
1288  if ($this instanceof ilLearningSequenceMembershipGUI) {
1289  $this->getMembersObject()->sendNotification(
1291  $usr_id
1292  );
1293  }
1294  }
1295  }
1296 
1297  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_deleted"), true);
1298  $this->ctrl->redirect($this, 'participants');
1299  }
getMembersObject()
Get member object.
GUI class for membership features.
global $DIC
Definition: goto.php:24
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
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.
+ Here is the call graph for this function:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

Send mail to selected users.

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

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

759  {
760  $participants = [];
761  if ($_POST['participants']) {
762  $participants = (array) $_POST['participants'];
763  } elseif ($_POST['subscribers']) {
764  $participants = (array) $_POST['subscribers'];
765  } elseif ($_POST['waiting']) {
766  $participants = (array) $_POST['waiting'];
767  } elseif ($_GET['member_id']) {
768  $participants = array($_GET['member_id']);
769  }
770 
771  if (!count($participants)) {
772  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
773  $this->ctrl->redirect($this, 'participants');
774  }
775 
776  foreach ($participants as $usr_id) {
777  $rcps[] = ilObjUser::_lookupLogin($usr_id);
778  }
779 
780 
781  $context_options = $this->getMailContextOptions();
782 
786  $this,
787  'participants',
788  array(),
789  array(
790  'type' => 'new',
791  'sig' => $this->createMailSignature()
792  ),
793  $context_options
794  )
795  );
796  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static setRecipients(array $recipients, string $type='to')
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
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 1060 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1061  {
1062  global $DIC;
1063 
1064  $ilAccess = $DIC['ilAccess'];
1065 
1066  if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members', $this->getParentObject()->getRefId())) {
1067  $tabs->addSubTabTarget(
1068  $this->getParentObject()->getType() . "_member_administration",
1069  $this->ctrl->getLinkTarget($this, 'participants'),
1070  "members",
1071  get_class($this)
1072  );
1073 
1074  // show group overview
1075  if ($this instanceof ilCourseMembershipGUI) {
1076  $tabs->addSubTabTarget(
1077  "crs_members_groups",
1078  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1079  "",
1080  "ilCourseParticipantsGroupsGUI"
1081  );
1082  }
1083 
1084  $tree = $DIC->repositoryTree();
1085  $children = (array) $tree->getSubTree($tree->getNodeData($this->getParentObject()->getRefId()), false, 'sess');
1086  if (count($children)) {
1087  $tabs->addSubTabTarget(
1088  'events',
1089  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilsessionoverviewgui'), 'listSessions'),
1090  '',
1091  'ilsessionoverviewgui'
1092  );
1093  }
1094 
1095  $tabs->addSubTabTarget(
1096  $this->getParentObject()->getType() . '_members_gallery',
1097  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1098  'view',
1099  'ilUsersGalleryGUI'
1100  );
1101  } elseif ($this->getParentObject()->getShowMembers()) {
1102  // gallery
1103  $tabs->addSubTabTarget(
1104  $this->getParentObject()->getType() . '_members_gallery',
1105  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1106  'view',
1107  'ilUsersGalleryGUI'
1108  );
1109  }
1110 
1111  include_once './Services/Maps/classes/class.ilMapUtil.php';
1112  if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1113  $tabs->addSubTabTarget(
1114  $this->getParentObject()->getType() . '_members_map',
1115  $this->ctrl->getLinkTarget($this, 'membersMap'),
1116  "membersMap",
1117  get_class($this)
1118  );
1119  }
1120 
1121  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1122  if (ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1123  $tabs->addSubTabTarget(
1124  'export_members',
1125  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilmemberexportgui'), 'show'),
1126  '',
1127  'ilmemberexportgui'
1128  );
1129  }
1130  }
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
global $DIC
Definition: goto.php:24
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 937 of file class.ilMembershipGUI.php.

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

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

938  {
939  global $DIC;
940 
941  $ilUser = $DIC['ilUser'];
942  $rbacsystem = $DIC['rbacsystem'];
943  $ilAccess = $DIC['ilAccess'];
944  include_once 'Services/Mail/classes/class.ilMail.php';
945  $mail = new ilMail($ilUser->getId());
946 
947  if (
948  ($this->getParentObject()->getMailToMembersType() == 1) ||
949  (
950  $ilAccess->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
951  $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
952  )
953  ) {
954  if ($a_separator) {
955  $toolbar->addSeparator();
956  }
957 
958  if ($a_back_cmd) {
959  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
960  }
961 
962  $toolbar->addButton(
963  $this->lng->txt("mail_members"),
964  $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
965  );
966  }
967  }
global $DIC
Definition: goto.php:24
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.
$ilUser
Definition: imgupload.php:18
+ 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 911 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

912  {
913  if (
914  $this->getParentObject()->getType() == 'crs' &&
915  $this->getParentObject()->getShowMembersExport()) {
916  if ($a_separator) {
917  $toolbar->addSeparator();
918  }
919 
920  if ($a_back_cmd) {
921  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
922  }
923  $toolbar->addButton(
924  $this->lng->txt($this->getParentObject()->getType() . '_print_list'),
925  $this->ctrl->getLinkTarget($this, 'printForMembersOutput')
926  );
927  }
928  }
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 861 of file class.ilMembershipGUI.php.

References $DIC, canAddOrSearchUsers(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), getParentGUI(), and showMailToMemberToolbarButton().

Referenced by participants().

862  {
863  global $DIC;
864 
865  $ilToolbar = $DIC['ilToolbar'];
866 
867  if ($this->canAddOrSearchUsers()) {
868  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
870  $this,
871  $ilToolbar,
872  array(
873  'auto_complete_name' => $this->lng->txt('user'),
874  'user_type' => $this->getParentGUI()->getLocalRoles(),
875  'user_type_default' => $this->getDefaultRole(),
876  'submit_name' => $this->lng->txt('add')
877  )
878  );
879 
880  // spacer
881  $ilToolbar->addSeparator();
882 
883  // search button
884  $ilToolbar->addButton(
885  $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
886  $this->ctrl->getLinkTargetByClass(
887  'ilRepositorySearchGUI',
888  'start'
889  )
890  );
891 
892  // separator
893  $ilToolbar->addSeparator();
894  }
895 
896  // print button
897  $ilToolbar->addButton(
898  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
899  $this->ctrl->getLinkTarget($this, 'printMembers')
900  );
901 
902  $this->showMailToMemberToolbarButton($ilToolbar, 'participants', false);
903  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
global $DIC
Definition: goto.php:24
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 497 of file class.ilMembershipGUI.php.

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

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