4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
19 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
24 $this->lng->loadLanguageModule(
"meta");
33 if(!$ilCtrl->getNextClass($this))
37 switch($ilCtrl->getCmd())
50 $to_hide =
$_POST[
"item_id"];
54 $to_hide = array((
int)
$_GET[
"hide"]);
67 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
68 $obj->setValue($value);
69 $obj->writeToSession();
72 if(isset(
$_POST[
"tbltplcrt"]))
74 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt",
$_POST[
"tbltplcrt"]);
76 if(isset(
$_POST[
"tbltpldel"]))
78 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel",
$_POST[
"tbltpldel"]);
81 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
99 global $ilObjDataCache;
106 include_once
'./Services/Search/classes/class.ilQueryParser.php';
109 $query_parser->setMinWordLength(0);
111 $query_parser->parse();
112 if(!$query_parser->validate())
118 if($filter[
"type"] ==
"lres")
120 $filter[
"type"] = array(
'lm',
'sahs',
'htlm',
'dbk');
124 $filter[
"type"] = array($filter[
"type"]);
127 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
129 $object_search->setFilter($filter[
"type"]);
132 $object_search->setIdFilter($preset_obj_ids);
134 $res =& $object_search->performSearch();
135 $res->setRequiredPermission($permission);
136 $res->setMaxHits(1000);
137 $res->addObserver($this,
"searchFilterListener");
139 if(!$this->filter[
"area"])
141 $res->filter(ROOT_FOLDER_ID,
false);
145 $res->filter($this->filter[
"area"],
false);
149 foreach(
$res->getResults() as $obj_data)
151 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
155 $this->limit_reached =
$res->isLimitReached();
157 return $objects ? $objects : array();
167 if(is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"]))
184 public function initFilter($a_split_learning_resources =
false)
186 global
$lng, $ilObjDataCache;
191 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
195 $si->readFromSession();
198 $si->setValue(
"crs");
200 $this->filter[
"type"] = $si->getValue();
203 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
206 $msi->readFromSession();
207 $this->filter[
"hide"] = $msi->getValue();
208 if($this->filter[
"hide"])
212 $type = $types[
"type"];
216 $type = array(
'lm',
'sahs',
'htlm',
'dbk');
220 $type = array($type);
222 foreach($this->filter[
"hide"] as $obj_id)
224 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
226 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
229 $msi->setOptions($options);
233 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
234 $ti =
new ilTextInputGUI($lng->txt(
"trac_title_description"),
"query");
238 $ti->readFromSession();
239 $this->filter[
"query"] = $ti->getValue();
242 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
246 $rs->readFromSession();
247 $this->filter[
"area"] = $rs->getValue();
258 protected function buildPath($ref_ids, $as_link =
true, $only_parents =
false)
262 include_once
'classes/class.ilLink.php';
274 $path_full = $tree->getPathFull($ref_id);
275 foreach($path_full as
$data)
277 if(++$counter < (count($path_full)-1))
281 if($ref_id != $data[
'ref_id'] || !$only_parents)
283 $path .=
" » ";
284 if($ref_id != $data[
'ref_id'] || !$as_link)
286 $path .= $data[
'title'];
290 $path .= (
'<a target="_top" href="'.
292 $data[
'title'].
'</a>');
309 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
315 if($a_split_learning_resources)
317 $options[
'lm'] = $lng->txt(
'objs_lm');
318 $options[
'sahs'] = $lng->txt(
'objs_sahs');
319 $options[
'htlm'] = $lng->txt(
'objs_htlm');
321 if($a_include_digilib)
323 $options[
'dbk'] = $lng->txt(
'objs_dbk');
328 $options[
'lres'] = $lng->txt(
'learning_resources');
331 $options[
'crs'] = $lng->txt(
'objs_crs');
332 $options[
'grp'] = $lng->txt(
'objs_grp');
333 $options[
'exc'] = $lng->txt(
'objs_exc');
334 $options[
'tst'] = $lng->txt(
'objs_tst');
336 if($a_allow_undefined_lp)
338 $options[
"file"] = $lng->txt(
"objs_file");
339 $options[
"webr"] = $lng->txt(
"objs_webr");
340 $options[
"wiki"] = $lng->txt(
"objs_wiki");
352 $pos = strrpos($id,
"_");
355 $function = strtoupper(substr($id, $pos+1));
356 if(in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")))
358 $id = substr($id, 0, $pos);
362 if(trim($value) ==
"" && $id !=
"status")
364 if($id ==
"title" && get_class($this) !=
"ilTrObjectUsersPropsTableGUI")
366 return "--".$lng->txt(
"none").
"--";
375 case 'status_changed':
387 case "spent_seconds":
388 if(in_array($type, array(
"exc")))
394 include_once(
"./classes/class.ilFormat.php");
416 if(in_array($type, array(
"lm",
"dbk")))
423 $value = $lng->txt(
"gender_".$value);
427 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
434 $value = $lng->txt(
"lang_".$value);
438 $value = $lng->txt(
"meta_c_".$value);
448 foreach($this->filter as $id => $value)
469 case "matriculation":
491 case "spent_seconds":
492 if(is_array($value) && implode(
"", $value))
503 case 'status_changed':
509 $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8).
"00:00:00";
514 $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8).
"23:59:59";
526 include_once(
"./Services/Tracking/classes/class.ilLPObjSettings.php");
536 protected function parseTitle($a_obj_id, $action, $a_user_id =
false)
538 global
$lng, $ilObjDataCache, $ilUser;
543 if($a_user_id != $ilUser->getId())
551 $user .=
", ".$a_user->getFullName();
554 if($a_obj_id != ROOT_FOLDER_ID)
556 $this->
setTitle($lng->txt($action).
": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
561 $this->
setTitle($lng->txt($action));
572 global
$lng, $ilObjDataCache, $ilUser, $ilClientIniFile;
585 include_once
'./classes/class.ilLink.php';
588 $lng->txt(
"trac_name_of_installation") => $ilClientIniFile->readVariable(
'client',
'name'),
589 $lng->txt(
"trac_object_name") => $ilObjDataCache->lookupTitle($this->obj_id),
592 $lng->txt(
"trac_report_date") =>
594 $lng->txt(
"trac_report_owner") => $ilUser->getFullName()
603 $worksheet->write($a_row, 0, $caption);
604 $worksheet->write($a_row, 1, $value);
614 $a_csv->addColumn(strip_tags($caption));
615 $a_csv->addColumn(strip_tags($value));
623 include_once
'Modules/Course/classes/Timings/class.ilTimingCache.php';
627 if($timings[
'item'][
'changeable'] and $timings[
'user'][$a_usr_id][
'end'])
629 $end = $timings[
'user'][$a_usr_id][
'end'];
631 else if ($timings[
'item'][
'suggestion_end'])
633 $end = $timings[
'item'][
'suggestion_end'];
645 $seconds = $seconds ? $seconds : 0;
646 if($a_shorten_zero && !$seconds)
651 $hours = floor($seconds / 3600);
652 $rest = $seconds % 3600;
654 $minutes = floor(
$rest / 60);
662 return sprintf(
"%dh%02dm",$hours,$minutes);
670 if(is_numeric($a_value))
673 $a_value = (int)$a_value;
674 if($a_value <= $threshold)
678 return "0-".$threshold;
689 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
694 $step = $a_max_value / 10;
695 $base = ceil(log($step, 10));
696 $fac = ceil($step / pow(10, (
$base - 1)));
697 $step = pow(10,
$base - 1) * $fac;
703 $ticks = range(0, $a_max_value+$step, $step);
705 $value_ticks = array(0 => 0);
706 foreach($ticks as $tick)
708 $value = $tvalue = $tick;
714 if($a_format_seconds)
718 $value_ticks[$value] = $tvalue;