ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 146 of file class.ilCourseParticipantsGroupsGUI.php.

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

147  {
148  global $DIC;
149 
150  $ilErr = $DIC['ilErr'];
151  $ilObjDataCache = $DIC['ilObjDataCache'];
152  $lng = $DIC['lng'];
153  $ilAccess = $DIC['ilAccess'];
154 
155  if (sizeof($_POST["usrs"])) {
156  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', (int) $_POST['grp_id'])) {
157  ilUtil::sendFailure($lng->txt("permission_denied"), true);
158  $this->show();
159  return;
160  }
161 
162  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
163  $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId((int) $_POST["grp_id"]));
164  foreach ($_POST["usrs"] as $new_member) {
165  if (!$members_obj->add($new_member, IL_GRP_MEMBER)) {
166  $ilErr->raiseError("An Error occured while assigning user to group !", $ilErr->MESSAGE);
167  }
168 
169  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
170  $members_obj->sendNotification(
172  $new_member
173  );
174  }
175  ilUtil::sendSuccess($lng->txt("grp_msg_member_assigned"));
176  }
177 
178  $this->show();
179  }
global $DIC
Definition: saml.php:7
const IL_GRP_MEMBER
$ilErr
Definition: raiseError.php:18
$lng
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ applyFilter()

ilCourseParticipantsGroupsGUI::applyFilter ( )

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

References show().

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

◆ confirmRemove()

ilCourseParticipantsGroupsGUI::confirmRemove ( )

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

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

75  {
76  global $DIC;
77 
78  $ilCtrl = $DIC['ilCtrl'];
79  $lng = $DIC['lng'];
80  $tpl = $DIC['tpl'];
81 
82  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
83  $confirm = new ilConfirmationGUI();
84  $confirm->setFormAction($ilCtrl->getFormAction($this, 'remove'));
85  $confirm->addHiddenItem("grp_id", $_GET["grp_id"]);
86  $confirm->setHeaderText($lng->txt('grp_dismiss_member'));
87  $confirm->setConfirm($lng->txt('confirm'), 'remove');
88  $confirm->setCancel($lng->txt('cancel'), 'show');
89 
90  include_once './Services/User/classes/class.ilUserUtil.php';
91 
92  $confirm->addItem(
93  'usr_id',
94  $_GET["usr_id"],
95  ilUserUtil::getNamePresentation($_GET["usr_id"], false, false, "", true),
96  ilUtil::getImagePath('icon_usr.svg')
97  );
98 
99  $tpl->setContent($confirm->getHTML());
100  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
$lng
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:
Confirmation screen class.
+ Here is the call graph for this function:

◆ executeCommand()

ilCourseParticipantsGroupsGUI::executeCommand ( )

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

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

29  {
30  global $DIC;
31 
32  $ilCtrl = $DIC['ilCtrl'];
33  $ilErr = $DIC['ilErr'];
34  $ilAccess = $DIC['ilAccess'];
35  $lng = $DIC['lng'];
36 
37  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', $this->ref_id)) {
38  $ilErr->raiseError($lng->txt('permission_denied'), $ilErr->WARNING);
39  }
40 
41  $cmd = $ilCtrl->getCmd();
42  if (!$cmd) {
43  $cmd = "show";
44  }
45  $this->$cmd();
46  }
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
global $ilCtrl
Definition: ilias.php:18
$lng
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

◆ remove()

ilCourseParticipantsGroupsGUI::remove ( )
protected

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

Returns
type

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

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

110  {
111  global $DIC;
112 
113  $ilObjDataCache = $DIC['ilObjDataCache'];
114  $lng = $DIC['lng'];
115  $ilCtrl = $DIC['ilCtrl'];
116 
117  if (!$GLOBALS['DIC']->access()->checkRbacOrPositionPermissionAccess('manage_members', 'manage_members', (int) $_POST['grp_id'])) {
118  ilUtil::sendFailure($lng->txt("permission_denied"), true);
119  $this->show();
120  return;
121  }
122 
123  include_once './Modules/Group/classes/class.ilGroupParticipants.php';
124  $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId((int) $_POST["grp_id"]));
125  $members_obj->delete((int) $_POST["usr_id"]);
126 
127  // Send notification
128  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
129  $members_obj->sendNotification(
131  (int) $_POST["usr_id"]
132  );
133 
134  ilUtil::sendSuccess($lng->txt("grp_msg_membership_annulled"), true);
135  $ilCtrl->redirect($this, "show");
136  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
$lng
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ Here is the call graph for this function:

◆ resetFilter()

ilCourseParticipantsGroupsGUI::resetFilter ( )

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

References show().

67  {
68  $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
69  $tbl_gui->resetOffset();
70  $tbl_gui->resetFilter();
71  $this->show();
72  }
+ Here is the call graph for this function:

◆ show()

ilCourseParticipantsGroupsGUI::show ( )

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

References $DIC, and $tpl.

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

49  {
50  global $DIC;
51 
52  $tpl = $DIC['tpl'];
53 
54  $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
55  $tpl->setContent($tbl_gui->getHTML());
56  }
global $DIC
Definition: saml.php:7
$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: