ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCourseMembershipGUI Class Reference

Member-tab content. More...

+ Inheritance diagram for ilCourseMembershipGUI:
+ Collaboration diagram for ilCourseMembershipGUI:

Public Member Functions

 filterUserIdsByRbacOrPositionOfCurrentUser ($a_user_ids)
 Filter user ids by access. More...
 
 assignMembers (array $a_usr_ids, $a_type)
 callback from repository search gui @global ilRbacSystem $rbacsystem More...
 
 getLocalTypeRole ($a_translation=false)
 
 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 @global type $rbacsystem @global type $ilErr. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list @global type $rbacsystem. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 getMailMemberRoles ()
 
 getMailContextOptions ()
 Get mail context options.
Returns
array
More...
 
 showDeleteParticipantsConfirmationWithLinkedCourses ($participants)
 Show deletion confirmation with linked courses. More...
 
 deleteParticipantsWithLinkedCourses ()
 
 updateParticipantsStatus ()
 => save button in member table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 init edit participants table gui More...
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 updateLPFromStatus ($a_member_id, $a_passed)
 Update lp from status. More...
 
 initWaitingList ()
 init waiting list More...
 
 getDefaultRole ()
 
 deliverCertificate ()
 Deliver certificate for an user on the member list. More...
 
 getPrintMemberData ($a_members)
 Get print member data. More...
 
- 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 @global 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 @global 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()

ilCourseMembershipGUI::assignMembers ( array  $a_usr_ids,
  $a_type 
)

callback from repository search gui @global ilRbacSystem $rbacsystem

Parameters
array$a_usr_ids
int$a_typerole_id
Returns
bool

Definition at line 145 of file class.ilCourseMembershipGUI.php.

146 {
147 global $DIC;
148
149 $rbacsystem = $DIC['rbacsystem'];
150 $ilErr = $DIC['ilErr'];
151
152 if (!$this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
153 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->FATAL);
154 }
155
156 if (!count($a_usr_ids)) {
157 ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
158 return false;
159 }
160
161 $a_usr_ids = $this->filterUserIdsByRbacOrPositionOfCurrentUser($a_usr_ids);
162
163 $added_users = 0;
164 foreach ($a_usr_ids as $user_id) {
165 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
166 continue;
167 }
168 if ($this->getMembersObject()->isAssigned($user_id)) {
169 continue;
170 }
171 switch ($a_type) {
172 case $this->getParentObject()->getDefaultMemberRole():
173 $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
174 break;
175 case $this->getParentObject()->getDefaultTutorRole():
176 $this->getMembersObject()->add($user_id, IL_CRS_TUTOR);
177 break;
178 case $this->getParentObject()->getDefaultAdminRole():
179 $this->getMembersObject()->add($user_id, IL_CRS_ADMIN);
180 break;
181 default:
182 if (in_array($a_type, $this->getParentObject()->getLocalCourseRoles(true))) {
183 $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
184 $this->getMembersObject()->updateRoleAssignments($user_id, (array) $a_type);
185 } else {
186 ilLoggerFactory::getLogger('crs')->notice('Can\'t find role with id .' . $a_type . ' to assign users.');
187 ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"), true);
188 return false;
189 }
190 break;
191 }
192 $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id);
193
194 $this->getParentObject()->checkLPStatusSync($user_id);
195
196 ++$added_users;
197 }
198 if ($added_users) {
199 ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
200 $this->ctrl->redirect($this, 'participants');
201 }
202 ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
203 return false;
204 }
const IL_CRS_ADMIN
Base class for course and group participants.
const IL_CRS_MEMBER
const IL_CRS_TUTOR
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
static getLogger($a_component_id)
Get component logger.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
getParentObject()
Get parent object.
getMembersObject()
Get member object.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$ilErr
Definition: raiseError.php:18
$a_type
Definition: workflow.php:92
$DIC
Definition: xapitoken.php:46

References $a_type, $DIC, $ilErr, ilMembershipGUI\checkRbacOrPositionAccessBool(), filterUserIdsByRbacOrPositionOfCurrentUser(), ilObjectFactory\getInstanceByObjId(), ilLoggerFactory\getLogger(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ deleteParticipantsWithLinkedCourses()

ilCourseMembershipGUI::deleteParticipantsWithLinkedCourses ( )
protected
Returns
bool

Definition at line 79 of file class.ilCourseMembershipGUI.php.

80 {
81 global $DIC;
82
83 $ilAccess = $DIC['ilAccess'];
84
85 $participants = (array) $_POST['participants'];
86
87 if (!is_array($participants) or !count($participants)) {
88 ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
89 $this->ctrl->redirect($this, 'participants');
90 }
91
92 // If the user doesn't have the edit_permission and is not administrator, he may not remove
93 // members who have the course administrator role
94 if (
95 !$ilAccess->checkAccess('edit_permission', '', $this->getParentObject()->getRefId()) &&
96 !$this->getMembersObject()->isAdmin($GLOBALS['DIC']['ilUser']->getId())
97 ) {
98 foreach ($participants as $part) {
99 if ($this->getMembersObject()->isAdmin($part)) {
100 ilUtil::sendFailure($this->lng->txt('msg_no_perm_perm'), true);
101 $this->ctrl->redirect($this, 'participants');
102 }
103 }
104 }
105
106 if (!$this->getMembersObject()->deleteParticipants($participants)) {
107 ilUtil::sendFailure('Error deleting participants.', true);
108 $this->ctrl->redirect($this, 'participants');
109 } else {
110 foreach ((array) $_POST["participants"] as $usr_id) {
111 $mail_type = 0;
112 switch ($this->getParentObject()->getType()) {
113 case 'crs':
114 $mail_type = $this->getMembersObject()->NOTIFY_DISMISS_MEMBER;
115 break;
116 }
117 $this->getMembersObject()->sendNotification($mail_type, $usr_id);
118 }
119 }
120
121 // Delete course reference assignments
122 if (count((array) $_POST['refs'])) {
123 foreach ($_POST['refs'] as $usr_id => $usr_info) {
124 foreach ((array) $usr_info as $course_ref_id => $tmp) {
125 $part = ilParticipants::getInstance($course_ref_id);
126 $part->delete($usr_id);
127 }
128 }
129 }
130
131 ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
132 $this->ctrl->redirect($this, "participants");
133
134 return true;
135 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_POST["username"]
static getInstance($a_ref_id)
Get instance by ref_id.

References $_POST, $DIC, $GLOBALS, ilMembershipGUI\deleteParticipants(), ilParticipants\getInstance(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ deliverCertificate()

ilCourseMembershipGUI::deliverCertificate ( )
protected

Deliver certificate for an user on the member list.

Returns
type

Definition at line 351 of file class.ilCourseMembershipGUI.php.

352 {
353 return $this->getParentGUI()->deliverCertificateObject();
354 }
getParentGUI()
Get parent gui.

References ilMembershipGUI\getParentGUI().

+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilCourseMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser (   $a_user_ids)

Filter user ids by access.

Parameters
int[]$a_user_ids
Returns
int[]

Reimplemented from ilMembershipGUI.

Definition at line 33 of file class.ilCourseMembershipGUI.php.

34 {
35 return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
36 'manage_members',
37 'manage_members',
38 $this->getParentObject()->getRefId(),
39 $a_user_ids
40 );
41 }

References $GLOBALS, and ilMembershipGUI\getParentObject().

Referenced by assignMembers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttendanceListUserData()

ilCourseMembershipGUI::getAttendanceListUserData (   $a_user_id)

Callback from attendance list.

Parameters
int$a_user_id

Definition at line 478 of file class.ilCourseMembershipGUI.php.

479 {
480 if (is_array($this->member_data) && array_key_exists($a_user_id, $this->member_data)) {
481 return $this->member_data[$a_user_id];
482 }
483 return [];
484 }

◆ getDefaultRole()

ilCourseMembershipGUI::getDefaultRole ( )
protected
Returns
int

Reimplemented from ilMembershipGUI.

Definition at line 342 of file class.ilCourseMembershipGUI.php.

343 {
344 return $this->getParentGUI()->object->getDefaultMemberRole();
345 }

References ilMembershipGUI\getParentGUI().

+ Here is the call graph for this function:

◆ getLocalTypeRole()

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

Definition at line 315 of file class.ilCourseMembershipGUI.php.

316 {
317 return $this->getParentObject()->getLocalCourseRoles($a_translation);
318 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ getMailContextOptions()

ilCourseMembershipGUI::getMailContextOptions ( )
protected

Get mail context options.

Returns
array

Reimplemented from ilMembershipGUI.

Definition at line 46 of file class.ilCourseMembershipGUI.php.

47 {
48 $context_options = [];
49
50 $context_options =
51 [
53 'ref_id' => $this->getParentObject()->getRefId(),
54 'ts' => time()
55 ];
56 return $context_options;
57 }
const CONTEXT_KEY
Session parameter for the context.

References ilMailFormCall\CONTEXT_KEY, ilMembershipGUI\getParentObject(), and ilCourseMailTemplateTutorContext\ID.

+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilCourseMembershipGUI::getMailMemberRoles ( )
protected
Returns
ilAbstractMailMemberRoles

Reimplemented from ilMembershipGUI.

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

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

◆ getPrintMemberData()

ilCourseMembershipGUI::getPrintMemberData (   $a_members)
protected

Get print member data.

Parameters
array$a_members

Definition at line 360 of file class.ilCourseMembershipGUI.php.

361 {
362 global $DIC;
363
364 $ilAccess = $DIC['ilAccess'];
365 $lng = $DIC['lng'];
366
367 $lng->loadLanguageModule('trac');
368
369 $is_admin = true;
370 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
372
373 if ($privacy->enabledCourseAccessTimes()) {
374 include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
375 $progress = ilLearningProgress::_lookupProgressByObjId($this->getParentObject()->getId());
376 }
377
378 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
379 $show_tracking =
380 (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
381 if ($show_tracking) {
382 include_once('./Services/Object/classes/class.ilObjectLP.php');
383 $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
384 $show_tracking = $olp->isActive();
385 }
386
387 if ($show_tracking) {
388 include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
390 $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->getParentObject()->getId());
392 }
393
394 $profile_data = ilObjUser::_readUsersProfileData($a_members);
395
396 // course defined fields
397 include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
398 $cdfs = ilCourseUserData::_getValuesByObjId($this->getParentObject()->getId());
399
400 $print_member = [];
401 foreach ($a_members as $member_id) {
402 // GET USER OBJ
403 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) {
404 // udf
405 include_once './Services/User/classes/class.ilUserDefinedData.php';
406 $udf_data = new ilUserDefinedData($member_id);
407 foreach ($udf_data->getAll() as $field => $value) {
408 list($f, $field_id) = explode('_', $field);
409 $print_member[$member_id]['udf_' . $field_id] = (string) $value;
410 }
411
412 foreach ((array) $cdfs[$member_id] as $cdf_field => $cdf_value) {
413 $print_member[$member_id]['cdf_' . $cdf_field] = (string) $cdf_value;
414 }
415
416 foreach ((array) $profile_data[$member_id] as $field => $value) {
417 $print_member[$member_id][$field] = $value;
418 }
419
420 $print_member[$member_id]['login'] = $tmp_obj->getLogin();
421 $print_member[$member_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
422
423 if ($this->getMembersObject()->isAdmin($member_id)) {
424 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_admin");
425 } elseif ($this->getMembersObject()->isTutor($member_id)) {
426 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_tutor");
427 } elseif ($this->getMembersObject()->isMember($member_id)) {
428 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_member");
429 }
430 if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
431 if ($this->getMembersObject()->isNotificationEnabled($member_id)) {
432 $print_member[$member_id]['status'] = $this->lng->txt("crs_notify");
433 } else {
434 $print_member[$member_id]['status'] = $this->lng->txt("crs_no_notify");
435 }
436 } else {
437 if ($this->getMembersObject()->isBlocked($member_id)) {
438 $print_member[$member_id]['status'] = $this->lng->txt("crs_blocked");
439 } else {
440 $print_member[$member_id]['status'] = $this->lng->txt("crs_unblocked");
441 }
442 }
443
444 if ($is_admin) {
445 $print_member[$member_id]['passed'] = $this->getMembersObject()->hasPassed($member_id) ?
446 $this->lng->txt('crs_member_passed') :
447 $this->lng->txt('crs_member_not_passed');
448 }
449 if ($privacy->enabledCourseAccessTimes()) {
450 if (isset($progress[$member_id]['ts']) and $progress[$member_id]['ts']) {
452 $print_member[$member_id]['access'] = ilDatePresentation::formatDate(new ilDateTime($progress[$member_id]['ts'], IL_CAL_UNIX));
454 } else {
455 $print_member[$member_id]['access'] = $this->lng->txt('no_date');
456 }
457 }
458 if ($show_tracking) {
459 if (in_array($member_id, $completed)) {
460 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
461 } elseif (in_array($member_id, $in_progress)) {
462 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
463 } elseif (in_array($member_id, $failed)) {
464 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_FAILED);
465 } else {
466 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
467 }
468 }
469 }
470 }
471 return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
472 }
$failed
Definition: Utf8Test.php:85
$_SESSION["AccountId"]
const IL_CAL_UNIX
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
@classDescription Date and time handling
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static _lookupProgressByObjId($a_obj_id)
lookup progress for a specific object
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
static getInstance($a_obj_id)
static _getInstance()
Get instance of ilPrivacySettings.
Class ilUserDefinedData.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12

References $_SESSION, $DIC, Vendor\Package\$f, $failed, ilMembershipGUI\$lng, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilPrivacySettings\_getInstance(), ilCourseUserData\_getValuesByObjId(), ilLPStatusWrapper\_lookupCompletedForObject(), ilLPStatusWrapper\_lookupFailedForObject(), ilLPStatusWrapper\_lookupInProgressForObject(), ilLearningProgress\_lookupProgressByObjId(), ilObjUser\_readUsersProfileData(), ilDatePresentation\formatDate(), ilObjectLP\getInstance(), ilObjectFactory\getInstanceByObjId(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), IL_CAL_UNIX, ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ilDatePresentation\setUseRelativeDates(), and ilUtil\sortArray().

+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilCourseMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

init edit participants table gui

Parameters
array$participants
Returns
\ilCourseEditParticipantsTableGUI

Definition at line 294 of file class.ilCourseMembershipGUI.php.

295 {
296 include_once './Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php';
297 $table = new ilCourseEditParticipantsTableGUI($this, $this->getParentObject());
298 $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
299 $table->setData($this->getParentGUI()->readMemberData($participants));
300
301 return $table;
302 }
readMemberData(array $usr_ids, array $columns)
Required for member table guis.

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

+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilCourseMembershipGUI::initParticipantTableGUI ( )
protected
Returns
\ilParticpantTableGUI

Definition at line 261 of file class.ilCourseMembershipGUI.php.

262 {
263 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
264 $show_tracking =
266 ;
267 if ($show_tracking) {
268 include_once('./Services/Object/classes/class.ilObjectLP.php');
269 $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
270 $show_tracking = $olp->isActive();
271 }
272
273 include_once('./Services/Object/classes/class.ilObjectActivation.php');
274 $timings_enabled =
275 (ilObjectActivation::hasTimings($this->getParentObject()->getRefId()) && ($this->getParentObject()->getViewMode() == IL_CRS_VIEW_TIMING))
276 ;
277
278
279 include_once './Modules/Course/classes/class.ilCourseParticipantsTableGUI.php';
281 $this,
282 $this->getParentObject(),
283 $show_tracking,
284 $timings_enabled,
285 $this->getParentObject()->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP
286 );
287 }
const IL_CRS_VIEW_TIMING
const STATUS_DETERMINATION_LP
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static hasTimings($a_ref_id)
Check if there is any active timing (in subtree)

References ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilObjectLP\getInstance(), ilMembershipGUI\getParentObject(), ilObjectActivation\hasTimings(), IL_CRS_VIEW_TIMING, and ilObjCourse\STATUS_DETERMINATION_LP.

+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilCourseMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

Definition at line 307 of file class.ilCourseMembershipGUI.php.

308 {
309 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_members.html', 'Modules/Course');
310 }

◆ initWaitingList()

ilCourseMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilCourseWaitingList

Definition at line 332 of file class.ilCourseMembershipGUI.php.

333 {
334 include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
335 $wait = new ilCourseWaitingList($this->getParentObject()->getId());
336 return $wait;
337 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ showDeleteParticipantsConfirmationWithLinkedCourses()

ilCourseMembershipGUI::showDeleteParticipantsConfirmationWithLinkedCourses (   $participants)
protected

Show deletion confirmation with linked courses.

Parameters
int[]participants

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

64 {
65 ilUtil::sendQuestion($this->lng->txt('crs_ref_delete_confirmation_info'));
66
67 $table = new ilCourseReferenceDeleteConfirmationTableGUI($this, $this->getParentObject(), 'confirmDeleteParticipants');
68 $table->init();
69 $table->setParticipants($participants);
70 $table->parse();
71
72 $this->tpl->setContent($table->getHTML());
73 }
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.

References ilMembershipGUI\getParentObject(), and ilUtil\sendQuestion().

+ Here is the call graph for this function:

◆ updateLPFromStatus()

ilCourseMembershipGUI::updateLPFromStatus (   $a_member_id,
  $a_passed 
)
protected

Update lp from status.

Definition at line 323 of file class.ilCourseMembershipGUI.php.

324 {
325 return $this->getParentGUI()->updateLPFromStatus($a_member_id, $a_passed);
326 }

References ilMembershipGUI\getParentGUI().

Referenced by updateParticipantsStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateParticipantsStatus()

ilCourseMembershipGUI::updateParticipantsStatus ( )
protected

=> save button in member table

Definition at line 209 of file class.ilCourseMembershipGUI.php.

210 {
211 global $DIC;
212
213 $ilAccess = $DIC['ilAccess'];
214 $ilErr = $DIC['ilErr'];
215 $ilUser = $DIC['ilUser'];
216 $rbacadmin = $DIC['rbacadmin'];
217
218 $visible_members = (array) $_POST['visible_member_ids'];
219 $passed = (array) $_POST['passed'];
220 $blocked = (array) $_POST['blocked'];
221 $contact = (array) $_POST['contact'];
222 $notification = (array) $_POST['notification'];
223
224 foreach ($visible_members as $member_id) {
225 if ($ilAccess->checkAccess("grade", "", $this->getParentObject()->getRefId())) {
226 $this->getMembersObject()->updatePassed($member_id, in_array($member_id, $passed), true);
227 $this->updateLPFromStatus($member_id, in_array($member_id, $passed));
228 }
229
230 if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
231 // remove blocked
232 $this->getMembersObject()->updateBlocked($member_id, 0);
233 $this->getMembersObject()->updateNotification($member_id, in_array($member_id, $notification));
234 $this->getMembersObject()->updateContact($member_id, in_array($member_id, $contact));
235 } else {
236 // send notifications => unblocked
237 if ($this->getMembersObject()->isBlocked($member_id) && !in_array($member_id, $blocked)) {
238 $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_UNBLOCK_MEMBER, $member_id);
239 }
240 // => blocked
241 if (!$this->getMembersObject()->isBlocked($member_id) && in_array($member_id, $blocked)) {
242 $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_BLOCK_MEMBER, $member_id);
243 }
244
245 // normal member => remove notification, contact
246 $this->getMembersObject()->updateNotification($member_id, false);
247 $this->getMembersObject()->updateContact($member_id, false);
248 $this->getMembersObject()->updateBlocked($member_id, in_array($member_id, $blocked));
249 }
250 }
251
252
253 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
254 $this->ctrl->redirect($this, 'participants');
255 }
updateLPFromStatus($a_member_id, $a_passed)
Update lp from status.
$ilUser
Definition: imgupload.php:18

References $_POST, $DIC, $ilErr, $ilUser, ilMembershipGUI\getMembersObject(), and updateLPFromStatus().

+ Here is the call graph for this function:

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