19 declare(strict_types=0);
    54         ?
object $a_parent_obj,
    60         $this->tree = $DIC->repositoryTree();
    61         $this->rbacsystem = $DIC->rbac()->system();
    62         $this->ilObjDataCache = $DIC[
'ilObjDataCache'];
    64         $this->
setId(
"trsmtx_" . $ref_id);
    69         $this->in_group_ref_id = $this->tree->checkForParentType($this->ref_id, 
"grp");
    70         if ($this->in_group_ref_id) {
    73             $this->in_course_ref_id = $this->tree->checkForParentType(
    77             if ($this->in_course_ref_id) {
    82         $this->
lng = $DIC->language();
    83         $this->
http = $DIC->http();
    88         $this->
parseTitle($this->obj_id, 
"trac_matrix");
    91             $this->
ctrl->getFormActionByClass(get_class($this))
    94             "tpl.user_object_matrix_row.html",
   102         $mail = 
new ilMail($DIC->user()->getId());
   103         if ($this->rbacsystem->checkAccess(
   105             $mail->getMailObjectReferenceId()
   109                 $this->
lng->txt(
"send_mail")
   113         $this->
lng->loadLanguageModule(
'user');
   116             $this->
lng->txt(
'clipboard_add_btn')
   119         $this->has_multi = 
true;
   125         foreach ($selected as 
$c) {
   128             if (isset($labels[$c][
"no_permission"]) && $labels[$c][
"no_permission"]) {
   129                 $title .= 
" (" . $this->
lng->txt(
"status_no_permission") . 
")";
   133             if (isset($labels[$c][
"icon"])) {
   134                 $alt = $this->
lng->txt($labels[$c][
"type"] ?? 
"");
   135                 $icon = 
'<img class="ilListItemIcon" src="' . $labels[
$c][
"icon"] . 
'" alt="' . $alt . 
'" />';
   136                 if (
sizeof($selected) > 5) {
   142                 if ($labels[$c][
"path"] ?? 
false) {
   143                     $tooltip[] = $labels[
$c][
"path"];
   147             if (isset($labels[$c][
"id"])) {
   148                 $sort_id = $labels[
$c][
"id"];
   151                 $sort_id = (substr($c, 0, 4) == 
"udf_") ? 
"" : $c;
   160                 implode(
" - ", $tooltip)
   172             $this->
lng->txt(
'login')
   174         $this->
filter[
"name"] = $item->getValue();
   177         if ($this->
http->wrapper()->query()->has($this->prefix . 
'_tpl')) {
   178             $this->filter[
"name"] = null;
   185         if ($a_field === 
'read_count' || $a_field === 
'spent_seconds') {
   194             $this->in_course_ref_id,
   195             $this->in_group_ref_id
   198         if ($this->obj_ids === null) {
   202                 array_keys($user_cols[0]),
   207         if (isset($this->obj_ids)) {
   209             foreach ($this->obj_ids as $obj_id) {
   210                 if ($obj_id == $this->obj_id) {
   211                     $parent = array(
"txt" => $this->
lng->txt(
"status"),
   217                     $ref_id = $this->ref_ids[
$obj_id];
   220                             'read_learning_progress',
   224                         $this->privacy_cols[] = 
$obj_id;
   227                     $title = $this->ilObjDataCache->lookupTitle((
int) $obj_id);
   228                     $type = $this->ilObjDataCache->lookupType((
int) $obj_id);
   230                     if ($type == 
"sess") {
   232                         $title = $sess->getPresentationTitle();
   238                         ($type == 
'catr' || $type == 
'crsr' || $type == 
'grpr')
   246                     $path = 
$path->getPath($this->ref_id, $ref_id);
   248                         $relpath = $this->
lng->txt(
'path') . 
': ' . 
$path;
   256                         "no_permission" => $no_perm,
   261             if (
sizeof($this->objective_ids)) {
   262                 foreach ($this->objective_ids as $obj_id => 
$title) {
   263                     $tmp_cols[strtolower(
   270             if (
sizeof($this->sco_ids)) {
   271                 foreach ($this->sco_ids as $obj_id => 
$title) {
   273                     $tmp_cols[strtolower(
   281             if (
sizeof($this->subitem_ids)) {
   282                 foreach ($this->subitem_ids as $obj_id => 
$title) {
   290                     $tmp_cols[strtolower(
   300             if (!
sizeof($this->sco_ids) && !
sizeof($this->subitem_ids)) {
   303             foreach ($tmp_cols as 
$id => $def) {
   304                 $id = explode(
'#~#', 
$id);
   305                 $columns[
$id[1]] = $def;
   314         unset($user_cols[0][
"status"]);
   315         unset($user_cols[0][
"login"]);
   316         foreach ($user_cols[0] as $col_id => $col_def) {
   317             if (!isset($columns[$col_id])) {
   319                 $col_def[
"default"] = 
false;
   320                 $columns[$col_id] = $col_def;
   328         array $a_user_fields,
   329         array $a_privary_fields = null
   333         if ($this->restore_filter) {
   334             $name = $this->restore_filter_values[
"name"];
   336             $this->
filter[
"name"] = $name;
   344         if ($collection[
"object_ids"]) {
   346             $this->ref_ids = $collection[
"ref_ids"];
   349             $check_agreement = 
false;
   350             if ($this->in_course) {
   353                 if ($privacy->courseConfirmationRequired()) {
   356             } elseif ($this->in_group) {
   359                 if ($privacy->groupConfirmationRequired()) {
   365                 $collection[
"object_ids"],
   366                 $this->
filter[
"name"] ?? 
'',
   371             if ($collection[
"objectives_parent_id"] && 
$data[
"users"]) {
   374                     $collection[
"objectives_parent_id"],
   378                 $this->objective_ids = array();
   380                 foreach (
$objectives as $user_id => $inner_objectives) {
   381                     if (isset(
$data[
"set"][$user_id])) {
   382                         foreach ($inner_objectives as $objective_id => $status) {
   383                             $obj_id = 
"objtv_" . $objective_id;
   386                             if (!in_array($obj_id, $this->objective_ids)) {
   397             if ($collection[
"scorm"] && 
$data[
"set"]) {
   398                 $this->sco_ids = array();
   399                 foreach (array_keys(
$data[
"set"]) as $user_id) {
   400                     foreach ($collection[
"scorm"][
"scos"] as $sco) {
   401                         if (!in_array($sco, $this->sco_ids)) {
   402                             $this->sco_ids[$sco] = $collection[
"scorm"][
"scos_title"][$sco];
   412                             $collection[
"scorm"][
"failed"][$sco]
   417                             $collection[
"scorm"][
"completed"][$sco]
   422                             $collection[
"scorm"][
"in_progress"][$sco]
   427                         $obj_id = 
"objsco_" . $sco;
   434             if ($collection[
"subitems"] && 
$data[
"set"]) {
   435                 foreach (array_keys(
$data[
"set"]) as $user_id) {
   436                     foreach ($collection[
"subitems"][
"items"] as $item_id) {
   437                         $this->subitem_ids[$item_id] = $collection[
"subitems"][
"item_titles"][$item_id];
   441                             $collection[
"subitems"][
"completed"]
   444                             $collection[
"subitems"][
"completed"][$item_id]
   448                             $collection[
"subitems"][
"in_progress"]
   452                                 $collection[
"subitems"][
"in_progress"][$item_id]
   457                         $obj_id = 
"objsub_" . $item_id;
   465                 $this->perc_map = array();
   466                 foreach (
$data[
"set"] as $row_idx => $row) {
   467                     foreach ($row as 
$column => $value) {
   468                         if (substr(
$column, -5) == 
"_perc") {
   469                             $obj_id = explode(
"_", 
$column);
   470                             $obj_id = (
int) $obj_id[1];
   477                                 $this->perc_map[
$obj_id] = 
true;
   488             if (in_array(
'org_units', $a_user_fields)) {
   489                 foreach ((
$data[
'set'] ?? []) as 
$key => $usr_data) {
   490                     if (!isset($usr_data[
'usr_id'])) {
   493                     $usr_id = (
int) $usr_data[
'usr_id'];
   494                     $org_units = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($usr_id);
   495                     $data[
"set"][
$key][
'org_units'] = $org_units;
   501             return $collection[
"object_ids"] ?? [];
   506     protected function fillRow(array $a_set): void
   508         if ($this->has_multi) {
   509             $this->tpl->setVariable(
"USER_ID", $a_set[
"usr_id"]);
   514                 case (substr($c, 0, 4) == 
"obj_"):
   515                     $obj_id = substr($c, 4);
   518                     if (in_array($obj_id, $this->privacy_cols) ||
   519                         ($a_set[
"privacy_conflict"] ?? 
false)) {
   520                         $this->tpl->setCurrentBlock(
"objects");
   521                         $this->tpl->setVariable(
"VAL_STATUS", 
" ");
   522                         $this->tpl->parseCurrentBlock();
   526                     $status = isset($a_set[$c])
   529                     $percentage = isset($a_set[$c . 
"_perc"])
   530                         ? (
int) $a_set[$c . 
"_perc"]
   535                             $this->ref_ids[$obj_id],
   539                             if ($timing !== 
true) {
   546                             $this->tpl->setCurrentBlock(
'warning_img');
   547                             $this->tpl->setVariable(
   550                                     'media/time_warn.svg'   553                             $this->tpl->setVariable(
   559                             $this->tpl->parseCurrentBlock();
   563                     $this->tpl->setCurrentBlock(
"objects");
   564                     $this->tpl->setVariable(
   572                     $this->tpl->setVariable(
   576                             (
string) $percentage,
   580                     $this->tpl->parseCurrentBlock();
   583                 case (substr($c, 0, 6) == 
"objtv_"):
   584                 case (substr($c, 0, 7) == 
"objsco_"):
   585                 case (substr($c, 0, 7) == 
"objsub_"):
   586                     $status = isset($a_set[$c])
   590                     $this->tpl->setCurrentBlock(
"objects");
   591                     if (!($a_set[
"privacy_conflict"] ?? 
false)) {
   592                         $this->tpl->setVariable(
   601                         $this->tpl->setVariable(
"VAL_STATUS", 
" ");
   603                     $this->tpl->parseCurrentBlock();
   607                     $this->tpl->setCurrentBlock(
"user_field");
   608                     if (!($a_set[
"privacy_conflict"] ?? 
false)) {
   609                         $this->tpl->setVariable(
   618                         $this->tpl->setVariable(
"VAL_UF", 
" ");
   620                     $this->tpl->parseCurrentBlock();
   626         if (!$a_set[
"active"] || ($a_set[
"privacy_conflict"] ?? 
false)) {
   628             if ($a_set[
"privacy_conflict"] ?? 
false) {
   629                 $mess[] = $this->
lng->txt(
"status_no_permission");
   630             } elseif (!$a_set[
"active"]) {
   631                 $mess[] = $this->
lng->txt(
"inactive");
   633             $this->tpl->setCurrentBlock(
'inactive_bl');
   634             $this->tpl->setVariable(
'TXT_INACTIVE', implode(
", ", $mess));
   635             $this->tpl->parseCurrentBlock();
   638         $login = !($a_set[
"privacy_conflict"] ?? 
false)
   641         $this->tpl->setVariable(
"VAL_LOGIN", $login);
   648         $ilObjDataCache = $DIC[
'ilObjDataCache'];
   650         $a_excel->
setCell($a_row, 0, $this->
lng->txt(
"login"));
   655             if (substr($c, 0, 4) == 
"obj_") {
   656                 $obj_id = substr($c, 4);
   658                 $type = $this->ilObjDataCache->lookupType((
int) $obj_id);
   659                 if ($DIC[
'objDefinition']->isPlugin($type)) {
   665                     $type_text = $this->
lng->txt($type);
   671                     "(" . $type_text . 
") " . $labels[$c][
"txt"]
   674                 if (isset($this->perc_map) && ($this->perc_map[$obj_id] ?? 
false)) {
   685                 $a_excel->
setCell($a_row, $cnt, $labels[$c][
"txt"]);
   700         $a_excel->
setCell($a_row, 0, $a_set[
"login"]);
   705                 case (substr($c, 0, 4) == 
"obj_"):
   706                     $obj_id = substr($c, 4);
   710                     $a_excel->
setCell($a_row, $cnt, $val);
   712                     if (isset($this->perc_map) && ($this->perc_map[$obj_id] ?? 
false)) {
   714                         $perc = (
int) ($a_set[$c . 
"_perc"] ?? 0);
   718                         $a_excel->
setCell($a_row, $cnt, $perc);
   722                 case (substr($c, 0, 6) == 
"objtv_"):
   723                 case (substr($c, 0, 7) == 
"objsco_"):
   724                 case (substr($c, 0, 7) == 
"objsub_"):
   728                     $a_excel->
setCell($a_row, $cnt, $val);
   737                     $val = $this->
parseValue($c, $a_set[$c] ?? 
'', 
"user");
   738                     $a_excel->
setCell($a_row, $cnt, $val);
   749         $ilObjDataCache = $DIC[
'ilObjDataCache'];
   755             if (substr($c, 0, 4) == 
"obj_") {
   756                 $obj_id = substr($c, 4);
   758                 $type = $this->ilObjDataCache->lookupType((
int) $obj_id);
   759                 if ($DIC[
'objDefinition']->isPlugin($type)) {
   765                     $type_text = $this->
lng->txt($type);
   768                 $a_csv->
addColumn(
"(" . $type_text . 
") " . $labels[$c][
"txt"]);
   770                 if (isset($this->perc_map) && ($this->perc_map[$obj_id] ?? 
false)) {
   772                         $this->
lng->txt(
"trac_percentage") . 
" (%)"   789                 case (substr($c, 0, 4) == 
"obj_"):
   790                     $obj_id = substr($c, 4);
   796                     if (isset($this->perc_map) && ($this->perc_map[$obj_id] ?? 
false)) {
   798                         if (isset($a_set[$c . 
"_perc"])) {
   799                             $perc = (
int) $a_set[$c . 
"_perc"];
   805                 case (substr($c, 0, 6) == 
"objtv_"):
   806                 case (substr($c, 0, 7) == 
"objsco_"):
   807                 case (substr($c, 0, 7) == 
"objsub_"):
   820                     $val = $this->
parseValue($c, $a_set[$c] ?? 
'', 
"user");
 const LP_STATUS_COMPLETED_NUM
 
static _lookupTargetTitle(int $a_obj_id)
 
Creates a path for a start and endnode. 
 
setExportFormats(array $formats)
Set available export formats. 
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
static getUserObjectiveMatrix(int $a_parent_obj_id, array $a_users)
 
getSelectableUserColumns(int $a_in_course=0, int $a_in_group=0)
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
getColumnCoord(int $a_col)
Get column "name" from number. 
 
setShowTemplates(bool $a_value)
 
const LP_STATUS_IN_PROGRESS_NUM
 
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
 
static getObjectIds(int $a_parent_obj_id, int $a_parent_ref_id, bool $use_collection=true, bool $a_refresh_status=true, ?array $a_user_ids=null)
Get (sub)objects for given object, also handles learning objectives (course only) ...
 
numericOrdering($a_field)
 
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value. 
 
ilObjectDataCache $ilObjDataCache
 
static getSubItemType(int $a_parent_obj_id)
Get sub-item object type for parent. 
 
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
 
static _lookupObjId(int $ref_id)
 
static getUserObjectMatrix(int $a_parent_ref_id, array $a_obj_ids, string $a_user_filter=null, ?array $a_additional_fields=null, ?array $a_privacy_fields=null, ?int $a_check_agreement=null)
Get status matrix for users on objects. 
 
getItems(array $a_user_fields, array $a_privary_fields=null)
 
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type. 
 
setBold(string $a_coords)
Set cell(s) to bold. 
 
static http()
Fetches the global http state from ILIAS. 
 
TableGUI class for learning progress. 
 
setDefaultOrderField(string $a_defaultorderfield)
 
isPercentageAvailable(int $a_obj_id)
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
 
parseValue(string $id, ?string $value, string $type)
 
setDefaultOrderDirection(string $a_defaultorderdirection)
 
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text. 
 
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
 
fillHeaderCSV(ilCSVWriter $a_csv)
 
setFilterValue(ilTableFilterItem $a_item, $a_value)
 
static lookupTxtById(string $plugin_id, string $lang_var)
 
const LP_STATUS_NOT_ATTEMPTED_NUM
 
fillHeaderExcel(ilExcel $a_excel, int &$a_row)
 
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks 
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
 
static _lookupType(int $id, bool $reference=false)
 
parseTitle(int $a_obj_id, string $action, int $a_user_id=0)
 
showTimingsWarning(int $a_ref_id, int $a_user_id)
 
addMultiCommand(string $a_cmd, string $a_text)
 
setEnableHeader(bool $a_enableheader)
 
setMaxCount(int $a_max_count)
set max. 
 
const LP_STATUS_FAILED_NUM
 
__construct(?object $a_parent_obj, string $a_parent_cmd, int $ref_id)
Constructor.