4 include_once(
"./Services/Tracking/classes/class.ilLPTableBaseGUI.php");
20 function __construct($a_parent_obj, $a_parent_cmd, $a_user_id, $a_obj_id, $a_ref_id, $a_print_view =
false)
24 $this->
setId(
"truop");
25 $this->user_id = $a_user_id;
26 $this->obj_id = $a_obj_id;
27 $this->ref_id = $a_ref_id;
32 $this->
parseTitle($this->obj_id,
"details", $this->user_id);
39 $this->
addColumn($this->lng->txt(
"title"),
"title");
44 if (in_array($l, array(
"last_access",
"first_access",
"read_count",
"spent_seconds",
"mark",
"status",
"percentage")))
48 if ($l ==
"u_comment")
52 $this->
addColumn($this->lng->txt($l), $c);
57 $this->
addColumn($this->lng->txt(
"actions"),
"");
63 $this->
setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
64 $this->
setRowTemplate(
"tpl.user_objects_props_row.html",
"Services/Tracking");
90 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
94 $cols[
"first_access"] = array(
95 "txt" => $lng->txt(
"trac_first_access"),
97 $cols[
"last_access"] = array(
98 "txt" => $lng->txt(
"trac_last_access"),
103 $cols[
"read_count"] = array(
104 "txt" => $lng->txt(
"trac_read_count"),
109 $cols[
"spent_seconds"] = array(
110 "txt" => $lng->txt(
"trac_spent_seconds"),
114 $cols[
"percentage"] = array(
115 "txt" => $lng->txt(
"trac_percentage"),
117 $cols[
"status"] = array(
118 "txt" => $lng->txt(
"trac_status"),
120 $cols[
"mark"] = array(
121 "txt" => $lng->txt(
"trac_mark"),
123 $cols[
"u_comment"] = array(
124 "txt" => $lng->txt(
"trac_comment"),
141 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
153 $this->filter[
"view_mode"]);
155 if (count($tr_data[
"set"]) == 0 && $this->
getOffset() > 0)
168 $this->filter[
"view_mode"]);
178 foreach($tr_data[
"set"] as $idx =>
$row)
180 if(
$row[
'obj_id'] == $this->obj_id)
184 else if(isset(
$row[
"sort_title"]))
186 $set[strtolower(
$row[
"sort_title"]).
"__".$idx] =
$row;
190 $set[strtolower(
$row[
"title"]).
"__".$idx] =
$row;
193 unset($tr_data[
"set"]);
202 $set = array_values($set);
205 array_unshift($set, $parent);
212 $this->
setData($tr_data[
"set"]);
224 include_once
'Services/Tracking/classes/class.ilLPCollectionCache.php';
228 $result[] = $child_id;
242 include_once
"Services/Tracking/classes/class.ilLPObjSettings.php";
249 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
250 include_once(
"./Services/Table/interfaces/interface.ilTableFilterItem.php");
253 include_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
254 include_once(
"./Services/Form/classes/class.ilRadioOption.php");
257 $ti->addOption(
new ilRadioOption($lng->txt(
"trac_view_mode_collection"),
"coll"));
259 $ti->readFromSession();
260 $this->filter[
"view_mode"] = $ti->getValue();
273 $data[
"percentage"] = NULL;
278 $val = (trim(
$data[$c]) ==
"")
282 if (
$data[$c] !=
"" || $c ==
"status")
295 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
300 if(
$data[
"type"] !=
"lobj" &&
$data[
"type"] !=
"sco")
313 $this->tpl->setCurrentBlock(
'warning_img');
315 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
316 $this->tpl->parseCurrentBlock();
321 case "spent_seconds":
322 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
327 $val =
$data[$c].
"%";
332 if ($c ==
"mark" && in_array($this->type, array(
"lm",
"dbk")))
336 if ($c ==
"spent_seconds" && in_array($this->type, array(
"exc")))
340 if ($c ==
"percentage" &&
341 (in_array(strtolower($this->status_class),
342 array(
"illpstatusmanual",
"illpstatusscormpackage",
"illpstatustestfinished")) ||
343 $this->type ==
"exc"))
348 $this->tpl->setCurrentBlock(
"user_field");
349 $this->tpl->setVariable(
"VAL_UF", $val);
350 $this->tpl->parseCurrentBlock();
353 if(
$data[
"title"] ==
"")
355 $data[
"title"] =
"--".$lng->txt(
"none").
"--";
358 $this->tpl->setVariable(
"ICON_ALT", $lng->txt(
$data[
"type"]));
360 if(in_array(
$data[
'type'], array(
'fold',
'grp')) &&
$data[
'obj_id'] != $this->obj_id)
362 if(
$data[
'type'] ==
'fold')
364 $object_gui =
'ilobjfoldergui';
368 $object_gui =
'ilobjgroupgui';
370 $this->tpl->setCurrentBlock(
'title_linked');
373 if(
$_GET[
"baseClass"] !=
"ilPersonalDesktopGUI" &&
$_GET[
"baseClass"] !=
"ilAdministrationGUI")
375 $old = $ilCtrl->getParameterArrayByClass(
'illplistofobjectsgui');
376 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'ref_id',
$data[
"ref_id"]);
377 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'details_id',
$data[
"ref_id"]);
378 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'user_id', $this->user_id);
379 $url = $ilCtrl->getLinkTargetByClass(array(
'ilrepositorygui', $object_gui,
'illearningprogressgui',
'illplistofobjectsgui'),
'userdetails');
380 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'ref_id', $old[
"ref_id"]);
381 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'details_id', $old[
"details_id"]);
382 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'user_id', $old[
"user_id"]);
389 $this->tpl->setVariable(
"URL_TITLE", $url);
390 $this->tpl->setVariable(
"VAL_TITLE",
$data[
"title"]);
391 $this->tpl->parseCurrentBlock();
395 $this->tpl->setCurrentBlock(
'title_plain');
396 $this->tpl->setVariable(
"VAL_TITLE",
$data[
"title"]);
397 $this->tpl->parseCurrentBlock();
402 $this->tpl->setCurrentBlock(
"item_command");
403 $ilCtrl->setParameterByClass(
"illplistofobjectsgui",
"userdetails_id",
$data[
"ref_id"]);
404 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass(
"illplistofobjectsgui",
'edituser'));
405 $this->tpl->setVariable(
"TXT_COMMAND", $lng->txt(
'edit'));
406 $ilCtrl->setParameterByClass(
"illplistofobjectsgui",
"userdetails_id",
"");
407 $this->tpl->parseCurrentBlock();
413 $worksheet->write($a_row, 0, $this->lng->txt(
"type"));
414 $worksheet->write($a_row, 1, $this->lng->txt(
"title"));
420 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
427 $worksheet->write($a_row, 0, $this->lng->txt($a_set[
"type"]));
428 $worksheet->write($a_row, 1, $a_set[
"title"]);
435 $val = $this->
parseValue($c, $a_set[$c],
"user");
441 $worksheet->write($a_row, $cnt, $val);
448 $a_csv->addColumn($this->lng->txt(
"type"));
449 $a_csv->addColumn($this->lng->txt(
"title"));
454 $a_csv->addColumn($labels[$c][
"txt"]);
462 $a_csv->addColumn($this->lng->txt($a_set[
"type"]));
463 $a_csv->addColumn($a_set[
"title"]);
469 $val = $this->
parseValue($c, $a_set[$c],
"user");
475 $a_csv->addColumn($val);