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();
47 if (!
$ilCtrl->getNextClass($this)) {
62 $to_hide =
$_POST[
"item_id"];
66 $to_hide = array((
int)
$_GET[
"hide"]);
69 case "mailselectedusers":
70 if (!
sizeof(
$_POST[
"uid"])) {
73 $this->
sendMail(
$_POST[
"uid"], $this->parent_obj, $this->parent_cmd);
77 case 'addToClipboard':
78 if (!
sizeof(
$_POST[
'uid'])) {
94 $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
95 $obj->setValue($value);
96 $obj->writeToSession();
99 if (isset($_REQUEST[
"tbltplcrt"])) {
100 $ilCtrl->setParameter($this->parent_obj,
"tbltplcrt", $_REQUEST[
"tbltplcrt"]);
102 if (isset($_REQUEST[
"tbltpldel"])) {
103 $ilCtrl->setParameter($this->parent_obj,
"tbltpldel", $_REQUEST[
"tbltpldel"]);
106 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
109 return parent::executeCommand();
113 protected function sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
117 require_once
'Services/Mail/classes/class.ilMailFormCall.php';
120 foreach ($a_user_ids as $usr_id) {
128 $ref_id = (int) $_REQUEST[
"ref_id"];
131 $tmpl_id = $obj_lp->getMailTemplateId();
140 include_once
'./Services/Link/classes/class.ilLink.php';
142 $sig = rawurlencode(base64_encode($sig));
153 'rcp_to' => implode(
',', $rcps),
170 protected function searchObjects(array
$filter, $permission, array $preset_obj_ids = null, $a_check_lp_activation =
true)
174 $ilObjDataCache = $DIC[
'ilObjDataCache'];
176 include_once
'./Services/Search/classes/class.ilQueryParser.php';
179 $query_parser->setMinWordLength(0);
181 $query_parser->parse();
182 if (!$query_parser->validate()) {
188 if ($filter[
"type"] ==
"lres") {
189 $filter[
"type"] = array(
'lm',
'sahs',
'htlm');
191 $filter[
"type"] = array($filter[
"type"]);
194 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
196 $object_search->setFilter($filter[
"type"]);
197 if ($preset_obj_ids) {
198 $object_search->setIdFilter($preset_obj_ids);
200 $res = &$object_search->performSearch();
203 $res->setRequiredPermission($permission);
206 $res->setMaxHits(1000);
208 if ($a_check_lp_activation) {
209 $res->addObserver($this,
"searchFilterListener");
212 if (!$this->filter[
"area"]) {
213 $res->filter(ROOT_FOLDER_ID,
false);
215 $res->filter($this->filter[
"area"],
false);
219 foreach (
$res->getResults() as $obj_data) {
220 $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
224 if (
$res->isLimitReached()) {
225 $this->lng->loadLanguageModule(
"search");
229 return $objects ? $objects : array();
239 if (is_array($this->filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->filter[
"hide"])) {
243 if (get_class($olp) !=
"ilObjectLP" &&
255 public function initBaseFilter($a_split_learning_resources =
false, $a_include_no_status_filter =
true)
260 $ilObjDataCache = $DIC[
'ilObjDataCache'];
265 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
269 $si->readFromSession();
270 if (!
$si->getValue()) {
271 $si->setValue(
"crs");
273 $this->filter[
"type"] =
$si->getValue();
276 include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
279 $msi->readFromSession();
280 $this->filter[
"hide"] = $msi->getValue();
281 if ($this->filter[
"hide"]) {
284 $type = $types[
"type"];
286 if (
$type ==
'lres') {
287 $type = array(
'lm',
'sahs',
'htlm');
291 foreach ($this->filter[
"hide"] as $obj_id) {
292 if (in_array($ilObjDataCache->lookupType($obj_id),
$type)) {
293 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
300 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
305 $ti->readFromSession();
306 $this->filter[
"query"] = $ti->getValue();
309 include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
313 $rs->readFromSession();
314 $this->filter[
"area"] = $rs->getValue();
317 if ($a_include_no_status_filter) {
318 include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
321 $cb->readFromSession();
322 $this->filter[
"status"] = $cb->getChecked();
336 $tree = $DIC[
'tree'];
339 include_once
'./Services/Link/classes/class.ilLink.php';
341 if (!count($ref_ids)) {
344 foreach ($ref_ids as $ref_id) {
347 $path_full =
$tree->getPathFull($ref_id);
348 foreach ($path_full as
$data) {
349 if (++$counter < (count($path_full) - 1)) {
352 $path .=
" » ";
353 if ($ref_id != $data[
'ref_id']) {
354 $path .= $data[
'title'];
356 $path .= (
'<a target="_top" href="' .
358 $data[
'title'] .
'</a>');
374 protected function getPossibleTypes($a_split_learning_resources =
false, $a_include_digilib =
false, $a_allow_undefined_lp =
false)
379 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
383 if ($a_split_learning_resources) {
403 if ($a_allow_undefined_lp) {
412 include_once
'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
413 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"Repository",
"robj");
414 foreach ($pl_names as $pl) {
415 $pl_id = $ilPluginAdmin->getId(
IL_COMP_SERVICE,
"Repository",
"robj", $pl);
432 $pos = strrpos(
$id,
"_");
433 if ($pos !==
false) {
434 $function = strtoupper(substr(
$id, $pos + 1));
435 if (in_array($function, array(
"MIN",
"MAX",
"SUM",
"AVG",
"COUNT"))) {
436 $id = substr(
$id, 0, $pos);
440 if (trim($value) ==
"" &&
$id !=
"status") {
441 if (
$id ==
"title" &&
442 get_class($this) !=
"ilTrObjectUsersPropsTableGUI" &&
443 get_class($this) !=
"ilTrMatrixTableGUI") {
444 return "--" .
$lng->txt(
"none") .
"--";
452 case 'status_changed':
464 case "spent_seconds":
476 $value = $value .
"%";
487 $value =
$lng->txt(
"gender_" . $value);
491 include_once(
"./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
498 $lng->loadLanguageModule(
"meta");
499 $value =
$lng->txt(
"meta_l_" . $value);
503 $value =
$lng->txt(
"meta_c_" . $value);
513 foreach ((array) $this->filter as
$id => $value) {
532 case "matriculation":
543 if ($value !==
false) {
552 case "spent_seconds":
553 if (is_array($value) && implode(
"", $value)) {
562 case 'status_changed':
564 if ($value[
"from"]) {
575 if ($value[
"from"]) {
595 $mode = $olp->getCurrentMode();
611 $ilObjDataCache = $DIC[
'ilObjDataCache'];
616 if ($a_user_id !=
$ilUser->getId()) {
621 $user .=
", " . $a_user->getFullName();
624 if ($a_obj_id != ROOT_FOLDER_ID) {
628 $this->
setDescription($this->lng->txt(
'trac_mode') .
": " . $olp->getModeText($olp->getCurrentMode()));
644 $ilObjDataCache = $DIC[
'ilObjDataCache'];
646 $ilClientIniFile = $DIC[
'ilClientIniFile'];
659 include_once
'./Services/Link/classes/class.ilLink.php';
662 $data[
$lng->txt(
"trac_name_of_installation")] = $ilClientIniFile->readVariable(
'client',
'name');
665 $data[
$lng->txt(
"trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
681 $a_excel->
setCell($a_row, 0, $caption);
682 $a_excel->
setCell($a_row, 1, $value);
691 $a_csv->addColumn(strip_tags($caption));
692 $a_csv->addColumn(strip_tags($value));
701 if ($timing_cache->isWarningRequired($a_user_id)) {
703 if ($timings[
'item'][
'changeable'] && $timings[
'user'][$a_user_id][
'end']) {
704 $end = $timings[
'user'][$a_user_id][
'end'];
705 } elseif ($timings[
'item'][
'suggestion_end']) {
706 $end = $timings[
'item'][
'suggestion_end'];
716 $seconds = ((int) $seconds > 0) ? $seconds : 0;
717 if ($a_shorten_zero && !$seconds) {
721 $hours = floor($seconds / 3600);
722 $rest = $seconds % 3600;
724 $minutes = floor(
$rest / 60);
731 return sprintf(
"%dh%02dm", $hours, $minutes);
739 if (is_numeric($a_value)) {
741 $a_value = (int) $a_value;
742 if ($a_value <= $threshold) {
743 if (!$a_force_number) {
744 return "0-" . $threshold;
753 protected function buildValueScale($a_max_value, $a_anonymize =
false, $a_format_seconds =
false)
757 $step = $a_max_value / 10;
765 $ticks = range(0, $a_max_value +
$step,
$step);
767 $value_ticks = array(0 => 0);
768 foreach ($ticks as $tick) {
769 $value = $tvalue = $tick;
774 if ($a_format_seconds) {
777 $value_ticks[$value] = $tvalue;
790 for ($loop = 0; $loop < 10; $loop++) {
791 $year = date(
"Y") - $loop;
793 for ($loop2 = 12; $loop2 > 0; $loop2--) {
794 $month = str_pad($loop2, 2,
"0", STR_PAD_LEFT);
795 if ($year . $month <= date(
"Ym")) {
797 $caption = $year .
" / " .
$lng->txt(
"month_" . $month .
"_long");
799 $caption = $year .
"/" . $month;
801 $options[$year .
"-" . $month] = $caption;
819 for ($loop = 1; $loop < 13; $loop++) {
820 $month = str_pad($loop, 2,
"0", STR_PAD_LEFT);
821 if ($a_year .
"-" . $month <= date(
"Y-m")) {
823 $caption =
$lng->txt(
"month_" . $month .
"_long");
825 $caption =
$lng->txt(
"month_" . $month .
"_short");
827 $all[$a_year .
"-" . $month] = $caption;
840 $cols = $privacy_fields = array();
842 include_once(
"./Services/User/classes/class.ilUserProfile.php");
844 $up->skipGroup(
"preferences");
845 $up->skipGroup(
"settings");
846 $up->skipGroup(
"interests");
847 $ufs = $up->getStandardFields();
850 $cols[
"login"] = array(
851 "txt" =>
$lng->txt(
"login"),
854 if (!$this->anonymized) {
855 $cols[
"firstname"] = array(
856 "txt" =>
$lng->txt(
"firstname"),
858 $cols[
"lastname"] = array(
859 "txt" =>
$lng->txt(
"lastname"),
864 include_once
'Services/Tracking/classes/class.ilObjUserTracking.php';
867 $cols[
"first_access"] = array(
868 "txt" =>
$lng->txt(
"trac_first_access"),
870 $cols[
"last_access"] = array(
871 "txt" =>
$lng->txt(
"trac_last_access"),
875 $cols[
"read_count"] = array(
876 "txt" =>
$lng->txt(
"trac_read_count"),
881 $cols[
"spent_seconds"] = array(
882 "txt" =>
$lng->txt(
"trac_spent_seconds"),
887 $cols[
"percentage"] = array(
888 "txt" =>
$lng->txt(
"trac_percentage"),
894 if ($olp->isActive()) {
895 $cols[
"status"] = array(
896 "txt" =>
$lng->txt(
"trac_status"),
899 $cols[
'status_changed'] = array(
900 'txt' =>
$lng->txt(
'trac_status_changed'),
905 $cols[
"mark"] = array(
906 "txt" =>
$lng->txt(
"trac_mark"),
910 $cols[
"u_comment"] = array(
911 "txt" =>
$lng->txt(
"trac_comment"),
914 $cols[
"create_date"] = array(
915 "txt" =>
$lng->txt(
"create_date"),
917 $cols[
"language"] = array(
918 "txt" =>
$lng->txt(
"language"),
922 if (!$this->anonymized &&
923 ($a_in_course || $a_in_group)) {
925 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
928 foreach ($ufs as
$f => $fd) {
929 if (!isset($cols[
$f]) && $f !=
"username" && !$fd[
"lists_hide"]) {
931 !($fd[
"course_export_fix_value"] ||
$ilSetting->get(
"usr_settings_course_export_" . $f))) {
935 !($fd[
"group_export_fix_value"] ||
$ilSetting->get(
"usr_settings_group_export_" . $f))) {
940 "txt" =>
$lng->txt($f),
943 $privacy_fields[] =
$f;
948 include_once
'./Services/User/classes/class.ilUserDefinedFields.php';
951 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
953 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
955 foreach ($user_defined_fields as $definition) {
957 $f =
"udf_" . $definition[
"field_id"];
959 "txt" => $definition[
"field_name"],
962 $privacy_fields[] =
$f;
968 return array($cols, $privacy_fields);
977 include_once
'./Services/User/classes/class.ilUserClipboard.php';
982 $GLOBALS[
'DIC'][
'lng']->loadLanguageModule(
'user');
983 ilUtil::sendSuccess($this->lng->txt(
'clipboard_user_added'),
true);
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)
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)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
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.
buildValueScale($a_max_value, $a_anonymize=false, $a_format_seconds=false)
This class represents a text property in a property form.
foreach( $_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
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
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
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)
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.
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="")
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
static & _getTimings($a_ref_id)