ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilGroupMembershipGUI Class Reference

GUI class for membership features. More...

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

Public Member Functions

 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $a_user_ids)
 Filter user ids by access. More...
 
 assignMembers (array $user_ids, string $a_type)
 
 getLocalTypeRole (bool $a_translation=false)
 
 getPrintMemberData (array $a_members)
 
 getAttendanceListUserData (int $user_id, array $filters=[])
 Callback from attendance list. More...
 
- Public Member Functions inherited from ilMembershipGUI
 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 
 getParentGUI ()
 
 getParentObject ()
 
 getMembersObject ()
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $a_user_ids)
 Filter user ids by access. More...
 
 executeCommand ()
 
 getAttendanceListUserData (int $user_id, array $filters=[])
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 Create Mail signature. More...
 
 addMemberTab (ilTabsGUI $tabs, bool $a_is_participant=false)
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 getMailMemberRoles ()
 
 updateParticipantsStatus ()
 save in participants table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 initWaitingList ()
 
 getDefaultRole ()
 @inheritDoc More...
 
 getMailContextOptions ()
 @inheritDoc More...
 
- Protected Member Functions inherited from ilMembershipGUI
 initParticipantsFromPost ()
 
 initMemberIdFromGet ()
 
 initSubscribersFromPost ()
 
 initWaitingListIdsFromPost ()
 
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 checkPermissionBool (string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
 
 checkRbacOrPositionAccessBool (string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
 
 checkPermission (string $a_permission, string $a_cmd="")
 Check permission If not granted redirect to parent gui. More...
 
 checkRbacOrPermissionAccess (string $a_rbac_perm, string $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...
 
 getParticipantTableTitle ()
 
 participantsApplyFilter ()
 Apply filter for participant table. More...
 
 participantsResetFilter ()
 reset participants filter More...
 
 editMember ()
 Edit one participant. More...
 
 editParticipants (array $post_participants=array())
 Edit participants. More...
 
 updateLPFromStatus (int $usr_id, bool $has_passed)
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 
 getMailContextOptions ()
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMemberExportToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 Show mail to member toolbar button. More...
 
 getMailButtonLabel ()
 
 getDefaultCommand ()
 
 getMemberTabName ()
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 refuseSubscribers ()
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 activateSubTab (string $a_sub_tab)
 
 printMembers ()
 
 printMembersOutput ()
 print members output More...
 
 printForMembersOutput ()
 print members output More...
 
 jump2UsersGallery ()
 
 initAttendanceList (bool $a_for_members=false)
 

Protected Attributes

GlobalHttpState $http
 
Factory $refinery
 
- Protected Attributes inherited from ilMembershipGUI
GlobalHttpState $http
 
Factory $refinery
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilLogger $logger
 
ilGlobalTemplateInterface $tpl
 
ilAccessHandler $access
 
ilParticipants $participants = null
 
ilObjUser $user
 
ilErrorHandling $error
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTree $tree
 
Profile $profile
 
array $member_data = []
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilGroupMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
ilObject  $repository_obj 
)

Reimplemented from ilMembershipGUI.

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

40 {
41 global $DIC;
42
43 parent::__construct($repository_gui, $repository_obj);
44 $this->refinery = $DIC->refinery();
45 $this->http = $DIC->http();
46 }
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilMembershipGUI\$repository_gui, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ assignMembers()

ilGroupMembershipGUI::assignMembers ( array  $user_ids,
string  $a_type 
)

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

72 : bool
73 {
74 $a_type = (int) $a_type;
75 if (!count($user_ids)) {
76 $this->lng->loadLanguageModule('search');
77 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_err_user_not_exist'), true);
78 return false;
79 }
80
81 $assigned = false;
82 foreach ($user_ids as $new_member) {
83 $new_member = (int) $new_member;
84 if ($this->getMembersObject()->isAssigned($new_member)) {
85 continue;
86 }
87 switch ($a_type) {
88 case $this->getParentObject()->getDefaultAdminRole():
89 $this->getMembersObject()->add($new_member, ilParticipants::IL_GRP_ADMIN);
90 $this->getMembersObject()->sendNotification(
92 $new_member
93 );
94 $assigned = true;
95 break;
96
97 case $this->getParentObject()->getDefaultMemberRole():
98 $this->getMembersObject()->add($new_member, ilParticipants::IL_GRP_MEMBER);
99 $this->getMembersObject()->sendNotification(
101 $new_member
102 );
103 $assigned = true;
104 break;
105
106 default:
107 if (in_array($a_type, $this->getParentObject()->getLocalGroupRoles(true))) {
108 $this->getMembersObject()->add($new_member, ilParticipants::IL_GRP_MEMBER);
109 $this->getMembersObject()->updateRoleAssignments($new_member, (array) $a_type);
110 } else {
111 ilLoggerFactory::getLogger('crs')->notice('Can not find role with id .' . $a_type . ' to assign users.');
112 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("crs_cannot_find_role"), true);
113 return false;
114 }
115 $this->getMembersObject()->sendNotification(
117 $new_member
118 );
119 $assigned = true;
120 break;
121 }
122 }
123
124 if ($assigned) {
125 $this->tpl->setOnScreenMessage('success', $this->lng->txt("grp_msg_member_assigned"), true);
126 } else {
127 $this->tpl->setOnScreenMessage('info', $this->lng->txt('grp_users_already_assigned'), true);
128 }
129 $this->ctrl->redirect($this, 'participants');
130 return true;
131 }
static getLogger(string $a_component_id)
Get component logger.

References ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), ilParticipants\IL_GRP_ADMIN, ilParticipants\IL_GRP_MEMBER, ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER.

+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilGroupMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser ( array  $a_user_ids)

Filter user ids by access.

Parameters
int[]$a_user_ids
Returns
int[]

Reimplemented from ilMembershipGUI.

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

62 : array
63 {
64 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
65 'manage_members',
66 'manage_members',
67 $this->getParentObject()->getRefId(),
68 $a_user_ids
69 );
70 }

References ILIAS\Repository\access(), and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilGroupMembershipGUI::getAttendanceListUserData ( int  $user_id,
array  $filters = [] 
)

Callback from attendance list.

Reimplemented from ilMembershipGUI.

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

244 : array
245 {
246 if (is_array($this->member_data) && array_key_exists($user_id, $this->member_data)) {
247 $user_data = $this->member_data[$user_id];
248 if (isset($user_data['access_time_unix'])) {
250 $user_data['access'] = ilDatePresentation::formatDate(
251 new ilDateTime($user_data['access_time_unix'], IL_CAL_UNIX)
252 );
254 }
255 if (isset($this->member_data['progress'])) {
256 $user_data['progress'] = $this->lng->txt($this->member_data['progress']);
257 }
258 return $user_data;
259 }
260 return [];
261 }
const IL_CAL_UNIX
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling

References $user_id, ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), and ilDatePresentation\setUseRelativeDates().

+ Here is the call graph for this function:

◆ getDefaultRole()

ilGroupMembershipGUI::getDefaultRole ( )
protected

@inheritDoc

Reimplemented from ilMembershipGUI.

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

229 : ?int
230 {
231 return $this->getParentGUI()->getObject()->getDefaultMemberRole();
232 }

References ilMembershipGUI\getParentGUI().

+ Here is the call graph for this function:

◆ getLocalTypeRole()

ilGroupMembershipGUI::getLocalTypeRole ( bool  $a_translation = false)

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

215 : array
216 {
217 return $this->getParentObject()->getLocalGroupRoles($a_translation);
218 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ getMailContextOptions()

ilGroupMembershipGUI::getMailContextOptions ( )
protected

@inheritDoc

Reimplemented from ilMembershipGUI.

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

266 : array
267 {
268 $context_options = [
270 $this->getParentObject()->getId(),
272 ''
273 ),
274 ];
275
276 return $context_options;
277 }
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
const string PROP_CONTEXT_SUBJECT_PREFIX

References ilContainer\_lookupContainerSetting(), ilObjectServiceSettingsGUI\EXTERNAL_MAIL_PREFIX, ILIAS\Survey\Mode\getId(), ilMembershipGUI\getParentObject(), and ilMail\PROP_CONTEXT_SUBJECT_PREFIX.

+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilGroupMembershipGUI::getMailMemberRoles ( )
protected
Returns
ilAbstractMailMemberRoles | null

Reimplemented from ilMembershipGUI.

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

52 {
53 return new ilMailMemberGroupRoles();
54 }
Class ilAbstractMailMemberRoles.
Class ilMailMemberCourseRoles.

◆ getPrintMemberData()

ilGroupMembershipGUI::getPrintMemberData ( array  $a_members)

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

234 : array
235 {
236 $member_data = $this->readMemberData($a_members, array());
237 $member_data = $this->getParentGUI()->addCustomData($member_data);
238 return $member_data;
239 }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.

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

+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilGroupMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

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

197 {
198 $table = new ilGroupEditParticipantsTableGUI($this, $this->getParentObject());
199 $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
200 $table->setData($this->getParentGUI()->readMemberData($participants));
201
202 return $table;
203 }
ilParticipants $participants

References ilMembershipGUI\getParentGUI(), ilMembershipGUI\getParentObject(), ILIAS\Repository\lng(), and ilMembershipGUI\readMemberData().

+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilGroupMembershipGUI::initParticipantTableGUI ( )
protected

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

180 {
181 $show_tracking =
183 ;
184 if ($show_tracking) {
186 $show_tracking = $olp->isActive();
187 }
188
190 $this,
191 $this->getParentObject(),
192 $show_tracking
193 );
194 }
static getInstance(int $obj_id)

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ILIAS\Survey\Mode\getId(), ilObjectLP\getInstance(), and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilGroupMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

210 : void
211 {
212 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.grp_edit_members.html', 'components/ILIAS/Group');
213 }

◆ initWaitingList()

ilGroupMembershipGUI::initWaitingList ( )
protected

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

222 {
223 return new ilGroupWaitingList($this->getParentObject()->getId());
224 }
Waiting list for groups.

References ILIAS\Survey\Mode\getId(), and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ updateParticipantsStatus()

ilGroupMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

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

136 : void
137 {
138 $participants = [];
139 if ($this->http->wrapper()->post()->has('visible_member_ids')) {
140 $participants = $this->http->wrapper()->post()->retrieve(
141 'visible_member_ids',
142 $this->refinery->kindlyTo()->listOf(
143 $this->refinery->kindlyTo()->int()
144 )
145 );
146 }
147 $notification = [];
148 if ($this->http->wrapper()->post()->has('notification')) {
149 $notification = $this->http->wrapper()->post()->retrieve(
150 'notification',
151 $this->refinery->kindlyTo()->listOf(
152 $this->refinery->kindlyTo()->int()
153 )
154 );
155 }
156 $contact = [];
157 if ($this->http->wrapper()->post()->has('contact')) {
158 $contact = $this->http->wrapper()->post()->retrieve(
159 'contact',
160 $this->refinery->kindlyTo()->listOf(
161 $this->refinery->kindlyTo()->int()
162 )
163 );
164 }
165 foreach ($participants as $mem_id) {
166 if ($this->getMembersObject()->isAdmin($mem_id)) {
167 $this->getMembersObject()->updateContact($mem_id, in_array($mem_id, $contact));
168 $this->getMembersObject()->updateNotification($mem_id, in_array($mem_id, $notification));
169 } else {
170 $this->getMembersObject()->updateContact($mem_id, false);
171 $this->getMembersObject()->updateNotification($mem_id, false);
172 }
173 }
174 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
175 $this->ctrl->redirect($this, 'participants');
176 }

References ilMembershipGUI\$participants, ILIAS\Repository\ctrl(), ilMembershipGUI\getMembersObject(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Field Documentation

◆ $http

GlobalHttpState ilGroupMembershipGUI::$http
protected

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

◆ $refinery

Factory ilGroupMembershipGUI::$refinery
protected

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


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