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"]) {
415 foreach ($this->
filter[
"hide"] as $obj_id) {
416 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
420 $msi->setOptions($options);
425 $this->
lng->txt(
"trac_title_description"),
428 $ti->setMaxLength(64);
431 $ti->readFromSession();
432 $this->
filter[
"query"] = $ti->getValue();
436 $this->
lng->txt(
"trac_filter_area"),
441 $rs->readFromSession();
442 $this->
filter[
"area"] = $rs->getValue();
445 if ($a_include_no_status_filter) {
447 $this->
lng->txt(
"trac_filter_has_status"),
451 $cb->readFromSession();
452 $this->
filter[
"status"] = $cb->getChecked();
460 if (!count($ref_ids)) {
464 foreach ($ref_ids as
$ref_id) {
467 $path_full = $this->tree->getPathFull($ref_id);
468 foreach ($path_full as
$data) {
469 if (++$counter < (count($path_full) - 1)) {
472 $path .=
" » ";
473 if ($ref_id != $data[
'ref_id']) {
474 $path .= $data[
'title'];
476 $path .= (
'<a target="_top" href="' .
481 $data[
'title'] .
'</a>');
491 bool $a_split_learning_resources =
false,
492 bool $a_include_digilib =
false,
493 bool $a_allow_undefined_lp =
false 497 $component_repository = $DIC[
'component.repository'];
501 if ($a_split_learning_resources) {
502 $options[
'lm'] = $this->
lng->txt(
'objs_lm');
503 $options[
'sahs'] = $this->
lng->txt(
'objs_sahs');
504 $options[
'htlm'] = $this->
lng->txt(
'objs_htlm');
506 $options[
'lres'] = $this->
lng->txt(
'obj_lrss');
509 $options[
'crs'] = $this->
lng->txt(
'objs_crs');
510 $options[
'grp'] = $this->
lng->txt(
'objs_grp');
511 $options[
'exc'] = $this->
lng->txt(
'objs_exc');
512 $options[
'file'] = $this->
lng->txt(
'objs_file');
513 $options[
'mcst'] = $this->
lng->txt(
'objs_mcst');
514 $options[
'svy'] = $this->
lng->txt(
'objs_svy');
515 $options[
'tst'] = $this->
lng->txt(
'objs_tst');
516 $options[
'prg'] = $this->
lng->txt(
'objs_prg');
517 $options[
'iass'] = $this->
lng->txt(
'objs_iass');
518 $options[
'copa'] = $this->
lng->txt(
'objs_copa');
519 $options[
'frm'] = $this->
lng->txt(
'objs_frm');
520 $options[
'cmix'] = $this->
lng->txt(
'objs_cmix');
521 $options[
'lti'] = $this->
lng->txt(
'objs_lti');
522 $options[
'lso'] = $this->
lng->txt(
'objs_lso');
523 $options[
'dcl'] = $this->
lng->txt(
'objs_dcl');
525 if ($a_allow_undefined_lp) {
526 $options[
'root'] = $this->
lng->txt(
'obj_reps');
527 $options[
'cat'] = $this->
lng->txt(
'objs_cat');
528 $options[
"webr"] = $this->
lng->txt(
"objs_webr");
529 $options[
"wiki"] = $this->
lng->txt(
"objs_wiki");
530 $options[
"blog"] = $this->
lng->txt(
"objs_blog");
531 $options[
"prtf"] = $this->
lng->txt(
"objs_prtf");
532 $options[
"prtt"] = $this->
lng->txt(
"objs_prtt");
536 $plugins = $component_repository->getPluginSlotById(
538 )->getActivePlugins();
539 foreach ($plugins as $pl) {
540 $pl_id = $pl->getId();
559 $pos = strrpos($id,
"_");
560 if ($pos !==
false) {
561 $function = strtoupper(substr($id, $pos + 1));
564 array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")
566 $id = substr($id, 0, $pos);
570 if ((trim((
string) $value) ==
"") && $id !=
"status") {
571 if ($id ==
"title" &&
572 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
573 get_class($this) !=
"ilTrMatrixTableGUI") {
574 return "--" . $this->
lng->txt(
"none") .
"--";
582 case 'status_changed':
600 case "spent_seconds":
606 ((
int) $value < 3600 ?
true :
false)
615 $value = $value .
"%";
626 $value = $this->
lng->txt(
"gender_" . $value);
631 $value = $icons->renderIconForStatus((
int) $value);
635 $this->
lng->loadLanguageModule(
"meta");
636 $value = $this->
lng->txt(
"meta_l_" . $value);
640 $value = $this->
lng->txt(
"meta_c_" . $value);
650 foreach ($this->
filter as
$id => $value) {
668 case "matriculation":
674 $result[
$id] = $value;
679 if (!is_null($value) && $value !==
"") {
680 $result[
$id] = $value;
688 case "spent_seconds":
689 if (is_array($value) && implode(
"", $value)) {
690 $result[
$id] = $value;
698 case 'status_changed':
700 if ($value[
"from"]) {
701 $result[
$id][
"from"] = $value[
"from"]->get(
706 $result[
$id][
"to"] = $value[
"to"]->get(
715 if ($value[
"from"]) {
716 $result[
$id][
"from"] = $value[
"from"]->get(
719 $result[
$id][
"from"] = substr(
720 $result[
$id][
"from"],
726 $result[
$id][
"to"] = $value[
"to"]->get(
729 $result[
$id][
"to"] = substr(
744 if ($a_obj_id === 0) {
748 $mode = $olp->getCurrentMode();
781 if ($a_user_id != $this->
user->getId()) {
786 $user .=
", " . $a_user->getFullName(
794 ) .
": " . $this->ilObjDataCache->lookupTitle($a_obj_id) .
$user 799 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText(
800 $olp->getCurrentMode()
815 $ilClientIniFile = $DIC[
'ilClientIniFile'];
831 "trac_name_of_installation" 832 )] = $ilClientIniFile->readVariable(
'client',
'name');
837 )] = $this->ilObjDataCache->lookupTitle((
int) $this->obj_id);
839 $data[$this->
lng->txt(
"trac_object_link")] = ilLink::_getLink(
859 $data[$this->
lng->txt(
"trac_report_owner")] = $this->
user->getFullName(
868 $a_excel->
setCell($a_row, 0, $caption);
869 $a_excel->
setCell($a_row, 1, $value);
893 if ($timing_cache->isWarningRequired($a_user_id)) {
896 $timings[
'item'][
'changeable'] &&
897 ($timings[
'user'][$a_user_id] ??
false) &&
898 $timings[
'user'][$a_user_id][
'end']
900 $end = $timings[
'user'][$a_user_id][
'end'];
901 } elseif ($timings[
'item'][
'suggestion_end']) {
902 $end = $timings[
'item'][
'suggestion_end'];
913 bool $a_shorten_zero =
false 915 $seconds = ($seconds > 0) ? $seconds : 0;
916 if ($a_shorten_zero && !$seconds) {
920 $hours = floor($seconds / 3600);
921 $rest = $seconds % 3600;
923 $minutes = floor($rest / 60);
930 return sprintf(
"%dh%02dm", $hours, $minutes);
946 bool $a_anonymize =
false,
947 bool $a_format_seconds =
false 951 $step = $a_max_value / 10;
952 $base = ceil(log($step, 10));
953 $fac = ceil($step / pow(10, (
$base - 1)));
954 $step = pow(10,
$base - 1) * $fac;
959 $ticks = range(0, $a_max_value + $step, $step);
961 $value_ticks = array(0 => 0);
962 foreach ($ticks as $tick) {
963 $value = $tvalue = $tick;
968 if ($a_format_seconds) {
971 $value_ticks[$value] = $tvalue;
980 for ($loop = 0; $loop < 10; $loop++) {
981 $year = date(
"Y") - $loop;
982 $options[$year] = $year;
983 for ($loop2 = 12; $loop2 > 0; $loop2--) {
984 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
985 if ($year . $month <= date(
"Ym")) {
987 $caption = $year .
" / " . $this->
lng->txt(
988 "month_" . $month .
"_long" 991 $caption = $year .
"/" . $month;
993 $options[$year .
"-" . $month] = $caption;
1003 $a_year = date(
"Y");
1007 for ($loop = 1; $loop < 13; $loop++) {
1008 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
1009 if ($a_year .
"-" . $month <= date(
"Y-m")) {
1011 $caption = $this->
lng->txt(
"month_" . $month .
"_long");
1013 $caption = $this->
lng->txt(
"month_" . $month .
"_short");
1015 $all[$a_year .
"-" . $month] = $caption;
1022 int $a_in_course = 0,
1025 $cols = $privacy_fields = array();
1028 $up->skipGroup(
"preferences");
1029 $up->skipGroup(
"settings");
1030 $up->skipGroup(
"interests");
1031 $ufs = $up->getStandardFields();
1034 $cols[
"login"] = array(
1035 "txt" => $this->
lng->txt(
"login"),
1039 if (!$this->anonymized) {
1040 $cols[
"firstname"] = array(
1041 "txt" => $this->
lng->txt(
"firstname"),
1044 $cols[
"lastname"] = array(
1045 "txt" => $this->
lng->txt(
"lastname"),
1052 if ($tracking->hasExtendedData(
1055 $cols[
"first_access"] = array(
1056 "txt" => $this->
lng->txt(
"trac_first_access"),
1059 $cols[
"last_access"] = array(
1060 "txt" => $this->
lng->txt(
"trac_last_access"),
1064 if ($tracking->hasExtendedData(
1067 $cols[
"read_count"] = array(
1068 "txt" => $this->
lng->txt(
"trac_read_count"),
1072 if ($tracking->hasExtendedData(
1076 $cols[
"spent_seconds"] = array(
1077 "txt" => $this->
lng->txt(
"trac_spent_seconds"),
1083 $cols[
"percentage"] = array(
1084 "txt" => $this->
lng->txt(
"trac_percentage"),
1091 if ($olp->isActive()) {
1092 $cols[
"status"] = array(
1093 "txt" => $this->
lng->txt(
"trac_status"),
1097 $cols[
'status_changed'] = array(
1098 'txt' => $this->
lng->txt(
'trac_status_changed'),
1104 $cols[
"mark"] = array(
1105 "txt" => $this->
lng->txt(
"trac_mark"),
1110 $cols[
"u_comment"] = array(
1111 "txt" => $this->
lng->txt(
"trac_comment"),
1115 $cols[
"create_date"] = array(
1116 "txt" => $this->
lng->txt(
"create_date"),
1119 $cols[
"language"] = array(
1120 "txt" => $this->
lng->txt(
"language"),
1125 if (!$this->anonymized &&
1126 ($a_in_course || $a_in_group)) {
1129 $a_in_group === 0 ? $a_in_course : $a_in_group
1132 foreach ($ufs as
$f => $fd) {
1133 if (!isset($cols[
$f]) && $f !=
"username" && !($fd[
"lists_hide"] ??
false)) {
1135 !(($fd[
"course_export_fix_value"] ??
false) || $this->setting->get(
1136 "usr_settings_course_export_" . $f
1141 !(($fd[
"group_export_fix_value"] ??
false) || $this->setting->get(
1142 "usr_settings_group_export_" . $f
1148 "txt" => $this->
lng->txt($f),
1151 $privacy_fields[] =
$f;
1158 $user_defined_fields = $user_defined_fields->getCourseExportableFields(
1161 $user_defined_fields = $user_defined_fields->getGroupExportableFields(
1164 foreach ($user_defined_fields as $definition) {
1166 $f =
"udf_" . $definition[
"field_id"];
1168 "txt" => $definition[
"field_name"],
1172 $privacy_fields[] =
$f;
1177 return array($cols, $privacy_fields);
1189 $this->
lng->loadLanguageModule(
'user');
1190 $this->main_tpl->setOnScreenMessage(
1193 'clipboard_user_added' 1212 $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)
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
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
const LP_MODE_VISITED_PAGES
static _enabledUserRelatedData()
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)
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)
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
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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)