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"),
115 $cols[
"percentage"] = array(
116 "txt" => $lng->txt(
"trac_percentage"),
119 $cols[
"status"] = array(
120 "txt" => $lng->txt(
"trac_status"),
122 $cols[
"mark"] = array(
123 "txt" => $lng->txt(
"trac_mark"),
125 $cols[
"u_comment"] = array(
126 "txt" => $lng->txt(
"trac_comment"),
143 include_once(
"./Services/Tracking/classes/class.ilTrQuery.php");
155 $this->filter[
"view_mode"]);
157 if (count($tr_data[
"set"]) == 0 && $this->
getOffset() > 0)
170 $this->filter[
"view_mode"]);
174 foreach($tr_data[
"set"] as $idx =>
$row)
177 !$rbacsystem->checkAccess(
"read_learning_progress",
$row[
"ref_id"]))
179 foreach(array_keys(
$row) as $col_id)
181 if(!in_array($col_id, array(
"type",
"obj_id",
"ref_id",
"title",
"sort_title")))
183 $tr_data[
"set"][$idx][$col_id] = null;
186 $tr_data[
"set"][$idx][
"privacy_conflict"] =
true;
197 foreach($tr_data[
"set"] as $idx =>
$row)
199 if(
$row[
'obj_id'] == $this->obj_id)
203 else if(isset(
$row[
"sort_title"]))
205 $set[strtolower(
$row[
"sort_title"]).
"__".$idx] =
$row;
209 $set[strtolower(
$row[
"title"]).
"__".$idx] =
$row;
212 unset($tr_data[
"set"]);
221 $set = array_values($set);
224 array_unshift($set, $parent);
231 $this->
setData($tr_data[
"set"]);
243 include_once
'./Services/Object/classes/class.ilObjectLP.php';
245 $collection = $olp->getCollectionInstance();
248 include_once(
"./Services/Form/classes/class.ilSubEnabledFormPropertyGUI.php");
249 include_once(
"./Services/Table/interfaces/interface.ilTableFilterItem.php");
252 include_once(
"./Services/Form/classes/class.ilRadioGroupInputGUI.php");
253 include_once(
"./Services/Form/classes/class.ilRadioOption.php");
256 $ti->addOption(
new ilRadioOption($lng->txt(
"trac_view_mode_collection"),
"coll"));
258 $ti->readFromSession();
259 $this->filter[
"view_mode"] = $ti->getValue();
272 $data[
"percentage"] = NULL;
277 if(!
$data[
"privacy_conflict"])
279 $val = (trim(
$data[$c]) ==
"")
283 if (
$data[$c] !=
"" || $c ==
"status")
296 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
301 if(
$data[
"type"] !=
"lobj" &&
$data[
"type"] !=
"sco")
314 $this->tpl->setCurrentBlock(
'warning_img');
316 $this->tpl->setVariable(
'WARNING_ALT', $this->lng->txt(
'trac_time_passed').$timing);
317 $this->tpl->parseCurrentBlock();
322 case "spent_seconds":
323 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
328 $val =
$data[$c].
"%";
333 if ($c ==
"mark" && in_array($this->type, array(
"lm",
"dbk")))
337 if ($c ==
"spent_seconds" && in_array($this->type, array(
"exc")))
341 if ($c ==
"percentage" &&
342 (in_array(strtolower($this->status_class),
343 array(
"illpstatusmanual",
"illpstatusscormpackage",
"illpstatustestfinished")) ||
344 $this->type ==
"exc"))
354 $this->tpl->setCurrentBlock(
"user_field");
355 $this->tpl->setVariable(
"VAL_UF", $val);
356 $this->tpl->parseCurrentBlock();
359 if(
$data[
"privacy_conflict"])
361 $this->tpl->setCurrentBlock(
"permission_bl");
362 $this->tpl->setVariable(
"TXT_NO_PERMISSION", $lng->txt(
"status_no_permission"));
363 $this->tpl->parseCurrentBlock();
366 if(
$data[
"title"] ==
"")
368 $data[
"title"] =
"--".$lng->txt(
"none").
"--";
371 $this->tpl->setVariable(
"ICON_ALT", $lng->txt(
$data[
"type"]));
373 if(in_array(
$data[
'type'], array(
'fold',
'grp')) &&
$data[
'obj_id'] != $this->obj_id)
375 if(
$data[
'type'] ==
'fold')
377 $object_gui =
'ilobjfoldergui';
381 $object_gui =
'ilobjgroupgui';
383 $this->tpl->setCurrentBlock(
'title_linked');
386 if(
$_GET[
"baseClass"] !=
"ilPersonalDesktopGUI" &&
$_GET[
"baseClass"] !=
"ilAdministrationGUI")
388 $old = $ilCtrl->getParameterArrayByClass(
'illplistofobjectsgui');
389 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'ref_id',
$data[
"ref_id"]);
390 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'details_id',
$data[
"ref_id"]);
391 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'user_id', $this->user_id);
392 $url = $ilCtrl->getLinkTargetByClass(array(
'ilrepositorygui', $object_gui,
'illearningprogressgui',
'illplistofobjectsgui'),
'userdetails');
393 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'ref_id', $old[
"ref_id"]);
394 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'details_id', $old[
"details_id"]);
395 $ilCtrl->setParameterByClass(
'illplistofobjectsgui',
'user_id', $old[
"user_id"]);
402 $this->tpl->setVariable(
"URL_TITLE", $url);
403 $this->tpl->setVariable(
"VAL_TITLE",
$data[
"title"]);
404 $this->tpl->parseCurrentBlock();
408 $this->tpl->setCurrentBlock(
'title_plain');
409 $this->tpl->setVariable(
"VAL_TITLE",
$data[
"title"]);
410 $this->tpl->parseCurrentBlock();
414 if(
$data[
"ref_id"] &&
415 $rbacsystem->checkAccess(
'edit_learning_progress',
$data[
"ref_id"]))
419 $this->tpl->setCurrentBlock(
"item_command");
420 $ilCtrl->setParameterByClass(
"illplistofobjectsgui",
"userdetails_id",
$data[
"ref_id"]);
421 $this->tpl->setVariable(
"HREF_COMMAND", $ilCtrl->getLinkTargetByClass(
"illplistofobjectsgui",
'edituser'));
422 $this->tpl->setVariable(
"TXT_COMMAND", $lng->txt(
'edit'));
423 $ilCtrl->setParameterByClass(
"illplistofobjectsgui",
"userdetails_id",
"");
424 $this->tpl->parseCurrentBlock();
431 $worksheet->write($a_row, 0, $this->lng->txt(
"type"));
432 $worksheet->write($a_row, 1, $this->lng->txt(
"title"));
438 $worksheet->write($a_row, $cnt, $labels[$c][
"txt"]);
445 $worksheet->write($a_row, 0, $this->lng->txt($a_set[
"type"]));
446 $worksheet->write($a_row, 1, $a_set[
"title"]);
453 $val = $this->
parseValue($c, $a_set[$c],
"user");
459 $worksheet->write($a_row, $cnt, $val);
466 $a_csv->addColumn($this->lng->txt(
"type"));
467 $a_csv->addColumn($this->lng->txt(
"title"));
472 $a_csv->addColumn($labels[$c][
"txt"]);
480 $a_csv->addColumn($this->lng->txt($a_set[
"type"]));
481 $a_csv->addColumn($a_set[
"title"]);
487 $val = $this->
parseValue($c, $a_set[$c],
"user");
493 $a_csv->addColumn($val);