ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 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 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 ()
 
 getMailContextOptions ()
 
 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 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()

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

callback from repository search gui ilRbacSystem $rbacsystem

Parameters
array$a_usr_ids
int$a_typerole_id
Returns
bool

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

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().

68  {
69  global $DIC;
70 
71  $rbacsystem = $DIC['rbacsystem'];
72  $ilErr = $DIC['ilErr'];
73 
74  if (!$this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
75  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->FATAL);
76  }
77 
78  if (!count($a_usr_ids)) {
79  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
80  return false;
81  }
82 
83  $a_usr_ids = $this->filterUserIdsByRbacOrPositionOfCurrentUser($a_usr_ids);
84 
85  $added_users = 0;
86  foreach ($a_usr_ids as $user_id) {
87  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
88  continue;
89  }
90  if ($this->getMembersObject()->isAssigned($user_id)) {
91  continue;
92  }
93  switch ($a_type) {
94  case $this->getParentObject()->getDefaultMemberRole():
95  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
96  break;
97  case $this->getParentObject()->getDefaultTutorRole():
98  $this->getMembersObject()->add($user_id, IL_CRS_TUTOR);
99  break;
100  case $this->getParentObject()->getDefaultAdminRole():
101  $this->getMembersObject()->add($user_id, IL_CRS_ADMIN);
102  break;
103  default:
104  if (in_array($a_type, $this->getParentObject()->getLocalCourseRoles(true))) {
105  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
106  $this->getMembersObject()->updateRoleAssignments($user_id, (array) $a_type);
107  } else {
108  ilLoggerFactory::getLogger('crs')->notice('Can\'t find role with id .' . $a_type . ' to assign users.');
109  ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"), true);
110  return false;
111  }
112  break;
113  }
114  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id);
115 
116  $this->getParentObject()->checkLPStatusSync($user_id);
117 
118  ++$added_users;
119  }
120  if ($added_users) {
121  ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
122  $this->ctrl->redirect($this, 'participants');
123  }
124  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
125  return false;
126  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
const IL_CRS_TUTOR
$ilErr
Definition: raiseError.php:18
const IL_CRS_MEMBER
$a_type
Definition: workflow.php:92
const IL_CRS_ADMIN
Base class for course and group participants.
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
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.
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ 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 273 of file class.ilCourseMembershipGUI.php.

References ilMembershipGUI\getParentGUI().

274  {
275  return $this->getParentGUI()->deliverCertificateObject();
276  }
getParentGUI()
Get parent gui.
+ 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[]

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

References $GLOBALS, and ilMembershipGUI\getParentObject().

Referenced by assignMembers().

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

400  {
401  if (is_array($this->member_data) && array_key_exists($a_user_id, $this->member_data)) {
402  return $this->member_data[$a_user_id];
403  }
404  return [];
405  }

◆ getDefaultRole()

ilCourseMembershipGUI::getDefaultRole ( )
protected
Returns
int

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

References ilMembershipGUI\getParentGUI().

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

◆ getLocalTypeRole()

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

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

References ilMembershipGUI\getParentObject().

238  {
239  return $this->getParentObject()->getLocalCourseRoles($a_translation);
240  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getMailContextOptions()

ilCourseMembershipGUI::getMailContextOptions ( )
protected

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

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

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.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilCourseMembershipGUI::getMailMemberRoles ( )
protected
Returns
ilAbstractMailMemberRoles

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

References $_SESSION, $DIC, $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().

283  {
284  global $DIC;
285 
286  $ilAccess = $DIC['ilAccess'];
287  $lng = $DIC['lng'];
288 
289  $lng->loadLanguageModule('trac');
290 
291  $is_admin = true;
292  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
293  $privacy = ilPrivacySettings::_getInstance();
294 
295  if ($privacy->enabledCourseAccessTimes()) {
296  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
297  $progress = ilLearningProgress::_lookupProgressByObjId($this->getParentObject()->getId());
298  }
299 
300  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
301  $show_tracking =
303  if ($show_tracking) {
304  include_once('./Services/Object/classes/class.ilObjectLP.php');
305  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
306  $show_tracking = $olp->isActive();
307  }
308 
309  if ($show_tracking) {
310  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
311  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->getParentObject()->getId());
312  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->getParentObject()->getId());
314  }
315 
316  $profile_data = ilObjUser::_readUsersProfileData($a_members);
317 
318  // course defined fields
319  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
320  $cdfs = ilCourseUserData::_getValuesByObjId($this->getParentObject()->getId());
321 
322  foreach ($a_members as $member_id) {
323  // GET USER OBJ
324  if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) {
325  // udf
326  include_once './Services/User/classes/class.ilUserDefinedData.php';
327  $udf_data = new ilUserDefinedData($member_id);
328  foreach ($udf_data->getAll() as $field => $value) {
329  list($f, $field_id) = explode('_', $field);
330  $print_member[$member_id]['udf_' . $field_id] = (string) $value;
331  }
332 
333  foreach ((array) $cdfs[$member_id] as $cdf_field => $cdf_value) {
334  $print_member[$member_id]['cdf_' . $cdf_field] = (string) $cdf_value;
335  }
336 
337  foreach ((array) $profile_data[$member_id] as $field => $value) {
338  $print_member[$member_id][$field] = $value;
339  }
340 
341  $print_member[$member_id]['login'] = $tmp_obj->getLogin();
342  $print_member[$member_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
343 
344  if ($this->getMembersObject()->isAdmin($member_id)) {
345  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_admin");
346  } elseif ($this->getMembersObject()->isTutor($member_id)) {
347  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_tutor");
348  } elseif ($this->getMembersObject()->isMember($member_id)) {
349  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_member");
350  }
351  if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
352  if ($this->getMembersObject()->isNotificationEnabled($member_id)) {
353  $print_member[$member_id]['status'] = $this->lng->txt("crs_notify");
354  } else {
355  $print_member[$member_id]['status'] = $this->lng->txt("crs_no_notify");
356  }
357  } else {
358  if ($this->getMembersObject()->isBlocked($member_id)) {
359  $print_member[$member_id]['status'] = $this->lng->txt("crs_blocked");
360  } else {
361  $print_member[$member_id]['status'] = $this->lng->txt("crs_unblocked");
362  }
363  }
364 
365  if ($is_admin) {
366  $print_member[$member_id]['passed'] = $this->getMembersObject()->hasPassed($member_id) ?
367  $this->lng->txt('crs_member_passed') :
368  $this->lng->txt('crs_member_not_passed');
369  }
370  if ($privacy->enabledCourseAccessTimes()) {
371  if (isset($progress[$member_id]['ts']) and $progress[$member_id]['ts']) {
373  $print_member[$member_id]['access'] = ilDatePresentation::formatDate(new ilDateTime($progress[$member_id]['ts'], IL_CAL_UNIX));
375  } else {
376  $print_member[$member_id]['access'] = $this->lng->txt('no_date');
377  }
378  }
379  if ($show_tracking) {
380  if (in_array($member_id, $completed)) {
381  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
382  } elseif (in_array($member_id, $in_progress)) {
383  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
384  } elseif (in_array($member_id, $failed)) {
385  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_FAILED);
386  } else {
387  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
388  }
389  }
390  }
391  }
392  return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
393  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Class ilUserDefinedData.
$_SESSION["AccountId"]
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
const LP_STATUS_NOT_ATTEMPTED
static _lookupFailedForObject($a_obj_id, $a_user_ids=null)
Get failed users for object.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
const LP_STATUS_IN_PROGRESS
static _enabledLearningProgress()
check wether learing progress is enabled or not
const LP_STATUS_FAILED
static _lookupProgressByObjId($a_obj_id)
lookup progress for a specific object
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
Date and time handling
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
$failed
Definition: Utf8Test.php:85
static _lookupInProgressForObject($a_obj_id, $a_user_ids=null)
Get in progress users for object.
static _getInstance()
Get instance of ilPrivacySettings.
getParentObject()
Get parent object.
static _lookupCompletedForObject($a_obj_id, $a_user_ids=null)
Get completed users for object.
const LP_STATUS_COMPLETED
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilCourseMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

init edit participants table gui

Parameters
array$participants
Returns

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

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

217  {
218  include_once './Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php';
220  $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
221  $table->setData($this->getParentGUI()->readMemberData($participants));
222 
223  return $table;
224  }
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()

ilCourseMembershipGUI::initParticipantTableGUI ( )
protected
Returns

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

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

184  {
185  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
186  $show_tracking =
188  ;
189  if ($show_tracking) {
190  include_once('./Services/Object/classes/class.ilObjectLP.php');
191  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
192  $show_tracking = $olp->isActive();
193  }
194 
195  include_once('./Services/Object/classes/class.ilObjectActivation.php');
196  $timings_enabled =
197  (ilObjectActivation::hasTimings($this->getParentObject()->getRefId()) && ($this->getParentObject()->getViewMode() == IL_CRS_VIEW_TIMING))
198  ;
199 
200 
201  include_once './Modules/Course/classes/class.ilCourseParticipantsTableGUI.php';
202  return new ilCourseParticipantsTableGUI(
203  $this,
204  $this->getParentObject(),
205  $show_tracking,
206  $timings_enabled,
207  $this->getParentObject()->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP
208  );
209  }
static hasTimings($a_ref_id)
Check if there is any active timing (in subtree)
const IL_CRS_VIEW_TIMING
const STATUS_DETERMINATION_LP
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()

ilCourseMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

230  {
231  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_members.html', 'Modules/Course');
232  }

◆ initWaitingList()

ilCourseMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilCourseWaitingList

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

References ilMembershipGUI\getParentObject().

255  {
256  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
257  $wait = new ilCourseWaitingList($this->getParentObject()->getId());
258  return $wait;
259  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ updateLPFromStatus()

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

Update lp from status.

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

References ilMembershipGUI\getParentGUI().

Referenced by updateParticipantsStatus().

246  {
247  return $this->getParentGUI()->updateLPFromStatus($a_member_id, $a_passed);
248  }
getParentGUI()
Get parent gui.
+ 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 131 of file class.ilCourseMembershipGUI.php.

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

132  {
133  global $DIC;
134 
135  $ilAccess = $DIC['ilAccess'];
136  $ilErr = $DIC['ilErr'];
137  $ilUser = $DIC['ilUser'];
138  $rbacadmin = $DIC['rbacadmin'];
139 
140  $visible_members = (array) $_POST['visible_member_ids'];
141  $passed = (array) $_POST['passed'];
142  $blocked = (array) $_POST['blocked'];
143  $contact = (array) $_POST['contact'];
144  $notification = (array) $_POST['notification'];
145 
146  foreach ($visible_members as $member_id) {
147  if ($ilAccess->checkAccess("grade", "", $this->getParentObject()->getRefId())) {
148  $this->getMembersObject()->updatePassed($member_id, in_array($member_id, $passed), true);
149  $this->updateLPFromStatus($member_id, in_array($member_id, $passed));
150  }
151 
152  if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
153  // remove blocked
154  $this->getMembersObject()->updateBlocked($member_id, 0);
155  $this->getMembersObject()->updateNotification($member_id, in_array($member_id, $notification));
156  $this->getMembersObject()->updateContact($member_id, in_array($member_id, $contact));
157  } else {
158  // send notifications => unblocked
159  if ($this->getMembersObject()->isBlocked($member_id) && !in_array($member_id, $blocked)) {
160  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_UNBLOCK_MEMBER, $member_id);
161  }
162  // => blocked
163  if (!$this->getMembersObject()->isBlocked($member_id) && in_array($member_id, $blocked)) {
164  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_BLOCK_MEMBER, $member_id);
165  }
166 
167  // normal member => remove notification, contact
168  $this->getMembersObject()->updateNotification($member_id, false);
169  $this->getMembersObject()->updateContact($member_id, false);
170  $this->getMembersObject()->updateBlocked($member_id, in_array($member_id, $blocked));
171  }
172  }
173 
174 
175  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
176  $this->ctrl->redirect($this, 'participants');
177  }
getMembersObject()
Get member object.
global $DIC
Definition: saml.php:7
$ilErr
Definition: raiseError.php:18
updateLPFromStatus($a_member_id, $a_passed)
Update lp from status.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

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