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")
401 if($id ==
"title" && get_class($this) !=
"ilTrObjectUsersPropsTableGUI")
403 return "--".$lng->txt(
"none").
"--";
412 case 'status_changed':
424 case "spent_seconds":
425 if(in_array($type, array(
"exc")))
431 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
453 if(in_array($type, array(
"lm",
"dbk")))
460 $value = $lng->txt(
"gender_".$value);
464 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
471 $lng->loadLanguageModule(
"meta");
472 $value = $lng->txt(
"meta_l_".$value);
476 $value = $lng->txt(
"meta_c_".$value);
486 foreach($this->filter as $id => $value)
507 case "matriculation":
529 case "spent_seconds":
530 if(is_array($value) && implode(
"", $value))
540 case 'status_changed':
560 $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8).
"00:00:00";
565 $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8).
"23:59:59";
579 $mode = $olp->getCurrentMode();
591 protected function parseTitle($a_obj_id, $action, $a_user_id =
false)
598 if($a_user_id != $ilUser->getId())
606 $user .=
", ".$a_user->getFullName();
609 if($a_obj_id != ROOT_FOLDER_ID)
611 $this->
setTitle($lng->txt($action).
": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
614 $this->
setDescription($this->lng->txt(
'trac_mode').
": ".$olp->getModeText($olp->getCurrentMode()));
618 $this->
setTitle($lng->txt($action));
629 global
$lng, $ilObjDataCache,
$ilUser, $ilClientIniFile;
642 include_once
'./Services/Link/classes/class.ilLink.php';
645 $lng->txt(
"trac_name_of_installation") => $ilClientIniFile->readVariable(
'client',
'name'),
646 $lng->txt(
"trac_object_name") => $ilObjDataCache->lookupTitle($this->obj_id),
649 $lng->txt(
"trac_report_date") =>
651 $lng->txt(
"trac_report_owner") => $ilUser->getFullName()
660 $worksheet->write($a_row, 0, $caption);
661 $worksheet->write($a_row, 1, $value);
671 $a_csv->addColumn(strip_tags($caption));
672 $a_csv->addColumn(strip_tags($value));
680 include_once
'Modules/Course/classes/Timings/class.ilTimingCache.php';
684 if($timings[
'item'][
'changeable'] and $timings[
'user'][$a_user_id][
'end'])
686 $end = $timings[
'user'][$a_user_id][
'end'];
688 else if ($timings[
'item'][
'suggestion_end'])
690 $end = $timings[
'item'][
'suggestion_end'];
702 $seconds = ((int)$seconds > 0) ? $seconds : 0;
703 if($a_shorten_zero && !$seconds)
708 $hours = floor($seconds / 3600);
709 $rest = $seconds % 3600;
711 $minutes = floor(
$rest / 60);
719 return sprintf(
"%dh%02dm",$hours,$minutes);
727 if(is_numeric($a_value))
730 $a_value = (int)$a_value;
731 if($a_value <= $threshold)
735 return "0-".$threshold;
746 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
751 $step = $a_max_value / 10;
752 $base = ceil(log($step, 10));
753 $fac = ceil($step / pow(10, (
$base - 1)));
754 $step = pow(10,
$base - 1) * $fac;
760 $ticks = range(0, $a_max_value+$step, $step);
762 $value_ticks = array(0 => 0);
763 foreach($ticks as $tick)
765 $value = $tvalue = $tick;
771 if($a_format_seconds)
775 $value_ticks[$value] = $tvalue;
786 for($loop = 0; $loop < 10; $loop++)
788 $year = date(
"Y")-$loop;
790 for($loop2 = 12; $loop2 > 0; $loop2--)
792 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
793 if($year.$month <= date(
"Ym"))
797 $caption = $year.
" / ".$lng->txt(
"month_".$month.
"_long");
801 $caption = $year.
"/".$month;
803 $options[$year.
"-".$month] = $caption;
820 for($loop = 1; $loop<13; $loop++)
822 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
823 if($a_year.
"-".$month <= date(
"Y-m"))
827 $caption = $lng->txt(
"month_".$month.
"_long");
831 $caption = $lng->txt(
"month_".$month.
"_short");
833 $all[$a_year.
"-".$month] = $caption;
843 $cols = $privacy_fields = array();
845 include_once(
"./Services/User/classes/class.ilUserProfile.php");
847 $up->skipGroup(
"preferences");
848 $up->skipGroup(
"settings");
849 $ufs = $up->getStandardFields();
852 $cols[
"login"] = array(
853 "txt" => $lng->txt(
"login"),
856 if(!$this->anonymized)
858 $cols[
"firstname"] = array(
859 "txt" => $lng->txt(
"firstname"),
861 $cols[
"lastname"] = array(
862 "txt" => $lng->txt(
"lastname"),
867 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
871 $cols[
"first_access"] = array(
872 "txt" => $lng->txt(
"trac_first_access"),
874 $cols[
"last_access"] = array(
875 "txt" => $lng->txt(
"trac_last_access"),
880 $cols[
"read_count"] = array(
881 "txt" => $lng->txt(
"trac_read_count"),
886 $cols[
"spent_seconds"] = array(
887 "txt" => $lng->txt(
"trac_spent_seconds"),
893 $cols[
"percentage"] = array(
894 "txt" => $lng->txt(
"trac_percentage"),
902 $cols[
"status"] = array(
903 "txt" => $lng->txt(
"trac_status"),
906 $cols[
'status_changed'] = array(
907 'txt' => $lng->txt(
'trac_status_changed'),
911 if($this->type !=
"lm")
913 $cols[
"mark"] = array(
914 "txt" => $lng->txt(
"trac_mark"),
918 $cols[
"u_comment"] = array(
919 "txt" => $lng->txt(
"trac_comment"),
922 $cols[
"create_date"] = array(
923 "txt" => $lng->txt(
"create_date"),
925 $cols[
"language"] = array(
926 "txt" => $lng->txt(
"language"),
930 if(!$this->anonymized &&
931 ($a_in_course || $a_in_group))
934 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
938 foreach ($ufs as $f => $fd)
940 if (!isset($cols[$f]) && $f !=
"username" && !$fd[
"lists_hide"])
943 !($fd[
"course_export_fix_value"] || $ilSetting->get(
"usr_settings_course_export_".$f)))
948 !($fd[
"group_export_fix_value"] || $ilSetting->get(
"usr_settings_group_export_".$f)))
954 "txt" => $lng->txt($f),
957 $privacy_fields[] = $f;
962 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
966 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
970 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
972 foreach($user_defined_fields as $definition)
976 $f =
"udf_".$definition[
"field_id"];
978 "txt" => $definition[
"field_name"],
981 $privacy_fields[] = $f;
987 return array($cols, $privacy_fields);