ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 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 ()
 
 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...
 
 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...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 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 45 of file class.ilCourseMembershipGUI.php.

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

46  {
47  global $rbacsystem, $ilErr;
48 
49  if (!$this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
50  $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->FATAL);
51  }
52 
53  if (!count($a_usr_ids)) {
54  ilUtil::sendFailure($this->lng->txt("crs_no_users_selected"), true);
55  return false;
56  }
57 
58  $a_usr_ids = $this->filterUserIdsByRbacOrPositionOfCurrentUser($a_usr_ids);
59 
60  $added_users = 0;
61  foreach ($a_usr_ids as $user_id) {
62  if (!$tmp_obj = ilObjectFactory::getInstanceByObjId($user_id, false)) {
63  continue;
64  }
65  if ($this->getMembersObject()->isAssigned($user_id)) {
66  continue;
67  }
68  switch ($a_type) {
69  case $this->getParentObject()->getDefaultMemberRole():
70  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
71  break;
72  case $this->getParentObject()->getDefaultTutorRole():
73  $this->getMembersObject()->add($user_id, IL_CRS_TUTOR);
74  break;
75  case $this->getParentObject()->getDefaultAdminRole():
76  $this->getMembersObject()->add($user_id, IL_CRS_ADMIN);
77  break;
78  default:
79  if (in_array($a_type, $this->getParentObject()->getLocalCourseRoles(true))) {
80  $this->getMembersObject()->add($user_id, IL_CRS_MEMBER);
81  $this->getMembersObject()->updateRoleAssignments($user_id, (array) $a_type);
82  } else {
83  ilLoggerFactory::getLogger('crs')->notice('Can\'t find role with id .' . $a_type . ' to assign users.');
84  ilUtil::sendFailure($this->lng->txt("crs_cannot_find_role"), true);
85  return false;
86  }
87  break;
88  }
89  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_ACCEPT_USER, $user_id);
90 
91  $this->getParentObject()->checkLPStatusSync($user_id);
92 
93  ++$added_users;
94  }
95  if ($added_users) {
96  ilUtil::sendSuccess($this->lng->txt("crs_users_added"), true);
97  $this->ctrl->redirect($this, 'participants');
98  }
99  ilUtil::sendFailure($this->lng->txt("crs_users_already_assigned"), true);
100  return false;
101  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
getMembersObject()
Get member object.
const IL_CRS_TUTOR
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
Create styles array
The data for the language used.
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 243 of file class.ilCourseMembershipGUI.php.

References ilMembershipGUI\getParentGUI().

244  {
245  return $this->getParentGUI()->deliverCertificateObject($user_id);
246  }
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 26 of file class.ilCourseMembershipGUI.php.

References $GLOBALS, and ilMembershipGUI\getParentObject().

Referenced by assignMembers(), and getAttendanceListUserData().

27  {
28  return $GLOBALS['DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
29  'manage_members',
30  'manage_members',
31  $this->getParentObject()->getRefId(),
32  $a_user_ids
33  );
34  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
getParentObject()
Get parent object.
+ 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.

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

References filterUserIdsByRbacOrPositionOfCurrentUser().

366  {
367  if ($this->filterUserIdsByRbacOrPositionOfCurrentUser([$a_user_id])) {
368  return $this->member_data[$a_user_id];
369  }
370  return [];
371  }
filterUserIdsByRbacOrPositionOfCurrentUser($a_user_ids)
Filter user ids by access.
+ Here is the call graph for this function:

◆ getDefaultRole()

ilCourseMembershipGUI::getDefaultRole ( )
protected
Returns
int

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

References ilMembershipGUI\getParentGUI().

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

◆ getLocalTypeRole()

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

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

References ilMembershipGUI\getParentObject().

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

◆ getPrintMemberData()

ilCourseMembershipGUI::getPrintMemberData (   $a_members)
protected

Get print member data.

Parameters
array$a_members

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

References $_SESSION, $failed, ilMembershipGUI\$lng, ilObjUserTracking\_enabledLearningProgress(), ilObjUserTracking\_enabledUserRelatedData(), ilPrivacySettings\_getInstance(), ilCourseUserData\_getValuesByObjId(), ilLPStatusWrapper\_lookupCompletedForObject(), ilLPStatusWrapper\_lookupFailedForObject(), ilLPStatusWrapper\_lookupInProgressForObject(), ilLearningProgress\_lookupProgressByObjId(), ilObjUser\_readUsersProfileData(), array, 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(), ilUtil\sortArray(), and string.

253  {
254  global $ilAccess,$lng;
255 
256  $lng->loadLanguageModule('trac');
257 
258  $is_admin = true;
259  include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
260  $privacy = ilPrivacySettings::_getInstance();
261 
262  if ($privacy->enabledCourseAccessTimes()) {
263  include_once('./Services/Tracking/classes/class.ilLearningProgress.php');
264  $progress = ilLearningProgress::_lookupProgressByObjId($this->getParentObject()->getId());
265  }
266 
267  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
268  $show_tracking =
269  (ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData());
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  if ($show_tracking) {
277  include_once 'Services/Tracking/classes/class.ilLPStatusWrapper.php';
278  $completed = ilLPStatusWrapper::_lookupCompletedForObject($this->getParentObject()->getId());
279  $in_progress = ilLPStatusWrapper::_lookupInProgressForObject($this->getParentObject()->getId());
281  }
282 
283  $profile_data = ilObjUser::_readUsersProfileData($a_members);
284 
285  // course defined fields
286  include_once('Modules/Course/classes/Export/class.ilCourseUserData.php');
287  $cdfs = ilCourseUserData::_getValuesByObjId($this->getParentObject()->getId());
288 
289  foreach ($a_members as $member_id) {
290  // GET USER OBJ
291  if ($tmp_obj = ilObjectFactory::getInstanceByObjId($member_id, false)) {
292  // udf
293  include_once './Services/User/classes/class.ilUserDefinedData.php';
294  $udf_data = new ilUserDefinedData($member_id);
295  foreach ($udf_data->getAll() as $field => $value) {
296  list($f, $field_id) = explode('_', $field);
297  $print_member[$member_id]['udf_' . $field_id] = (string) $value;
298  }
299 
300  foreach ((array) $cdfs[$member_id] as $cdf_field => $cdf_value) {
301  $print_member[$member_id]['cdf_' . $cdf_field] = (string) $cdf_value;
302  }
303 
304  foreach ((array) $profile_data[$member_id] as $field => $value) {
305  $print_member[$member_id][$field] = $value;
306  }
307 
308  $print_member[$member_id]['login'] = $tmp_obj->getLogin();
309  $print_member[$member_id]['name'] = $tmp_obj->getLastname() . ', ' . $tmp_obj->getFirstname();
310 
311  if ($this->getMembersObject()->isAdmin($member_id)) {
312  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_admin");
313  } elseif ($this->getMembersObject()->isTutor($member_id)) {
314  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_tutor");
315  } elseif ($this->getMembersObject()->isMember($member_id)) {
316  $print_member[$member_id]['role'] = $this->lng->txt("il_crs_member");
317  }
318  if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
319  if ($this->getMembersObject()->isNotificationEnabled($member_id)) {
320  $print_member[$member_id]['status'] = $this->lng->txt("crs_notify");
321  } else {
322  $print_member[$member_id]['status'] = $this->lng->txt("crs_no_notify");
323  }
324  } else {
325  if ($this->getMembersObject()->isBlocked($member_id)) {
326  $print_member[$member_id]['status'] = $this->lng->txt("crs_blocked");
327  } else {
328  $print_member[$member_id]['status'] = $this->lng->txt("crs_unblocked");
329  }
330  }
331 
332  if ($is_admin) {
333  $print_member[$member_id]['passed'] = $this->getMembersObject()->hasPassed($member_id) ?
334  $this->lng->txt('crs_member_passed') :
335  $this->lng->txt('crs_member_not_passed');
336  }
337  if ($privacy->enabledCourseAccessTimes()) {
338  if (isset($progress[$member_id]['ts']) and $progress[$member_id]['ts']) {
340  $print_member[$member_id]['access'] = ilDatePresentation::formatDate(new ilDateTime($progress[$member_id]['ts'], IL_CAL_UNIX));
342  } else {
343  $print_member[$member_id]['access'] = $this->lng->txt('no_date');
344  }
345  }
346  if ($show_tracking) {
347  if (in_array($member_id, $completed)) {
348  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_COMPLETED);
349  } elseif (in_array($member_id, $in_progress)) {
350  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_IN_PROGRESS);
351  } elseif (in_array($member_id, $failed)) {
352  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_FAILED);
353  } else {
354  $print_member[$member_id]['progress'] = $this->lng->txt(ilLPStatus::LP_STATUS_NOT_ATTEMPTED);
355  }
356  }
357  }
358  }
359  return ilUtil::sortArray($print_member, 'name', $_SESSION['crs_print_order'], false, true);
360  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Add rich text string
Class ilUserDefinedData.
$_SESSION["AccountId"]
getMembersObject()
Get member object.
static _getValuesByObjId($a_obj_id)
Get values by obj_id (for all users)
const LP_STATUS_NOT_ATTEMPTED
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
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 _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
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
Create styles array
The data for the language used.
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)
PHPExcel root directory.
Definition: Database.php:30
+ 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 186 of file class.ilCourseMembershipGUI.php.

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

187  {
188  include_once './Modules/Course/classes/class.ilCourseEditParticipantsTableGUI.php';
190  $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
191  $table->setData($this->getParentGUI()->readMemberData($participants));
192 
193  return $table;
194  }
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 153 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.

154  {
155  include_once './Services/Tracking/classes/class.ilObjUserTracking.php';
156  $show_tracking =
158  ;
159  if ($show_tracking) {
160  include_once('./Services/Object/classes/class.ilObjectLP.php');
161  $olp = ilObjectLP::getInstance($this->getParentObject()->getId());
162  $show_tracking = $olp->isActive();
163  }
164 
165  include_once('./Services/Object/classes/class.ilObjectActivation.php');
166  $timings_enabled =
167  (ilObjectActivation::hasTimings($this->getParentObject()->getRefId()) && ($this->getParentObject()->getViewMode() == IL_CRS_VIEW_TIMING))
168  ;
169 
170 
171  include_once './Modules/Course/classes/class.ilCourseParticipantsTableGUI.php';
172  return new ilCourseParticipantsTableGUI(
173  $this,
174  $this->getParentObject(),
175  $show_tracking,
176  $timings_enabled,
177  $this->getParentObject()->getStatusDetermination() == ilObjCourse::STATUS_DETERMINATION_LP
178  );
179  }
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 199 of file class.ilCourseMembershipGUI.php.

200  {
201  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_edit_members.html', 'Modules/Course');
202  }

◆ initWaitingList()

ilCourseMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilCourseWaitingList

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

References ilMembershipGUI\getParentObject().

225  {
226  include_once './Modules/Course/classes/class.ilCourseWaitingList.php';
227  $wait = new ilCourseWaitingList($this->getParentObject()->getId());
228  return $wait;
229  }
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 215 of file class.ilCourseMembershipGUI.php.

References ilMembershipGUI\getParentGUI().

Referenced by updateParticipantsStatus().

216  {
217  return $this->getParentGUI()->updateLPFromStatus($a_member_id, $a_passed);
218  }
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 106 of file class.ilCourseMembershipGUI.php.

References $_POST, $ilErr, $ilUser, array, ilMembershipGUI\getMembersObject(), ilUtil\sendSuccess(), and updateLPFromStatus().

107  {
108  global $ilAccess,$ilErr,$ilUser,$rbacadmin;
109 
110  $visible_members = (array) $_POST['visible_member_ids'];
111  $passed = (array) $_POST['passed'];
112  $blocked = (array) $_POST['blocked'];
113  $contact = (array) $_POST['contact'];
114  $notification = (array) $_POST['notification'];
115 
116  foreach ($visible_members as $member_id) {
117  if ($ilAccess->checkAccess("grade", "", $this->getParentObject()->getRefId())) {
118  $this->getMembersObject()->updatePassed($member_id, in_array($member_id, $passed), true);
119  $this->updateLPFromStatus($member_id, in_array($member_id, $passed));
120  }
121 
122  if ($this->getMembersObject()->isAdmin($member_id) or $this->getMembersObject()->isTutor($member_id)) {
123  // remove blocked
124  $this->getMembersObject()->updateBlocked($member_id, 0);
125  $this->getMembersObject()->updateNotification($member_id, in_array($member_id, $notification));
126  $this->getMembersObject()->updateContact($member_id, in_array($member_id, $contact));
127  } else {
128  // send notifications => unblocked
129  if ($this->getMembersObject()->isBlocked($member_id) && !in_array($member_id, $blocked)) {
130  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_UNBLOCK_MEMBER, $member_id);
131  }
132  // => blocked
133  if (!$this->getMembersObject()->isBlocked($member_id) && in_array($member_id, $blocked)) {
134  $this->getMembersObject()->sendNotification($this->getMembersObject()->NOTIFY_BLOCK_MEMBER, $member_id);
135  }
136 
137  // normal member => remove notification, contact
138  $this->getMembersObject()->updateNotification($member_id, false);
139  $this->getMembersObject()->updateContact($member_id, false);
140  $this->getMembersObject()->updateBlocked($member_id, in_array($member_id, $blocked));
141  }
142  }
143 
144 
145  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
146  $this->ctrl->redirect($this, 'participants');
147  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilErr
Definition: raiseError.php:16
getMembersObject()
Get member object.
updateLPFromStatus($a_member_id, $a_passed)
Update lp from status.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

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