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");
26 include_once(
"./Services/Tracking/classes/class.ilLPObjSettings.php");
35 if(!$ilCtrl->getNextClass($this))
39 switch($ilCtrl->getCmd())
52 $to_hide =
$_POST[
"item_id"];
56 $to_hide = array((
int)
$_GET[
"hide"]);
69 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
70 $obj->setValue($value);
71 $obj->writeToSession();
76 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt",
$_REQUEST[
"tbltplcrt"]);
80 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel",
$_REQUEST[
"tbltpldel"]);
83 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
101 global $ilObjDataCache;
109 include_once
'./Services/Search/classes/class.ilQueryParser.php';
112 $query_parser->setMinWordLength(0);
114 $query_parser->parse();
115 if(!$query_parser->validate())
121 if($filter[
"type"] ==
"lres")
123 $filter[
"type"] = array(
'lm',
'sahs',
'htlm',
'dbk');
127 $filter[
"type"] = array($filter[
"type"]);
130 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
132 $object_search->setFilter($filter[
"type"]);
135 $object_search->setIdFilter($preset_obj_ids);
137 $res =& $object_search->performSearch();
138 $res->setRequiredPermission($permission);
139 $res->setMaxHits(1000);
140 $res->addObserver($this,
"searchFilterListener");
142 if(!$this->filter[
"area"])
144 $res->filter(ROOT_FOLDER_ID,
false);
148 $res->filter($this->filter[
"area"],
false);
152 foreach(
$res->getResults() as $obj_data)
154 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
158 $this->limit_reached =
$res->isLimitReached();
160 return $objects ? $objects : array();
170 if(is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"]))
187 public function initFilter($a_split_learning_resources =
false, $a_include_no_status_filter =
true)
189 global
$lng, $ilObjDataCache;
194 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
198 $si->readFromSession();
201 $si->setValue(
"crs");
203 $this->filter[
"type"] =
$si->getValue();
206 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
209 $msi->readFromSession();
210 $this->filter[
"hide"] = $msi->getValue();
211 if($this->filter[
"hide"])
215 $type = $types[
"type"];
219 $type = array(
'lm',
'sahs',
'htlm',
'dbk');
223 $type = array($type);
225 foreach($this->filter[
"hide"] as $obj_id)
227 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
229 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
232 $msi->setOptions($options);
236 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
237 $ti =
new ilTextInputGUI($lng->txt(
"trac_title_description"),
"query");
241 $ti->readFromSession();
242 $this->filter[
"query"] = $ti->getValue();
245 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
249 $rs->readFromSession();
250 $this->filter[
"area"] = $rs->getValue();
253 if($a_include_no_status_filter)
255 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
258 $cb->readFromSession();
259 $this->filter[
"status"] = $cb->getChecked();
273 include_once
'./Services/Link/classes/class.ilLink.php';
283 $path_full = $tree->getPathFull($ref_id);
284 foreach($path_full as
$data)
286 if(++$counter < (count($path_full)-1))
290 $path .=
" » ";
291 if($ref_id != $data[
'ref_id'])
293 $path .= $data[
'title'];
297 $path .= (
'<a target="_top" href="'.
299 $data[
'title'].
'</a>');
315 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
317 global
$lng, $ilPluginAdmin;
321 if($a_split_learning_resources)
323 $options[
'lm'] = $lng->txt(
'objs_lm');
324 $options[
'sahs'] = $lng->txt(
'objs_sahs');
325 $options[
'htlm'] = $lng->txt(
'objs_htlm');
327 if($a_include_digilib)
329 $options[
'dbk'] = $lng->txt(
'objs_dbk');
334 $options[
'lres'] = $lng->txt(
'learning_resources');
337 $options[
'crs'] = $lng->txt(
'objs_crs');
338 $options[
'grp'] = $lng->txt(
'objs_grp');
339 $options[
'exc'] = $lng->txt(
'objs_exc');
340 $options[
'tst'] = $lng->txt(
'objs_tst');
342 if($a_allow_undefined_lp)
344 $options[
"file"] = $lng->txt(
"objs_file");
345 $options[
"webr"] = $lng->txt(
"objs_webr");
346 $options[
"wiki"] = $lng->txt(
"objs_wiki");
350 include_once
'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
351 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
352 foreach ($pl_names as $pl)
354 $pl_id = $ilPluginAdmin->getId(
IL_COMP_SERVICE,
"Repository",
"robj", $pl);
370 $pos = strrpos($id,
"_");
373 $function = strtoupper(substr($id, $pos+1));
374 if(in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")))
376 $id = substr($id, 0, $pos);
380 if(trim($value) ==
"" && $id !=
"status")
382 if($id ==
"title" && get_class($this) !=
"ilTrObjectUsersPropsTableGUI")
384 return "--".$lng->txt(
"none").
"--";
393 case 'status_changed':
405 case "spent_seconds":
406 if(in_array($type, array(
"exc")))
412 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
434 if(in_array($type, array(
"lm",
"dbk")))
441 $value = $lng->txt(
"gender_".$value);
445 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
452 $lng->loadLanguageModule(
"meta");
453 $value = $lng->txt(
"meta_l_".$value);
457 $value = $lng->txt(
"meta_c_".$value);
467 foreach($this->filter as $id => $value)
488 case "matriculation":
510 case "spent_seconds":
511 if(is_array($value) && implode(
"", $value))
521 case 'status_changed':
541 $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8).
"00:00:00";
546 $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8).
"23:59:59";
558 include_once(
"./Services/Tracking/classes/class.ilLPObjSettings.php");
568 protected function parseTitle($a_obj_id, $action, $a_user_id =
false)
575 if($a_user_id != $ilUser->getId())
583 $user .=
", ".$a_user->getFullName();
586 if($a_obj_id != ROOT_FOLDER_ID)
588 $this->
setTitle($lng->txt($action).
": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
593 $this->
setTitle($lng->txt($action));
604 global
$lng, $ilObjDataCache,
$ilUser, $ilClientIniFile;
617 include_once
'./Services/Link/classes/class.ilLink.php';
620 $lng->txt(
"trac_name_of_installation") => $ilClientIniFile->readVariable(
'client',
'name'),
621 $lng->txt(
"trac_object_name") => $ilObjDataCache->lookupTitle($this->obj_id),
624 $lng->txt(
"trac_report_date") =>
626 $lng->txt(
"trac_report_owner") => $ilUser->getFullName()
635 $worksheet->write($a_row, 0, $caption);
636 $worksheet->write($a_row, 1, $value);
646 $a_csv->addColumn(strip_tags($caption));
647 $a_csv->addColumn(strip_tags($value));
655 include_once
'Modules/Course/classes/Timings/class.ilTimingCache.php';
659 if($timings[
'item'][
'changeable'] and $timings[
'user'][$a_user_id][
'end'])
661 $end = $timings[
'user'][$a_user_id][
'end'];
663 else if ($timings[
'item'][
'suggestion_end'])
665 $end = $timings[
'item'][
'suggestion_end'];
677 $seconds = ((int)$seconds > 0) ? $seconds : 0;
678 if($a_shorten_zero && !$seconds)
683 $hours = floor($seconds / 3600);
684 $rest = $seconds % 3600;
686 $minutes = floor(
$rest / 60);
694 return sprintf(
"%dh%02dm",$hours,$minutes);
702 if(is_numeric($a_value))
705 $a_value = (int)$a_value;
706 if($a_value <= $threshold)
710 return "0-".$threshold;
721 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
726 $step = $a_max_value / 10;
727 $base = ceil(log($step, 10));
728 $fac = ceil($step / pow(10, (
$base - 1)));
729 $step = pow(10,
$base - 1) * $fac;
735 $ticks = range(0, $a_max_value+$step, $step);
737 $value_ticks = array(0 => 0);
738 foreach($ticks as $tick)
740 $value = $tvalue = $tick;
746 if($a_format_seconds)
750 $value_ticks[$value] = $tvalue;
761 for($loop = 0; $loop < 10; $loop++)
763 $year = date(
"Y")-$loop;
764 $options[$year] = $year;
765 for($loop2 = 12; $loop2 > 0; $loop2--)
767 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
768 if($year.$month <= date(
"Ym"))
772 $caption = $year.
" / ".$lng->txt(
"month_".$month.
"_long");
776 $caption = $year.
"/".$month;
778 $options[$year.
"-".$month] = $caption;
795 for($loop = 1; $loop<13; $loop++)
797 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
798 if($a_year.
"-".$month <= date(
"Y-m"))
802 $caption = $lng->txt(
"month_".$month.
"_long");
806 $caption = $lng->txt(
"month_".$month.
"_short");
808 $all[$a_year.
"-".$month] = $caption;