ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 
 readMemberData (array $usr_ids, array $columns, bool $skip_names=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 ()
 
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 ()
 
 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 148 of file class.ilCourseMembershipGUI.php.

149 {
150 global $DIC;
151
152 $rbacsystem = $DIC['rbacsystem'];
153 $ilErr = $DIC['ilErr'];
154
155 if (!$this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
156 $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->FATAL);
157 }
158
159 if (!count($a_usr_ids)) {
160 ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
161 return false;
162 }
163
164 $a_usr_ids = $this->filterUserIdsByRbacOrPositionOfCurrentUser($a_usr_ids);
165
166 $added_users = 0;
167 foreach ($a_usr_ids as $user_id) {
168 if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
169 continue;
170 }
171 if ($this->getMembersObject()->isAssigned($user_id)) {
172 continue;
173 }
174 switch ($a_type) {
175 case $this->getParentObject()->getDefaultMemberRole():
176 $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
177 break;
178 case $this->getParentObject()->getDefaultTutorRole():
179 $this->getMembersObject()->add($user_id, IL_CRS_TUTOR);
180 break;
181 case $this->getParentObject()->getDefaultAdminRole():
182 $this->getMembersObject()->add($user_id, IL_CRS_ADMIN);
183 break;
184 default:
185 if (in_array($a_type, $this->getParentObject()->getLocalCourseRoles(true))) {
186 $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
187 $this->getMembersObject()->updateRoleAssignments($user_id, (array) $a_type);
188 } else {
189 ilLoggerFactory::getLogger('crs')->notice('Can\'t find role with id .' . $a_type . ' to assign users.');
190 ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"), true);
191 return false;
192 }
193 break;
194 }
195 $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id);
196
197 $this->getParentObject()->checkLPStatusSync($user_id);
198
199 ++$added_users;
200 }
201 if ($added_users) {
202 ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
203 $this->ctrl->redirect($this, 'participants');
204 }
205 ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
206 return false;
207 }
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.
global $DIC
Definition: goto.php:24
$ilErr
Definition: raiseError.php:18

References $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 82 of file class.ilCourseMembershipGUI.php.

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

360 {
361 return $this->getParentGUI()->deliverCertificateObject();
362 }
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 486 of file class.ilCourseMembershipGUI.php.

487 {
488 if (is_array($this->member_data) && array_key_exists($a_user_id, $this->member_data)) {
489 return $this->member_data[$a_user_id];
490 }
491 return [];
492 }

◆ getDefaultRole()

ilCourseMembershipGUI::getDefaultRole ( )
protected
Returns
int

Reimplemented from ilMembershipGUI.

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

351 {
352 return $this->getParentGUI()->object->getDefaultMemberRole();
353 }

References ilMembershipGUI\getParentGUI().

+ Here is the call graph for this function:

◆ getLocalTypeRole()

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

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

319 {
320 return $this->getParentObject()->getLocalCourseRoles($a_translation);
321 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ getMailContextOptions()

ilCourseMembershipGUI::getMailContextOptions ( )
protected

Returns
array

Reimplemented from ilMembershipGUI.

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

46 : array
47 {
48 $context_options = [
50 'ref_id' => $this->getParentObject()->getRefId(),
51 'ts' => time(),
53 $this->getParentObject()->getId(),
55 ''
56 ),
57 ];
58
59 return $context_options;
60 }
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
const CONTEXT_KEY
Session parameter for the context.
const PROP_CONTEXT_SUBJECT_PREFIX

References ilContainer\_lookupContainerSetting(), ilMailFormCall\CONTEXT_KEY, ilObjectServiceSettingsGUI\EXTERNAL_MAIL_PREFIX, ilMembershipGUI\getParentObject(), ilCourseMailTemplateTutorContext\ID, and ilMail\PROP_CONTEXT_SUBJECT_PREFIX.

+ 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 368 of file class.ilCourseMembershipGUI.php.

369 {
370 global $DIC;
371
372 $ilAccess = $DIC['ilAccess'];
373 $lng = $DIC['lng'];
374
375 $lng->loadLanguageModule('trac');
376
377 $is_admin = true;
378 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
380
381 if ($privacy->enabledCourseAccessTimes()) {
382 include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
383 $progress = ilLearningProgress::_lookupProgressByObjId($this->getParentObject()->getId());
384 }
385
386 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
387 $show_tracking =
388 (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
389 if ($show_tracking) {
390 include_once('./Services/Object/classes/class.ilObjectLP.php');
391 $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
392 $show_tracking = $olp->isActive();
393 }
394
395 if ($show_tracking) {
396 include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
398 $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->getParentObject()->getId());
400 }
401
402 $profile_data = ilObjUser::_readUsersProfileData($a_members);
403
404 // course defined fields
405 include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
406 $cdfs = ilCourseUserData::_getValuesByObjId($this->getParentObject()->getId());
407
408 $print_member = [];
409 foreach ($a_members as $member_id) {
410 // GET USER OBJ
411 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) {
412 // udf
413 include_once './Services/User/classes/class.ilUserDefinedData.php';
414 $udf_data = new ilUserDefinedData($member_id);
415 foreach ($udf_data->getAll() as $field => $value) {
416 list($f, $field_id) = explode('_', $field);
417 $print_member[$member_id]['udf_' . $field_id] = (string) $value;
418 }
419
420 foreach ((array) $cdfs[$member_id] as $cdf_field => $cdf_value) {
421 $print_member[$member_id]['cdf_' . $cdf_field] = (string) $cdf_value;
422 }
423
424 foreach ((array) $profile_data[$member_id] as $field => $value) {
425 $print_member[$member_id][$field] = $value;
426 }
427
428 $print_member[$member_id]['login'] = $tmp_obj->getLogin();
429 $print_member[$member_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
430
431 if ($this->getMembersObject()->isAdmin($member_id)) {
432 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_admin");
433 } elseif ($this->getMembersObject()->isTutor($member_id)) {
434 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_tutor");
435 } elseif ($this->getMembersObject()->isMember($member_id)) {
436 $print_member[$member_id]['role'] = $this->lng->txt("il_crs_member");
437 }
438 if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
439 if ($this->getMembersObject()->isNotificationEnabled($member_id)) {
440 $print_member[$member_id]['status'] = $this->lng->txt("crs_notify");
441 } else {
442 $print_member[$member_id]['status'] = $this->lng->txt("crs_no_notify");
443 }
444 } else {
445 if ($this->getMembersObject()->isBlocked($member_id)) {
446 $print_member[$member_id]['status'] = $this->lng->txt("crs_blocked");
447 } else {
448 $print_member[$member_id]['status'] = $this->lng->txt("crs_unblocked");
449 }
450 }
451
452 if ($is_admin) {
453 $print_member[$member_id]['passed'] = $this->getMembersObject()->hasPassed($member_id) ?
454 $this->lng->txt('crs_member_passed') :
455 $this->lng->txt('crs_member_not_passed');
456 }
457 if ($privacy->enabledCourseAccessTimes()) {
458 if (isset($progress[$member_id]['ts']) and $progress[$member_id]['ts']) {
460 $print_member[$member_id]['access'] = ilDatePresentation::formatDate(new ilDateTime($progress[$member_id]['ts'], IL_CAL_UNIX));
462 } else {
463 $print_member[$member_id]['access'] = $this->lng->txt('no_date');
464 }
465 }
466 if ($show_tracking) {
467 if (in_array($member_id, $completed)) {
468 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
469 } elseif (in_array($member_id, $in_progress)) {
470 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
471 } elseif (in_array($member_id, $failed)) {
472 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_FAILED);
473 } else {
474 $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
475 }
476 }
477 }
478 }
479 return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
480 }
$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 297 of file class.ilCourseMembershipGUI.php.

298 {
299 include_once './Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php';
300 $table = new ilCourseEditParticipantsTableGUI($this, $this->getParentObject());
301 $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
302 $table->setData($this->getParentGUI()->readMemberData($participants));
303
304 return $table;
305 }
readMemberData(array $usr_ids, array $columns, bool $skip_names=false)

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

+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilCourseMembershipGUI::initParticipantTableGUI ( )
protected
Returns
\ilParticpantTableGUI

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

265 {
266 include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
267 $show_tracking =
269 ;
270 if ($show_tracking) {
271 include_once('./Services/Object/classes/class.ilObjectLP.php');
272 $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
273 $show_tracking = $olp->isActive();
274 }
275
276 include_once('./Services/Object/classes/class.ilObjectActivation.php');
277 $timings_enabled =
278 (ilObjectActivation::hasTimings($this->getParentObject()->getRefId()) && ($this->getParentObject()->getViewMode() == IL_CRS_VIEW_TIMING))
279 ;
280
281
282 include_once './Modules/Course/classes/class.ilCourseParticipantsTableGUI.php';
284 $this,
285 $this->getParentObject(),
286 $show_tracking,
287 $timings_enabled,
288 $this->getParentObject()->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP
289 );
290 }
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 310 of file class.ilCourseMembershipGUI.php.

311 {
312 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_members.html', 'Modules/Course');
313 }

◆ initWaitingList()

ilCourseMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilCourseWaitingList

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

341 {
342 include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
343 $wait = new ilCourseWaitingList($this->getParentObject()->getId());
344 return $wait;
345 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ readMemberData()

ilCourseMembershipGUI::readMemberData ( array  $usr_ids,
array  $columns,
bool  $skip_names = false 
)

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

324 {
325 return $this->getParentGUI()->readMemberData($usr_ids, $columns, $skip_names);
326 }
if(! $in) $columns
Definition: Utf8Test.php:45

References $columns, and ilMembershipGUI\getParentGUI().

Referenced by initEditParticipantTableGUI().

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

◆ showDeleteParticipantsConfirmationWithLinkedCourses()

ilCourseMembershipGUI::showDeleteParticipantsConfirmationWithLinkedCourses (   $participants)
protected

Show deletion confirmation with linked courses.

Parameters
int[]participants

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

67 {
68 ilUtil::sendQuestion($this->lng->txt('crs_ref_delete_confirmation_info'));
69
70 $table = new ilCourseReferenceDeleteConfirmationTableGUI($this, $this->getParentObject(), 'confirmDeleteParticipants');
71 $table->init();
72 $table->setParticipants($participants);
73 $table->parse();
74
75 $this->tpl->setContent($table->getHTML());
76 }
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 331 of file class.ilCourseMembershipGUI.php.

332 {
333 return $this->getParentGUI()->updateLPFromStatus($a_member_id, $a_passed);
334 }

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 212 of file class.ilCourseMembershipGUI.php.

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