19 declare(strict_types=1);
41 private bool $has_general_lp_access,
42 private bool $has_rbac_or_position_access
47 if ($lp->isActive()) {
48 $this->has_active_lp =
true;
51 $this->
setRowTemplate(
'tpl.statistics_table_row.html',
'Modules/Forum');
57 isset($column[
'sortable']) && $column[
'sortable'] ? $column[
'field'] :
'',
58 (ceil((100 / count($columns)))) .
'%' 62 if ($this->has_active_lp && $this->has_general_lp_access) {
63 $this->
lng->loadLanguageModule(
'trac');
87 'txt' => $this->
lng->txt(
'frm_statistics_ranking'),
92 'txt' => $this->
lng->txt(
'login'),
96 'field' =>
'lastname',
97 'txt' => $this->
lng->txt(
'lastname'),
101 'field' =>
'firstname',
102 'txt' => $this->
lng->txt(
'firstname'),
105 if ($this->has_active_lp && $this->has_general_lp_access) {
107 'field' =>
'progress',
108 'txt' => $this->
lng->txt(
'learning_progress'),
116 protected function fillRow(array $a_set): void
118 parent::fillRow($a_set);
122 if ($this->has_active_lp && $this->has_general_lp_access) {
123 if ($this->has_rbac_or_position_access || $this->actor->getId() === (
int) $a_set[
'usr_id']) {
124 $this->tpl->setCurrentBlock(
'val_lp');
126 case in_array($a_set[
'usr_id'], $this->completed,
false):
128 $this->tpl->setVariable(
134 case in_array($a_set[
'usr_id'], $this->in_progress,
false):
136 $this->tpl->setVariable(
142 case in_array($a_set[
'usr_id'], $this->failed,
false):
144 $this->tpl->setVariable(
152 $this->tpl->setVariable(
158 $this->tpl->parseCurrentBlock();
160 $this->tpl->touchBlock(
'no_lp');
167 return match ($a_field) {
const LP_STATUS_COMPLETED_NUM
Class ilForumStatisticsTableGUI.
enable(string $a_module_name)
const LP_STATUS_NOT_ATTEMPTED
static _lookupInProgressForObject(int $a_obj_id, ?array $a_user_ids=null)
const LP_STATUS_IN_PROGRESS_NUM
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
const LP_STATUS_IN_PROGRESS
static _lookupCompletedForObject(int $a_obj_id, ?array $a_user_ids=null)
__construct(ilObjForumGUI $a_parent_obj, string $a_parent_cmd, ilObjForum $forum, private ilObjUser $actor, private bool $has_general_lp_access, private bool $has_rbac_or_position_access)
setDefaultOrderField(string $a_defaultorderfield)
ilObjForumGUI: ilPermissionGUI, ilForumExportGUI, ilInfoScreenGUI ilObjForumGUI: ilColumnGUI...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
numericOrdering(string $a_field)
const LP_STATUS_NOT_ATTEMPTED_NUM
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)
static _lookupFailedForObject(int $a_obj_id, ?array $a_user_ids=null)
const LP_STATUS_COMPLETED
static getInstance(int $obj_id)
const LP_STATUS_FAILED_NUM