ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilGroupMembershipGUI Class Reference

GUI class for membership features. More...

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

Public Member Functions

 filterUserIdsByRbacOrPositionOfCurrentUser ($a_user_ids)
 Filter user ids by access. More...
 
 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...
 
 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

 getMailMemberRoles ()
 
 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
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 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...
 
 getMailContextOptions ()
 Get mail context options. 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...
 
 getMemberTabName ()
 Get member tab name. More...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 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 ()
 

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 47 of file class.ilGroupMembershipGUI.php.

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

48  {
49  if (empty($user_ids[0])) {
50  $this->lng->loadLanguageModule('search');
51  ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'), true);
52  return false;
53  }
54 
55  $assigned = false;
56  foreach ((array) $user_ids as $new_member) {
57  if ($this->getMembersObject()->isAssigned($new_member)) {
58  continue;
59  }
60  switch ($a_type) {
61  case $this->getParentObject()->getDefaultAdminRole():
62  $this->getMembersObject()->add($new_member, IL_GRP_ADMIN);
63  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
64  $this->getMembersObject()->sendNotification(
66  $new_member
67  );
68  $assigned = true;
69  break;
70 
71  case $this->getParentObject()->getDefaultMemberRole():
72  $this->getMembersObject()->add($new_member, IL_GRP_MEMBER);
73  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
74  $this->getMembersObject()->sendNotification(
76  $new_member
77  );
78  $assigned = true;
79  break;
80 
81  default:
82  if (in_array($a_type, $this->getParentObject()->getLocalGroupRoles(true))) {
83  $this->getMembersObject()->add($new_member, IL_GRP_MEMBER);
84  $this->getMembersObject()->updateRoleAssignments($new_member, (array) $a_type);
85  } else {
86  ilLoggerFactory::getLogger('crs')->notice('Can not find role with id .' . $a_type . ' to assign users.');
87  ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"), true);
88  return false;
89  }
90  include_once './Modules/Group/classes/class.ilGroupMembershipMailNotification.php';
91  $this->getMembersObject()->sendNotification(
93  $new_member
94  );
95  $assigned = true;
96  break;
97  }
98  }
99 
100  if ($assigned) {
101  ilUtil::sendSuccess($this->lng->txt("grp_msg_member_assigned"), true);
102  } else {
103  ilUtil::sendSuccess($this->lng->txt('grp_users_already_assigned'), true);
104  }
105  $this->ctrl->redirect($this, 'participants');
106  }
getMembersObject()
Get member object.
const IL_GRP_ADMIN
const IL_GRP_MEMBER
$a_type
Definition: workflow.php:92
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:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilGroupMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser (   $a_user_ids)

Filter user ids by access.

Parameters
int[]$a_user_ids
Returns
int[]

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

References $GLOBALS, and ilMembershipGUI\getParentObject().

35  {
36  return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
37  'manage_members',
38  'manage_members',
39  $this->getParentObject()->getRefId(),
40  $a_user_ids
41  );
42  }
getParentObject()
Get parent object.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 232 of file class.ilGroupMembershipGUI.php.

233  {
234  if (is_array($this->member_data) && array_key_exists($a_user_id, $this->member_data)) {
235  $user_data = $this->member_data[$a_user_id];
236  $user_data['access'] = $this->member_data['access_time'];
237  $user_data['progress'] = $this->lng->txt($this->member_data['progress']);
238  return $user_data;
239  }
240  return [];
241  }

◆ getDefaultRole()

ilGroupMembershipGUI::getDefaultRole ( )
protected
Returns
int

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

References ilMembershipGUI\getParentGUI().

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

◆ getLocalTypeRole()

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

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

References ilMembershipGUI\getParentObject().

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

◆ getMailMemberRoles()

ilGroupMembershipGUI::getMailMemberRoles ( )
protected
Returns
ilAbstractMailMemberRoles | null

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

24  {
25  return new ilMailMemberGroupRoles();
26  }
Class ilMailMemberCourseRoles.

◆ getPrintMemberData()

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

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

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

221  {
222  $member_data = $this->readMemberData($a_members, array());
223  $member_data = $this->getParentGUI()->addCustomData($member_data);
224  return $member_data;
225  }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.
getParentGUI()
Get parent gui.
+ 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 161 of file class.ilGroupMembershipGUI.php.

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

162  {
163  include_once './Modules/Group/classes/class.ilGroupEditParticipantsTableGUI.php';
165  $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
166  $table->setData($this->getParentGUI()->readMemberData($participants));
167 
168  return $table;
169  }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.
getParentGUI()
Get parent gui.
getParentObject()
Get parent object.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilGroupMembershipGUI::initParticipantTableGUI ( )
protected
Returns

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

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

137  {
138  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
139  $show_tracking =
141  ;
142  if ($show_tracking) {
143  include_once('./Services/Object/classes/class.ilObjectLP.php');
144  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
145  $show_tracking = $olp->isActive();
146  }
147 
148  include_once './Modules/Group/classes/class.ilGroupParticipantsTableGUI.php';
149  return new ilGroupParticipantsTableGUI(
150  $this,
151  $this->getParentObject(),
152  $show_tracking
153  );
154  }
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 176 of file class.ilGroupMembershipGUI.php.

177  {
178  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.grp_edit_members.html', 'Modules/Group');
179  }

◆ initWaitingList()

ilGroupMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilGroupWaitingList

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

References ilMembershipGUI\getParentObject().

202  {
203  include_once './Modules/Group/classes/class.ilGroupWaitingList.php';
204  $wait = new ilGroupWaitingList($this->getParentObject()->getId());
205  return $wait;
206  }
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 192 of file class.ilGroupMembershipGUI.php.

193  {
194  return null;
195  }

◆ updateParticipantsStatus()

ilGroupMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

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

References $_POST, ilLoggerFactory\getLogger(), and ilMembershipGUI\getMembersObject().

112  {
113  $participants = (array) $_POST['visible_member_ids'];
114  $notification = (array) $_POST['notification'];
115  $contact = (array) $_POST['contact'];
116 
117  ilLoggerFactory::getLogger('grp')->dump($contact);
118 
119  foreach ($participants as $mem_id) {
120  if ($this->getMembersObject()->isAdmin($mem_id)) {
121  $this->getMembersObject()->updateContact($mem_id, in_array($mem_id, $contact));
122  $this->getMembersObject()->updateNotification($mem_id, in_array($mem_id, $notification));
123  } else {
124  $this->getMembersObject()->updateContact($mem_id, false);
125  $this->getMembersObject()->updateNotification($mem_id, false);
126  }
127  }
128  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
129  $this->ctrl->redirect($this, 'participants');
130  }
getMembersObject()
Get member object.
static getLogger($a_component_id)
Get component logger.
$_POST["username"]
+ Here is the call graph for this function:

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