3 declare(strict_types=0);
37 $this->cronManager = $DIC->cron()->manager();
42 if ($this->
http->wrapper()->query()->has(
'ref_id')) {
43 $this->ref_id = $this->
http->wrapper()->query()->retrieve(
53 if ($this->
http->wrapper()->post()->has(
'item_id')) {
54 return $this->
http->wrapper()->post()->retrieve(
57 $this->
refinery->kindlyTo()->string()
66 $this->tabs_gui->addSubTab(
67 'trac_object_stat_access',
68 $this->
lng->txt(
'trac_object_stat_access'),
69 $this->
ctrl->getLinkTarget($this,
'accessFilter')
71 $this->tabs_gui->addSubTab(
72 'trac_object_stat_daily',
73 $this->
lng->txt(
'trac_object_stat_daily'),
74 $this->
ctrl->getLinkTarget($this,
'dailyFilter')
76 $this->tabs_gui->addSubTab(
77 'trac_object_stat_lp',
78 $this->
lng->txt(
'trac_object_stat_lp'),
79 $this->
ctrl->getLinkTarget($this,
'learningProgressFilter')
81 $this->tabs_gui->addSubTab(
82 'trac_object_stat_types',
83 $this->
lng->txt(
'trac_object_stat_types'),
84 $this->
ctrl->getLinkTarget($this,
'typesFilter')
87 if ($this->rbacsystem->checkAccess(
"visible,read", $this->ref_id)) {
88 $this->tabs_gui->addSubTab(
89 'trac_object_stat_admin',
90 $this->
lng->txt(
'trac_object_stat_admin'),
91 $this->
ctrl->getLinkTarget($this,
'admin')
98 $this->
ctrl->setReturn($this,
"");
101 switch ($this->
ctrl->getNextClass()) {
102 case "illpobjectstatisticstablegui":
109 $this->
ctrl->forwardCommand($lp_table);
112 case "illpobjectstatisticsdailytablegui":
119 $this->
ctrl->forwardCommand($lp_table);
122 case "illpobjectstatisticslptablegui":
129 $this->
ctrl->forwardCommand($lp_table);
146 $lp_table->resetOffset();
147 $lp_table->writeFilterToSession();
159 $lp_table->resetOffset();
160 $lp_table->resetFilter();
169 public function access(
bool $a_load_data =
true): void
171 $this->tabs_gui->activateSubTab(
'trac_object_stat_access');
180 $lp_table->getItems();
182 $lp_table->disable(
"content");
183 $lp_table->disable(
"header");
185 $this->tpl->setContent($lp_table->getHTML());
191 $this->tpl->setOnScreenMessage(
193 $this->
lng->txt(
"no_checkbox")
198 $this->tabs_gui->activateSubTab(
'trac_object_stat_access');
205 $lp_table->getItems();
206 $this->tpl->setContent(
208 $this->initItemIdFromPost()
209 ) . $lp_table->getHTML()
221 $lp_table->resetOffset();
222 $lp_table->writeFilterToSession();
234 $lp_table->resetOffset();
235 $lp_table->resetFilter();
244 public function types(
bool $a_load_data =
true): void
246 $this->tabs_gui->activateSubTab(
'trac_object_stat_types');
257 $lp_table->disable(
"content");
258 $lp_table->disable(
"header");
261 $this->tpl->setContent($lp_table->getHTML());
267 $this->tpl->setOnScreenMessage(
269 $this->
lng->txt(
"no_checkbox")
275 $this->tabs_gui->activateSubTab(
'trac_object_stat_types');
283 $this->tpl->setContent(
285 $this->initItemIdFromPost()
286 ) . $lp_table->getHTML()
298 $lp_table->resetOffset();
299 $lp_table->writeFilterToSession();
311 $lp_table->resetOffset();
312 $lp_table->resetFilter();
321 public function daily(
bool $a_load_data =
true): void
323 $this->tabs_gui->activateSubTab(
'trac_object_stat_daily');
335 $lp_table->getItems();
337 $lp_table->disable(
"content");
338 $lp_table->disable(
"header");
340 $this->tpl->setContent($lp_table->getHTML());
346 $this->tpl->setOnScreenMessage(
348 $this->
lng->txt(
"no_checkbox")
354 $this->tabs_gui->activateSubTab(
'trac_object_stat_daily');
362 $lp_table->getItems();
363 $this->tpl->setContent(
365 $this->initItemIdFromPost()
366 ) . $lp_table->getHTML()
372 $this->tabs_gui->activateSubTab(
'trac_object_stat_admin');
376 if ($this->rbacsystem->checkAccess(
'write', $this->ref_id)) {
378 $this->
lng->txt(
"trac_sync_obj_stats"),
379 $this->
ctrl->getLinkTarget($this,
"adminSync")
383 if ($this->
access->checkAccess(
"delete",
"", $this->ref_id)) {
385 $this->tpl->setContent($lp_table->getHTML());
393 $this->tpl->setOnScreenMessage(
396 "trac_sync_obj_stats_success" 400 $this->
ctrl->redirect($this,
"admin");
406 $this->tpl->setOnScreenMessage(
408 $this->
lng->txt(
"no_checkbox")
414 $this->tabs_gui->clearTargets();
415 $this->tabs_gui->setBackTarget(
416 $this->
lng->txt(
"back"),
417 $this->
ctrl->getLinkTarget($this,
"admin")
422 $cgui->setFormAction($this->
ctrl->getFormAction($this));
423 $cgui->setHeaderText($this->
lng->txt(
"trac_sure_delete_data"));
424 $cgui->setCancel($this->
lng->txt(
"cancel"),
"admin");
425 $cgui->setConfirm($this->
lng->txt(
"delete"),
"deleteData");
429 $caption = $this->
lng->txt(
437 " " . substr(
$i, 0, 4);
439 $cgui->addItem(
"item_id[]",
$i, $caption);
442 $this->tpl->setContent($cgui->getHTML());
448 $this->tpl->setOnScreenMessage(
450 $this->
lng->txt(
"no_checkbox")
457 $this->tpl->setOnScreenMessage(
459 $this->
lng->txt(
"trac_data_deleted")
472 $lp_table->resetOffset();
473 $lp_table->writeFilterToSession();
485 $lp_table->resetOffset();
486 $lp_table->resetFilter();
497 $this->tabs_gui->activateSubTab(
'trac_object_stat_lp');
508 $lp_table->loadItems();
510 $lp_table->disable(
"content");
511 $lp_table->disable(
"header");
513 $this->tpl->setContent($lp_table->getHTML());
519 $this->tpl->setOnScreenMessage(
521 $this->
lng->txt(
"no_checkbox")
527 $this->tabs_gui->activateSubTab(
'trac_object_stat_lp');
535 $lp_table->loadItems();
536 $this->tpl->setContent(
538 $this->initItemIdFromPost()
539 ) . $lp_table->getHTML()
546 if ($this->
http->wrapper()->query()->has(
'item_id')) {
547 $item_id = $this->
http->wrapper()->query()->retrieve(
554 "showLearningProgressDetails",
560 $lp_table->loadItems();
562 "tpl.lp_object_statistics_lp_details.html",
567 $a_tpl->setVariable(
"CONTENT", $lp_table->getHTML());
568 $a_tpl->setVariable(
'CLOSE_IMG_TXT', $this->
lng->txt(
'close'));
581 if ($a_show_link && $this->
access->checkAccess(
586 $link =
" <a href=\"" . $this->
ctrl->getLinkTarget(
590 $this->
lng->txt(
"trac_log_info_link") .
"</a>";
593 $this->tpl->setOnScreenMessage(
607 if (!$this->cronManager->isJobActive(
"lp_object_statistics")) {
608 $this->tpl->setOnScreenMessage(
610 $this->
lng->txt(
"trac_cron_info")
ilCronManager $cronManager
applyLearningProgressFilter()
types(bool $a_load_data=true)
daily(bool $a_load_data=true)
showLearningProgressDetails()
access(bool $a_load_data=true)
resetLearningProgressFilter()
static deleteObjectStatistics(array $a_months)
TableGUI class for learning progress.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _syncObjectStats(?int $a_now=null, int $a_minimum=20000)
learningProgress(bool $a_load_data=true)
static http()
Fetches the global http state from ILIAS.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(int $a_mode, int $a_ref_id=0)
showAggregationInfo(bool $a_show_link=true)
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showLearningProgressGraph()
static getObjectStatisticsLogInfo()
Get last update info for object statistics.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...