4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
20 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
25 $this->lng->loadLanguageModule(
"meta");
27 include_once(
"./Services/Object/classes/class.ilObjectLP.php");
30 if(!$this->anonymized && $this->obj_id)
32 include_once
"Services/Object/classes/class.ilObjectLP.php";
34 $this->anonymized = $olp->isAnonymized();
44 if(!$ilCtrl->getNextClass($this))
48 switch($ilCtrl->getCmd())
61 $to_hide =
$_POST[
"item_id"];
65 $to_hide = array((
int)
$_GET[
"hide"]);
78 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
79 $obj->setValue($value);
80 $obj->writeToSession();
85 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt",
$_REQUEST[
"tbltplcrt"]);
89 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel",
$_REQUEST[
"tbltpldel"]);
92 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
110 global $ilObjDataCache;
118 include_once
'./Services/Search/classes/class.ilQueryParser.php';
121 $query_parser->setMinWordLength(0);
123 $query_parser->parse();
124 if(!$query_parser->validate())
130 if($filter[
"type"] ==
"lres")
132 $filter[
"type"] = array(
'lm',
'sahs',
'htlm',
'dbk');
136 $filter[
"type"] = array($filter[
"type"]);
139 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
141 $object_search->setFilter($filter[
"type"]);
144 $object_search->setIdFilter($preset_obj_ids);
146 $res =& $object_search->performSearch();
150 $res->setRequiredPermission($permission);
153 $res->setMaxHits(1000);
154 $res->addObserver($this,
"searchFilterListener");
156 if(!$this->filter[
"area"])
158 $res->filter(ROOT_FOLDER_ID,
false);
162 $res->filter($this->filter[
"area"],
false);
166 foreach(
$res->getResults() as $obj_data)
168 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
172 if(
$res->isLimitReached())
174 $this->lng->loadLanguageModule(
"search");
178 return $objects ? $objects : array();
188 if(is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"]))
193 if(get_class($olp) !=
"ilObjectLP" &&
206 public function initFilter($a_split_learning_resources =
false, $a_include_no_status_filter =
true)
208 global
$lng, $ilObjDataCache;
213 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
217 $si->readFromSession();
220 $si->setValue(
"crs");
222 $this->filter[
"type"] =
$si->getValue();
225 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
228 $msi->readFromSession();
229 $this->filter[
"hide"] = $msi->getValue();
230 if($this->filter[
"hide"])
234 $type = $types[
"type"];
238 $type = array(
'lm',
'sahs',
'htlm',
'dbk');
242 $type = array($type);
244 foreach($this->filter[
"hide"] as $obj_id)
246 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
248 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
255 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
256 $ti =
new ilTextInputGUI($lng->txt(
"trac_title_description"),
"query");
260 $ti->readFromSession();
261 $this->filter[
"query"] = $ti->getValue();
264 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
268 $rs->readFromSession();
269 $this->filter[
"area"] = $rs->getValue();
272 if($a_include_no_status_filter)
274 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
277 $cb->readFromSession();
278 $this->filter[
"status"] = $cb->getChecked();
292 include_once
'./Services/Link/classes/class.ilLink.php';
302 $path_full = $tree->getPathFull($ref_id);
303 foreach($path_full as
$data)
305 if(++$counter < (count($path_full)-1))
309 $path .=
" » ";
310 if($ref_id != $data[
'ref_id'])
312 $path .= $data[
'title'];
316 $path .= (
'<a target="_top" href="'.
318 $data[
'title'].
'</a>');
334 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
336 global
$lng, $ilPluginAdmin;
340 if($a_split_learning_resources)
342 $options[
'lm'] = $lng->txt(
'objs_lm');
343 $options[
'sahs'] = $lng->txt(
'objs_sahs');
344 $options[
'htlm'] = $lng->txt(
'objs_htlm');
346 if($a_include_digilib)
348 $options[
'dbk'] = $lng->txt(
'objs_dbk');
353 $options[
'lres'] = $lng->txt(
'learning_resources');
356 $options[
'crs'] = $lng->txt(
'objs_crs');
357 $options[
'grp'] = $lng->txt(
'objs_grp');
358 $options[
'exc'] = $lng->txt(
'objs_exc');
359 $options[
'tst'] = $lng->txt(
'objs_tst');
361 if($a_allow_undefined_lp)
363 $options[
"file"] = $lng->txt(
"objs_file");
364 $options[
"webr"] = $lng->txt(
"objs_webr");
365 $options[
"wiki"] = $lng->txt(
"objs_wiki");
369 include_once
'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
370 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
371 foreach ($pl_names as $pl)
373 $pl_id = $ilPluginAdmin->getId(
IL_COMP_SERVICE,
"Repository",
"robj", $pl);
389 $pos = strrpos($id,
"_");
392 $function = strtoupper(substr($id, $pos+1));
393 if(in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")))
395 $id = substr($id, 0, $pos);
399 if(trim($value) ==
"" && $id !=
"status")
402 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
403 get_class($this) !=
"ilTrMatrixTableGUI")
405 return "--".$lng->txt(
"none").
"--";
414 case 'status_changed':
426 case "spent_seconds":
427 if(in_array($type, array(
"exc")))
433 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
455 if(in_array($type, array(
"lm",
"dbk")))
462 $value = $lng->txt(
"gender_".$value);
466 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
473 $lng->loadLanguageModule(
"meta");
474 $value = $lng->txt(
"meta_l_".$value);
478 $value = $lng->txt(
"meta_c_".$value);
488 foreach($this->filter as $id => $value)
509 case "matriculation":
531 case "spent_seconds":
532 if(is_array($value) && implode(
"", $value))
542 case 'status_changed':
562 $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8).
"00:00:00";
567 $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8).
"23:59:59";
581 $mode = $olp->getCurrentMode();
593 protected function parseTitle($a_obj_id, $action, $a_user_id =
false)
600 if($a_user_id != $ilUser->getId())
608 $user .=
", ".$a_user->getFullName();
611 if($a_obj_id != ROOT_FOLDER_ID)
613 $this->
setTitle($lng->txt($action).
": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
616 $this->
setDescription($this->lng->txt(
'trac_mode').
": ".$olp->getModeText($olp->getCurrentMode()));
620 $this->
setTitle($lng->txt($action));
631 global
$lng, $ilObjDataCache,
$ilUser, $ilClientIniFile;
644 include_once
'./Services/Link/classes/class.ilLink.php';
647 $data[$lng->txt(
"trac_name_of_installation")] = $ilClientIniFile->readVariable(
'client',
'name');
651 $data[$lng->txt(
"trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
659 $data[$lng->txt(
"trac_report_date")] =
661 $data[$lng->txt(
"trac_report_owner")] = $ilUser->getFullName();
670 $worksheet->write($a_row, 0, $caption);
671 $worksheet->write($a_row, 1, $value);
681 $a_csv->addColumn(strip_tags($caption));
682 $a_csv->addColumn(strip_tags($value));
690 include_once
'Modules/Course/classes/Timings/class.ilTimingCache.php';
694 if($timings[
'item'][
'changeable'] && $timings[
'user'][$a_user_id][
'end'])
696 $end = $timings[
'user'][$a_user_id][
'end'];
698 else if ($timings[
'item'][
'suggestion_end'])
700 $end = $timings[
'item'][
'suggestion_end'];
712 $seconds = ((int)$seconds > 0) ? $seconds : 0;
713 if($a_shorten_zero && !$seconds)
718 $hours = floor($seconds / 3600);
719 $rest = $seconds % 3600;
721 $minutes = floor(
$rest / 60);
729 return sprintf(
"%dh%02dm",$hours,$minutes);
737 if(is_numeric($a_value))
740 $a_value = (int)$a_value;
741 if($a_value <= $threshold)
745 return "0-".$threshold;
756 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
761 $step = $a_max_value / 10;
762 $base = ceil(log($step, 10));
763 $fac = ceil($step / pow(10, (
$base - 1)));
764 $step = pow(10,
$base - 1) * $fac;
770 $ticks = range(0, $a_max_value+$step, $step);
772 $value_ticks = array(0 => 0);
773 foreach($ticks as $tick)
775 $value = $tvalue = $tick;
781 if($a_format_seconds)
785 $value_ticks[$value] = $tvalue;
796 for($loop = 0; $loop < 10; $loop++)
798 $year = date(
"Y")-$loop;
800 for($loop2 = 12; $loop2 > 0; $loop2--)
802 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
803 if($year.$month <= date(
"Ym"))
807 $caption = $year.
" / ".$lng->txt(
"month_".$month.
"_long");
811 $caption = $year.
"/".$month;
813 $options[$year.
"-".$month] = $caption;
830 for($loop = 1; $loop<13; $loop++)
832 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
833 if($a_year.
"-".$month <= date(
"Y-m"))
837 $caption = $lng->txt(
"month_".$month.
"_long");
841 $caption = $lng->txt(
"month_".$month.
"_short");
843 $all[$a_year.
"-".$month] = $caption;
853 $cols = $privacy_fields = array();
855 include_once(
"./Services/User/classes/class.ilUserProfile.php");
857 $up->skipGroup(
"preferences");
858 $up->skipGroup(
"settings");
859 $up->skipGroup(
"interests");
860 $ufs = $up->getStandardFields();
863 $cols[
"login"] = array(
864 "txt" => $lng->txt(
"login"),
867 if(!$this->anonymized)
869 $cols[
"firstname"] = array(
870 "txt" => $lng->txt(
"firstname"),
872 $cols[
"lastname"] = array(
873 "txt" => $lng->txt(
"lastname"),
878 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
882 $cols[
"first_access"] = array(
883 "txt" => $lng->txt(
"trac_first_access"),
885 $cols[
"last_access"] = array(
886 "txt" => $lng->txt(
"trac_last_access"),
891 $cols[
"read_count"] = array(
892 "txt" => $lng->txt(
"trac_read_count"),
897 $cols[
"spent_seconds"] = array(
898 "txt" => $lng->txt(
"trac_spent_seconds"),
904 $cols[
"percentage"] = array(
905 "txt" => $lng->txt(
"trac_percentage"),
913 $cols[
"status"] = array(
914 "txt" => $lng->txt(
"trac_status"),
917 $cols[
'status_changed'] = array(
918 'txt' => $lng->txt(
'trac_status_changed'),
922 if($this->type !=
"lm")
924 $cols[
"mark"] = array(
925 "txt" => $lng->txt(
"trac_mark"),
929 $cols[
"u_comment"] = array(
930 "txt" => $lng->txt(
"trac_comment"),
933 $cols[
"create_date"] = array(
934 "txt" => $lng->txt(
"create_date"),
936 $cols[
"language"] = array(
937 "txt" => $lng->txt(
"language"),
941 if(!$this->anonymized &&
942 ($a_in_course || $a_in_group))
945 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
949 foreach ($ufs as $f => $fd)
951 if (!isset($cols[$f]) && $f !=
"username" && !$fd[
"lists_hide"])
954 !($fd[
"course_export_fix_value"] || $ilSetting->get(
"usr_settings_course_export_".$f)))
959 !($fd[
"group_export_fix_value"] || $ilSetting->get(
"usr_settings_group_export_".$f)))
965 "txt" => $lng->txt($f),
968 $privacy_fields[] = $f;
973 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
977 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
981 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
983 foreach($user_defined_fields as $definition)
987 $f =
"udf_".$definition[
"field_id"];
989 "txt" => $definition[
"field_name"],
992 $privacy_fields[] = $f;
998 return array($cols, $privacy_fields);