19 declare(strict_types=1);
    54         $this->ref_id = $ls_ref_id;
    55         $this->obj_id = $ls_obj_id;
    64         $this->local_roles = array();
    70             self::ROLE_LS_ADMIN . 
'_' . $this->ref_id,
    71             "LSO admin learning sequence obj_no." . $this->obj_id,
    77             self::ROLE_LS_MEMBER . 
'_' . $this->ref_id,
    78             "LSO member of learning sequence obj_no." . $this->obj_id,
    89         if (count($this->local_roles) == 0) {
    90             $role_ids = $this->rbacreview->getRolesOfRoleFolder(
    94             foreach ($role_ids as $role_id) {
    95                 if ($this->rbacreview->isAssignable($role_id, $this->ref_id) == 
true) {
   101                         $role_name = $role->getTitle();
   104                     $this->local_roles[$role_name] = $role->getId();
   115         return $local_ls_roles[self::ROLE_LS_MEMBER . 
"_" . 
$this->ref_id];
   121         return $local_ls_roles[self::ROLE_LS_ADMIN . 
"_" . 
$this->ref_id];
   126         return $this->
join($user_id, $role);
   131         if (is_null($role)) {
   134         $this->rbacadmin->assignUser($role, $user_id);
   140         $roles = $this->participants::getMemberRoles($this->ref_id);
   142         foreach ($roles as $role) {
   143             $this->rbacadmin->deassignUser($role, $user_id);
   155         foreach ($this->rbacreview->assignedUsers($this->getDefaultAdminRole()) as $admin_id) {
   156             $users[] = (
int) $admin_id;
   167         if (strlen($lso_id) == 0) {
   171         $roles = $this->rbacreview->getRolesOfRoleFolder($lso_id);
   173         $default_roles = array();
   174         foreach ($roles as $role) {
   177             $member = self::ROLE_LS_MEMBER . 
"_" . $lso_id;
   178             $admin = self::ROLE_LS_ADMIN . 
"_" . $lso_id;
   180             if (strcmp($object->getTitle(), $member) == 0) {
   181                 $default_roles[
"lso_member_role"] = $object->getId();
   184             if (strcmp($object->getTitle(), $admin) == 0) {
   185                 $default_roles[
"lso_admin_role"] = $object->getId();
   189         return $default_roles;
   202     public function readMemberData(array $user_ids, array $selected_columns = null): array
   204         $portfolio_enabled = $this->
isPortfolio($selected_columns);
   208         if ($tracking_enabled) {
   210             $tracking_enabled = $olp->isActive();
   217         if ($privacy->enabledLearningSequenceAccessTimes()) {
   221         if ($portfolio_enabled) {
   224                 $this->
ctrl->getLinkTargetByClass(
"ilLearningSequenceMembershipGUI", 
"members")
   230         foreach ($user_ids as $usr_id) {
   234             $data[
'firstname'] = $name[
'firstname'];
   235             $data[
'lastname'] = $name[
'lastname'];
   237             $data[
'usr_id'] = $usr_id;
   239             $data[
'notification'] = 0;
   240             if ($this->participants->isNotificationEnabled($usr_id)) {
   241                 $data[
'notification'] = 1;
   244             foreach ($profile_data[$usr_id] as $field => $value) {
   245                 $data[$field] = $value;
   248             if ($tracking_enabled) {
   249                 if (in_array($usr_id, $completed)) {
   251                 } elseif (in_array($usr_id, $in_progress)) {
   253                 } elseif (in_array($usr_id, $failed)) {
   260             if ($privacy->enabledLearningSequenceAccessTimes()) {
   261                 if (isset($progress[$usr_id][
'ts']) && $progress[$usr_id][
'ts']) {
   267                     $data[
'access_time'] = $this->
lng->txt(
'no_date');
   268                     $data[
'access_time_unix'] = 0;
   272             if ($portfolio_enabled && array_key_exists($usr_id, $portfolios)) {
   273                 $data[
'prtf'] = $portfolios[$usr_id];
   276             $members[$usr_id] = 
$data;
   292         if (is_null($columns)) {
   295         return in_array(self::TYPE_PORTFOLIO, $columns);
   300         return $this->participants->isMember($usr_id);
   308         return ($tracking_active && $user_completion);
 static _hasUserCompleted(int $a_obj_id, int $a_user_id)
Lookup user object completion. 
 
isCompletedByUser(int $usr_id)
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
 
getLocalLearningSequenceRoles(bool $translate=false)
 
const LP_STATUS_NOT_ATTEMPTED
 
static _lookupInProgressForObject(int $a_obj_id, ?array $a_user_ids=null)
 
static _lookupName(int $a_user_id)
lookup user name 
 
static createDefaultRole(string $a_title, string $a_description, string $a_tpl_name, int $a_ref_id)
 
const LP_STATUS_IN_PROGRESS
 
getDefaultLearningSequenceRoles(string $lso_id)
 
static _lookupCompletedForObject(int $a_obj_id, ?array $a_user_ids=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _enabledUserRelatedData()
 
static _enabledLearningProgress()
 
readMemberData(array $user_ids, array $selected_columns=null)
 
join(int $user_id, int $role=null)
 
static _getTranslation(string $a_role_title)
 
addLSMember(int $user_id, int $role)
 
__construct(int $ls_ref_id, int $ls_obj_id, ilLearningSequenceParticipants $participants, ilCtrl $ctrl, ilRbacAdmin $rbacadmin, ilRbacReview $rbacreview, ilDBInterface $database, ilObjUser $user, ilLanguage $lng)
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
isPortfolio(array $columns=null)
 
ilLearningSequenceParticipants $participants
 
static _readUsersProfileData(array $a_user_ids)
 
static _lookupProgressByObjId(int $a_obj_id)
lookup progress for a specific object 
 
getLearningSequenceAdminIds()
 
static getAvailablePortfolioLinksForUserIds(array $a_owner_ids, ?string $a_back_url=null)
 
static _lookupFailedForObject(int $a_obj_id, ?array $a_user_ids=null)
 
Class ilRbacAdmin Core functions for role based access control. 
 
const LP_STATUS_COMPLETED
 
static getInstance(int $obj_id)
 
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)
 
getRoleObject(int $obj_id)
 
static _lookupLogin(int $a_user_id)