4 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
5 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
6 require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
21 public function __construct($a_parent_obj, $a_parent_cmd =
"", $a_template_context =
"")
23 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
26 $this->lng->loadLanguageModule(
"meta");
28 include_once(
"./Services/Object/classes/class.ilObjectLP.php");
31 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)) {
47 switch ($ilCtrl->getCmd()) {
59 $to_hide =
$_POST[
"item_id"];
66 case "mailselectedusers":
67 if (!
sizeof(
$_POST[
"uid"])) {
70 $this->
sendMail(
$_POST[
"uid"], $this->parent_obj, $this->parent_cmd);
74 case 'addToClipboard':
75 if (!
sizeof(
$_POST[
'uid'])) {
91 $value = array_unique(array_merge((
array) $obj->getValue(), $to_hide));
92 $obj->setValue($value);
93 $obj->writeToSession();
96 if (isset($_REQUEST[
"tbltplcrt"])) {
97 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt", $_REQUEST[
"tbltplcrt"]);
99 if (isset($_REQUEST[
"tbltpldel"])) {
100 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel", $_REQUEST[
"tbltpldel"]);
103 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
106 return parent::executeCommand();
110 protected function sendMail(
array $a_user_ids, $a_parent_obj, $a_parent_cmd)
114 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
117 foreach ($a_user_ids as $usr_id) {
125 $ref_id = (int) $_REQUEST[
"ref_id"];
128 $tmpl_id = $obj_lp->getMailTemplateId();
137 include_once
'./Services/Link/classes/class.ilLink.php';
139 $sig = rawurlencode(base64_encode($sig));
150 'rcp_to' => implode(
',', $rcps),
169 global $ilObjDataCache;
171 include_once
'./Services/Search/classes/class.ilQueryParser.php';
174 $query_parser->setMinWordLength(0);
176 $query_parser->parse();
177 if (!$query_parser->validate()) {
183 if ($filter[
"type"] ==
"lres") {
184 $filter[
"type"] =
array(
'lm',
'sahs',
'htlm');
186 $filter[
"type"] =
array($filter[
"type"]);
189 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
191 $object_search->setFilter($filter[
"type"]);
192 if ($preset_obj_ids) {
193 $object_search->setIdFilter($preset_obj_ids);
195 $res =&$object_search->performSearch();
198 $res->setRequiredPermission($permission);
201 $res->setMaxHits(1000);
203 if ($a_check_lp_activation) {
204 $res->addObserver($this,
"searchFilterListener");
207 if (!$this->filter[
"area"]) {
208 $res->filter(ROOT_FOLDER_ID,
false);
210 $res->filter($this->filter[
"area"],
false);
214 foreach (
$res->getResults() as $obj_data) {
215 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
219 if (
$res->isLimitReached()) {
220 $this->lng->loadLanguageModule(
"search");
224 return $objects ? $objects :
array();
234 if (is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"])) {
238 if (get_class($olp) !=
"ilObjectLP" &&
250 public function initBaseFilter($a_split_learning_resources =
false, $a_include_no_status_filter =
true)
252 global
$lng, $ilObjDataCache;
257 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
261 $si->readFromSession();
262 if (!
$si->getValue()) {
263 $si->setValue(
"crs");
265 $this->filter[
"type"] =
$si->getValue();
268 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
271 $msi->readFromSession();
272 $this->filter[
"hide"] = $msi->getValue();
273 if ($this->filter[
"hide"]) {
276 $type = $types[
"type"];
278 if (
$type ==
'lres') {
283 foreach ($this->filter[
"hide"] as $obj_id) {
284 if (in_array($ilObjDataCache->lookupType($obj_id),
$type)) {
285 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
292 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
293 $ti =
new ilTextInputGUI($lng->txt(
"trac_title_description"),
"query");
297 $ti->readFromSession();
298 $this->filter[
"query"] = $ti->getValue();
301 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
305 $rs->readFromSession();
306 $this->filter[
"area"] = $rs->getValue();
309 if ($a_include_no_status_filter) {
310 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
313 $cb->readFromSession();
314 $this->filter[
"status"] = $cb->getChecked();
328 include_once
'./Services/Link/classes/class.ilLink.php';
330 if (!count($ref_ids)) {
333 foreach ($ref_ids as $ref_id) {
336 $path_full = $tree->getPathFull($ref_id);
337 foreach ($path_full as
$data) {
338 if (++
$counter < (count($path_full)-1)) {
341 $path .=
" » ";
342 if ($ref_id != $data[
'ref_id']) {
343 $path .= $data[
'title'];
345 $path .= (
'<a target="_top" href="' .
347 $data[
'title'] .
'</a>');
363 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
365 global
$lng, $ilPluginAdmin;
369 if ($a_split_learning_resources) {
370 $options[
'lm'] = $lng->txt(
'objs_lm');
371 $options[
'sahs'] = $lng->txt(
'objs_sahs');
372 $options[
'htlm'] = $lng->txt(
'objs_htlm');
374 $options[
'lres'] = $lng->txt(
'learning_resources');
377 $options[
'crs'] = $lng->txt(
'objs_crs');
378 $options[
'grp'] = $lng->txt(
'objs_grp');
379 $options[
'exc'] = $lng->txt(
'objs_exc');
380 $options[
'file'] = $lng->txt(
'objs_file');
381 $options[
'mcst'] = $lng->txt(
'objs_mcst');
382 $options[
'svy'] = $lng->txt(
'objs_svy');
383 $options[
'tst'] = $lng->txt(
'objs_tst');
384 $options[
'prg'] = $lng->txt(
'objs_prg');
385 $options[
'iass'] = $lng->txt(
'objs_iass');
387 if ($a_allow_undefined_lp) {
388 $options[
"webr"] = $lng->txt(
"objs_webr");
389 $options[
"wiki"] = $lng->txt(
"objs_wiki");
390 $options[
"blog"] = $lng->txt(
"objs_blog");
391 $options[
"prtf"] = $lng->txt(
"objs_prtf");
392 $options[
"prtt"] = $lng->txt(
"objs_prtt");
396 include_once
'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
397 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
398 foreach ($pl_names as $pl) {
399 $pl_id = $ilPluginAdmin->getId(
IL_COMP_SERVICE,
"Repository",
"robj", $pl);
414 $pos = strrpos(
$id,
"_");
415 if ($pos !==
false) {
417 if (in_array(
$function,
array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT"))) {
418 $id = substr(
$id, 0, $pos);
422 if (trim($value) ==
"" &&
$id !=
"status") {
423 if (
$id ==
"title" &&
424 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
425 get_class($this) !=
"ilTrMatrixTableGUI") {
426 return "--" . $lng->txt(
"none") .
"--";
434 case 'status_changed':
446 case "spent_seconds":
458 $value = $value .
"%";
469 $value = $lng->txt(
"gender_" . $value);
473 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
480 $lng->loadLanguageModule(
"meta");
481 $value = $lng->txt(
"meta_l_" . $value);
485 $value = $lng->txt(
"meta_c_" . $value);
495 foreach ((
array) $this->filter as
$id => $value) {
514 case "matriculation":
525 if ($value !==
false) {
534 case "spent_seconds":
535 if (is_array($value) && implode(
"", $value)) {
544 case 'status_changed':
546 if ($value[
"from"]) {
557 if ($value[
"from"]) {
577 $mode = $olp->getCurrentMode();
594 if ($a_user_id != $ilUser->getId()) {
599 $user .=
", " . $a_user->getFullName();
602 if ($a_obj_id != ROOT_FOLDER_ID) {
603 $this->
setTitle($lng->txt(
$action) .
": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
606 $this->
setDescription($this->lng->txt(
'trac_mode') .
": " . $olp->getModeText($olp->getCurrentMode()));
619 global
$lng, $ilObjDataCache,
$ilUser, $ilClientIniFile;
632 include_once
'./Services/Link/classes/class.ilLink.php';
635 $data[$lng->txt(
"trac_name_of_installation")] = $ilClientIniFile->readVariable(
'client',
'name');
638 $data[$lng->txt(
"trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
646 $data[$lng->txt(
"trac_report_owner")] = $ilUser->getFullName();
654 $a_excel->
setCell($a_row, 0, $caption);
655 $a_excel->
setCell($a_row, 1, $value);
664 $a_csv->addColumn(strip_tags($caption));
665 $a_csv->addColumn(strip_tags($value));
674 if ($timing_cache->isWarningRequired($a_user_id)) {
676 if ($timings[
'item'][
'changeable'] && $timings[
'user'][$a_user_id][
'end']) {
677 $end = $timings[
'user'][$a_user_id][
'end'];
678 } elseif ($timings[
'item'][
'suggestion_end']) {
679 $end = $timings[
'item'][
'suggestion_end'];
689 $seconds = ((int) $seconds > 0) ? $seconds : 0;
690 if ($a_shorten_zero && !$seconds) {
694 $hours = floor($seconds / 3600);
695 $rest = $seconds % 3600;
697 $minutes = floor(
$rest / 60);
704 return sprintf(
"%dh%02dm", $hours, $minutes);
712 if (is_numeric($a_value)) {
714 $a_value = (int) $a_value;
715 if ($a_value <= $threshold) {
716 if (!$a_force_number) {
717 return "0-" . $threshold;
726 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
730 $step = $a_max_value / 10;
731 $base = ceil(log($step, 10));
732 $fac = ceil($step / pow(10, (
$base - 1)));
733 $step = pow(10,
$base - 1) * $fac;
738 $ticks =
range(0, $a_max_value+$step, $step);
740 $value_ticks =
array(0 => 0);
741 foreach ($ticks as $tick) {
742 $value = $tvalue = $tick;
747 if ($a_format_seconds) {
750 $value_ticks[$value] = $tvalue;
761 for ($loop = 0; $loop < 10; $loop++) {
762 $year =
date(
"Y")-$loop;
764 for ($loop2 = 12; $loop2 > 0; $loop2--) {
765 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
766 if ($year . $month <=
date(
"Ym")) {
768 $caption = $year .
" / " . $lng->txt(
"month_" . $month .
"_long");
770 $caption = $year .
"/" . $month;
772 $options[$year .
"-" . $month] = $caption;
788 for ($loop = 1; $loop<13; $loop++) {
789 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
790 if ($a_year .
"-" . $month <=
date(
"Y-m")) {
792 $caption = $lng->txt(
"month_" . $month .
"_long");
794 $caption = $lng->txt(
"month_" . $month .
"_short");
796 $all[$a_year .
"-" . $month] = $caption;
808 include_once(
"./Services/User/classes/class.ilUserProfile.php");
810 $up->skipGroup(
"preferences");
811 $up->skipGroup(
"settings");
812 $up->skipGroup(
"interests");
813 $ufs = $up->getStandardFields();
817 "txt" => $lng->txt(
"login"),
820 if (!$this->anonymized) {
822 "txt" => $lng->txt(
"firstname"),
825 "txt" => $lng->txt(
"lastname"),
830 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
834 "txt" => $lng->txt(
"trac_first_access"),
837 "txt" => $lng->txt(
"trac_last_access"),
842 "txt" => $lng->txt(
"trac_read_count"),
848 "txt" => $lng->txt(
"trac_spent_seconds"),
854 "txt" => $lng->txt(
"trac_percentage"),
860 if ($olp->isActive()) {
862 "txt" => $lng->txt(
"trac_status"),
866 'txt' => $lng->txt(
'trac_status_changed'),
872 "txt" => $lng->txt(
"trac_mark"),
877 "txt" => $lng->txt(
"trac_comment"),
880 $cols[
"create_date"] =
array(
881 "txt" => $lng->txt(
"create_date"),
883 $cols[
"language"] =
array(
884 "txt" => $lng->txt(
"language"),
888 if (!$this->anonymized &&
889 ($a_in_course || $a_in_group)) {
891 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
894 foreach ($ufs as $f => $fd) {
895 if (!isset($cols[$f]) && $f !=
"username" && !$fd[
"lists_hide"]) {
897 !($fd[
"course_export_fix_value"] || $ilSetting->get(
"usr_settings_course_export_" . $f))) {
901 !($fd[
"group_export_fix_value"] || $ilSetting->get(
"usr_settings_group_export_" . $f))) {
906 "txt" => $lng->txt($f),
909 $privacy_fields[] = $f;
914 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
917 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
919 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
921 foreach ($user_defined_fields as $definition) {
923 $f =
"udf_" . $definition[
"field_id"];
925 "txt" => $definition[
"field_name"],
928 $privacy_fields[] = $f;
934 return array($cols, $privacy_fields);
943 include_once
'./Services/User/classes/class.ilUserClipboard.php';
948 $GLOBALS[
'lng']->loadLanguageModule(
'user');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupLogin($a_user_id)
lookup login
anonymizeValue($a_value, $a_force_number=false)
const EXTENDED_DATA_LAST_ACCESS
setDescription($a_val)
Set description.
buildPath($ref_ids)
Build path with deep-link.
getSelectableUserColumns($a_in_course=false, $a_in_group=false)
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
static _getInstance()
Get instance.
static lookupTxtById($plugin_id, $lang_var)
static getInstance($a_usr_id)
Get singelton instance.
static _getImagePathForStatus($a_status)
Get image path for status.
static _lookupFullname($a_user_id)
Lookup Full Name.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
getMonthsYear($a_year=null, $a_short=false)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
resetOffset($a_in_determination=false)
Reset offset.
if(!array_key_exists('StateId', $_REQUEST)) $id
getFilterItemByPostVar($a_post_var)
const EXTENDED_DATA_READ_COUNT
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static setUseRelativeDates($a_status)
set use relative dates
parseTitle($a_obj_id, $action, $a_user_id=false)
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
parseValue($id, $value, $type)
addToClipboard()
Add selected users to clipboard.
static _lookupObjectId($a_ref_id)
lookup object id
initBaseFilter($a_split_learning_resources=false, $a_include_no_status_filter=true)
Init filter.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
const LP_MODE_VISITED_PAGES
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
foreach($_POST as $key=> $value) $res
TableGUI class for learning progress.
getExportMeta()
Build export meta data.
const LP_MODE_TEST_PASSED
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
buildValueScale($a_max_value, $a_anonymize=false, $a_format_seconds=false)
This class represents a text property in a property form.
isPercentageAvailable($a_obj_id)
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
static _lookupOwner($a_id)
lookup object owner
setMaxLength($a_maxlength)
Set Max Length.
searchFilterListener($a_ref_id, $a_data)
Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVA...
fillMetaExcel(ilExcel $a_excel, &$a_row)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstanceByRefId($ref_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const EXTENDED_DATA_SPENT_SECONDS
writeFilterToSession()
Write filter values to session.
static supportsMark($a_obj_type)
sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
determineSelectedFilters()
Determine selected filters.
static supportsSpentSeconds($a_obj_type)
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
getMonthsFilter($a_short=false)
formatSeconds($seconds, $a_shorten_zero=false)
showTimingsWarning($a_ref_id, $a_user_id)
static getLogger($a_component_id)
Get component logger.
static _getInstance()
Get instance of ilPrivacySettings.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getCurrentFilter($as_query=false)
static redirect($a_script)
static getInstance($a_obj_id)
resetFilter()
Reset filter.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
static & _getTimings($a_ref_id)