ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilCourseParticipantsGroupsGUI Class Reference

Class ilCourseParticipantsGroupsGUI. More...

+ Collaboration diagram for ilCourseParticipantsGroupsGUI:

Public Member Functions

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCourseParticipantsGroupsGUI::__construct (   $a_ref_id)

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

18 {
19 $this->ref_id = $a_ref_id;
20 }

Member Function Documentation

◆ add()

ilCourseParticipantsGroupsGUI::add ( )

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

112 {
113 global $ilErr, $ilObjDataCache, $lng, $ilAccess;
114
115
116 if(sizeof($_POST["usrs"]))
117 {
118 if (!$ilAccess->checkAccess("write", "", $_POST["grp_id"]))
119 {
120 ilUtil::sendFailure($lng->txt("permission_denied"), true);
121 $this->show();
122 return;
123 }
124
125 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
126 $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId($_POST["grp_id"]));
127 foreach ($_POST["usrs"] as $new_member)
128 {
129 if (!$members_obj->add($new_member, IL_GRP_MEMBER))
130 {
131 $ilErr->raiseError("An Error occured while assigning user to group !", $ilErr->MESSAGE);
132 }
133
134 include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
135 $members_obj->sendNotification(
137 $new_member
138 );
139
140 }
141
142 ilUtil::sendSuccess($lng->txt("grp_msg_member_assigned"));
143 }
144
145 $this->show();
146 }
const IL_GRP_MEMBER
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

◆ applyFilter()

ilCourseParticipantsGroupsGUI::applyFilter ( )

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

48 {
49 $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
50 $tbl_gui->resetOffset();
51 $tbl_gui->writeFilterToSession();
52 $this->show();
53 }

References show().

+ Here is the call graph for this function:

◆ confirmRemove()

ilCourseParticipantsGroupsGUI::confirmRemove ( )

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

64 {
65 global $ilAccess, $ilCtrl, $lng, $tpl;
66
67 include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
68 $confirm = new ilConfirmationGUI();
69 $confirm->setFormAction($ilCtrl->getFormAction($this,'remove'));
70 $confirm->addHiddenItem("grp_id", $_GET["grp_id"]);
71 $confirm->setHeaderText($lng->txt('grp_dismiss_member'));
72 $confirm->setConfirm($lng->txt('confirm'),'remove');
73 $confirm->setCancel($lng->txt('cancel'),'show');
74
75 include_once './Services/User/classes/class.ilUserUtil.php';
76
77 $confirm->addItem('usr_id',
78 $_GET["usr_id"],
79 ilUserUtil::getNamePresentation($_GET["usr_id"], false, false, "", true),
80 ilUtil::getImagePath('icon_usr.svg'));
81
82 $tpl->setContent($confirm->getHTML());
83 }
global $tpl
Definition: ilias.php:8
$_GET["client_id"]
Confirmation screen class.
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)
Default behaviour is:
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ executeCommand()

ilCourseParticipantsGroupsGUI::executeCommand ( )

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

23 {
24 global $ilCtrl, $ilErr, $ilAccess, $lng;
25
26 if(!$ilAccess->checkAccess('write','',$this->ref_id))
27 {
28 $ilErr->raiseError($lng->txt('permission_denied'),$ilErr->WARNING);
29 }
30
31 $cmd = $ilCtrl->getCmd();
32 if(!$cmd)
33 {
34 $cmd = "show";
35 }
36 $this->$cmd();
37 }
$cmd
Definition: sahs_server.php:35

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

◆ remove()

ilCourseParticipantsGroupsGUI::remove ( )

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

86 {
87 global $ilAccess, $ilObjDataCache, $lng, $ilCtrl;
88
89 if (!$ilAccess->checkAccess("write", "", $_POST["grp_id"]))
90 {
91 ilUtil::sendFailure($lng->txt("permission_denied"), true);
92 $this->show();
93 return;
94 }
95
96 include_once './Modules/Group/classes/class.ilGroupParticipants.php';
97 $members_obj = ilGroupParticipants::_getInstanceByObjId($ilObjDataCache->lookupObjId($_POST["grp_id"]));
98 $members_obj->delete($_POST["usr_id"]);
99
100 // Send notification
101 include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
102 $members_obj->sendNotification(
104 $_POST["usr_id"]
105 );
106
107 ilUtil::sendSuccess($lng->txt("grp_msg_membership_annulled"), true);
108 $ilCtrl->redirect($this, "show");
109 }

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

+ Here is the call graph for this function:

◆ resetFilter()

ilCourseParticipantsGroupsGUI::resetFilter ( )

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

56 {
57 $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
58 $tbl_gui->resetOffset();
59 $tbl_gui->resetFilter();
60 $this->show();
61 }

References show().

+ Here is the call graph for this function:

◆ show()

ilCourseParticipantsGroupsGUI::show ( )

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

40 {
41 global $tpl;
42
43 $tbl_gui = new ilCourseParticipantsGroupsTableGUI($this, "show", $this->ref_id);
44 $tpl->setContent($tbl_gui->getHTML());
45 }

References $tpl.

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

+ Here is the caller graph for this function:

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