3declare(strict_types=1);
 
   30        $this->parent_gui = $parent_gui;
 
   31        $this->rep_object = $ls_object;
 
   34        $this->obj_user_tracking = $obj_user_tracking;
 
   35        $this->privacy_settings = $privacy_settings;
 
   37        $this->access = $access;
 
   38        $this->rbac_review = $rbac_review;
 
   41        $this->lng->loadLanguageModule(
'lso');
 
   42        $this->lng->loadLanguageModule(
'trac');
 
   43        $this->lng->loadLanguageModule(
'rbac');
 
   44        $this->lng->loadLanguageModule(
'mmbr');
 
   45        $this->lng->loadLanguageModule(
'user');
 
   46        $this->lng->loadLanguageModule(
'ps');
 
   63        $this->
setRowTemplate(
"tpl.show_participants_row.html", 
"Modules/LearningSequence");
 
   68        $this->
addColumn($this->lng->txt(
'name'), 
'lastname', 
'20%');
 
   69        $this->
addColumn($this->lng->txt(
'login'), 
'login');
 
   73            $this->
addColumn($all_cols[$col][
'txt'], $col);
 
   81            $this->
addColumn($this->lng->txt(
'first_access'), 
"first_access");
 
   82            $this->
addColumn($this->lng->txt(
'last_access'), 
"last_access");
 
   84        $this->
addColumn($this->lng->txt(
'completed_steps'), 
"completed_steps");
 
   85        $this->
addColumn($this->lng->txt(
'last_visited_step'), 
"last_visited_step");
 
   86        $this->
addColumn($this->lng->txt(
'lso_notification'), 
'notification');
 
   87        $this->
addColumn($this->lng->txt(
''), 
'optional');
 
   92        $this->
enable(
'select_all');
 
   97        $this->
addMultiCommand(
'confirmDeleteParticipants', $this->lng->txt(
'remove'));
 
   98        $this->
addMultiCommand(
'sendMailToSelectedUsers', $this->lng->txt(
'mmbr_btn_mail_selected_users'));
 
   99        $this->
addMultiCommand(
'addToClipboard', $this->lng->txt(
'clipboard_add_btn'));
 
  100        $this->
addCommandButton(
'updateParticipantsStatus', $this->lng->txt(
'save'));
 
  105        $this->tpl->setVariable(
'VAL_ID', $set[
'usr_id']);
 
  106        $this->tpl->setVariable(
'VAL_NAME', $set[
'lastname'] . 
', ' . $set[
'firstname']);
 
  107        $this->tpl->setVariable(
'VAL_LOGIN', $set[
'login']);
 
  110            !$this->access->checkAccessOfUser($set[
'usr_id'], 
'read', 
'', $this->getRepositoryObject()->getRefId()) &&
 
  111            is_array($info = $this->access->getInfo())
 
  113            $this->tpl->setCurrentBlock(
'access_warning');
 
  114            $this->tpl->setVariable(
'PARENT_ACCESS', $info[0][
'text']);
 
  115            $this->tpl->parseCurrentBlock();
 
  119            $this->tpl->setCurrentBlock(
'access_warning');
 
  120            $this->tpl->setVariable(
'PARENT_ACCESS', $this->lng->txt(
'usr_account_inactive'));
 
  121            $this->tpl->parseCurrentBlock();
 
  128                    if (is_array($set[
'prtf'])) {
 
  129                        foreach ($set[
'prtf'] as $prtf_url => $prtf_txt) {
 
  130                            $tmp[] = 
'<a href="' . $prtf_url . 
'">' . $prtf_txt . 
'</a>';
 
  133                    $this->tpl->setCurrentBlock(
'custom_fields');
 
  134                    $this->tpl->setVariable(
'VAL_CUST', (
string) implode(
'<br />', $tmp));
 
  135                    $this->tpl->parseCurrentBlock();
 
  138                    $this->tpl->setCurrentBlock(
'custom_fields');
 
  139                    $this->tpl->setVariable(
'VAL_CUST', (
string) $set[
'roles_label']);
 
  140                    $this->tpl->parseCurrentBlock();
 
  143                    $this->tpl->setCurrentBlock(
'custom_fields');
 
  144                    $this->tpl->setVariable(
'VAL_CUST', (
string) ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($set[
'usr_id']));
 
  145                    $this->tpl->parseCurrentBlock();
 
  148                    $this->tpl->setCurrentBlock(
'custom_fields');
 
  149                    $this->tpl->setVariable(
'VAL_CUST', isset($set[$field]) ? (
string) $set[$field] : 
'');
 
  150                    $this->tpl->parseCurrentBlock();
 
  155        $this->tpl->setVariable(
'VAL_POSTNAME', 
'participants');
 
  162            $this->tpl->setVariable(
'FIRST_ACCESS', $this->
getFirstAccess((
int) $set[
'usr_id']));
 
  163            $this->tpl->setVariable(
'LAST_ACCESS', $this->
getLastAccess((
int) $set[
'usr_id']));
 
  166        $this->tpl->setVariable(
'COMPLETED_STEPS', $this->
getCompletedSteps((
int) $set[
'usr_id']));
 
  167        $this->tpl->setVariable(
'LAST_VISITED_STEP', $this->
getLastVisitedStep((
int) $set[
'usr_id']));
 
  170            $this->tpl->setVariable(
'VAL_NOTIFICATION_ID', $set[
'usr_id']);
 
  171            $this->tpl->setVariable(
 
  172                'VAL_NOTIFICATION_CHECKED',
 
  173                $set[
'notification'] ? 
'checked="checked"' : 
'' 
  178        $this->tpl->setVariable(
'VAL_LOGIN', $set[
'login']);
 
  188        if (
$data[$user_id] === -1) {
 
  192        return $data[$user_id];
 
  202        if (
$data[$user_id] === -1) {
 
  206        return $data[$user_id];
 
  212        $learner_items = array();
 
  218        $completion_states = $this->rep_object->getLPCompletionStates();
 
  220        foreach ($learner_items as $learner_item) {
 
  221            if (in_array($learner_item->getLearningProgressStatus(), $completion_states)) {
 
  226        return $passed . 
" / " . count($learner_items);
 
  241        if (
$data[$user_id] === -1) {
 
  257        $ls_participants = $this->participants->getParticipants();
 
  259        $ls_participants = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
 
  266        if (!$ls_participants) {
 
  271        $lso_user_data = $this->parent_gui->readMemberData(
 
  277        unset($additional_fields[
'prtf']);
 
  278        unset($additional_fields[
'roles']);
 
  279        unset($additional_fields[
'org_units']);
 
  281        $udf_ids = $usr_data_fields = $odf_ids = array();
 
  282        foreach ($additional_fields as $field) {
 
  283            if (substr($field, 0, 3) == 
'udf') {
 
  284                $udf_ids[] = substr($field, 4);
 
  288            if (substr($field, 0, 3) == 
'odf') {
 
  289                $odf_ids[] = substr($field, 4);
 
  293            $usr_data_fields[] = $field;
 
  301            $this->current_filter[
'login'],
 
  313        $user_data = array();
 
  314        $filtered_user_ids = array();
 
  315        $local_roles = $this->parent_gui->getLocalRoles();
 
  317        foreach ($usr_data[
'set'] as $ud) {
 
  318            $user_id = $ud[
'usr_id'];
 
  320            if ($this->current_filter[
'roles']) {
 
  321                if (!$this->rbac_review->isAssigned($user_id, $this->current_filter[
'roles'])) {
 
  326            if ($this->current_filter[
'org_units']) {
 
  327                $org_unit = $this->current_filter[
'org_units'];
 
  329                $user_units = (string) ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
 
  330                if (strpos($user_units, 
$title) === 
false) {
 
  335            $filtered_user_ids[] = $user_id;
 
  336            $user_data[$user_id] = array_merge($ud, (array) $lso_user_data[$user_id]);
 
  339            foreach ($local_roles as $role_id => $role_name) {
 
  340                if ($this->rbac_review->isAssigned($user_id, $role_id)) {
 
  341                    $roles[] = $role_name;
 
  345            $user_data[$user_id][
'name'] = $user_data[$user_id][
'lastname'] . 
', ' . $user_data[$user_id][
'firstname'];
 
  346            $user_data[$user_id][
'roles_label'] = implode(
'<br />', $roles);
 
  347            $user_data[$user_id][
'roles'] = $this->participants->setRoleOrderPosition($user_id);
 
  353            foreach (
$data as $usr_id => $fields) {
 
  358                foreach ($fields as $field_id => $value) {
 
  359                    $user_data[$usr_id][
'udf_' . $field_id] = $value;
 
  370        return $this->
setData($user_data);
 
  377        $columns = $ef->getSelectableFieldsInfo(
 
  381        if ($this->
settings->get(
'user_portfolios')) {
 
  383                'txt' => $this->lng->txt(
'obj_prtf'),
 
  391                    'txt' => $this->lng->txt(
'objs_role'),
 
  396                'org_units' => array(
 
  397                    'txt' => $this->lng->txt(
"org_units"),
 
An exception for terminatinating execution or to throw for unit testing.
static _getInstanceByType($a_type)
Get Singleton Instance.
GUI class for learning sequence membership features.
getLastAccess(int $user_id)
getFirstAccess(int $user_id)
__construct(ilLearningSequenceMembershipGUI $parent_gui, ilObjLearningSequence $ls_object, ilObjUserTracking $obj_user_tracking, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilAccess $access, ilRbacReview $rbac_review, ilSetting $settings)
getSelectableColumns()
Get selectable columns.
getLastVisitedStep(int $user_id)
Different to the concept we decide to use the title of the object instead of its actually number in t...
fillRow($set)
Standard Version of Fill Row.
getCompletedSteps(int $user_id)
Class ilObjLearningSequence.
static _enabledLearningProgress()
check wether learing progress is enabled or not
const EXTENDED_DATA_LAST_ACCESS
static _lookupActive($a_usr_id)
Check user account active.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
getParticipants()
Get participants.
initSettings()
Init acceptance.
showActionLinks($a_set)
show edit links
checkAcceptance($a_usr_id)
Check acceptance.
initFilter()
Init table filter.
Singleton class that stores all privacy settings.
class ilRbacReview Contains Review functions of core Rbac.
getSelectedColumns()
Get selected columns.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormName($a_formname="")
Set Form name.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
getOrderDirection()
Get order direction.
enable($a_module_name)
enables particular modules of table
static lookupData($a_user_ids, $a_field_ids)
Lookup data.
static getUserListData( $a_order_field, $a_order_dir, $a_offset, $a_limit, $a_string_filter="", $a_activation_filter="", $a_last_login_filter=null, $a_limited_access_filter=false, $a_no_courses_filter=false, $a_course_group_filter=0, $a_role_filter=0, $a_user_folder_filter=null, $a_additional_fields='', $a_user_filter=null, $a_first_letter="", $a_authentication_filter=null)
Get data for user administration list.
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc