19declare(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",
95 "components/ILIAS/Tracking"
102 if ($this->rbacsystem->checkAccess(
104 $mail->getMailObjectReferenceId()
108 $this->
lng->txt(
"send_mail")
112 $this->
lng->loadLanguageModule(
'user');
115 $this->
lng->txt(
'clipboard_add_btn')
118 $this->has_multi =
true;
124 foreach ($selected as
$c) {
127 if (isset($labels[
$c][
"no_permission"]) && $labels[
$c][
"no_permission"]) {
128 $title .=
" (" . $this->
lng->txt(
"status_no_permission") .
")";
132 if (isset($labels[
$c][
"icon"])) {
133 $alt = $this->
lng->txt($labels[
$c][
"type"] ??
"");
134 $icon =
'<img class="ilListItemIcon" src="' . $labels[
$c][
"icon"] .
'" alt="' . $alt .
'" />';
135 if (
sizeof($selected) > 5) {
141 if ($labels[
$c][
"path"] ??
false) {
142 $tooltip[] = $labels[
$c][
"path"];
146 if (isset($labels[
$c][
"id"])) {
147 $sort_id = $labels[
$c][
"id"];
150 $sort_id = (substr(
$c, 0, 4) ==
"udf_") ?
"" :
$c;
159 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"),
220 'read_learning_progress',
224 $this->privacy_cols[] =
$obj_id;
228 $type = $this->ilObjDataCache->lookupType((
int)
$obj_id);
230 if (
$type ==
"sess") {
232 $title = $sess->getPresentationTitle();
248 $relpath = $this->
lng->txt(
'path') .
': ' .
$path;
256 "no_permission" => $no_perm,
261 if (
sizeof($this->objective_ids)) {
263 $tmp_cols[strtolower(
270 if (
sizeof($this->sco_ids)) {
273 $tmp_cols[strtolower(
281 if (
sizeof($this->subitem_ids)) {
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();
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();
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]
434 if ($collection[
"subitems"] &&
$data[
"set"]) {
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") {
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"]);
512 foreach ($this->getSelectedColumns() as
$c) {
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"]
534 $timing = $this->showTimingsWarning(
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"));
652 $labels = $this->getSelectableColumns();
654 foreach ($this->getSelectedColumns() as
$c) {
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"]);
703 foreach ($this->getSelectedColumns() as
$c) {
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'];
753 $labels = $this->getSelectableColumns();
754 foreach ($this->getSelectedColumns() as
$c) {
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") .
" (%)"
787 foreach ($this->getSelectedColumns() as
$c) {
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");
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupTargetTitle(int $a_obj_id)
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
setBold(string $a_coords)
Set cell(s) to bold.
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
getColumnCoord(int $a_col)
Get column "name" from number.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
TableGUI class for learning progress.
isPercentageAvailable(int $a_obj_id)
parseTitle(int $a_obj_id, string $action, int $a_user_id=0)
getSelectableUserColumns(int $a_in_course=0, int $a_in_group=0)
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static lookupTxtById(string $plugin_id, string $lang_var)
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
setExportFormats(array $formats)
Set available export formats.
addMultiCommand(string $a_cmd, string $a_text)
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setFilterValue(ilTableFilterItem $a_item, $a_value)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
fillRow(array $a_set)
Standard Version of Fill Row.
fillHeaderCSV(ilCSVWriter $a_csv)
CSV Version of Fill Header.
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
fillHeaderExcel(ilExcel $a_excel, int &$a_row)
Excel Version of Fill Header.
__construct(?object $a_parent_obj, string $a_parent_cmd, int $ref_id)
Constructor.
getItems(array $a_user_fields, ?array $a_privary_fields=null)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
ilObjectDataCache $ilObjDataCache
numericOrdering($a_field)
getSelectableColumns()
Get selectable columns.
static getUserObjectiveMatrix(int $a_parent_obj_id, array $a_users)
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)
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.
static getSubItemType(int $a_parent_obj_id)
Get sub-item object type for parent.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
if(!file_exists('../ilias.ini.php'))