3 declare(strict_types=0);
    36         ?
object $a_parent_obj,
    38         array $a_preselect = null,
    39         bool $a_load_items = 
true    41         $this->preselected = $a_preselect;
    43         $this->
setId(
"lpobjstatdlytbl");
    47     public function init(): void
    53         $this->
addColumn($this->
lng->txt(
"trac_title"), 
"title");
    57             $column_definition = $all_columns[$col_name];
    59                 $column_definition[
'txt'],
    60                 $column_definition[
'sortable'] ? $column_definition[
'field'] : 
'',
    61                 $column_definition[
'width']
    64         for ($loop = 0; $loop < 24; $loop += 2) {
    66                 str_pad((
string) $loop, 2, 
"0", STR_PAD_LEFT) . 
":00-<br />" .
    67                 str_pad((
string) ($loop + 2), 2, 
"0", STR_PAD_LEFT) . 
":00 ",
    72         $this->
setTitle($this->
lng->txt(
"trac_object_stat_daily"));
    77             $this->
lng->txt(
"trac_show_graph")
    83             $this->
ctrl->getFormAction(
    84                 $this->getParentObject(),
    89             "tpl.lp_object_statistics_daily_row.html",
   109         $columns[
'obj_id'] = [
   111             'txt' => $this->
lng->txt(
'object_id'),
   117         $columns[
'reference_ids'] = [
   118             'field' => 
'reference_ids',
   119             'txt' => $this->
lng->txt(
'trac_reference_ids_column'),
   125         $columns[
'paths'] = [
   127             'txt' => $this->
lng->txt(
'trac_paths'),
   139         $alphabetic_ordering = [
   142         if (!in_array($a_field, $alphabetic_ordering)) {
   159         $si->readFromSession();
   160         if (!$si->getValue()) {
   161             $si->setValue(
"crs");
   163         $this->
filter[
"type"] = $si->getValue();
   167             $this->
lng->txt(
"trac_title_description"),
   170         $ti->setMaxLength(64);
   173         $ti->readFromSession();
   174         $this->
filter[
"query"] = $ti->getValue();
   179             array(
"read_count" => $this->
lng->txt(
"trac_read_count"),
   180                   "spent_seconds" => $this->
lng->txt(
"trac_spent_seconds")
   184         $si->readFromSession();
   185         if (!$si->getValue()) {
   186             $si->setValue(
"read_count");
   188         $this->
filter[
"measure"] = $si->getValue();
   192             $this->
lng->txt(
"year") . 
" / " . $this->
lng->txt(
"month"),
   197         $si->readFromSession();
   198         if (!$si->getValue()) {
   199             $si->setValue(date(
"Y-m"));
   201         $this->
filter[
"yearmonth"] = $si->getValue();
   210         if ($this->
filter[
"type"] != 
"prtf") {
   219             if ($this->
filter[
"type"] == 
"blog") {
   223                     $objects[$obj_id] = array($obj_id);
   231                 $objects[$obj_id] = array($obj_id);
   236             $yearmonth = explode(
"-", $this->
filter[
"yearmonth"]);
   237             if (
sizeof($yearmonth) == 1) {
   245                     (
string) $yearmonth[0],
   246                     (
string) $yearmonth[1]
   250             foreach ($stat_objects as $obj_id => $hours) {
   251                 $data[$obj_id][
"obj_id"] = $obj_id;
   255                 foreach ($hours as $hour => $values) {
   257                     $hour_transf = floor($hour / 2) * 2;
   258                     $data[$obj_id][
"hour" . $hour_transf] =
   259                         (
$data[$obj_id][
"hour" . $hour_transf] ?? 0) + (
int) $values[$this->
filter[
"measure"]];
   260                     $data[$obj_id][
"sum"] =
   261                         (
$data[$obj_id][
"sum"] ?? 0) + (
int) $values[$this->filter[
"measure"]];
   264                     $data[$obj_id][
"graph"][
"hour" . $hour] = $values[$this->filter[
"measure"]];
   269             foreach ($objects as $obj_id => $ref_ids) {
   270                 if (!isset(
$data[$obj_id])) {
   271                     $data[$obj_id][
"obj_id"] = $obj_id;
   283     protected function fillRow(array $a_set): void
   286         $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
   287         $this->tpl->setVariable(
   291         $this->tpl->setVariable(
"ICON_ALT", $this->
lng->txt($type));
   292         $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
   294         if ($this->preselected && in_array(
   298             $this->tpl->setVariable(
"CHECKBOX_STATE", 
" checked=\"checked\"");
   301         $this->tpl->setCurrentBlock(
"hour");
   302         for ($loop = 0; $loop < 24; $loop += 2) {
   303             $value = (
int) ($a_set[
"hour" . $loop] ?? 0);
   304             if ($this->
filter[
"measure"] != 
"spent_seconds") {
   309             $this->tpl->setVariable(
"HOUR_VALUE", $value);
   310             $this->tpl->parseCurrentBlock();
   313         if ($this->
filter[
"measure"] == 
"spent_seconds") {
   314             $sum = $this->
formatSeconds((
int) ($a_set[
"sum"] ?? 0), 
true);
   318         $this->tpl->setVariable(
"TOTAL", $sum);
   322             $this->tpl->setVariable(
'OBJ_ID_COL_VALUE', (
string) $a_set[
'obj_id']);
   325             $this->tpl->setVariable(
'REF_IDS', implode(
', ', $a_set[
'reference_ids']));
   329             foreach ($a_set[
'reference_ids'] as $reference_id) {
   331                 $path_gui->enableTextOnly(
false);
   332                 $path_gui->enableHideLeaf(
false);
   333                 $path_gui->setUseImages(
true);
   336             $this->tpl->setVariable(
'PATHS', implode(
'<br />', $paths));
   340     public function getGraph(array $a_graph_items): string
   347         $chart->setSize(
"700", 
"500");
   350         $chart->setLegend($legend);
   353         foreach ($this->
getData() as $object) {
   354             if (in_array($object[
"obj_id"], $a_graph_items)) {
   358                 for ($loop = 0; $loop < 24; $loop++) {
   359                     $value = (
int) ($object[
"graph"][
"hour" . $loop] ?? 0);
   360                     $max_value = max($max_value, $value);
   361                     if ($this->
filter[
"measure"] != 
"spent_seconds") {
   364                     $series->addPoint($loop, $value);
   367                 $chart->addData($series);
   373             ($this->
filter[
"measure"] != 
"spent_seconds"),
   374             ($this->
filter[
"measure"] == 
"spent_seconds")
   378         for ($loop = 0; $loop < 24; $loop++) {
   379             $labels[$loop] = str_pad((
string) $loop, 2, 
"0", STR_PAD_LEFT);
   381         $chart->setTicks($labels, $value_ticks, 
true);
   383         return $chart->getHTML();
   401             $a_excel->
setCell($a_row, ++$col, (
string) $a_set[
'obj_id']);
   404             $a_excel->
setCell($a_row, ++$col, implode(
', ', $a_set[
'reference_ids']));
   408             foreach ($a_set[
'reference_ids'] as $reference_id) {
   410                 $path_gui->enableTextOnly(
true);
   411                 $path_gui->enableHideLeaf(
false);
   412                 $path_gui->setUseImages(
false);
   419             $a_excel->
setCell($a_row, ++$col, substr(implode(
', ', $paths), 0, -1));
   422         for ($loop = 0; $loop < 24; $loop += 2) {
   423             $value = (
int) ($a_set[
"hour" . $loop] ?? 0);
   424             if ($this->
filter[
"measure"] != 
"spent_seconds") {
   428             $a_excel->
setCell($a_row, ++$col, $value);
   431         if ($this->
filter[
"measure"] == 
"spent_seconds") {
   434             $sum = (
int) ($a_set[
"sum"] ?? 0);
   438         $a_excel->
setCell($a_row, ++$col, $sum);
   454             $a_csv->
addColumn(implode(
', ', $a_set[
'reference_ids']));
   458             foreach ($a_set[
'reference_ids'] as $reference_id) {
   460                 $path_gui->enableTextOnly(
true);
   461                 $path_gui->enableHideLeaf(
false);
   462                 $path_gui->setUseImages(
false);
   469             $a_csv->
addColumn(substr(implode(
', ', $paths), 0, -1));
   472         for ($loop = 0; $loop < 24; $loop += 2) {
   473             $value = (
int) ($a_set[
"hour" . $loop] ?? 0);
   474             if ($this->
filter[
"measure"] != 
"spent_seconds") {
   481         if ($this->
filter[
"measure"] == 
"spent_seconds") {
   484             $sum = (
int) ($a_set[
"sum"] ?? 0);
 buildValueScale(int $a_max_value, bool $a_anonymize=false, bool $a_format_seconds=false)
 
Creates a path for a start and endnode. 
 
getPossibleTypes(bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
 
getCurrentFilter(bool $as_query=false)
 
getGraph(array $a_graph_items)
 
setExportFormats(array $formats)
Set available export formats. 
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
 
setEnableTitle(bool $a_enabletitle)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setResetCommand(string $a_val, string $a_caption="")
 
findReferencesForObjId(int $a_obj_id)
 
searchObjects(array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
Search objects that match current filters. 
 
fillMetaCSV(ilCSVWriter $a_csv)
 
fillRow(array $a_set)
Fill table row. 
 
setDisableFilterHiding(bool $a_val=true)
 
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value. 
 
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
 
static getObjectDailyStatistics(array $a_ref_ids, string $a_year, ?string $a_month=null)
 
__construct(?object $a_parent_obj, string $a_parent_cmd, array $a_preselect=null, bool $a_load_items=true)
Constructor. 
 
isForwardingToFormDispatcher()
 
anonymizeValue($a_value, bool $a_force_number=false)
 
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
 
isColumnSelected(string $col)
 
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector. 
 
static _lookupTitle(int $obj_id)
 
TableGUI class for learning progress. 
 
static getWorkspaceBlogs(?string $a_title=null)
 
setDefaultOrderField(string $a_defaultorderfield)
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
setFilterCommand(string $a_val, string $a_caption="")
 
setDefaultOrderDirection(string $a_defaultorderdirection)
 
formatSeconds(int $seconds, bool $a_shorten_zero=false)
 
fillMetaExcel(ilExcel $a_excel, int &$a_row)
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
initRepositoryFilter(array $filter)
 
numericOrdering(string $a_field)
 
setEnableNumInfo(bool $a_val)
 
getMonthsFilter($a_short=false)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static getPortfolios(?string $a_title=null)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
 
static _lookupType(int $id, bool $reference=false)
 
addMultiCommand(string $a_cmd, string $a_text)
 
setEnableHeader(bool $a_enableheader)
 
static getInstanceByType(int $a_type, string $a_id)