19 declare(strict_types=0);
43 ?
object $a_parent_obj,
46 ?array $obj_ids = null,
47 bool $details =
false,
49 bool $personal_only =
false,
50 ?
int $a_parent_id = null,
51 ?
int $a_parent_ref_id = null,
52 ?
int $lp_context = null
56 $ilCtrl = $DIC[
'ilCtrl'];
59 $this->tracked_user = $a_user;
62 $this->mode = (
int) $mode;
63 $this->parent_obj_id = (
int) $a_parent_id;
64 $this->lp_context = (
int) $lp_context;
68 $this->ref_id = (
int) $a_parent_ref_id;
71 $this->
setId(
"lpprgtbl");
75 if (!$this->details) {
76 $this->has_object_subitems =
true;
82 $this->
addColumn($this->
lng->txt(
"trac_title"),
"title",
"26%");
83 $this->
addColumn($this->
lng->txt(
"status"),
"status",
"7%");
85 $this->
lng->txt(
'trac_status_changed'),
90 $this->
lng->txt(
"trac_percentage"),
94 $this->
addColumn($this->
lng->txt(
"trac_mark"),
"",
"5%");
96 $this->
addColumn($this->
lng->txt(
"trac_mode"),
"",
"20%");
102 $this->
lng->txt(
"trac_learning_progress_of"),
109 $obj_ids || $this->details
115 $this->
lng->txt(
"trac_hide_selected")
119 $collection = $olp->getCollectionInstance();
124 $this->
addColumn($this->
lng->txt(
"trac_title"),
"title",
"31%");
125 $this->
addColumn($this->
lng->txt(
"status"),
"status",
"7%");
128 $this->
lng->loadLanguageModule(
'content');
129 $this->
addColumn($this->
lng->txt(
'cont_score'),
'score',
'10%');
130 } elseif ($this->has_object_subitems) {
132 $this->
lng->txt(
'trac_status_changed'),
137 $this->
lng->txt(
"trac_percentage"),
141 $this->
addColumn($this->
lng->txt(
"trac_mark"),
"",
"5%");
142 $this->
addColumn($this->
lng->txt(
"comment"),
"",
"10%");
143 $this->
addColumn($this->
lng->txt(
"trac_mode"),
"",
"20%");
150 $this->
ctrl->getFormActionByClass(get_class($this))
153 "tpl.lp_progress_list_row.html",
154 "components/ILIAS/Tracking" 162 if ($this->has_object_subitems) {
164 array(self::EXPORT_CSV, self::EXPORT_EXCEL)
169 if ($this->tracked_user) {
176 return $a_field ==
"percentage";
183 if (!$obj_ids && !$this->details) {
187 switch ($this->lp_context) {
203 $this->tracked_user->getId(),
207 ) as $obj_id => $status) {
209 unset($obj_ids[$obj_id]);
216 switch ($this->mode) {
219 $this->tracked_user->getId(),
227 $this->tracked_user->getId(),
236 if ($this->tracked_user) {
238 $this->tracked_user->getId(),
247 $this->tracked_user->getId(),
250 foreach (
$data as $idx => $item) {
251 if (!($item[
"status"] ??
false) && !($this->
filter[
"status"] ??
false) && !$this->details) {
264 foreach (
$data as $idx => $row) {
267 $data[$idx][
"percentage"] = -1;
274 protected function fillRow(array $a_set): void
276 if (!$this->details) {
277 $this->tpl->setCurrentBlock(
"column_checkbox");
278 $this->tpl->setVariable(
"OBJ_ID", $a_set[
"obj_id"]);
279 $this->tpl->parseCurrentBlock();
282 $this->tpl->setVariable(
286 $this->tpl->setVariable(
"ICON_ALT", $this->
lng->txt(
'obj_' . $a_set[
"type"]));
287 $this->tpl->setVariable(
"TITLE_TEXT", $a_set[
"title"]);
289 if ($a_set[
"offline"] ??
false) {
290 $this->tpl->setCurrentBlock(
"offline");
291 $this->tpl->setVariable(
"TEXT_STATUS", $this->
lng->txt(
"status"));
292 $this->tpl->setVariable(
"TEXT_OFFLINE", $this->
lng->txt(
"offline"));
293 $this->tpl->parseCurrentBlock();
297 $this->tpl->setVariable(
299 $icons->renderIconForStatus((
int) $a_set[
"status"])
303 $this->tpl->setVariable(
'SCORE_VAL', $a_set[
"score"]);
304 } elseif ($this->has_object_subitems) {
305 $this->tpl->setCurrentBlock(
"status_details");
307 $this->tpl->setVariable(
308 'STATUS_CHANGED_VAL',
311 $a_set[
'status_changed'],
318 $this->tpl->setVariable(
320 $olp->getModeText($a_set[
"u_mode"])
322 $this->tpl->setVariable(
"MARK_VALUE", $a_set[
"mark"]);
323 $this->tpl->setVariable(
"COMMENT_TEXT", $a_set[
"comment"]);
325 if ($a_set[
"percentage"] < 0) {
326 $this->tpl->setVariable(
"PERCENTAGE_VALUE",
"");
328 $this->tpl->setVariable(
330 sprintf(
"%d%%", $a_set[
"percentage"])
337 $this->tpl->setCurrentBlock(
"item_path");
338 foreach (
$path as $path_item) {
339 $this->tpl->setVariable(
"PATH_ITEM", $path_item);
340 $this->tpl->parseCurrentBlock();
344 $this->tpl->parseCurrentBlock();
351 $ref_id = $a_set[
"ref_ids"];
352 $ref_id = array_shift($ref_id);
355 $this->tracked_user->getId()
358 if ($timing !==
true) {
365 $this->tpl->setCurrentBlock(
'warning_img');
366 $this->tpl->setVariable(
369 'media/time_warn.svg' 372 $this->tpl->setVariable(
378 $this->tpl->parseCurrentBlock();
383 if (!$this->details) {
384 $this->tpl->setCurrentBlock(
"item_command");
385 $this->
ctrl->setParameterByClass(
390 $this->tpl->setVariable(
392 $this->
ctrl->getLinkTargetByClass(
397 $this->tpl->setVariable(
399 $this->
lng->txt(
'trac_hide')
401 $this->tpl->parseCurrentBlock();
404 if ($olp->getCollectionInstance() && $a_set[
"ref_ids"]) {
405 $ref_id = $a_set[
"ref_ids"];
406 $ref_id = array_shift($ref_id);
407 $this->
ctrl->setParameterByClass(
408 $this->
ctrl->getCmdClass(),
412 $this->tpl->setVariable(
414 $this->
ctrl->getLinkTargetByClass(
415 $this->ctrl->getCmdClass(),
419 $this->
ctrl->setParameterByClass(
420 $this->
ctrl->getCmdClass(),
424 $this->tpl->setVariable(
426 $this->
lng->txt(
'trac_subitems')
428 $this->tpl->parseCurrentBlock();
431 $this->tpl->setCurrentBlock(
"column_action");
432 $this->tpl->parseCurrentBlock();
439 $a_excel->
setCell($a_row, 0, $this->
lng->txt(
"type"));
440 $a_excel->
setCell($a_row, 1, $this->
lng->txt(
"trac_title"));
441 $a_excel->
setCell($a_row, 2, $this->
lng->txt(
"status"));
442 $a_excel->
setCell($a_row, 3, $this->
lng->txt(
"trac_status_changed"));
443 $a_excel->
setCell($a_row, 4, $this->
lng->txt(
"trac_percentage"));
444 $a_excel->
setCell($a_row, 5, $this->
lng->txt(
"trac_mark"));
445 $a_excel->
setCell($a_row, 6, $this->
lng->txt(
"comment"));
446 $a_excel->
setCell($a_row, 7, $this->
lng->txt(
"trac_mode"));
449 $a_excel->
setBold(
"A" . $a_row .
":H" . $a_row);
457 $a_excel->
setCell($a_row, 0, $this->
lng->txt(
'obj_' . $a_set[
"type"]));
458 $a_excel->
setCell($a_row, 1, $a_set[
"title"]);
471 $a_set[
'status_changed'],
477 $a_excel->
setCell($a_row, 4,
'-');
479 $a_excel->
setCell($a_row, 4, $a_set[
"percentage"] .
"%");
481 $a_excel->
setCell($a_row, 5, (
string) $a_set[
"mark"]);
482 $a_excel->
setCell($a_row, 6, (
string) $a_set[
"comment"]);
495 $a_csv->
addColumn($this->
lng->txt(
"trac_status_changed"));
506 $a_csv->
addColumn($this->
lng->txt(
'obj_' . $a_set[
"type"]));
516 $a_set[
'status_changed'],
526 $a_csv->
addColumn(sprintf(
"%d%%", $a_set[
"percentage"]));
528 $a_csv->
addColumn((
string) $a_set[
"mark"]);
529 $a_csv->
addColumn((
string) $a_set[
"comment"]);
const LP_STATUS_COMPLETED_NUM
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
static array 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,)
getCurrentFilter(bool $as_query=false)
static getLPMemberships(int $usr_id, array $obj_ids, ?int $parent_ref_id=null, bool $mapped_ref_ids=false)
Get all objects where given user is member (from LP POV)
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)
static getSubItemsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_item_ids)
Get subitems status.
static getObjectivesStatusForUser(int $a_user_id, int $a_obj_id, array $a_objective_ids)
setEnableTitle(bool $a_enabletitle)
fillHeaderCSV(ilCSVWriter $a_csv)
buildPath(array $ref_ids)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
searchObjects(array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
Search objects that match current filters.
static getSCOsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_sco_ids)
const LP_MODE_COLLECTION_MANUAL
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
bool $has_object_subitems
static resetToDefaults()
reset to defaults
const LP_MODE_COLLECTION_TLT
__construct(?object $a_parent_obj, string $a_parent_cmd, ?ilObjUser $a_user=null, ?array $obj_ids=null, bool $details=false, ?int $mode=null, bool $personal_only=false, ?int $a_parent_id=null, ?int $a_parent_ref_id=null, ?int $lp_context=null)
Constructor.
TableGUI class for learning progress.
LP collection of repository objects.
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setBold(string $a_coords)
Set cell(s) to bold.
TableGUI class for learning progress.
setDefaultOrderField(string $a_defaultorderfield)
isPercentageAvailable(int $a_obj_id)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setDefaultOrderDirection(string $a_defaultorderdirection)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
const LP_CONTEXT_ORG_UNIT
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true, bool $show_type_filter=true)
Init filter.
static getObjectsStatusForUser(int $a_user_id, array $obj_refs)
setEnableNumInfo(bool $a_val)
const LP_MODE_COLLECTION_MOBS
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
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 isObjectOffline(int $a_obj_id, string $a_type='')
showTimingsWarning(int $a_ref_id, int $a_user_id)
addMultiCommand(string $a_cmd, string $a_text)
static getInstance(int $obj_id)
setEnableHeader(bool $a_enableheader)
fillHeaderExcel(ilExcel $a_excel, int &$a_row)
numericOrdering(string $a_field)
static _mode2Text(int $a_mode)