19 declare(strict_types=0);
47 ?
object $a_parent_obj,
48 string $a_parent_cmd =
"",
49 string $a_template_context =
"" 52 $this->main_tpl = $DIC->ui()->mainTemplate();
54 $this->objDefinition = $DIC[
'objDefinition'];
55 $this->ilObjDataCache = $DIC[
'ilObjDataCache'];
56 $this->tree = $DIC->repositoryTree();
57 $this->
user = $DIC->user();
58 $this->setting = $DIC->settings();
59 $this->
http = $DIC->http();
63 if (!$this->anonymized && isset($this->obj_id) && $this->obj_id > 0) {
65 $this->anonymized = $olp->isAnonymized();
76 $this->
lng->loadLanguageModule(
"meta");
81 if ($this->
http->wrapper()->post()->has(
'item_id')) {
82 return $this->
http->wrapper()->post()->retrieve(
94 if ($this->
http->wrapper()->post()->has(
'uid')) {
95 return $this->
http->wrapper()->post()->retrieve(
108 if (!$this->
ctrl->getNextClass($this)) {
111 switch ($this->
ctrl->getCmd()) {
130 if ($this->
http->wrapper()->query()->has(
'hide')) {
131 $hide = $this->
http->wrapper()->query()->retrieve(
139 case "mailselectedusers":
141 $this->main_tpl->setOnScreenMessage(
157 case 'addToClipboard':
159 $this->main_tpl->setOnScreenMessage(
181 $value = array_unique(
182 array_merge((array) $obj->getValue(), $to_hide)
184 $obj->setValue($value);
185 $obj->writeToSession();
188 if ($this->requested_tmpl_create !==
"") {
189 $this->
ctrl->setParameter(
192 $this->requested_tmpl_create
195 if ($this->requested_tmpl_delete !==
"") {
196 $this->
ctrl->setParameter(
199 $this->requested_tmpl_delete
202 $this->
ctrl->redirect($this->parent_obj, $this->parent_cmd);
205 return parent::executeCommand();
216 sort($ref_ids, SORT_NUMERIC);
230 foreach ($a_user_ids as $usr_id) {
238 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
239 $ref_id = $this->
http->wrapper()->query()->retrieve(
249 $tmpl_id = $obj_lp->getMailTemplateId();
258 $sig = ilLink::_getLink(
$ref_id);
259 $sig = rawurlencode(base64_encode($sig));
270 'rcp_to' => implode(
',', $rcps),
284 ?array $preset_obj_ids = null,
285 bool $a_check_lp_activation =
true 288 $query_parser->setMinWordLength(0);
290 $query_parser->parse();
291 if (!$query_parser->validate()) {
293 $query_parser->getMessage()
299 if ($filter[
"type"] ==
"lres") {
300 $filter[
"type"] = array(
'lm',
'sahs',
'htlm');
302 $filter[
"type"] = array($filter[
"type"]);
306 $object_search->setFilter($filter[
"type"]);
307 if ($preset_obj_ids) {
308 $object_search->setIdFilter($preset_obj_ids);
310 $res = $object_search->performSearch();
313 $res->setRequiredPermission($permission);
316 $res->setMaxHits(self::HIT_LIMIT);
318 if ($a_check_lp_activation) {
319 $res->addObserver($this,
"searchFilterListener");
322 if (!$this->
filter[
"area"]) {
329 foreach (
$res->getResults() as $obj_data) {
330 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
332 return $objects ?: array();
342 if (is_array($this->
filter[
"hide"]) && in_array(
366 $this->
lng->txt(
'trac_filter_area'),
372 foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
373 if ($this->objDefinition->isContainer($type)) {
374 $white_list[] = $type;
377 $repo->getExplorerGUI()->setTypeWhiteList($white_list);
379 $repo->readFromSession();
380 $filter[
'area'] = (
int) $repo->getValue();
388 bool $a_split_learning_resources =
false,
389 bool $a_include_no_status_filter =
true,
390 bool $show_type_filter =
true 395 if ($show_type_filter) {
400 $si->readFromSession();
401 if (!$si->getValue()) {
402 $si->setValue(
"crs");
404 $this->
filter[
"type"] = $si->getValue();
410 $this->
lng->txt(
"trac_filter_hidden"),
414 $msi->readFromSession();
415 $this->
filter[
"hide"] = $msi->getValue();
416 if ($this->
filter[
"hide"]) {
420 foreach ($this->
filter[
"hide"] as $obj_id) {
421 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
425 $msi->setOptions($options);
430 $this->
lng->txt(
"trac_title_description"),
433 $ti->setMaxLength(64);
436 $ti->readFromSession();
437 $this->
filter[
"query"] = $ti->getValue();
441 $this->
lng->txt(
"trac_filter_area"),
446 $rs->readFromSession();
447 $this->
filter[
"area"] = $rs->getValue();
450 if ($a_include_no_status_filter) {
452 $this->
lng->txt(
"trac_filter_has_status"),
456 $cb->readFromSession();
457 $this->
filter[
"status"] = $cb->getChecked();
465 if (!count($ref_ids)) {
469 foreach ($ref_ids as
$ref_id) {
472 $path_full = $this->tree->getPathFull($ref_id);
473 foreach ($path_full as
$data) {
474 if (++$counter < (count($path_full) - 1)) {
477 $path .=
" » ";
478 if ($ref_id != $data[
'ref_id']) {
479 $path .= $data[
'title'];
481 $path .= (
'<a target="_top" href="' .
486 $data[
'title'] .
'</a>');
496 bool $a_split_learning_resources =
false,
497 bool $a_include_digilib =
false,
498 bool $a_allow_undefined_lp =
false 502 $component_repository = $DIC[
'component.repository'];
506 if ($a_split_learning_resources) {
507 $options[
'lm'] = $this->
lng->txt(
'objs_lm');
508 $options[
'sahs'] = $this->
lng->txt(
'objs_sahs');
509 $options[
'htlm'] = $this->
lng->txt(
'objs_htlm');
511 $options[
'lres'] = $this->
lng->txt(
'obj_lrss');
514 $options[
'crs'] = $this->
lng->txt(
'objs_crs');
515 $options[
'grp'] = $this->
lng->txt(
'objs_grp');
516 $options[
'exc'] = $this->
lng->txt(
'objs_exc');
517 $options[
'file'] = $this->
lng->txt(
'objs_file');
518 $options[
'mcst'] = $this->
lng->txt(
'objs_mcst');
519 $options[
'svy'] = $this->
lng->txt(
'objs_svy');
520 $options[
'tst'] = $this->
lng->txt(
'objs_tst');
521 $options[
'prg'] = $this->
lng->txt(
'objs_prg');
522 $options[
'iass'] = $this->
lng->txt(
'objs_iass');
523 $options[
'copa'] = $this->
lng->txt(
'objs_copa');
524 $options[
'frm'] = $this->
lng->txt(
'objs_frm');
525 $options[
'cmix'] = $this->
lng->txt(
'objs_cmix');
526 $options[
'lti'] = $this->
lng->txt(
'objs_lti');
527 $options[
'lso'] = $this->
lng->txt(
'objs_lso');
528 $options[
'dcl'] = $this->
lng->txt(
'objs_dcl');
530 if ($a_allow_undefined_lp) {
531 $options[
'root'] = $this->
lng->txt(
'obj_reps');
532 $options[
'cat'] = $this->
lng->txt(
'objs_cat');
533 $options[
"webr"] = $this->
lng->txt(
"objs_webr");
534 $options[
"wiki"] = $this->
lng->txt(
"objs_wiki");
535 $options[
"blog"] = $this->
lng->txt(
"objs_blog");
536 $options[
"prtf"] = $this->
lng->txt(
"objs_prtf");
537 $options[
"prtt"] = $this->
lng->txt(
"objs_prtt");
541 $plugins = $component_repository->getPluginSlotById(
543 )->getActivePlugins();
544 foreach ($plugins as $pl) {
545 $pl_id = $pl->getId();
564 $pos = strrpos($id,
"_");
565 if ($pos !==
false) {
566 $function = strtoupper(substr($id, $pos + 1));
569 array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")
571 $id = substr($id, 0, $pos);
575 if ((trim((
string) $value) ==
"") && $id !=
"status") {
576 if ($id ==
"title" &&
577 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
578 get_class($this) !=
"ilTrMatrixTableGUI") {
579 return "--" . $this->
lng->txt(
"none") .
"--";
587 case 'status_changed':
605 case "spent_seconds":
611 ((
int) $value < 3600 ?
true :
false)
620 $value = $value .
"%";
631 $value = $this->
lng->txt(
"gender_" . $value);
636 $value = $icons->renderIconForStatus((
int) $value);
640 $this->
lng->loadLanguageModule(
"meta");
641 $value = $this->
lng->txt(
"meta_l_" . $value);
645 $value = $this->
lng->txt(
"meta_c_" . $value);
655 foreach ($this->
filter as
$id => $value) {
673 case "matriculation":
679 $result[
$id] = $value;
684 if (!is_null($value) && $value !==
"") {
685 $result[
$id] = $value;
693 case "spent_seconds":
694 if (is_array($value) && implode(
"", $value)) {
695 $result[
$id] = $value;
703 case 'status_changed':
705 if ($value[
"from"]) {
706 $result[
$id][
"from"] = $value[
"from"]->get(
711 $result[
$id][
"to"] = $value[
"to"]->get(
720 if ($value[
"from"]) {
721 $result[
$id][
"from"] = $value[
"from"]->get(
724 $result[
$id][
"from"] = substr(
725 $result[
$id][
"from"],
731 $result[
$id][
"to"] = $value[
"to"]->get(
734 $result[
$id][
"to"] = substr(
749 if ($a_obj_id === 0) {
753 $mode = $olp->getCurrentMode();
784 if ($a_user_id != $this->
user->getId()) {
789 $user .=
", " . $a_user->getFullName(
797 ) .
": " . $this->ilObjDataCache->lookupTitle($a_obj_id) .
$user 802 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText(
803 $olp->getCurrentMode()
818 $ilClientIniFile = $DIC[
'ilClientIniFile'];
834 "trac_name_of_installation" 835 )] = $ilClientIniFile->readVariable(
'client',
'name');
840 )] = $this->ilObjDataCache->lookupTitle((
int) $this->obj_id);
842 $data[$this->
lng->txt(
"trac_object_link")] = ilLink::_getLink(
862 $data[$this->
lng->txt(
"trac_report_owner")] = $this->
user->getFullName(
871 $a_excel->
setCell($a_row, 0, $caption);
872 $a_excel->
setCell($a_row, 1, $value);
896 if ($timing_cache->isWarningRequired($a_user_id)) {
899 $timings[
'item'][
'changeable'] &&
900 ($timings[
'user'][$a_user_id] ??
false) &&
901 $timings[
'user'][$a_user_id][
'end']
903 $end = $timings[
'user'][$a_user_id][
'end'];
904 } elseif ($timings[
'item'][
'suggestion_end']) {
905 $end = $timings[
'item'][
'suggestion_end'];
916 bool $a_shorten_zero =
false 918 $seconds = ($seconds > 0) ? $seconds : 0;
919 if ($a_shorten_zero && !$seconds) {
923 $hours = floor($seconds / 3600);
924 $rest = $seconds % 3600;
926 $minutes = floor($rest / 60);
933 return sprintf(
"%dh%02dm", $hours, $minutes);
949 bool $a_anonymize =
false,
950 bool $a_format_seconds =
false 954 $step = $a_max_value / 10;
955 $base = ceil(log($step, 10));
956 $fac = ceil($step / pow(10, (
$base - 1)));
957 $step = pow(10,
$base - 1) * $fac;
962 $ticks = range(0, $a_max_value + $step, $step);
964 $value_ticks = array(0 => 0);
965 foreach ($ticks as $tick) {
966 $value = $tvalue = $tick;
971 if ($a_format_seconds) {
974 $value_ticks[$value] = $tvalue;
983 for ($loop = 0; $loop < 10; $loop++) {
984 $year = date(
"Y") - $loop;
985 $options[$year] = $year;
986 for ($loop2 = 12; $loop2 > 0; $loop2--) {
987 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
988 if ($year . $month <= date(
"Ym")) {
990 $caption = $year .
" / " . $this->
lng->txt(
991 "month_" . $month .
"_long" 994 $caption = $year .
"/" . $month;
996 $options[$year .
"-" . $month] = $caption;
1006 $a_year = date(
"Y");
1010 for ($loop = 1; $loop < 13; $loop++) {
1011 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
1012 if ($a_year .
"-" . $month <= date(
"Y-m")) {
1014 $caption = $this->
lng->txt(
"month_" . $month .
"_long");
1016 $caption = $this->
lng->txt(
"month_" . $month .
"_short");
1018 $all[$a_year .
"-" . $month] = $caption;
1025 int $a_in_course = 0,
1028 $cols = $privacy_fields = array();
1031 $up->skipGroup(
"preferences");
1032 $up->skipGroup(
"settings");
1033 $up->skipGroup(
"interests");
1034 $ufs = $up->getStandardFields();
1037 $cols[
"login"] = array(
1038 "txt" => $this->
lng->txt(
"login"),
1042 if (!$this->anonymized) {
1043 $cols[
"firstname"] = array(
1044 "txt" => $this->
lng->txt(
"firstname"),
1047 $cols[
"lastname"] = array(
1048 "txt" => $this->
lng->txt(
"lastname"),
1055 if ($tracking->hasExtendedData(
1058 $cols[
"first_access"] = array(
1059 "txt" => $this->
lng->txt(
"trac_first_access"),
1062 $cols[
"last_access"] = array(
1063 "txt" => $this->
lng->txt(
"trac_last_access"),
1067 if ($tracking->hasExtendedData(
1070 $cols[
"read_count"] = array(
1071 "txt" => $this->
lng->txt(
"trac_read_count"),
1075 if ($tracking->hasExtendedData(
1079 $cols[
"spent_seconds"] = array(
1080 "txt" => $this->
lng->txt(
"trac_spent_seconds"),
1086 $cols[
"percentage"] = array(
1087 "txt" => $this->
lng->txt(
"trac_percentage"),
1094 if ($olp->isActive()) {
1095 $cols[
"status"] = array(
1096 "txt" => $this->
lng->txt(
"trac_status"),
1100 $cols[
'status_changed'] = array(
1101 'txt' => $this->
lng->txt(
'trac_status_changed'),
1107 $cols[
"mark"] = array(
1108 "txt" => $this->
lng->txt(
"trac_mark"),
1113 $cols[
"u_comment"] = array(
1114 "txt" => $this->
lng->txt(
"trac_comment"),
1118 $cols[
"create_date"] = array(
1119 "txt" => $this->
lng->txt(
"create_date"),
1122 $cols[
"language"] = array(
1123 "txt" => $this->
lng->txt(
"language"),
1128 if (!$this->anonymized &&
1129 ($a_in_course || $a_in_group)) {
1132 $a_in_group === 0 ? $a_in_course : $a_in_group
1135 foreach ($ufs as
$f => $fd) {
1136 if (!isset($cols[
$f]) && $f !=
"username" && !($fd[
"lists_hide"] ??
false)) {
1138 !(($fd[
"course_export_fix_value"] ??
false) || $this->setting->get(
1139 "usr_settings_course_export_" . $f
1144 !(($fd[
"group_export_fix_value"] ??
false) || $this->setting->get(
1145 "usr_settings_group_export_" . $f
1151 "txt" => $this->
lng->txt($f),
1154 $privacy_fields[] =
$f;
1161 $user_defined_fields = $user_defined_fields->getCourseExportableFields(
1164 $user_defined_fields = $user_defined_fields->getGroupExportableFields(
1167 foreach ($user_defined_fields as $definition) {
1169 $f =
"udf_" . $definition[
"field_id"];
1171 "txt" => $definition[
"field_name"],
1175 $privacy_fields[] =
$f;
1180 return array($cols, $privacy_fields);
1192 $this->
lng->loadLanguageModule(
'user');
1193 $this->main_tpl->setOnScreenMessage(
1196 'clipboard_user_added' 1215 $this->icon_variant = $variant;
buildValueScale(int $a_max_value, bool $a_anonymize=false, bool $a_format_seconds=false)
const LP_MODE_CMIX_COMPLETED
const EXTENDED_DATA_LAST_ACCESS
static array static setUseRelativeDates(bool $a_status)
set use relative dates
const LP_MODE_CMIX_COMPLETED_OR_PASSED
getPossibleTypes(bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
getCurrentFilter(bool $as_query=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const LP_MODE_CMIX_PASSED_WITH_FAILED
static _lookupFullname(int $a_user_id)
getSelectableUserColumns(int $a_in_course=0, int $a_in_group=0)
buildPath(array $ref_ids)
findReferencesForObjId(int $a_obj_id)
getMonthsYear($a_year=null, $a_short=false)
const LP_MODE_CMIX_PASSED
searchObjects(array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
Search objects that match current filters.
static _getAllReferences(int $id)
get all reference ids for object ID
fillMetaExcel(ilExcel $a_excel, int &$a_row)
sendMail(array $a_user_ids, $a_parent_obj, string $a_parent_cmd)
setDescription(string $a_val)
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
setDisableFilterHiding(bool $a_val=true)
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
const EXTENDED_DATA_READ_COUNT
fillMetaCSV(ilCSVWriter $a_csv)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
isForwardingToFormDispatcher()
addToClipboard()
Add selected users to clipboard.
sort()
description: > Example for rendering a Sort Glyph.
searchFilterListener(int $a_ref_id, array $a_data)
Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVA...
getFilterItemByPostVar(string $a_post_var)
const LP_MODE_CMIX_COMPL_WITH_FAILED
const LP_MODE_VISITED_PAGES
static _enabledUserRelatedData()
resetOffset(bool $a_in_determination=false)
anonymizeValue($a_value, bool $a_force_number=false)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
static http()
Fetches the global http state from ILIAS.
TableGUI class for learning progress.
getExportMeta()
Build export meta data.
const LP_MODE_TEST_PASSED
isPercentageAvailable(int $a_obj_id)
setIconVariant(int $variant)
Sets the variant of LP icons that is shown in the table.
getIconVariant()
Gets the variant of LP icons that is shown in the table.
parseValue(string $id, ?string $value, string $type)
ilObjectDataCache $ilObjDataCache
ilObjectDefinition $objDefinition
static _lookupObjectId(int $ref_id)
formatSeconds(int $seconds, bool $a_shorten_zero=false)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
const EXTENDED_DATA_SPENT_SECONDS
static lookupTxtById(string $plugin_id, string $lang_var)
static redirect(string $a_script)
static isTypePluginWithLP(string $a_type, bool $a_active_status=true)
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true, bool $show_type_filter=true)
Init filter.
initRepositoryFilter(array $filter)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static supportsSpentSeconds(string $obj_type)
determineSelectedFilters()
ilGlobalTemplateInterface $main_tpl
getMonthsFilter($a_short=false)
__construct(Container $dic, ilPlugin $plugin)
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static _getTimings(int $a_ref_id)
static supportsMark(string $obj_type)
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)
const LP_MODE_LTI_OUTCOME
static getInstance(int $obj_id)
determineOffsetAndOrder(bool $a_omit_offset=false)
storeProperty(string $type, string $value)
static getInstance(int $a_usr_id)
static getInstanceByRefId(int $ref_id)
RefineryFactory $refinery
static _lookupLogin(int $a_user_id)