19declare(strict_types=0);
51 ?
object $a_parent_obj,
52 string $a_parent_cmd =
"",
53 string $a_template_context =
""
56 $this->main_tpl =
$DIC->ui()->mainTemplate();
58 $this->objDefinition =
$DIC[
'objDefinition'];
59 $this->ilObjDataCache =
$DIC[
'ilObjDataCache'];
60 $this->tree =
$DIC->repositoryTree();
61 $this->
user = $DIC->user();
62 $this->setting =
$DIC->settings();
63 $this->
http = $DIC->http();
65 $this->
profile = $DIC[
'user']->getProfile();
68 if (!$this->anonymized && isset($this->obj_id) && $this->obj_id > 0) {
70 $this->anonymized = $olp->isAnonymized();
81 $this->
lng->loadLanguageModule(
"meta");
86 if ($this->
http->wrapper()->post()->has(
'item_id')) {
87 return $this->
http->wrapper()->post()->retrieve(
90 $this->refinery->kindlyTo()->int()
99 if ($this->
http->wrapper()->post()->has(
'uid')) {
100 return $this->
http->wrapper()->post()->retrieve(
102 $this->
refinery->kindlyTo()->listOf(
103 $this->refinery->kindlyTo()->int()
113 if (!$this->
ctrl->getNextClass($this)) {
116 switch ($this->
ctrl->getCmd()) {
135 if ($this->
http->wrapper()->query()->has(
'hide')) {
136 $hide = $this->
http->wrapper()->query()->retrieve(
144 case "mailselectedusers":
146 $this->main_tpl->setOnScreenMessage(
162 case 'addToClipboard':
164 $this->main_tpl->setOnScreenMessage(
186 $value = array_unique(
187 array_merge((array) $obj->getValue(), $to_hide)
189 $obj->setValue($value);
190 $obj->writeToSession();
193 if ($this->requested_tmpl_create !==
"") {
194 $this->
ctrl->setParameter(
197 $this->requested_tmpl_create
200 if ($this->requested_tmpl_delete !==
"") {
201 $this->
ctrl->setParameter(
204 $this->requested_tmpl_delete
207 $this->
ctrl->redirect($this->parent_obj, $this->parent_cmd);
210 return parent::executeCommand();
221 sort($ref_ids, SORT_NUMERIC);
235 foreach ($a_user_ids as $usr_id) {
243 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
244 $ref_id = $this->
http->wrapper()->query()->retrieve(
254 $tmpl_id = $obj_lp->getMailTemplateId();
263 $sig = ilLink::_getLink(
$ref_id);
264 $sig = rawurlencode(base64_encode($sig));
275 'rcp_to' => implode(
',', $rcps),
289 ?array $preset_obj_ids =
null,
290 bool $a_check_lp_activation =
true
295 $query_parser->parse();
296 if (!$query_parser->validate()) {
298 $query_parser->getMessage()
304 if ($filter[
"type"] ==
"lres") {
305 $filter[
"type"] = array(
'lm',
'sahs',
'htlm');
307 $filter[
"type"] = array($filter[
"type"]);
311 $object_search->setFilter($filter[
"type"]);
312 if ($preset_obj_ids) {
313 $object_search->setIdFilter($preset_obj_ids);
315 $res = $object_search->performSearch();
318 $res->setRequiredPermission($permission);
321 $res->setMaxHits(self::HIT_LIMIT);
323 if ($a_check_lp_activation) {
324 $res->addObserver($this,
"searchFilterListener");
327 if (!$this->
filter[
"area"]) {
334 foreach (
$res->getResults() as $obj_data) {
335 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
337 return $objects ?: array();
347 if (is_array($this->
filter[
"hide"]) && in_array(
371 $this->
lng->txt(
'trac_filter_area'),
374 ($this->isForwardingToFormDispatcher()) ? $this :
null
377 foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
378 if ($this->objDefinition->isContainer($type)) {
379 $white_list[] = $type;
382 $repo->getExplorerGUI()->setTypeWhiteList($white_list);
383 $this->addFilterItem($repo);
384 $repo->readFromSession();
385 $filter[
'area'] = (
int) $repo->getValue();
393 bool $a_split_learning_resources =
false,
394 bool $a_include_no_status_filter =
true
396 $this->setDisableFilterHiding(
true);
400 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
401 $this->addFilterItem($si);
402 $si->readFromSession();
403 if (!$si->getValue()) {
404 $si->setValue(
"crs");
406 $this->
filter[
"type"] = $si->getValue();
410 $this->
lng->txt(
"trac_filter_hidden"),
413 $this->addFilterItem($msi);
414 $msi->readFromSession();
415 $this->
filter[
"hide"] = $msi->getValue();
416 if ($this->
filter[
"hide"]) {
418 $types = $this->getCurrentFilter(
true);
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);
435 $this->addFilterItem($ti);
436 $ti->readFromSession();
437 $this->
filter[
"query"] = $ti->getValue();
441 $this->
lng->txt(
"trac_filter_area"),
444 $rs->setSelectText($this->
lng->txt(
"trac_select_area"));
445 $this->addFilterItem($rs);
446 $rs->readFromSession();
447 $this->
filter[
"area"] = $rs->getValue();
450 if ($a_include_no_status_filter) {
452 $this->
lng->txt(
"trac_filter_has_status"),
455 $this->addFilterItem($cb);
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 .=
" » ";
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) {
656 $item = $this->getFilterItemByPostVar(
$id);
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();
786 if ($a_user_id != $this->
user->getId()) {
789 $a_user = $this->user;
791 $user .=
", " . $a_user->getFullName(
799 ) .
": " . $this->ilObjDataCache->lookupTitle($a_obj_id) . $user
803 $this->setDescription(
804 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText(
805 $olp->getCurrentMode()
809 $this->setTitle($this->
lng->txt($action));
820 $ilClientIniFile =
$DIC[
'ilClientIniFile'];
836 "trac_name_of_installation"
837 )] = $ilClientIniFile->readVariable(
'client',
'name');
842 )] = $this->ilObjDataCache->lookupTitle((
int) $this->obj_id);
844 $data[$this->
lng->txt(
"trac_object_link")] = ilLink::_getLink(
864 $data[$this->
lng->txt(
"trac_report_owner")] = $this->
user->getFullName(
872 foreach ($this->getExportMeta() as $caption => $value) {
873 $a_excel->
setCell($a_row, 0, $caption);
874 $a_excel->
setCell($a_row, 1, $value);
882 foreach ($this->getExportMeta() as $caption => $value) {
898 if ($timing_cache->isWarningRequired($a_user_id)) {
901 $timings[
'item'][
'changeable'] &&
902 ($timings[
'user'][$a_user_id] ??
false) &&
903 $timings[
'user'][$a_user_id][
'end']
905 $end = $timings[
'user'][$a_user_id][
'end'];
906 } elseif ($timings[
'item'][
'suggestion_end']) {
907 $end = $timings[
'item'][
'suggestion_end'];
918 bool $a_shorten_zero =
false
920 $seconds = ($seconds > 0) ? $seconds : 0;
921 if ($a_shorten_zero && !$seconds) {
925 $hours = floor($seconds / 3600);
926 $rest = $seconds % 3600;
928 $minutes = floor($rest / 60);
935 return sprintf(
"%dh%02dm", $hours, $minutes);
951 bool $a_anonymize =
false,
952 bool $a_format_seconds =
false
956 $step = $a_max_value / 10;
957 $base = ceil(log($step, 10));
958 $fac = ceil($step / pow(10, ($base - 1)));
959 $step = pow(10, $base - 1) * $fac;
964 $ticks = range(0, $a_max_value + $step, $step);
966 $value_ticks = array(0 => 0);
967 foreach ($ticks as $tick) {
968 $value = $tvalue = $tick;
970 $value = $this->anonymizeValue($value,
true);
971 $tvalue = $this->anonymizeValue($tvalue);
973 if ($a_format_seconds) {
974 $tvalue = $this->formatSeconds($value);
976 $value_ticks[$value] = $tvalue;
985 for ($loop = 0; $loop < 10; $loop++) {
986 $year = date(
"Y") - $loop;
987 $options[$year] = $year;
988 for ($loop2 = 12; $loop2 > 0; $loop2--) {
989 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
990 if ($year . $month <= date(
"Ym")) {
992 $caption = $year .
" / " . $this->
lng->txt(
993 "month_" . $month .
"_long"
996 $caption = $year .
"/" . $month;
998 $options[$year .
"-" . $month] = $caption;
1008 $a_year = date(
"Y");
1012 for ($loop = 1; $loop < 13; $loop++) {
1013 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
1014 if ($a_year .
"-" . $month <= date(
"Y-m")) {
1016 $caption = $this->
lng->txt(
"month_" . $month .
"_long");
1018 $caption = $this->
lng->txt(
"month_" . $month .
"_short");
1020 $all[$a_year .
"-" . $month] = $caption;
1027 int $a_in_course = 0,
1030 $cols = $privacy_fields = array();
1032 $this->
profile->skipGroup(AvailableSections::Interests);
1033 if ($a_in_course === 1) {
1034 $ufs = $this->
profile->getVisibleFields(Context::Course);
1035 } elseif ($a_in_group === 1) {
1038 $ufs = $this->
profile->getFields();
1042 $cols[
"login"] = array(
1043 "txt" => $this->
lng->txt(
"login"),
1047 if (!$this->anonymized) {
1048 $cols[
"firstname"] = array(
1049 "txt" => $this->
lng->txt(
"firstname"),
1052 $cols[
"lastname"] = array(
1053 "txt" => $this->
lng->txt(
"lastname"),
1060 if ($tracking->hasExtendedData(
1063 $cols[
"first_access"] = array(
1064 "txt" => $this->
lng->txt(
"trac_first_access"),
1067 $cols[
"last_access"] = array(
1068 "txt" => $this->
lng->txt(
"trac_last_access"),
1072 if ($tracking->hasExtendedData(
1075 $cols[
"read_count"] = array(
1076 "txt" => $this->
lng->txt(
"trac_read_count"),
1080 if ($tracking->hasExtendedData(
1084 $cols[
"spent_seconds"] = array(
1085 "txt" => $this->
lng->txt(
"trac_spent_seconds"),
1090 if ($this->isPercentageAvailable($this->obj_id)) {
1091 $cols[
"percentage"] = array(
1092 "txt" => $this->
lng->txt(
"trac_percentage"),
1099 if ($olp->isActive()) {
1100 $cols[
"status"] = array(
1101 "txt" => $this->
lng->txt(
"trac_status"),
1105 $cols[
'status_changed'] = array(
1106 'txt' => $this->
lng->txt(
'trac_status_changed'),
1112 $cols[
"mark"] = array(
1113 "txt" => $this->
lng->txt(
"trac_mark"),
1118 $cols[
"u_comment"] = array(
1119 "txt" => $this->
lng->txt(
"trac_comment"),
1123 $cols[
"create_date"] = array(
1124 "txt" => $this->
lng->txt(
"create_date"),
1127 $cols[
"language"] = array(
1128 "txt" => $this->
lng->txt(
"language"),
1133 if (!$this->anonymized &&
1134 ($a_in_course || $a_in_group)) {
1137 $a_in_group === 0 ? $a_in_course : $a_in_group
1140 foreach ($ufs as $fd) {
1141 $f = $fd->getIdentifier();
1142 if (!isset($cols[
$f]) &&
$f !==
"username" && !$fd->hiddenInLists()) {
1144 "txt" => $fd->getLabel($this->lng),
1147 $privacy_fields[] =
$f;
1152 return array($cols, $privacy_fields);
1160 $users = $this->initUidFromPost();
1164 $this->
lng->loadLanguageModule(
'user');
1165 $this->main_tpl->setOnScreenMessage(
1168 'clipboard_user_added'
1179 return $this->icon_variant;
1187 $this->icon_variant = $variant;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
@classDescription Date and time handling
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
const LP_MODE_CMIX_COMPLETED_OR_PASSED
const LP_MODE_CMIX_COMPL_WITH_FAILED
const LP_MODE_CMIX_PASSED
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
const LP_MODE_TEST_PASSED
const LP_MODE_VISITED_PAGES
const LP_MODE_LTI_OUTCOME
const LP_MODE_CMIX_COMPLETED
const LP_MODE_CMIX_PASSED_WITH_FAILED
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
TableGUI class for learning progress.
ilObjectDefinition $objDefinition
fillMetaExcel(ilExcel $a_excel, int &$a_row)
Add meta information to excel export.
sendMail(array $a_user_ids, $a_parent_obj, string $a_parent_cmd)
setIconVariant(int $variant)
Sets the variant of LP icons that is shown in the table.
addToClipboard()
Add selected users to clipboard.
buildPath(array $ref_ids)
fillMetaCSV(ilCSVWriter $a_csv)
Add meta information to csv export.
showTimingsWarning(int $a_ref_id, int $a_user_id)
ilObjectDataCache $ilObjDataCache
RefineryFactory $refinery
formatSeconds(int $seconds, bool $a_shorten_zero=false)
getMonthsYear($a_year=null, $a_short=false)
anonymizeValue($a_value, bool $a_force_number=false)
searchFilterListener(int $a_ref_id, array $a_data)
Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVA...
initRepositoryFilter(array $filter)
getPossibleTypes(bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
getIconVariant()
Gets the variant of LP icons that is shown in the table.
findReferencesForObjId(int $a_obj_id)
getCurrentFilter(bool $as_query=false)
getMonthsFilter($a_short=false)
getExportMeta()
Build export meta data.
parseValue(string $id, ?string $value, string $type)
buildValueScale(int $a_max_value, bool $a_anonymize=false, bool $a_format_seconds=false)
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true)
Init filter.
__construct(?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
isForwardingToFormDispatcher()
isPercentageAvailable(int $a_obj_id)
parseTitle(int $a_obj_id, string $action, int $a_user_id=0)
ilGlobalTemplateInterface $main_tpl
getSelectableUserColumns(int $a_in_course=0, int $a_in_group=0)
searchObjects(array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
Search objects that match current filters.
static getLogger(string $a_component_id)
Get component logger.
const EXTENDED_DATA_READ_COUNT
static _enabledUserRelatedData()
const EXTENDED_DATA_SPENT_SECONDS
const EXTENDED_DATA_LAST_ACCESS
static _lookupFullname(int $a_user_id)
static _lookupLogin(int $a_user_id)
parses the objects.xml it handles the xml-description of all ilias objects
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)
static supportsMark(string $obj_type)
static getInstance(int $obj_id)
static lookupTxtById(string $plugin_id, string $lang_var)
static _lookupObjectId(int $ref_id)
static _lookupType(int $id, bool $reference=false)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
static _getAllReferences(int $id)
get all reference ids for object ID
setMinWordLength(int $a_length)
static isTypePluginWithLP(string $a_type, bool $a_active_status=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getFilterItemByPostVar(string $a_post_var)
determineOffsetAndOrder(bool $a_omit_offset=false)
resetOffset(bool $a_in_determination=false)
storeProperty(string $type, string $value)
determineSelectedFilters()
This class represents a text property in a property form.
static getInstanceByRefId(int $ref_id)
static _getTimings(int $a_ref_id)
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
static getInstance(int $a_usr_id)
static redirect(string $a_script)
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)