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 397 $si->readFromSession();
398 if (!$si->getValue()) {
399 $si->setValue(
"crs");
401 $this->
filter[
"type"] = $si->getValue();
405 $this->
lng->txt(
"trac_filter_hidden"),
409 $msi->readFromSession();
410 $this->
filter[
"hide"] = $msi->getValue();
411 if ($this->
filter[
"hide"]) {
414 $type = $types[
"type"];
416 if ($type ==
'lres') {
417 $type = array(
'lm',
'sahs',
'htlm');
419 $type = array($type);
421 foreach ($this->
filter[
"hide"] as $obj_id) {
423 $this->ilObjDataCache->lookupType((
int) $obj_id),
426 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
431 $msi->setOptions($options);
436 $this->
lng->txt(
"trac_title_description"),
439 $ti->setMaxLength(64);
442 $ti->readFromSession();
443 $this->
filter[
"query"] = $ti->getValue();
447 $this->
lng->txt(
"trac_filter_area"),
452 $rs->readFromSession();
453 $this->
filter[
"area"] = $rs->getValue();
456 if ($a_include_no_status_filter) {
458 $this->
lng->txt(
"trac_filter_has_status"),
462 $cb->readFromSession();
463 $this->
filter[
"status"] = $cb->getChecked();
471 if (!count($ref_ids)) {
475 foreach ($ref_ids as
$ref_id) {
478 $path_full = $this->tree->getPathFull($ref_id);
479 foreach ($path_full as
$data) {
480 if (++$counter < (count($path_full) - 1)) {
483 $path .=
" » ";
484 if ($ref_id != $data[
'ref_id']) {
485 $path .= $data[
'title'];
487 $path .= (
'<a target="_top" href="' .
492 $data[
'title'] .
'</a>');
502 bool $a_split_learning_resources =
false,
503 bool $a_include_digilib =
false,
504 bool $a_allow_undefined_lp =
false 508 $component_repository = $DIC[
'component.repository'];
512 if ($a_split_learning_resources) {
513 $options[
'lm'] = $this->
lng->txt(
'objs_lm');
514 $options[
'sahs'] = $this->
lng->txt(
'objs_sahs');
515 $options[
'htlm'] = $this->
lng->txt(
'objs_htlm');
517 $options[
'lres'] = $this->
lng->txt(
'obj_lrss');
520 $options[
'crs'] = $this->
lng->txt(
'objs_crs');
521 $options[
'grp'] = $this->
lng->txt(
'objs_grp');
522 $options[
'exc'] = $this->
lng->txt(
'objs_exc');
523 $options[
'file'] = $this->
lng->txt(
'objs_file');
524 $options[
'mcst'] = $this->
lng->txt(
'objs_mcst');
525 $options[
'svy'] = $this->
lng->txt(
'objs_svy');
526 $options[
'tst'] = $this->
lng->txt(
'objs_tst');
527 $options[
'prg'] = $this->
lng->txt(
'objs_prg');
528 $options[
'iass'] = $this->
lng->txt(
'objs_iass');
529 $options[
'copa'] = $this->
lng->txt(
'objs_copa');
530 $options[
'frm'] = $this->
lng->txt(
'objs_frm');
531 $options[
'cmix'] = $this->
lng->txt(
'objs_cmix');
532 $options[
'lti'] = $this->
lng->txt(
'objs_lti');
533 $options[
'lso'] = $this->
lng->txt(
'objs_lso');
534 $options[
'dcl'] = $this->
lng->txt(
'objs_dcl');
536 if ($a_allow_undefined_lp) {
537 $options[
'root'] = $this->
lng->txt(
'obj_reps');
538 $options[
'cat'] = $this->
lng->txt(
'objs_cat');
539 $options[
"webr"] = $this->
lng->txt(
"objs_webr");
540 $options[
"wiki"] = $this->
lng->txt(
"objs_wiki");
541 $options[
"blog"] = $this->
lng->txt(
"objs_blog");
542 $options[
"prtf"] = $this->
lng->txt(
"objs_prtf");
543 $options[
"prtt"] = $this->
lng->txt(
"objs_prtt");
547 $plugins = $component_repository->getPluginSlotById(
549 )->getActivePlugins();
550 foreach ($plugins as $pl) {
551 $pl_id = $pl->getId();
570 $pos = strrpos($id,
"_");
571 if ($pos !==
false) {
572 $function = strtoupper(substr($id, $pos + 1));
575 array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")
577 $id = substr($id, 0, $pos);
581 if ((trim((
string) $value) ==
"") && $id !=
"status") {
582 if ($id ==
"title" &&
583 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
584 get_class($this) !=
"ilTrMatrixTableGUI") {
585 return "--" . $this->
lng->txt(
"none") .
"--";
593 case 'status_changed':
611 case "spent_seconds":
617 ((
int) $value < 3600 ?
true :
false)
626 $value = $value .
"%";
637 $value = $this->
lng->txt(
"gender_" . $value);
642 $value = $icons->renderIconForStatus((
int) $value);
646 $this->
lng->loadLanguageModule(
"meta");
647 $value = $this->
lng->txt(
"meta_l_" . $value);
651 $value = $this->
lng->txt(
"meta_c_" . $value);
661 foreach ($this->
filter as
$id => $value) {
679 case "matriculation":
685 $result[
$id] = $value;
690 if (!is_null($value) && $value !==
"") {
691 $result[
$id] = $value;
699 case "spent_seconds":
700 if (is_array($value) && implode(
"", $value)) {
701 $result[
$id] = $value;
709 case 'status_changed':
711 if ($value[
"from"]) {
712 $result[
$id][
"from"] = $value[
"from"]->get(
717 $result[
$id][
"to"] = $value[
"to"]->get(
726 if ($value[
"from"]) {
727 $result[
$id][
"from"] = $value[
"from"]->get(
730 $result[
$id][
"from"] = substr(
731 $result[
$id][
"from"],
737 $result[
$id][
"to"] = $value[
"to"]->get(
740 $result[
$id][
"to"] = substr(
755 if ($a_obj_id === 0) {
759 $mode = $olp->getCurrentMode();
790 if ($a_user_id != $this->
user->getId()) {
795 $user .=
", " . $a_user->getFullName(
803 ) .
": " . $this->ilObjDataCache->lookupTitle($a_obj_id) .
$user 808 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText(
809 $olp->getCurrentMode()
824 $ilClientIniFile = $DIC[
'ilClientIniFile'];
840 "trac_name_of_installation" 841 )] = $ilClientIniFile->readVariable(
'client',
'name');
846 )] = $this->ilObjDataCache->lookupTitle((
int) $this->obj_id);
848 $data[$this->
lng->txt(
"trac_object_link")] = ilLink::_getLink(
868 $data[$this->
lng->txt(
"trac_report_owner")] = $this->
user->getFullName(
877 $a_excel->
setCell($a_row, 0, $caption);
878 $a_excel->
setCell($a_row, 1, $value);
902 if ($timing_cache->isWarningRequired($a_user_id)) {
905 $timings[
'item'][
'changeable'] &&
906 ($timings[
'user'][$a_user_id] ??
false) &&
907 $timings[
'user'][$a_user_id][
'end']
909 $end = $timings[
'user'][$a_user_id][
'end'];
910 } elseif ($timings[
'item'][
'suggestion_end']) {
911 $end = $timings[
'item'][
'suggestion_end'];
922 bool $a_shorten_zero =
false 924 $seconds = ($seconds > 0) ? $seconds : 0;
925 if ($a_shorten_zero && !$seconds) {
929 $hours = floor($seconds / 3600);
930 $rest = $seconds % 3600;
932 $minutes = floor($rest / 60);
939 return sprintf(
"%dh%02dm", $hours, $minutes);
955 bool $a_anonymize =
false,
956 bool $a_format_seconds =
false 960 $step = $a_max_value / 10;
961 $base = ceil(log($step, 10));
962 $fac = ceil($step / pow(10, (
$base - 1)));
963 $step = pow(10,
$base - 1) * $fac;
968 $ticks = range(0, $a_max_value + $step, $step);
970 $value_ticks = array(0 => 0);
971 foreach ($ticks as $tick) {
972 $value = $tvalue = $tick;
977 if ($a_format_seconds) {
980 $value_ticks[$value] = $tvalue;
989 for ($loop = 0; $loop < 10; $loop++) {
990 $year = date(
"Y") - $loop;
991 $options[$year] = $year;
992 for ($loop2 = 12; $loop2 > 0; $loop2--) {
993 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
994 if ($year . $month <= date(
"Ym")) {
996 $caption = $year .
" / " . $this->
lng->txt(
997 "month_" . $month .
"_long" 1000 $caption = $year .
"/" . $month;
1002 $options[$year .
"-" . $month] = $caption;
1012 $a_year = date(
"Y");
1016 for ($loop = 1; $loop < 13; $loop++) {
1017 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
1018 if ($a_year .
"-" . $month <= date(
"Y-m")) {
1020 $caption = $this->
lng->txt(
"month_" . $month .
"_long");
1022 $caption = $this->
lng->txt(
"month_" . $month .
"_short");
1024 $all[$a_year .
"-" . $month] = $caption;
1031 int $a_in_course = 0,
1034 $cols = $privacy_fields = array();
1037 $up->skipGroup(
"preferences");
1038 $up->skipGroup(
"settings");
1039 $up->skipGroup(
"interests");
1040 $ufs = $up->getStandardFields();
1043 $cols[
"login"] = array(
1044 "txt" => $this->
lng->txt(
"login"),
1048 if (!$this->anonymized) {
1049 $cols[
"firstname"] = array(
1050 "txt" => $this->
lng->txt(
"firstname"),
1053 $cols[
"lastname"] = array(
1054 "txt" => $this->
lng->txt(
"lastname"),
1061 if ($tracking->hasExtendedData(
1064 $cols[
"first_access"] = array(
1065 "txt" => $this->
lng->txt(
"trac_first_access"),
1068 $cols[
"last_access"] = array(
1069 "txt" => $this->
lng->txt(
"trac_last_access"),
1073 if ($tracking->hasExtendedData(
1076 $cols[
"read_count"] = array(
1077 "txt" => $this->
lng->txt(
"trac_read_count"),
1081 if ($tracking->hasExtendedData(
1085 $cols[
"spent_seconds"] = array(
1086 "txt" => $this->
lng->txt(
"trac_spent_seconds"),
1092 $cols[
"percentage"] = array(
1093 "txt" => $this->
lng->txt(
"trac_percentage"),
1100 if ($olp->isActive()) {
1101 $cols[
"status"] = array(
1102 "txt" => $this->
lng->txt(
"trac_status"),
1106 $cols[
'status_changed'] = array(
1107 'txt' => $this->
lng->txt(
'trac_status_changed'),
1113 $cols[
"mark"] = array(
1114 "txt" => $this->
lng->txt(
"trac_mark"),
1119 $cols[
"u_comment"] = array(
1120 "txt" => $this->
lng->txt(
"trac_comment"),
1124 $cols[
"create_date"] = array(
1125 "txt" => $this->
lng->txt(
"create_date"),
1128 $cols[
"language"] = array(
1129 "txt" => $this->
lng->txt(
"language"),
1134 if (!$this->anonymized &&
1135 ($a_in_course || $a_in_group)) {
1138 $a_in_group === 0 ? $a_in_course : $a_in_group
1141 foreach ($ufs as
$f => $fd) {
1142 if (!isset($cols[
$f]) && $f !=
"username" && !($fd[
"lists_hide"] ??
false)) {
1144 !(($fd[
"course_export_fix_value"] ??
false) || $this->setting->get(
1145 "usr_settings_course_export_" . $f
1150 !(($fd[
"group_export_fix_value"] ??
false) || $this->setting->get(
1151 "usr_settings_group_export_" . $f
1157 "txt" => $this->
lng->txt($f),
1160 $privacy_fields[] =
$f;
1167 $user_defined_fields = $user_defined_fields->getCourseExportableFields(
1170 $user_defined_fields = $user_defined_fields->getGroupExportableFields(
1173 foreach ($user_defined_fields as $definition) {
1175 $f =
"udf_" . $definition[
"field_id"];
1177 "txt" => $definition[
"field_name"],
1181 $privacy_fields[] =
$f;
1186 return array($cols, $privacy_fields);
1198 $this->
lng->loadLanguageModule(
'user');
1199 $this->main_tpl->setOnScreenMessage(
1202 'clipboard_user_added' 1221 $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
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)
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)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
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.
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
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.
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()
parses the objects.xml it handles the xml-description of all ilias objects
resetOffset(bool $a_in_determination=false)
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true)
Init filter.
anonymizeValue($a_value, bool $a_force_number=false)
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)
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)
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)
static setUseRelativeDates(bool $a_status)
set use relative dates
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)