ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 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...
 
 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...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 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 $GLOBALS, $repository_gui, ilLoggerFactory\getLogger(), and getParentObject().

54  {
55  $this->repository_gui = $repository_gui;
56  $this->repository_object = $repository_obj;
57 
58  $this->lng = $GLOBALS['DIC']->language();
59  $this->lng->loadLanguageModule('crs');
60  $this->lng->loadLanguageModule($this->getParentObject()->getType());
61  $this->tpl = $GLOBALS['DIC']->ui()->mainTemplate();
62  $this->ctrl = $GLOBALS['DIC']->ctrl();
63  $this->logger = ilLoggerFactory::getLogger($this->getParentObject()->getType());
64  $this->access = $GLOBALS['DIC']->access();
65  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getLogger($a_component_id)
Get component logger.
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

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

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

964  {
965  global $ilAccess;
966 
967  include_once './Services/Mail/classes/class.ilMail.php';
968  $mail = new ilMail($GLOBALS['ilUser']->getId());
969 
970  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
971  'manage_members',
972  'manage_members',
973  $this->getParentObject()->getRefId()
974  );
975 
976  if ($has_manage_members_permission) {
977  $tabs->addTab(
978  'members',
979  $this->lng->txt('members'),
980  $this->ctrl->getLinkTarget($this, '')
981  );
982  } elseif (
983  (bool) $this->getParentObject()->getShowMembers() && $a_is_participant
984  ) {
985  $tabs->addTab(
986  'members',
987  $this->lng->txt('members'),
988  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilusersgallerygui'), 'view')
989  );
990  } elseif (
991  $this->getParentObject()->getMailToMembersType() == 1 &&
992  $GLOBALS['rbacsystem']->checkAccess('internal_mail', $mail->getMailObjectReferenceId()) &&
993  $a_is_participant
994  ) {
995  $tabs->addTab(
996  'members',
997  $this->lng->txt('members'),
998  $this->ctrl->getLinkTarget($this, "mailMembersBtn")
999  );
1000  }
1001  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
This class handles base functions for mail handling.
Create styles array
The data for the language used.
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.
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:

◆ addToClipboard()

ilMembershipGUI::addToClipboard ( )
protected

Add selected users to user clipboard.

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

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

1475  {
1476  $users = (array) $_POST['participants'];
1477  if (!count($users)) {
1478  ilUtil::sendFailure($this->lng->txt('select_one'), true);
1479  $this->ctrl->redirect($this, 'participants');
1480  }
1481  include_once './Services/User/classes/class.ilUserClipboard.php';
1482  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
1483  $clip->add($users);
1484  $clip->save();
1485 
1486  $this->lng->loadLanguageModule('user');
1487  ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
1488  $this->ctrl->redirect($this, 'participants');
1489  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
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 1338 of file class.ilMembershipGUI.php.

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

1339  {
1340  if (!count($_POST["waiting"])) {
1341  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1342  $this->ctrl->redirect($this, 'participants');
1343  }
1344 
1345  $waiting_list = $this->initWaitingList();
1346 
1347  $added_users = 0;
1348  foreach ($_POST["waiting"] as $user_id) {
1349  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
1350  continue;
1351  }
1352  if ($this->getMembersObject()->isAssigned($user_id)) {
1353  continue;
1354  }
1355 
1356  if ($this instanceof ilCourseMembershipGUI) {
1357  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
1358  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id, true);
1359  $this->getParentObject()->checkLPStatusSync($user_id);
1360  }
1361  if ($this instanceof ilGroupMembershipGUI) {
1362  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1363  $this->getMembersObject()->add($user_id, IL_GRP_MEMBER);
1364  $this->getMembersObject()->sendNotification(
1366  $user_id,
1367  true
1368  );
1369  }
1370  if ($this instanceof ilSessionMembershipGUI) {
1371  $this->getMembersObject()->register($user_id);
1373  $noti->setRefId($this->getParentObject()->getRefId());
1374  $noti->setRecipients(array($user_id));
1376  $noti->send();
1377  }
1378 
1379  $waiting_list->removeFromList($user_id);
1380  ++$added_users;
1381  }
1382 
1383  if ($added_users) {
1384  ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
1385  $this->ctrl->redirect($this, 'participants');
1386  } else {
1387  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
1388  $this->ctrl->redirect($this, 'participants');
1389  }
1390  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
Create styles array
The data for the language used.
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 1233 of file class.ilMembershipGUI.php.

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

1234  {
1235  global $ilErr;
1236 
1237  if (!is_array($_POST["subscribers"])) {
1238  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1239  $this->ctrl->redirect($this, 'participants');
1240  }
1241 
1242  if (!$this->getMembersObject()->assignSubscribers($_POST["subscribers"])) {
1243  ilUtil::sendFailure($ilErr->getMessage(), true);
1244  $this->ctrl->redirect($this, 'participants');
1245  } else {
1246  foreach ($_POST["subscribers"] as $usr_id) {
1247  if ($this instanceof ilCourseMembershipGUI) {
1248  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_SUBSCRIBER, $usr_id);
1249  $this->getParentObject()->checkLPStatusSync($usr_id);
1250  }
1251  if ($this instanceof ilGroupMembershipGUI) {
1252  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1253  $this->getMembersObject()->sendNotification(
1255  $usr_id
1256  );
1257  }
1258  if ($this instanceof ilSessionMembershipGUI) {
1259  // todo refactor to participants
1260  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1262  $noti->setRefId($this->getParentObject()->getRefId());
1263  $noti->setRecipients(array($usr_id));
1265  $noti->send();
1266  }
1267  }
1268  }
1269  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_assigned"), true);
1270  $this->ctrl->redirect($this, 'participants');
1271  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
getMembersObject()
Get member object.
assignSubscribers()
Do assignment of subscription request type $rbacsystem type $ilErr.
GUI class for membership features.
Create styles array
The data for the language used.
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 187 of file class.ilMembershipGUI.php.

References checkPermissionBool().

Referenced by showParticipantsToolbar().

188  {
189  return $this->checkPermissionBool('manage_members');
190  }
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 159 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser(), and printMembers().

160  {
161  if (!$this->checkPermissionBool($a_permission, $a_cmd)) {
162  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
163  $this->ctrl->redirect($this->getParentGUI());
164  }
165  }
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 130 of file class.ilMembershipGUI.php.

References getParentObject().

Referenced by canAddOrSearchUsers(), checkPermission(), and confirmDeleteParticipants().

131  {
132  if (!$a_ref_id) {
133  $a_ref_id = $this->getParentObject()->getRefId();
134  }
135  return $this->access->checkAccess($a_permission, $a_cmd, $a_ref_id);
136  }
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 173 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

174  {
175  if (!$this->checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm)) {
176  ilUtil::sendFailure($this->lng->txt('no_permission'), true);
177  $this->ctrl->redirect($this->getParentGUI());
178  }
179  }
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 144 of file class.ilMembershipGUI.php.

References getParentObject().

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

145  {
146  if (!$a_ref_id) {
147  $a_ref_id = $this->getParentObject()->getRefId();
148  }
149  return $this->access->checkRbacOrPositionPermissionAccess($a_rbac_perm, $a_pos_perm, $a_ref_id);
150  }
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 1301 of file class.ilMembershipGUI.php.

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

1302  {
1303  if (!is_array($_POST["waiting"])) {
1304  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
1305  $this->ctrl->redirect($this, 'participants');
1306  }
1307 
1308 
1309  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1310  $c_gui = new ilConfirmationGUI();
1311 
1312  // set confirm/cancel commands
1313  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignFromWaitingList"));
1314  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1315  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1316  $c_gui->setConfirm($this->lng->txt("confirm"), "assignFromWaitingList");
1317 
1318  foreach ($_POST["waiting"] as $waiting) {
1319  $name = ilObjUser::_lookupName($waiting);
1320 
1321  $c_gui->addItem(
1322  'waiting[]',
1323  $name['user_id'],
1324  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1325  ilUtil::getImagePath('icon_usr.svg')
1326  );
1327  }
1328 
1329  $this->tpl->setContent($c_gui->getHTML());
1330  return true;
1331  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:146
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 1116 of file class.ilMembershipGUI.php.

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

1117  {
1118  if (!is_array($_POST["subscribers"])) {
1119  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1120  $this->ctrl->redirect($this, 'participants');
1121  }
1122 
1123  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1124  $c_gui = new ilConfirmationGUI();
1125 
1126  // set confirm/cancel commands
1127  $c_gui->setFormAction($this->ctrl->getFormAction($this, "assignSubscribers"));
1128  $c_gui->setHeaderText($this->lng->txt("info_assign_sure"));
1129  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1130  $c_gui->setConfirm($this->lng->txt("confirm"), "assignSubscribers");
1131 
1132  foreach ($_POST["subscribers"] as $subscribers) {
1133  $name = ilObjUser::_lookupName($subscribers);
1134 
1135  $c_gui->addItem(
1136  'subscribers[]',
1137  $name['user_id'],
1138  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1139  ilUtil::getImagePath('icon_usr.svg')
1140  );
1141  }
1142 
1143  $this->tpl->setContent($c_gui->getHTML());
1144  return true;
1145  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:146
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 608 of file class.ilMembershipGUI.php.

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

609  {
610  global $ilAccess, $ilUser;
611 
612  $participants = (array) $_POST['participants'];
613 
614  if (!count($participants)) {
615  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
616  $this->ctrl->redirect($this, 'participants');
617  }
618 
619  // Check last admin
620  if (!$this->getMembersObject()->checkLastAdmin($participants)) {
621  ilUtil::sendFailure($this->lng->txt($this->getParentObject()->getType() . '_at_least_one_admin'), true);
622  $this->ctrl->redirect($this, 'participants');
623  }
624 
625  // if only position access is granted, show additional info
626  if (!$this->checkPermissionBool('manage_members')) {
627  $this->lng->loadLanguageModule('rbac');
628  ilUtil::sendInfo($this->lng->txt('rbac_info_only_position_access'));
629  }
630 
631 
632  // Access check for admin deletion
633  if (
634  !$ilAccess->checkAccess(
635  'edit_permission',
636  '',
637  $this->getParentObject()->getRefId()
638  ) &&
639  !$this->getMembersObject()->isAdmin($GLOBALS['ilUser']->getId())
640  ) {
641  foreach ($participants as $usr_id) {
642  if ($this->getMembersObject()->isAdmin($usr_id)) {
643  ilUtil::sendFailure($this->lng->txt("msg_no_perm_perm"), true);
644  $this->ctrl->redirect($this, 'participants');
645  }
646  }
647  }
648 
649 
650  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
651  $confirm = new ilConfirmationGUI();
652  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
653  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
654  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
655  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
656 
657  foreach ($participants as $usr_id) {
658  $name = ilObjUser::_lookupName($usr_id);
659 
660  $confirm->addItem(
661  'participants[]',
662  $name['user_id'],
663  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
664  ilUtil::getImagePath('icon_usr.svg')
665  );
666  }
667 
668  $this->tpl->setContent($confirm->getHTML());
669  }
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($format !==null) $name
Definition: metadata.php:146
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
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:

◆ confirmRefuseFromList()

ilMembershipGUI::confirmRefuseFromList ( )

Refuse from waiting list (confirmation)

Returns
boolean

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

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

1397  {
1398  if (!is_array($_POST["waiting"])) {
1399  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
1400  $this->ctrl->redirect($this, 'participants');
1401  }
1402 
1403  $this->lng->loadLanguageModule('mmbr');
1404 
1405  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1406  $c_gui = new ilConfirmationGUI();
1407 
1408  // set confirm/cancel commands
1409  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseFromList"));
1410  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1411  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1412  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseFromList");
1413 
1414  foreach ($_POST["waiting"] as $waiting) {
1415  $name = ilObjUser::_lookupName($waiting);
1416 
1417  $c_gui->addItem(
1418  'waiting[]',
1419  $name['user_id'],
1420  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1421  ilUtil::getImagePath('icon_usr.svg')
1422  );
1423  }
1424 
1425  $this->tpl->setContent($c_gui->getHTML());
1426  return true;
1427  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:146
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 1151 of file class.ilMembershipGUI.php.

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

1152  {
1153  if (!is_array($_POST["subscribers"])) {
1154  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1155  $this->ctrl->redirect($this, 'participants');
1156  }
1157 
1158  $this->lng->loadLanguageModule('mmbr');
1159 
1160  include_once("Services/Utilities/classes/class.ilConfirmationGUI.php");
1161  $c_gui = new ilConfirmationGUI();
1162 
1163  // set confirm/cancel commands
1164  $c_gui->setFormAction($this->ctrl->getFormAction($this, "refuseSubscribers"));
1165  $c_gui->setHeaderText($this->lng->txt("info_refuse_sure"));
1166  $c_gui->setCancel($this->lng->txt("cancel"), "participants");
1167  $c_gui->setConfirm($this->lng->txt("confirm"), "refuseSubscribers");
1168 
1169  foreach ($_POST["subscribers"] as $subscribers) {
1170  $name = ilObjUser::_lookupName($subscribers);
1171 
1172  $c_gui->addItem(
1173  'subscribers[]',
1174  $name['user_id'],
1175  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
1176  ilUtil::getImagePath('icon_usr.svg')
1177  );
1178  }
1179 
1180  $this->tpl->setContent($c_gui->getHTML());
1181  return true;
1182  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:146
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 932 of file class.ilMembershipGUI.php.

References getParentGUI().

Referenced by sendMailToSelectedUsers().

933  {
934  return $this->getParentGUI()->createMailSignature();
935  }
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 671 of file class.ilMembershipGUI.php.

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

672  {
673  global $rbacreview, $rbacsystem, $ilAccess, $ilUser;
674 
675  $participants = (array) $_POST['participants'];
676 
677  if (!is_array($participants) or !count($participants)) {
678  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
679  $this->ctrl->redirect($this, 'participants');
680  }
681 
682  // If the user doesn't have the edit_permission and is not administrator, he may not remove
683  // members who have the course administrator role
684  if (
685  !$ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
686  !$this->getMembersObject()->isAdmin($GLOBALS['ilUser']->getId())
687  ) {
688  foreach ($participants as $part) {
689  if ($this->getMembersObject()->isAdmin($part)) {
690  ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'), true);
691  $this->ctrl->redirect($this, 'participants');
692  }
693  }
694  }
695 
696  if (!$this->getMembersObject()->deleteParticipants($participants)) {
697  ilUtil::sendFailure('Error deleting participants.', true);
698  $this->ctrl->redirect($this, 'participants');
699  } else {
700  foreach ((array) $_POST["participants"] as $usr_id) {
701  $mail_type = 0;
702  // @todo more generic
703  switch ($this->getParentObject()->getType()) {
704  case 'crs':
705  $mail_type = $this->getMembersObject()->NOTIFY_DISMISS_MEMBER;
706  break;
707  case 'grp':
708  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
710  break;
711  }
712  $this->getMembersObject()->sendNotification($mail_type, $usr_id);
713  }
714  }
715  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
716  $this->ctrl->redirect($this, "participants");
717 
718  return true;
719  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
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:

◆ editMember()

ilMembershipGUI::editMember ( )
protected

Edit one participant.

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

References array, editParticipants(), and getParentObject().

459  {
460  $this->activateSubTab($this->getParentObject()->getType() . "_member_administration");
461  return $this->editParticipants(array($_REQUEST['member_id']));
462  }
Create styles array
The data for the language used.
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 468 of file class.ilMembershipGUI.php.

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

Referenced by editMember().

469  {
470  if (!$post_participants) {
471  $post_participants = (array) $_POST['participants'];
472  }
473 
474  $real_participants = $this->getMembersObject()->getParticipants();
475  $participants = array_intersect((array) $post_participants, (array) $real_participants);
476 
477  if (!count($participants)) {
478  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
479  $this->ctrl->redirect($this, 'participants');
480  }
481  $table = $this->initEditParticipantTableGUI($participants);
482  $this->tpl->setContent($table->getHTML());
483  return true;
484  }
getMembersObject()
Get member object.
Create styles array
The data for the language used.
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 78 of file class.ilMembershipGUI.php.

References $ctrl.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getDefaultCommand()

ilMembershipGUI::getDefaultCommand ( )
protected

Get default command.

Returns
string

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

References checkRbacOrPositionAccessBool(), and getParentObject().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

942  {
943  $has_manage_members_permission = $this->checkRbacOrPositionAccessBool(
944  'manage_members',
945  'manage_members',
946  $this->getParentObject()->getRefId()
947  );
948  if ($has_manage_members_permission) {
949  return 'participants';
950  }
951 
952  if ($this->getParentObject()->getShowMembers()) {
953  return 'jump2UsersGallery';
954  }
955  return 'mailMembersBtn';
956  }
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 1494 of file class.ilMembershipGUI.php.

References $GLOBALS, and $tabs.

Referenced by showParticipantsToolbar().

1495  {
1496  return null;
1497  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilMembershipGUI::getLanguage ( )
protected
Returns
ilLanguage

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

References $lng.

Referenced by ilSessionMembershipGUI\updateMembers().

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

◆ getLocalRoles()

ilMembershipGUI::getLocalRoles ( )

Get parent roles.

Returns
type

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

References getParentGUI().

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1090  {
1091  return $this->getParentGUI()->getLocalRoles();
1092  }
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
ilLogger

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

References $logger.

Referenced by ilSessionMembershipGUI\updateMembers().

87  {
88  return $this->logger;
89  }
+ Here is the caller graph for this function:

◆ getMembersObject()

ilMembershipGUI::getMembersObject ( )

Get member object.

Returns
ilParticipants

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

References ilParticipants\getInstanceByObjId(), 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().

115  {
116  if ($this->participants instanceof ilParticipants) {
117  return $this->participants;
118  }
119  include_once './Services/Membership/classes/class.ilParticipants.php';
120  return $this->participants = ilParticipants::getInstanceByObjId($this->getParentObject()->getId());
121  }
participants()
Show participant table, subscriber table, wating list table;.
getParentObject()
Get parent object.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getParentGUI()

◆ getParentObject()

ilMembershipGUI::getParentObject ( )

Get parent object.

Returns
ilObject

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

References $repository_object.

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

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

◆ jump2UsersGallery()

ilMembershipGUI::jump2UsersGallery ( )
protected

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

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

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

◆ mailMembersBtn()

ilMembershipGUI::mailMembersBtn ( )
protected

Mail to members view type $ilToolbar.

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

References $GLOBALS, and showMailToMemberToolbarButton().

814  {
815  global $ilToolbar;
816 
817  $this->showMailToMemberToolbarButton($GLOBALS['ilToolbar'], 'mailMembersBtn');
818  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
+ Here is the call graph for this function:

◆ membersMap()

ilMembershipGUI::membersMap ( )
protected

Members map.

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

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

780  {
781  global $tpl;
782  $this->activateSubTab($this->getParentObject()->getType() . "_members_map");
783  include_once("./Services/Maps/classes/class.ilMapUtil.php");
784  if (!ilMapUtil::isActivated() || !$this->getParentObject()->getEnableMap()) {
785  return;
786  }
787 
788  $map = ilMapUtil::getMapGUI();
789  $map->setMapId("course_map")
790  ->setWidth("700px")
791  ->setHeight("500px")
792  ->setLatitude($this->getParentObject()->getLatitude())
793  ->setLongitude($this->getParentObject()->getLongitude())
794  ->setZoom($this->getParentObject()->getLocationZoom())
795  ->setEnableTypeControl(true)
796  ->setEnableNavigationControl(true)
797  ->setEnableCentralMarker(true);
798 
799  include_once './Services/Membership/classes/class.ilParticipants.php';
800  $members = ilParticipants::getInstanceByObjId($this->getParentObject()->getId())->getParticipants();
801  foreach ((array) $members as $user_id) {
802  $map->addUserMarker($user_id);
803  }
804 
805  $tpl->setContent($map->getHTML());
806  $tpl->setLeftContent($map->getUserListHTML());
807  }
static getMapGUI()
Get an instance of the GUI class.
Create styles array
The data for the language used.
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 1097 of file class.ilMembershipGUI.php.

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

Referenced by participants().

1098  {
1099  $subscribers = $this->getMembersObject()->getSubscribers();
1100  $filtered_subscribers = $this->filterUserIdsByRbacOrPositionOfCurrentUser($subscribers);
1101  if (!count($filtered_subscribers)) {
1102  return null;
1103  }
1104  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true);
1105  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
1106  $subscriber->readSubscriberData(
1107  $filtered_subscribers
1108  );
1109  return $subscriber;
1110  }
getMembersObject()
Get member object.
GUI class for course/group subscriptions.
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:

◆ parseWaitingListTable()

ilMembershipGUI::parseWaitingListTable ( )
protected

Parse table of subscription request.

Returns
ilWaitingListTableGUI

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

References filterUserIdsByRbacOrPositionOfCurrentUser(), and getParentObject().

Referenced by participants().

1278  {
1279  $wait = $this->initWaitingList();
1280 
1281  $wait_users = $this->filterUserIdsByRbacOrPositionOfCurrentUser($wait->getUserIds());
1282  if (!count($wait_users)) {
1283  return null;
1284  }
1285 
1286  include_once './Services/Membership/classes/class.ilWaitingListTableGUI.php';
1287  $waiting_table = new ilWaitingListTableGUI($this, $this->getParentObject(), $wait);
1288  $waiting_table->setUserIds(
1289  $wait_users
1290  );
1291  $waiting_table->readUserData();
1292  $waiting_table->setTitle($this->lng->txt('crs_waiting_list'));
1293 
1294  return $waiting_table;
1295  }
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 397 of file class.ilMembershipGUI.php.

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

Referenced by getMembersObject(), ilSessionMembershipGUI\jump2UsersGallery(), participantsApplyFilter(), and participantsResetFilter().

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

References $table, and participants().

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

References $_POST, $table, ilLoggerFactory\getLogger(), and participants().

444  {
445  ilLoggerFactory::getLogger('root')->dump($_POST);
446 
447  $table = $this->initParticipantTableGUI();
448  $table->resetOffset();
449  $table->resetFilter();
450 
451  $this->participants();
452  }
participants()
Show participant table, subscriber table, wating list table;.
static getLogger($a_component_id)
Get component logger.
if(empty($password)) $table
Definition: pwgen.php:24
$_POST["username"]
+ Here is the call graph for this function:

◆ printForMembersOutput()

ilMembershipGUI::printForMembersOutput ( )
protected

print members output

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

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

1561  {
1562  $list = $this->initAttendanceList();
1563  $list->setTitle($this->lng->txt('obj_' . $this->getParentObject()->getType()) . ': ' . $this->getParentObject()->getTitle());
1564  $list->setId(0);
1565  $form = $list->initForm('printForMembersOutput');
1566  $list->initFromForm();
1567  $list->setCallback(array($this, 'getAttendanceListUserData'));
1568  $this->member_data = $this->getPrintMemberData($this->getMembersObject()->getParticipants());
1569  $list->getNonMemberUserData($this->member_data);
1570 
1571  $list->getFullscreenHTML();
1572  exit();
1573  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getMembersObject()
Get member object.
if(isset($_POST['submit'])) $form
Create styles array
The data for the language used.
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 1518 of file class.ilMembershipGUI.php.

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

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

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

1541  {
1542  $list = $this->initAttendanceList();
1543  $list->initFromForm();
1544  $list->setCallback(array($this, 'getAttendanceListUserData'));
1545  $this->member_data = $this->getPrintMemberData(
1547  $this->getMembersObject()->getParticipants()
1548  )
1549  );
1550 
1551  $list->getNonMemberUserData($this->member_data);
1552 
1553  $list->getFullscreenHTML();
1554  exit();
1555  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
getMembersObject()
Get member object.
Create styles array
The data for the language used.
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 1080 of file class.ilMembershipGUI.php.

References getParentGUI().

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

1081  {
1082  return $this->getParentGUI()->readMemberData($usr_ids, $columns);
1083  }
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 1435 of file class.ilMembershipGUI.php.

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

1436  {
1437  if (!count($_POST['waiting'])) {
1438  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
1439  $this->ctrl->redirect($this, 'participants');
1440  }
1441 
1442  $waiting_list = $this->initWaitingList();
1443 
1444  foreach ($_POST["waiting"] as $user_id) {
1445  $waiting_list->removeFromList($user_id);
1446 
1447  if ($this instanceof ilCourseMembershipGUI) {
1448  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $user_id, true);
1449  }
1450  if ($this instanceof ilGroupMembershipGUI) {
1451  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1452  $this->getMembersObject()->sendNotification(
1454  $user_id,
1455  true
1456  );
1457  }
1458  if ($this instanceof ilSessionMembershipGUI) {
1459  include_once './Modules/Session/classes/class.ilSessionMembershipMailNotification.php';
1461  $noti->setRefId($this->getParentObject()->getRefId());
1462  $noti->setRecipients(array($user_id));
1464  $noti->send();
1465  }
1466  }
1467  ilUtil::sendSuccess($this->lng->txt('crs_users_removed_from_list'), true);
1468  $this->ctrl->redirect($this, 'participants');
1469  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
GUI class for membership features.
Create styles array
The data for the language used.
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 1189 of file class.ilMembershipGUI.php.

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

1190  {
1191  global $rbacsystem;
1192 
1193  if (!$_POST['subscribers']) {
1194  ilUtil::sendFailure($this->lng->txt("crs_no_subscribers_selected"), true);
1195  $this->ctrl->redirect($this, 'participants');
1196  }
1197 
1198  if (!$this->getMembersObject()->deleteSubscribers($_POST["subscribers"])) {
1199  ilUtil::sendFailure($GLOBALS['ilErr']->getMessage(), true);
1200  $this->ctrl->redirect($this, 'participants');
1201  } else {
1202  foreach ($_POST['subscribers'] as $usr_id) {
1203  if ($this instanceof ilCourseMembershipGUI) {
1204  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_DISMISS_SUBSCRIBER, $usr_id);
1205  }
1206  if ($this instanceof ilGroupMembershipGUI) {
1207  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
1208  $this->getMembersObject()->sendNotification(
1210  $usr_id
1211  );
1212  }
1213  if ($this instanceof ilSessionMembershipGUI) {
1215  $noti->setRefId($this->getParentObject()->getRefId());
1216  $noti->setRecipients(array($usr_id));
1218  $noti->send();
1219  }
1220  }
1221  }
1222 
1223  ilUtil::sendSuccess($this->lng->txt("crs_subscribers_deleted"), true);
1224  $this->ctrl->redirect($this, 'participants');
1225  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
GUI class for membership features.
Create styles array
The data for the language used.
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:

◆ sendMailToSelectedUsers()

ilMembershipGUI::sendMailToSelectedUsers ( )
protected

Send mail to selected users.

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

References $_GET, $_POST, ilObjUser\_lookupLogin(), array, ilMailFormCall\CONTEXT_KEY, createMailSignature(), getParentObject(), ilMailFormCall\getRedirectTarget(), ilCourseMailTemplateTutorContext\ID, ilUtil\redirect(), ilUtil\sendFailure(), ilMailFormCall\setRecipients(), and time.

725  {
726  if ($_POST['participants']) {
727  $participants = (array) $_POST['participants'];
728  } elseif ($_GET['member_id']) {
729  $participants = array($_GET['member_id']);
730  } elseif ($_POST['subscribers']) {
731  $participants = (array) $_POST['subscribers'];
732  } elseif ($_POST['waiting']) {
733  $participants = (array) $_POST['waiting'];
734  }
735 
736  if (!count($participants)) {
737  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
738  $this->ctrl->redirect($this, 'participants');
739  }
740 
741  foreach ($participants as $usr_id) {
742  $rcps[] = ilObjUser::_lookupLogin($usr_id);
743  }
744 
745  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
746  require_once 'Modules/Course/classes/class.ilCourseMailTemplateTutorContext.php';
747 
748  $context_options = [];
749 
750  // @todo refactor
751  if ($this->getParentObject()->getType() == 'crs') {
752  $context_options =
753  array(
755  'ref_id' => $this->getParentObject()->getRefId(),
756  'ts' => time()
757  );
758  }
759 
760 
764  $this,
765  'participants',
766  array(),
767  array(
768  'type' => 'new',
769  'sig' => $this->createMailSignature()
770  ),
771  $context_options
772  )
773  );
774  }
static _lookupLogin($a_user_id)
lookup login
$_GET["client_id"]
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const CONTEXT_KEY
Session parameter for the context.
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
static setRecipients(array $recipients)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getParentObject()
Get parent object.
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 1006 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

1007  {
1008  global $ilAccess;
1009 
1010  if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members', $this->getParentObject()->getRefId())) {
1011  $tabs->addSubTabTarget(
1012  $this->getParentObject()->getType() . "_member_administration",
1013  $this->ctrl->getLinkTarget($this, 'participants'),
1014  "members",
1015  get_class($this)
1016  );
1017 
1018  // show group overview
1019  if ($this instanceof ilCourseMembershipGUI) {
1020  $tabs->addSubTabTarget(
1021  "crs_members_groups",
1022  $this->ctrl->getLinkTargetByClass("ilCourseParticipantsGroupsGUI", "show"),
1023  "",
1024  "ilCourseParticipantsGroupsGUI"
1025  );
1026  }
1027 
1028  $childs = (array) $GLOBALS['tree']->getChildsByType($this->getParentObject()->getRefId(), 'sess');
1029  if (count($childs)) {
1030  $tabs->addSubTabTarget(
1031  'events',
1032  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilsessionoverviewgui'), 'listSessions'),
1033  '',
1034  'ilsessionoverviewgui'
1035  );
1036  }
1037 
1038  $tabs->addSubTabTarget(
1039  $this->getParentObject()->getType() . '_members_gallery',
1040  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1041  'view',
1042  'ilUsersGalleryGUI'
1043  );
1044  } elseif ($this->getParentObject()->getShowMembers()) {
1045  // gallery
1046  $tabs->addSubTabTarget(
1047  $this->getParentObject()->getType() . '_members_gallery',
1048  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
1049  'view',
1050  'ilUsersGalleryGUI'
1051  );
1052  }
1053 
1054  include_once './Services/Maps/classes/class.ilMapUtil.php';
1055  if (ilMapUtil::isActivated() && $this->getParentObject()->getEnableMap()) {
1056  $tabs->addSubTabTarget(
1057  $this->getParentObject()->getType() . '_members_map',
1058  $this->ctrl->getLinkTarget($this, 'membersMap'),
1059  "membersMap",
1060  get_class($this)
1061  );
1062  }
1063 
1064  include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
1065  if (ilPrivacySettings::_getInstance()->checkExportAccess($this->getParentObject()->getRefId())) {
1066  $tabs->addSubTabTarget(
1067  'export_members',
1068  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilmemberexportgui'), 'show'),
1069  '',
1070  'ilmemberexportgui'
1071  );
1072  }
1073  }
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
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 900 of file class.ilMembershipGUI.php.

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

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

901  {
902  global $ilUser, $rbacsystem, $ilAccess;
903  include_once 'Services/Mail/classes/class.ilMail.php';
904  $mail = new ilMail($ilUser->getId());
905 
906  if (
907  ($this->getParentObject()->getMailToMembersType() == 1) ||
908  (
909  $ilAccess->checkAccess('manage_members', "", $this->getParentObject()->getRefId()) &&
910  $rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId())
911  )
912  ) {
913  if ($a_separator) {
914  $toolbar->addSeparator();
915  }
916 
917  if ($a_back_cmd) {
918  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
919  }
920 
921  $toolbar->addButton(
922  $this->lng->txt("mail_members"),
923  $this->ctrl->getLinkTargetByClass('ilMailMemberSearchGUI', '')
924  );
925  }
926  }
This class handles base functions for mail handling.
$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 874 of file class.ilMembershipGUI.php.

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

Referenced by filterUserIdsByRbacOrPositionOfCurrentUser().

875  {
876  if (
877  $this->getParentObject()->getType() == 'crs' &&
878  $this->getParentObject()->getShowMembersExport()) {
879  if ($a_separator) {
880  $toolbar->addSeparator();
881  }
882 
883  if ($a_back_cmd) {
884  $this->ctrl->setParameter($this, "back_cmd", $a_back_cmd);
885  }
886  $toolbar->addButton(
887  $this->lng->txt($this->getParentObject()->getType() . '_print_list'),
888  $this->ctrl->getLinkTarget($this, 'printForMembersOutput')
889  );
890  }
891  }
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 826 of file class.ilMembershipGUI.php.

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

Referenced by participants().

827  {
828  global $ilToolbar;
829 
830  if ($this->canAddOrSearchUsers()) {
831  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
833  $this,
834  $ilToolbar,
835  array(
836  'auto_complete_name' => $this->lng->txt('user'),
837  'user_type' => $this->getParentGUI()->getLocalRoles(),
838  'user_type_default' => $this->getDefaultRole(),
839  'submit_name' => $this->lng->txt('add')
840  )
841  );
842 
843  // spacer
844  $ilToolbar->addSeparator();
845 
846  // search button
847  $ilToolbar->addButton(
848  $this->lng->txt($this->getParentObject()->getType() . "_search_users"),
849  $this->ctrl->getLinkTargetByClass(
850  'ilRepositorySearchGUI',
851  'start'
852  )
853  );
854 
855  // separator
856  $ilToolbar->addSeparator();
857  }
858 
859  // print button
860  $ilToolbar->addButton(
861  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
862  $this->ctrl->getLinkTarget($this, 'printMembers')
863  );
864 
865  $this->showMailToMemberToolbarButton($ilToolbar, 'participants', false);
866  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
getParentGUI()
Get parent gui.
Create styles array
The data for the language used.
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 493 of file class.ilMembershipGUI.php.

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

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

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

◆ $ctrl

ilMembershipGUI::$ctrl = null
protected

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

Referenced by getCtrl().

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