ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCourseParticipantsGroupsGUI Class Reference

Class ilCourseParticipantsGroupsGUI. More...

+ Collaboration diagram for ilCourseParticipantsGroupsGUI:

Public Member Functions

 __construct ($a_ref_id)
 
 executeCommand ()
 
 show ()
 
 applyFilter ()
 
 resetFilter ()
 
 confirmRemove ()
 

Protected Member Functions

 remove ()
 Remove user from group type $ilObjDataCache type $lng type $ilCtrl. More...
 
 add ()
 Add user to group type $ilErr type $ilObjDataCache type $lng type $ilAccess. More...
 

Private Attributes

 $ref_id = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCourseParticipantsGroupsGUI::__construct (   $a_ref_id)

Definition at line 23 of file class.ilCourseParticipantsGroupsGUI.php.

24  {
25  $this->ref_id = $a_ref_id;
26  }

Member Function Documentation

◆ add()

ilCourseParticipantsGroupsGUI::add ( )
protected

Add user to group type $ilErr type $ilObjDataCache type $lng type $ilAccess.

Returns
type

Definition at line 131 of file class.ilCourseParticipantsGroupsGUI.php.

References $_POST, $GLOBALS, $ilErr, $lng, ilGroupParticipants\_getInstanceByObjId(), IL_GRP_MEMBER, ilUtil\sendFailure(), ilUtil\sendSuccess(), show(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.

132  {
133  global $ilErr, $ilObjDataCache, $lng, $ilAccess;
134 
135  if (sizeof($_POST["usrs"])) {
136  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', (int) $_POST['grp_id'])) {
137  ilUtil::sendFailure($lng->txt("permission_denied"), true);
138  $this->show();
139  return;
140  }
141 
142  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
143  $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId((int) $_POST["grp_id"]));
144  foreach ($_POST["usrs"] as $new_member) {
145  if (!$members_obj->add($new_member, IL_GRP_MEMBER)) {
146  $ilErr->raiseError("An Error occured while assigning user to group !", $ilErr->MESSAGE);
147  }
148 
149  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
150  $members_obj->sendNotification(
152  $new_member
153  );
154  }
155  ilUtil::sendSuccess($lng->txt("grp_msg_member_assigned"));
156  }
157 
158  $this->show();
159  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const IL_GRP_MEMBER
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ applyFilter()

ilCourseParticipantsGroupsGUI::applyFilter ( )

Definition at line 51 of file class.ilCourseParticipantsGroupsGUI.php.

References show().

52  {
53  $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
54  $tbl_gui->resetOffset();
55  $tbl_gui->writeFilterToSession();
56  $this->show();
57  }
+ Here is the call graph for this function:

◆ confirmRemove()

ilCourseParticipantsGroupsGUI::confirmRemove ( )

Definition at line 67 of file class.ilCourseParticipantsGroupsGUI.php.

References $_GET, $ilCtrl, $lng, $tpl, ilUtil\getImagePath(), and ilUserUtil\getNamePresentation().

68  {
69  global $ilCtrl, $lng, $tpl;
70 
71  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
72  $confirm = new ilConfirmationGUI();
73  $confirm->setFormAction($ilCtrl->getFormAction($this, 'remove'));
74  $confirm->addHiddenItem("grp_id", $_GET["grp_id"]);
75  $confirm->setHeaderText($lng->txt('grp_dismiss_member'));
76  $confirm->setConfirm($lng->txt('confirm'), 'remove');
77  $confirm->setCancel($lng->txt('cancel'), 'show');
78 
79  include_once './Services/User/classes/class.ilUserUtil.php';
80 
81  $confirm->addItem(
82  'usr_id',
83  $_GET["usr_id"],
84  ilUserUtil::getNamePresentation($_GET["usr_id"], false, false, "", true),
85  ilUtil::getImagePath('icon_usr.svg')
86  );
87 
88  $tpl->setContent($confirm->getHTML());
89  }
$_GET["client_id"]
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
global $lng
Definition: privfeed.php:17
Confirmation screen class.
+ Here is the call graph for this function:

◆ executeCommand()

ilCourseParticipantsGroupsGUI::executeCommand ( )

Definition at line 28 of file class.ilCourseParticipantsGroupsGUI.php.

References $GLOBALS, $ilCtrl, $ilErr, and $lng.

29  {
30  global $ilCtrl, $ilErr, $ilAccess, $lng;
31 
32  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', $this->ref_id)) {
33  $ilErr->raiseError($lng->txt('permission_denied'), $ilErr->WARNING);
34  }
35 
36  $cmd = $ilCtrl->getCmd();
37  if (!$cmd) {
38  $cmd = "show";
39  }
40  $this->$cmd();
41  }
global $ilErr
Definition: raiseError.php:16
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17

◆ remove()

ilCourseParticipantsGroupsGUI::remove ( )
protected

Remove user from group type $ilObjDataCache type $lng type $ilCtrl.

Returns
type

Definition at line 98 of file class.ilCourseParticipantsGroupsGUI.php.

References $_POST, $GLOBALS, $ilCtrl, $lng, ilGroupParticipants\_getInstanceByObjId(), ilUtil\sendFailure(), ilUtil\sendSuccess(), show(), and ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER.

99  {
100  global $ilObjDataCache, $lng, $ilCtrl;
101 
102  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', (int) $_POST['grp_id'])) {
103  ilUtil::sendFailure($lng->txt("permission_denied"), true);
104  $this->show();
105  return;
106  }
107 
108  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
109  $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId((int) $_POST["grp_id"]));
110  $members_obj->delete((int) $_POST["usr_id"]);
111 
112  // Send notification
113  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
114  $members_obj->sendNotification(
116  (int) $_POST["usr_id"]
117  );
118 
119  ilUtil::sendSuccess($lng->txt("grp_msg_membership_annulled"), true);
120  $ilCtrl->redirect($this, "show");
121  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
global $ilCtrl
Definition: ilias.php:18
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ resetFilter()

ilCourseParticipantsGroupsGUI::resetFilter ( )

Definition at line 59 of file class.ilCourseParticipantsGroupsGUI.php.

References show().

60  {
61  $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
62  $tbl_gui->resetOffset();
63  $tbl_gui->resetFilter();
64  $this->show();
65  }
+ Here is the call graph for this function:

◆ show()

ilCourseParticipantsGroupsGUI::show ( )

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

References $tpl.

Referenced by add(), applyFilter(), remove(), and resetFilter().

44  {
45  global $tpl;
46 
47  $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
48  $tpl->setContent($tbl_gui->getHTML());
49  }
$tpl
Definition: ilias.php:10
+ Here is the caller graph for this function:

Field Documentation

◆ $ref_id

ilCourseParticipantsGroupsGUI::$ref_id = 0
private

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


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