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 $this->
ctrl->redirect($this->parent_obj, $this->parent_cmd);
196 return parent::executeCommand();
207 sort($ref_ids, SORT_NUMERIC);
221 foreach ($a_user_ids as $usr_id) {
229 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
230 $ref_id = $this->
http->wrapper()->query()->retrieve(
240 $tmpl_id = $obj_lp->getMailTemplateId();
249 $sig = ilLink::_getLink(
$ref_id);
250 $sig = rawurlencode(base64_encode($sig));
261 'rcp_to' => implode(
',', $rcps),
275 ?array $preset_obj_ids =
null,
276 bool $a_check_lp_activation =
true
281 $query_parser->parse();
282 if (!$query_parser->validate()) {
284 $query_parser->getMessage()
290 if ($filter[
"type"] ==
"lres") {
291 $filter[
"type"] = array(
'lm',
'sahs',
'htlm');
293 $filter[
"type"] = array($filter[
"type"]);
297 $object_search->setFilter($filter[
"type"]);
298 if ($preset_obj_ids) {
299 $object_search->setIdFilter($preset_obj_ids);
301 $res = $object_search->performSearch();
304 $res->setRequiredPermission($permission);
307 $res->setMaxHits(self::HIT_LIMIT);
309 if ($a_check_lp_activation) {
310 $res->addObserver($this,
"searchFilterListener");
313 if (!$this->
filter[
"area"]) {
320 foreach (
$res->getResults() as $obj_data) {
321 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
323 return $objects ?: array();
333 if (is_array($this->
filter[
"hide"]) && in_array(
357 $this->
lng->txt(
'trac_filter_area'),
360 ($this->isForwardingToFormDispatcher()) ? $this :
null
363 foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
364 if ($this->objDefinition->isContainer($type)) {
365 $white_list[] = $type;
368 $repo->getExplorerGUI()->setTypeWhiteList($white_list);
369 $this->addFilterItem($repo);
370 $repo->readFromSession();
371 $filter[
'area'] = (
int) $repo->getValue();
379 bool $a_split_learning_resources =
false,
380 bool $a_include_no_status_filter =
true
382 $this->setDisableFilterHiding(
true);
386 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
387 $this->addFilterItem($si);
388 $si->readFromSession();
389 if (!$si->getValue()) {
390 $si->setValue(
"crs");
392 $this->
filter[
"type"] = $si->getValue();
396 $this->
lng->txt(
"trac_filter_hidden"),
399 $this->addFilterItem($msi);
400 $msi->readFromSession();
401 $this->
filter[
"hide"] = $msi->getValue();
402 if ($this->
filter[
"hide"]) {
404 $types = $this->getCurrentFilter(
true);
406 foreach ($this->
filter[
"hide"] as $obj_id) {
407 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
416 $this->
lng->txt(
"trac_title_description"),
419 $ti->setMaxLength(64);
421 $this->addFilterItem($ti);
422 $ti->readFromSession();
423 $this->
filter[
"query"] = $ti->getValue();
427 $this->
lng->txt(
"trac_filter_area"),
430 $rs->setSelectText($this->
lng->txt(
"trac_select_area"));
431 $this->addFilterItem($rs);
432 $rs->readFromSession();
433 $this->
filter[
"area"] = $rs->getValue();
436 if ($a_include_no_status_filter) {
438 $this->
lng->txt(
"trac_filter_has_status"),
441 $this->addFilterItem($cb);
442 $cb->readFromSession();
443 $this->
filter[
"status"] = $cb->getChecked();
451 if (!count($ref_ids)) {
455 foreach ($ref_ids as
$ref_id) {
458 $path_full = $this->tree->getPathFull(
$ref_id);
459 foreach ($path_full as
$data) {
460 if (++
$counter < (count($path_full) - 1)) {
463 $path .=
" » ";
467 $path .= (
'<a target="_top" href="' .
472 $data[
'title'] .
'</a>');
482 bool $a_split_learning_resources =
false,
483 bool $a_include_digilib =
false,
484 bool $a_allow_undefined_lp =
false
488 $component_repository =
$DIC[
'component.repository'];
492 if ($a_split_learning_resources) {
516 if ($a_allow_undefined_lp) {
527 $plugins = $component_repository->getPluginSlotById(
529 )->getActivePlugins();
530 foreach ($plugins as $pl) {
531 $pl_id = $pl->getId();
550 $pos = strrpos(
$id,
"_");
551 if ($pos !==
false) {
552 $function = strtoupper(substr(
$id, $pos + 1));
555 array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")
557 $id = substr(
$id, 0, $pos);
561 if ((trim((
string) $value) ==
"") &&
$id !=
"status") {
562 if (
$id ==
"title" &&
563 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
564 get_class($this) !=
"ilTrMatrixTableGUI") {
565 return "--" . $this->
lng->txt(
"none") .
"--";
573 case 'status_changed':
591 case "spent_seconds":
597 ((
int) $value < 3600 ?
true :
false)
606 $value = $value .
"%";
617 $value = $this->
lng->txt(
"gender_" . $value);
622 $value = $icons->renderIconForStatus((
int) $value);
626 $this->
lng->loadLanguageModule(
"meta");
627 $value = $this->
lng->txt(
"meta_l_" . $value);
631 $value = $this->
lng->txt(
"meta_c_" . $value);
641 foreach ($this->
filter as
$id => $value) {
642 $item = $this->getFilterItemByPostVar(
$id);
658 case "matriculation":
664 $result[
$id] = $value;
669 if (!is_null($value) && $value !==
"") {
670 $result[
$id] = $value;
678 case "spent_seconds":
679 if (is_array($value) && implode(
"", $value)) {
680 $result[
$id] = $value;
688 case 'status_changed':
690 if ($value[
"from"]) {
691 $result[
$id][
"from"] = $value[
"from"]->get(
696 $result[
$id][
"to"] = $value[
"to"]->get(
705 if ($value[
"from"]) {
706 $result[
$id][
"from"] = $value[
"from"]->get(
709 $result[
$id][
"from"] = substr(
710 $result[
$id][
"from"],
716 $result[
$id][
"to"] = $value[
"to"]->get(
719 $result[
$id][
"to"] = substr(
734 if ($a_obj_id === 0) {
738 $mode = $olp->getCurrentMode();
771 if ($a_user_id != $this->
user->getId()) {
774 $a_user = $this->user;
776 $user .=
", " . $a_user->getFullName(
784 ) .
": " . $this->ilObjDataCache->lookupTitle($a_obj_id) . $user
788 $this->setDescription(
789 $this->
lng->txt(
'trac_mode') .
": " . $olp->getModeText(
790 $olp->getCurrentMode()
794 $this->setTitle($this->
lng->txt($action));
805 $ilClientIniFile =
$DIC[
'ilClientIniFile'];
821 "trac_name_of_installation"
822 )] = $ilClientIniFile->readVariable(
'client',
'name');
827 )] = $this->ilObjDataCache->lookupTitle((
int) $this->obj_id);
829 $data[$this->
lng->txt(
"trac_object_link")] = ilLink::_getLink(
849 $data[$this->
lng->txt(
"trac_report_owner")] = $this->
user->getFullName(
857 foreach ($this->getExportMeta() as $caption => $value) {
858 $a_excel->
setCell($a_row, 0, $caption);
859 $a_excel->
setCell($a_row, 1, $value);
867 foreach ($this->getExportMeta() as $caption => $value) {
883 if ($timing_cache->isWarningRequired($a_user_id)) {
886 $timings[
'item'][
'changeable'] &&
887 ($timings[
'user'][$a_user_id] ??
false) &&
888 $timings[
'user'][$a_user_id][
'end']
890 $end = $timings[
'user'][$a_user_id][
'end'];
891 } elseif ($timings[
'item'][
'suggestion_end']) {
892 $end = $timings[
'item'][
'suggestion_end'];
903 bool $a_shorten_zero =
false
905 $seconds = ($seconds > 0) ? $seconds : 0;
906 if ($a_shorten_zero && !$seconds) {
910 $hours = floor($seconds / 3600);
911 $rest = $seconds % 3600;
913 $minutes = floor($rest / 60);
920 return sprintf(
"%dh%02dm", $hours, $minutes);
936 bool $a_anonymize =
false,
937 bool $a_format_seconds =
false
941 $step = $a_max_value / 10;
942 $base = ceil(log($step, 10));
943 $fac = ceil($step / pow(10, ($base - 1)));
944 $step = pow(10, $base - 1) * $fac;
949 $ticks = range(0, $a_max_value + $step, $step);
951 $value_ticks = array(0 => 0);
952 foreach ($ticks as $tick) {
953 $value = $tvalue = $tick;
955 $value = $this->anonymizeValue($value,
true);
956 $tvalue = $this->anonymizeValue($tvalue);
958 if ($a_format_seconds) {
959 $tvalue = $this->formatSeconds($value);
961 $value_ticks[$value] = $tvalue;
970 for ($loop = 0; $loop < 10; $loop++) {
971 $year = date(
"Y") - $loop;
973 for ($loop2 = 12; $loop2 > 0; $loop2--) {
974 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
975 if ($year . $month <= date(
"Ym")) {
977 $caption = $year .
" / " . $this->
lng->txt(
978 "month_" . $month .
"_long"
981 $caption = $year .
"/" . $month;
983 $options[$year .
"-" . $month] = $caption;
997 for ($loop = 1; $loop < 13; $loop++) {
998 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
999 if ($a_year .
"-" . $month <= date(
"Y-m")) {
1001 $caption = $this->
lng->txt(
"month_" . $month .
"_long");
1003 $caption = $this->
lng->txt(
"month_" . $month .
"_short");
1005 $all[$a_year .
"-" . $month] = $caption;
1012 int $a_in_course = 0,
1015 $cols = $privacy_fields = array();
1017 if ($a_in_course === 1) {
1018 $ufs = $this->
profile->getVisibleFields(Context::Course,
null, [AvailableSections::Interests]);
1019 } elseif ($a_in_group === 1) {
1022 $ufs = $this->
profile->getFields();
1026 $cols[
"login"] = array(
1027 "txt" => $this->
lng->txt(
"login"),
1031 if (!$this->anonymized) {
1032 $cols[
"firstname"] = array(
1033 "txt" => $this->
lng->txt(
"firstname"),
1036 $cols[
"lastname"] = array(
1037 "txt" => $this->
lng->txt(
"lastname"),
1044 if ($tracking->hasExtendedData(
1047 $cols[
"first_access"] = array(
1048 "txt" => $this->
lng->txt(
"trac_first_access"),
1051 $cols[
"last_access"] = array(
1052 "txt" => $this->
lng->txt(
"trac_last_access"),
1056 if ($tracking->hasExtendedData(
1059 $cols[
"read_count"] = array(
1060 "txt" => $this->
lng->txt(
"trac_read_count"),
1064 if ($tracking->hasExtendedData(
1068 $cols[
"spent_seconds"] = array(
1069 "txt" => $this->
lng->txt(
"trac_spent_seconds"),
1074 if ($this->isPercentageAvailable($this->obj_id)) {
1075 $cols[
"percentage"] = array(
1076 "txt" => $this->
lng->txt(
"trac_percentage"),
1083 if ($olp->isActive()) {
1084 $cols[
"status"] = array(
1085 "txt" => $this->
lng->txt(
"trac_status"),
1089 $cols[
'status_changed'] = array(
1090 'txt' => $this->
lng->txt(
'trac_status_changed'),
1096 $cols[
"mark"] = array(
1097 "txt" => $this->
lng->txt(
"trac_mark"),
1102 $cols[
"u_comment"] = array(
1103 "txt" => $this->
lng->txt(
"trac_comment"),
1107 $cols[
"create_date"] = array(
1108 "txt" => $this->
lng->txt(
"create_date"),
1111 $cols[
"language"] = array(
1112 "txt" => $this->
lng->txt(
"language"),
1117 if (!$this->anonymized &&
1118 ($a_in_course || $a_in_group)) {
1121 $a_in_group === 0 ? $a_in_course : $a_in_group
1124 foreach ($ufs as $fd) {
1125 if ($fd->isCustom()) {
1128 $f = $fd->getIdentifier();
1129 if (!isset($cols[
$f]) &&
$f !==
"username" && !$fd->hiddenInLists()) {
1131 "txt" => $fd->getLabel($this->lng),
1134 $privacy_fields[] =
$f;
1139 return array($cols, $privacy_fields);
1147 $users = $this->initUidFromPost();
1151 $this->
lng->loadLanguageModule(
'user');
1152 $this->main_tpl->setOnScreenMessage(
1155 'clipboard_user_added'
1166 return $this->icon_variant;
1174 $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, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)