ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilGroupMembershipGUI Class Reference

GUI class for membership features. More...

+ Inheritance diagram for ilGroupMembershipGUI:
+ Collaboration diagram for ilGroupMembershipGUI:

Public Member Functions

 assignMembers ($user_ids, $a_type)
 public More...
 
 getLocalTypeRole ($a_translation=false)
 
 getPrintMemberData ($a_members)
 
 getAttendanceListUserData ($a_user_id)
 Callback from attendance list. More...
 
- Public Member Functions inherited from ilMembershipGUI
 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 Constructor. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 getParentObject ()
 Get parent object. More...
 
 getMembersObject ()
 Get member object. 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

 updateParticipantsStatus ()
 save in participants table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 init edit participants table gui More...
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 updateLPFromStatus ()
 Update lp from status. More...
 
 initWaitingList ()
 init waiting list More...
 
 getDefaultRole ()
 
- Protected Member Functions inherited from ilMembershipGUI
 checkPermissionBool ($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
 Check permission. 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...
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show mail to member toolbar button. 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...
 

Additional Inherited Members

- Protected Attributes inherited from ilMembershipGUI
 $lng = null
 
 $ctrl = null
 
 $logger = null
 
 $tpl
 
 $access
 

Detailed Description

Member Function Documentation

◆ assignMembers()

ilGroupMembershipGUI::assignMembers (   $user_ids,
  $a_type 
)

public

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

References $a_type, array, ilLoggerFactory\getLogger(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), IL_GRP_ADMIN, IL_GRP_MEMBER, ilUtil\sendFailure(), ilUtil\sendSuccess(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.

24  {
25  if(empty($user_ids[0]))
26  {
27  $this->lng->loadLanguageModule('search');
28  ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'),true);
29  return false;
30  }
31 
32  $assigned = FALSE;
33  foreach((array) $user_ids as $new_member)
34  {
35  if($this->getMembersObject()->isAssigned($new_member))
36  {
37  continue;
38  }
39  switch($a_type)
40  {
41  case $this->getParentObject()->getDefaultAdminRole():
42  $this->getMembersObject()->add($new_member, IL_GRP_ADMIN);
43  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
44  $this->getMembersObject()->sendNotification(
46  $new_member
47  );
48  $assigned = TRUE;
49  break;
50 
51  case $this->getParentObject()->getDefaultMemberRole();
52  $this->getMembersObject()->add($new_member, IL_GRP_MEMBER);
53  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
54  $this->getMembersObject()->sendNotification(
56  $new_member
57  );
58  $assigned = TRUE;
59  break;
60 
61  default:
62  if(in_array($a_type,$this->getParentObject()->getLocalGroupRoles(true)))
63  {
64  $this->getMembersObject()->add($new_member,IL_GRP_MEMBER);
65  $this->getMembersObject()->updateRoleAssignments($new_member,(array) $a_type);
66  }
67  else
68  {
69  ilLoggerFactory::getLogger('crs')->notice('Can not find role with id .' . $a_type. ' to assign users.');
70  ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"),true);
71  return false;
72  }
73  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
74  $this->getMembersObject()->sendNotification(
76  $new_member
77  );
78  $assigned = TRUE;
79  break;
80  }
81  }
82 
83  if($assigned)
84  {
85  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"),true);
86  }
87  else
88  {
89  ilUtil::sendSuccess($this->lng->txt('grp_users_already_assigned'),TRUE);
90  }
91  $this->ctrl->redirect($this,'participants');
92  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
const IL_GRP_ADMIN
const IL_GRP_MEMBER
$a_type
Definition: workflow.php:93
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilGroupMembershipGUI::getAttendanceListUserData (   $a_user_id)

Callback from attendance list.

Parameters
int$a_user_id
Returns
array

Definition at line 220 of file class.ilGroupMembershipGUI.php.

References $data.

221  {
222  $data = $this->member_data[$a_user_id];
223 
224  $this->logger->dump($data);
225 
226  $data['access'] = $data['access_time'];
227  $data['progress'] = $this->lng->txt($data['progress']);
228 
229  return $data;
230  }

◆ getDefaultRole()

ilGroupMembershipGUI::getDefaultRole ( )
protected
Returns
int

Definition at line 196 of file class.ilGroupMembershipGUI.php.

References ilMembershipGUI\getParentGUI().

197  {
198  return $this->getParentGUI()->object->getDefaultMemberRole();
199  }
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:

◆ getLocalTypeRole()

ilGroupMembershipGUI::getLocalTypeRole (   $a_translation = false)
Todo:
refactor delete

Definition at line 169 of file class.ilGroupMembershipGUI.php.

References ilMembershipGUI\getParentObject().

170  {
171  return $this->getParentObject()->getLocalGroupRoles($a_translation);
172  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getPrintMemberData()

ilGroupMembershipGUI::getPrintMemberData (   $a_members)
Parameters
array$a_members
Returns
array

Definition at line 205 of file class.ilGroupMembershipGUI.php.

References array, ilMembershipGUI\getParentGUI(), and ilMembershipGUI\readMemberData().

206  {
207  $member_data = $this->readMemberData($a_members, array());
208  $member_data = $this->getParentGUI()->addCustomData($member_data);
209 
210  $this->logger->dump($member_data);
211 
212  return $member_data;
213  }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.
getParentGUI()
Get parent gui.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilGroupMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

init edit participants table gui

Parameters
array$participants
Returns

Definition at line 146 of file class.ilGroupMembershipGUI.php.

References ilMembershipGUI\getParentGUI(), ilMembershipGUI\getParentObject(), and ilMembershipGUI\readMemberData().

147  {
148  include_once './Modules/Group/classes/class.ilGroupEditParticipantsTableGUI.php';
149  $table = new ilGroupEditParticipantsTableGUI($this, $this->getParentObject());
150  $table->setTitle($this->lng->txt($this->getParentObject()->getType().'_header_edit_members'));
151  $table->setData($this->getParentGUI()->readMemberData($participants));
152 
153  return $table;
154  }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.
getParentGUI()
Get parent gui.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilGroupMembershipGUI::initParticipantTableGUI ( )
protected
Returns

Definition at line 120 of file class.ilGroupMembershipGUI.php.

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilObjectLP\getInstance(), and ilMembershipGUI\getParentObject().

121  {
122  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
123  $show_tracking =
125  ;
126  if($show_tracking)
127  {
128  include_once('./Services/Object/classes/class.ilObjectLP.php');
129  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
130  $show_tracking = $olp->isActive();
131  }
132 
133  include_once './Modules/Group/classes/class.ilGroupParticipantsTableGUI.php';
134  return new ilGroupParticipantsTableGUI(
135  $this,
136  $this->getParentObject(),
137  $show_tracking
138  );
139  }
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _enabledLearningProgress()
check wether learing progress is enabled or not
getParentObject()
Get parent object.
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilGroupMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

Definition at line 161 of file class.ilGroupMembershipGUI.php.

162  {
163  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.grp_edit_members.html','Modules/Group');
164  }

◆ initWaitingList()

ilGroupMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilGroupWaitingList

Definition at line 186 of file class.ilGroupMembershipGUI.php.

References ilMembershipGUI\getParentObject().

187  {
188  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
189  $wait = new ilGroupWaitingList($this->getParentObject()->getId());
190  return $wait;
191  }
Waiting list for groups.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ updateLPFromStatus()

ilGroupMembershipGUI::updateLPFromStatus ( )
protected

Update lp from status.

Definition at line 177 of file class.ilGroupMembershipGUI.php.

178  {
179  return null;
180  }

◆ updateParticipantsStatus()

ilGroupMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

Definition at line 97 of file class.ilGroupMembershipGUI.php.

References $_POST, array, ilMembershipGUI\getMembersObject(), and ilUtil\sendSuccess().

98  {
99  $participants = (array) $_POST['visible_member_ids'];
100  $notification = (array) $_POST['notification'];
101  foreach($participants as $mem_id)
102  {
103  if($this->getMembersObject()->isAdmin($mem_id))
104  {
105  $this->getMembersObject()->updateNotification($mem_id, in_array($mem_id, $notification));
106  }
107  else
108  {
109  $this->getMembersObject()->updateNotification($mem_id, false);
110  }
111  }
112  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
113  $this->ctrl->redirect($this, 'participants');
114  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

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