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 =
"")
22 parent::__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"]);
68 case "mailselectedusers":
75 $this->
sendMail(
$_POST[
"uid"], $this->parent_obj, $this->parent_cmd);
89 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
90 $obj->setValue($value);
91 $obj->writeToSession();
96 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt",
$_REQUEST[
"tbltplcrt"]);
100 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel",
$_REQUEST[
"tbltpldel"]);
103 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
108 return parent::executeCommand();
112 protected function sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
116 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
119 foreach($a_user_ids as $usr_id)
132 $tmpl_id = $obj_lp->getMailTemplateId();
144 include_once
'./Services/Link/classes/class.ilLink.php';
146 $sig = rawurlencode(base64_encode($sig));
157 'rcp_to' => implode(
',', $rcps),
174 protected function searchObjects(array
$filter, $permission, array $preset_obj_ids = null, $a_check_lp_activation =
true)
176 global $ilObjDataCache;
178 include_once
'./Services/Search/classes/class.ilQueryParser.php';
181 $query_parser->setMinWordLength(0);
183 $query_parser->parse();
184 if(!$query_parser->validate())
191 if($filter[
"type"] ==
"lres")
193 $filter[
"type"] = array(
'lm',
'sahs',
'htlm',
'dbk');
197 $filter[
"type"] = array($filter[
"type"]);
200 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
202 $object_search->setFilter($filter[
"type"]);
205 $object_search->setIdFilter($preset_obj_ids);
207 $res =& $object_search->performSearch();
211 $res->setRequiredPermission($permission);
214 $res->setMaxHits(1000);
216 if($a_check_lp_activation)
218 $res->addObserver($this,
"searchFilterListener");
221 if(!$this->filter[
"area"])
223 $res->filter(ROOT_FOLDER_ID,
false);
227 $res->filter($this->filter[
"area"],
false);
231 foreach(
$res->getResults() as $obj_data)
233 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
237 if(
$res->isLimitReached())
239 $this->lng->loadLanguageModule(
"search");
243 return $objects ? $objects : array();
253 if(is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"]))
258 if(get_class($olp) !=
"ilObjectLP" &&
271 public function initFilter($a_split_learning_resources =
false, $a_include_no_status_filter =
true)
273 global
$lng, $ilObjDataCache;
278 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
282 $si->readFromSession();
285 $si->setValue(
"crs");
287 $this->filter[
"type"] =
$si->getValue();
290 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
293 $msi->readFromSession();
294 $this->filter[
"hide"] = $msi->getValue();
295 if($this->filter[
"hide"])
299 $type = $types[
"type"];
303 $type = array(
'lm',
'sahs',
'htlm',
'dbk');
307 $type = array($type);
309 foreach($this->filter[
"hide"] as $obj_id)
311 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
313 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
320 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
321 $ti =
new ilTextInputGUI($lng->txt(
"trac_title_description"),
"query");
325 $ti->readFromSession();
326 $this->filter[
"query"] = $ti->getValue();
329 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
333 $rs->readFromSession();
334 $this->filter[
"area"] = $rs->getValue();
337 if($a_include_no_status_filter)
339 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
342 $cb->readFromSession();
343 $this->filter[
"status"] = $cb->getChecked();
357 include_once
'./Services/Link/classes/class.ilLink.php';
367 $path_full = $tree->getPathFull($ref_id);
368 foreach($path_full as
$data)
370 if(++$counter < (count($path_full)-1))
374 $path .=
" » ";
375 if($ref_id != $data[
'ref_id'])
377 $path .= $data[
'title'];
381 $path .= (
'<a target="_top" href="'.
383 $data[
'title'].
'</a>');
399 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
401 global
$lng, $ilPluginAdmin;
405 if($a_split_learning_resources)
407 $options[
'lm'] = $lng->txt(
'objs_lm');
408 $options[
'sahs'] = $lng->txt(
'objs_sahs');
409 $options[
'htlm'] = $lng->txt(
'objs_htlm');
411 if($a_include_digilib)
413 $options[
'dbk'] = $lng->txt(
'objs_dbk');
418 $options[
'lres'] = $lng->txt(
'learning_resources');
421 $options[
'crs'] = $lng->txt(
'objs_crs');
422 $options[
'grp'] = $lng->txt(
'objs_grp');
423 $options[
'exc'] = $lng->txt(
'objs_exc');
424 $options[
'file'] = $lng->txt(
'objs_file');
425 $options[
'mcst'] = $lng->txt(
'objs_mcst');
426 $options[
'svy'] = $lng->txt(
'objs_svy');
427 $options[
'tst'] = $lng->txt(
'objs_tst');
428 $options[
'prg'] = $lng->txt(
'objs_prg');
430 if($a_allow_undefined_lp)
432 $options[
"webr"] = $lng->txt(
"objs_webr");
433 $options[
"wiki"] = $lng->txt(
"objs_wiki");
437 include_once
'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
438 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
439 foreach ($pl_names as $pl)
441 $pl_id = $ilPluginAdmin->getId(
IL_COMP_SERVICE,
"Repository",
"robj", $pl);
457 $pos = strrpos($id,
"_");
460 $function = strtoupper(substr($id, $pos+1));
461 if(in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT")))
463 $id = substr($id, 0, $pos);
467 if(trim($value) ==
"" && $id !=
"status")
470 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
471 get_class($this) !=
"ilTrMatrixTableGUI")
473 return "--".$lng->txt(
"none").
"--";
482 case 'status_changed':
494 case "spent_seconds":
501 include_once(
"./Services/Utilities/classes/class.ilFormat.php");
525 $value = $lng->txt(
"gender_".$value);
529 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
536 $lng->loadLanguageModule(
"meta");
537 $value = $lng->txt(
"meta_l_".$value);
541 $value = $lng->txt(
"meta_c_".$value);
551 foreach($this->filter as $id => $value)
572 case "matriculation":
594 case "spent_seconds":
595 if(is_array($value) && implode(
"", $value))
605 case 'status_changed':
625 $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8).
"00:00:00";
630 $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8).
"23:59:59";
644 $mode = $olp->getCurrentMode();
657 protected function parseTitle($a_obj_id, $action, $a_user_id =
false)
664 if($a_user_id != $ilUser->getId())
672 $user .=
", ".$a_user->getFullName();
675 if($a_obj_id != ROOT_FOLDER_ID)
677 $this->
setTitle($lng->txt($action).
": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
680 $this->
setDescription($this->lng->txt(
'trac_mode').
": ".$olp->getModeText($olp->getCurrentMode()));
684 $this->
setTitle($lng->txt($action));
695 global
$lng, $ilObjDataCache,
$ilUser, $ilClientIniFile;
708 include_once
'./Services/Link/classes/class.ilLink.php';
711 $data[$lng->txt(
"trac_name_of_installation")] = $ilClientIniFile->readVariable(
'client',
'name');
715 $data[$lng->txt(
"trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
723 $data[$lng->txt(
"trac_report_date")] =
725 $data[$lng->txt(
"trac_report_owner")] = $ilUser->getFullName();
734 $worksheet->write($a_row, 0, $caption);
735 $worksheet->write($a_row, 1, $value);
745 $a_csv->addColumn(strip_tags($caption));
746 $a_csv->addColumn(strip_tags($value));
754 include_once
'Modules/Course/classes/Timings/class.ilTimingCache.php';
758 if($timings[
'item'][
'changeable'] && $timings[
'user'][$a_user_id][
'end'])
760 $end = $timings[
'user'][$a_user_id][
'end'];
762 else if ($timings[
'item'][
'suggestion_end'])
764 $end = $timings[
'item'][
'suggestion_end'];
776 $seconds = ((int)$seconds > 0) ? $seconds : 0;
777 if($a_shorten_zero && !$seconds)
782 $hours = floor($seconds / 3600);
783 $rest = $seconds % 3600;
785 $minutes = floor(
$rest / 60);
793 return sprintf(
"%dh%02dm",$hours,$minutes);
801 if(is_numeric($a_value))
804 $a_value = (int)$a_value;
805 if($a_value <= $threshold)
809 return "0-".$threshold;
820 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
825 $step = $a_max_value / 10;
826 $base = ceil(log($step, 10));
827 $fac = ceil($step / pow(10, (
$base - 1)));
828 $step = pow(10,
$base - 1) * $fac;
834 $ticks = range(0, $a_max_value+$step, $step);
836 $value_ticks = array(0 => 0);
837 foreach($ticks as $tick)
839 $value = $tvalue = $tick;
845 if($a_format_seconds)
849 $value_ticks[$value] = $tvalue;
860 for($loop = 0; $loop < 10; $loop++)
862 $year = date(
"Y")-$loop;
864 for($loop2 = 12; $loop2 > 0; $loop2--)
866 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
867 if($year.$month <= date(
"Ym"))
871 $caption = $year.
" / ".$lng->txt(
"month_".$month.
"_long");
875 $caption = $year.
"/".$month;
877 $options[$year.
"-".$month] = $caption;
894 for($loop = 1; $loop<13; $loop++)
896 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
897 if($a_year.
"-".$month <= date(
"Y-m"))
901 $caption = $lng->txt(
"month_".$month.
"_long");
905 $caption = $lng->txt(
"month_".$month.
"_short");
907 $all[$a_year.
"-".$month] = $caption;
917 $cols = $privacy_fields = array();
919 include_once(
"./Services/User/classes/class.ilUserProfile.php");
921 $up->skipGroup(
"preferences");
922 $up->skipGroup(
"settings");
923 $up->skipGroup(
"interests");
924 $ufs = $up->getStandardFields();
927 $cols[
"login"] = array(
928 "txt" => $lng->txt(
"login"),
931 if(!$this->anonymized)
933 $cols[
"firstname"] = array(
934 "txt" => $lng->txt(
"firstname"),
936 $cols[
"lastname"] = array(
937 "txt" => $lng->txt(
"lastname"),
942 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
946 $cols[
"first_access"] = array(
947 "txt" => $lng->txt(
"trac_first_access"),
949 $cols[
"last_access"] = array(
950 "txt" => $lng->txt(
"trac_last_access"),
955 $cols[
"read_count"] = array(
956 "txt" => $lng->txt(
"trac_read_count"),
962 $cols[
"spent_seconds"] = array(
963 "txt" => $lng->txt(
"trac_spent_seconds"),
969 $cols[
"percentage"] = array(
970 "txt" => $lng->txt(
"trac_percentage"),
978 $cols[
"status"] = array(
979 "txt" => $lng->txt(
"trac_status"),
982 $cols[
'status_changed'] = array(
983 'txt' => $lng->txt(
'trac_status_changed'),
989 $cols[
"mark"] = array(
990 "txt" => $lng->txt(
"trac_mark"),
994 $cols[
"u_comment"] = array(
995 "txt" => $lng->txt(
"trac_comment"),
998 $cols[
"create_date"] = array(
999 "txt" => $lng->txt(
"create_date"),
1000 "default" =>
false);
1001 $cols[
"language"] = array(
1002 "txt" => $lng->txt(
"language"),
1003 "default" =>
false);
1006 if(!$this->anonymized &&
1007 ($a_in_course || $a_in_group))
1010 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1014 foreach ($ufs as $f => $fd)
1016 if (!isset($cols[$f]) && $f !=
"username" && !$fd[
"lists_hide"])
1019 !($fd[
"course_export_fix_value"] || $ilSetting->get(
"usr_settings_course_export_".$f)))
1024 !($fd[
"group_export_fix_value"] || $ilSetting->get(
"usr_settings_group_export_".$f)))
1030 "txt" => $lng->txt($f),
1031 "default" =>
false);
1033 $privacy_fields[] = $f;
1038 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
1042 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
1046 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
1048 foreach($user_defined_fields as $definition)
1052 $f =
"udf_".$definition[
"field_id"];
1054 "txt" => $definition[
"field_name"],
1055 "default" =>
false);
1057 $privacy_fields[] = $f;
1063 return array($cols, $privacy_fields);
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.
_lookupOwner($a_id)
lookup object owner
static _getInstance()
Get instance.
getMonthsYear($a_year=null, $a_short=false)
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.
getFilterItemByPostVar($a_post_var)
_getImagePathForStatus($a_status)
Get image path for status.
const EXTENDED_DATA_READ_COUNT
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
static setUseRelativeDates($a_status)
set use relative dates
_showWarning($a_ref_id, $a_usr_id)
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)
_lookupFullname($a_user_id)
Lookup Full Name.
static _lookupObjectId($a_ref_id)
lookup object id
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 lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
fillMetaExcel($worksheet, &$a_row)
TableGUI class for learning progress.
if(!is_array($argv)) $options
getExportMeta()
Build export meta data.
const LP_MODE_TEST_PASSED
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
_getStatusText($a_status, $a_lng=null)
Get status alt text.
buildValueScale($a_max_value, $a_anonymize=false, $a_format_seconds=false)
This class represents a text property in a property form.
initFilter($a_split_learning_resources=false, $a_include_no_status_filter=true)
Init filter.
static formatDate(ilDateTime $date)
Format a date public.
isPercentageAvailable($a_obj_id)
setMaxLength($a_maxlength)
Set Max Length.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
searchFilterListener($a_ref_id, $a_data)
Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVA...
static _lookupType($a_id, $a_reference=false)
lookup object type
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.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
static _getInstance()
Get instance of ilPrivacySettings.
getCurrentFilter($as_query=false)
static redirect($a_script)
http redirect to other script
static getInstance($a_obj_id)
resetFilter()
Reset filter.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")