4include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
 
    5include_once  
'./Services/Search/classes/class.ilSearchSettings.php';
 
    6require_once(
'./Services/Repository/classes/class.ilObjectPlugin.php');
 
   24    public function __construct($a_parent_obj, $a_parent_cmd = 
"", $a_template_context = 
"")
 
   29        $this->lng->loadLanguageModule(
"meta");
 
   31        include_once(
"./Services/Object/classes/class.ilObjectLP.php");
 
   34        if (!$this->anonymized && $this->obj_id) {
 
   35            include_once 
"Services/Object/classes/class.ilObjectLP.php";
 
   37            $this->anonymized = $olp->isAnonymized();
 
   45        $ilCtrl = 
$DIC[
'ilCtrl'];
 
   50        if (!$ilCtrl->getNextClass($this)) {
 
   53            switch ($ilCtrl->getCmd()) {
 
   65                    $to_hide = 
$_POST[
"item_id"];
 
   69                    $to_hide = array((
int) 
$_GET[
"hide"]);
 
   72                case "mailselectedusers":
 
   73                    if (!
sizeof(
$_POST[
"uid"])) {
 
   76                        $this->
sendMail(
$_POST[
"uid"], $this->parent_obj, $this->parent_cmd);
 
   80                case 'addToClipboard':
 
   81                    if (!
sizeof(
$_POST[
'uid'])) {
 
   97                $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
 
   98                $obj->setValue($value);
 
   99                $obj->writeToSession();
 
  102            if (isset($_REQUEST[
"tbltplcrt"])) {
 
  103                $ilCtrl->setParameter($this->parent_obj, 
"tbltplcrt", $_REQUEST[
"tbltplcrt"]);
 
  105            if (isset($_REQUEST[
"tbltpldel"])) {
 
  106                $ilCtrl->setParameter($this->parent_obj, 
"tbltpldel", $_REQUEST[
"tbltpldel"]);
 
  109            $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
 
  112            return parent::executeCommand();
 
  116    protected function sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
 
  120        require_once 
'Services/Mail/classes/class.ilMailFormCall.php';
 
  123        foreach ($a_user_ids as $usr_id) {
 
  131        $ref_id = (int) $_REQUEST[
"ref_id"];
 
  134            $tmpl_id = $obj_lp->getMailTemplateId();
 
  143                include_once 
'./Services/Link/classes/class.ilLink.php';
 
  145                $sig = rawurlencode(base64_encode($sig));
 
  156                    'rcp_to' => implode(
',', $rcps),
 
  173    protected function searchObjects(array 
$filter, $permission, array $preset_obj_ids = 
null, $a_check_lp_activation = 
true)
 
  177        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  179        include_once 
'./Services/Search/classes/class.ilQueryParser.php';
 
  182        $query_parser->setMinWordLength(0);
 
  184        $query_parser->parse();
 
  185        if (!$query_parser->validate()) {
 
  191        if (
$filter[
"type"] == 
"lres") {
 
  192            $filter[
"type"] = array(
'lm',
'sahs',
'htlm');
 
  197        include_once 
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
 
  199        $object_search->setFilter(
$filter[
"type"]);
 
  200        if ($preset_obj_ids) {
 
  201            $object_search->setIdFilter($preset_obj_ids);
 
  203        $res = $object_search->performSearch();
 
  206            $res->setRequiredPermission($permission);
 
  209        $res->setMaxHits(self::HIT_LIMIT);
 
  211        if ($a_check_lp_activation) {
 
  212            $res->addObserver($this, 
"searchFilterListener");
 
  215        if (!$this->
filter[
"area"]) {
 
  222        foreach (
$res->getResults() as $obj_data) {
 
  223            $objects[$obj_data[
'obj_id']][] = $obj_data[
'ref_id'];
 
  225        return $objects ? $objects : array();
 
  235        if (is_array($this->
filter[
"hide"]) && in_array($a_data[
"obj_id"], $this->
filter[
"hide"])) {
 
  239        if (get_class($olp) != 
"ilObjectLP" && 
 
  251    public function initBaseFilter($a_split_learning_resources = 
false, $a_include_no_status_filter = 
true)
 
  256        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  261        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  265        $si->readFromSession();
 
  266        if (!
$si->getValue()) {
 
  267            $si->setValue(
"crs");
 
  272        include_once(
"./Services/Form/classes/class.ilMultiSelectInputGUI.php");
 
  275        $msi->readFromSession();
 
  276        $this->
filter[
"hide"] = $msi->getValue();
 
  277        if ($this->
filter[
"hide"]) {
 
  280            $type = $types[
"type"];
 
  282            if (
$type == 
'lres') {
 
  283                $type = array(
'lm',
'sahs',
'htlm');
 
  287            foreach ($this->
filter[
"hide"] as $obj_id) {
 
  288                if (in_array($ilObjDataCache->lookupType($obj_id), 
$type)) {
 
  289                    $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
 
  292            $msi->setOptions($options);
 
  296        include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
 
  298        $ti->setMaxLength(64);
 
  301        $ti->readFromSession();
 
  302        $this->
filter[
"query"] = $ti->getValue();
 
  305        include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
 
  307        $rs->setSelectText(
$lng->txt(
"trac_select_area"));
 
  309        $rs->readFromSession();
 
  310        $this->
filter[
"area"] = $rs->getValue();
 
  313        if ($a_include_no_status_filter) {
 
  314            include_once(
"./Services/Form/classes/class.ilCheckboxInputGUI.php");
 
  317            $cb->readFromSession();
 
  318            $this->
filter[
"status"] = $cb->getChecked();
 
  332        $tree = 
$DIC[
'tree'];
 
  333        $ilCtrl = 
$DIC[
'ilCtrl'];
 
  335        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  337        if (!count($ref_ids)) {
 
  340        foreach ($ref_ids as $ref_id) {
 
  343            $path_full = $tree->getPathFull($ref_id);
 
  344            foreach ($path_full as 
$data) {
 
  345                if (++$counter < (count($path_full) - 1)) {
 
  348                $path .= 
" » ";
 
  349                if ($ref_id != 
$data[
'ref_id']) {
 
  350                    $path .= 
$data[
'title'];
 
  352                    $path .= (
'<a target="_top" href="' .
 
  354                              $data[
'title'] . 
'</a>');
 
  370    protected function getPossibleTypes($a_split_learning_resources = 
false, $a_include_digilib = 
false, $a_allow_undefined_lp = 
false)
 
  375        $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  379        if ($a_split_learning_resources) {
 
  380            $options[
'lm'] = 
$lng->txt(
'objs_lm');
 
  381            $options[
'sahs'] = 
$lng->txt(
'objs_sahs');
 
  382            $options[
'htlm'] = 
$lng->txt(
'objs_htlm');
 
  384            $options[
'lres'] = 
$lng->txt(
'obj_lrss');
 
  387        $options[
'crs'] = 
$lng->txt(
'objs_crs');
 
  388        $options[
'grp'] = 
$lng->txt(
'objs_grp');
 
  389        $options[
'exc'] = 
$lng->txt(
'objs_exc');
 
  390        $options[
'file'] = 
$lng->txt(
'objs_file');
 
  391        $options[
'mcst'] = 
$lng->txt(
'objs_mcst');
 
  392        $options[
'svy'] = 
$lng->txt(
'objs_svy');
 
  393        $options[
'tst'] = 
$lng->txt(
'objs_tst');
 
  394        $options[
'prg'] = 
$lng->txt(
'objs_prg');
 
  395        $options[
'iass'] = 
$lng->txt(
'objs_iass');
 
  396        $options[
'copa'] = 
$lng->txt(
'objs_copa');
 
  397        $options[
'cmix'] = 
$lng->txt(
'objs_cmix');
 
  398        $options[
'lti'] = 
$lng->txt(
'objs_lti');
 
  399        $options[
'lso'] = 
$lng->txt(
'objs_lso');
 
  401        if ($a_allow_undefined_lp) {
 
  402            $options[
'root'] = 
$lng->txt(
'obj_reps');
 
  403            $options[
'cat'] = 
$lng->txt(
'objs_cat');
 
  404            $options[
"webr"] = 
$lng->txt(
"objs_webr");
 
  405            $options[
"wiki"] = 
$lng->txt(
"objs_wiki");
 
  406            $options[
"blog"] = 
$lng->txt(
"objs_blog");
 
  407            $options[
"prtf"] = 
$lng->txt(
"objs_prtf");
 
  408            $options[
"prtt"] = 
$lng->txt(
"objs_prtt");
 
  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);
 
  492                $value = $icons->renderIconForStatus((
int) $value);
 
  496                $lng->loadLanguageModule(
"meta");
 
  497                $value = 
$lng->txt(
"meta_l_" . $value);
 
  501                $value = 
$lng->txt(
"meta_c_" . $value);
 
  511        foreach ((array) $this->
filter as $id => $value) {
 
  530                case "matriculation":
 
  541                    if ($value !== 
false) {
 
  550                case "spent_seconds":
 
  551                    if (is_array($value) && implode(
"", $value)) {
 
  560                 case 'status_changed':
 
  562                         if ($value[
"from"]) {
 
  573                         if ($value[
"from"]) {
 
  575                             $result[$id][
"from"] = substr(
$result[$id][
"from"], 0, -8) . 
"00:00:00";
 
  579                             $result[$id][
"to"] = substr(
$result[$id][
"to"], 0, -8) . 
"23:59:59";
 
  593        $mode = $olp->getCurrentMode();
 
  611    protected function parseTitle($a_obj_id, $action, $a_user_id = 
false)
 
  616        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  621            if ($a_user_id != 
$ilUser->getId()) {
 
  626            $user .= 
", " . $a_user->getFullName(); 
 
  630            $this->
setTitle(
$lng->txt($action) . 
": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
 
  633            $this->
setDescription($this->lng->txt(
'trac_mode') . 
": " . $olp->getModeText($olp->getCurrentMode()));
 
  649        $ilObjDataCache = 
$DIC[
'ilObjDataCache'];
 
  651        $ilClientIniFile = 
$DIC[
'ilClientIniFile'];
 
  664        include_once 
'./Services/Link/classes/class.ilLink.php';
 
  667        $data[
$lng->txt(
"trac_name_of_installation")] = $ilClientIniFile->readVariable(
'client', 
'name');
 
  670            $data[
$lng->txt(
"trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
 
  686            $a_excel->
setCell($a_row, 0, $caption);
 
  687            $a_excel->
setCell($a_row, 1, $value);
 
  696            $a_csv->addColumn(strip_tags($caption));
 
  697            $a_csv->addColumn(strip_tags($value));
 
  706        if ($timing_cache->isWarningRequired($a_user_id)) {
 
  708            if ($timings[
'item'][
'changeable'] && $timings[
'user'][$a_user_id][
'end']) {
 
  709                $end = $timings[
'user'][$a_user_id][
'end'];
 
  710            } elseif ($timings[
'item'][
'suggestion_end']) {
 
  711                $end = $timings[
'item'][
'suggestion_end'];
 
  721        $seconds = ((int) $seconds > 0) ? $seconds : 0;
 
  722        if ($a_shorten_zero && !$seconds) {
 
  726        $hours = floor($seconds / 3600);
 
  727        $rest = $seconds % 3600;
 
  729        $minutes = floor(
$rest / 60);
 
  736        return sprintf(
"%dh%02dm", $hours, $minutes);
 
  744        if (is_numeric($a_value)) {
 
  746            $a_value = (int) $a_value;
 
  747            if ($a_value <= $threshold) {
 
  748                if (!$a_force_number) {
 
  749                    return "0-" . $threshold;
 
  758    protected function buildValueScale($a_max_value, $a_anonymize = 
false, $a_format_seconds = 
false)
 
  762            $step = $a_max_value / 10;
 
  763            $base = ceil(log($step, 10));
 
  764            $fac = ceil($step / pow(10, (
$base - 1)));
 
  765            $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) {
 
  774            $value = $tvalue = $tick;
 
  779            if ($a_format_seconds) {
 
  782            $value_ticks[$value] = $tvalue;
 
  795        for ($loop = 0; $loop < 10; $loop++) {
 
  796            $year = date(
"Y") - $loop;
 
  797            $options[$year] = $year;
 
  798            for ($loop2 = 12; $loop2 > 0; $loop2--) {
 
  799                $month = str_pad($loop2, 2, 
"0", STR_PAD_LEFT);
 
  800                if ($year . $month <= date(
"Ym")) {
 
  802                        $caption = $year . 
" / " . 
$lng->txt(
"month_" . $month . 
"_long");
 
  804                        $caption = $year . 
"/" . $month;
 
  806                    $options[$year . 
"-" . $month] = $caption;
 
  824        for ($loop = 1; $loop < 13; $loop++) {
 
  825            $month = str_pad($loop, 2, 
"0", STR_PAD_LEFT);
 
  826            if ($a_year . 
"-" . $month <= date(
"Y-m")) {
 
  828                    $caption = 
$lng->txt(
"month_" . $month . 
"_long");
 
  830                    $caption = 
$lng->txt(
"month_" . $month . 
"_short");
 
  832                $all[$a_year . 
"-" . $month] = $caption;
 
  845        $cols = $privacy_fields = array();
 
  847        include_once(
"./Services/User/classes/class.ilUserProfile.php");
 
  849        $up->skipGroup(
"preferences");
 
  850        $up->skipGroup(
"settings");
 
  851        $up->skipGroup(
"interests");
 
  852        $ufs = $up->getStandardFields();
 
  855        $cols[
"login"] = array(
 
  856            "txt" => 
$lng->txt(
"login"),
 
  859        if (!$this->anonymized) {
 
  860            $cols[
"firstname"] = array(
 
  861                "txt" => 
$lng->txt(
"firstname"),
 
  863            $cols[
"lastname"] = array(
 
  864                "txt" => 
$lng->txt(
"lastname"),
 
  869        include_once 
'Services/Tracking/classes/class.ilObjUserTracking.php';
 
  872            $cols[
"first_access"] = array(
 
  873                "txt" => 
$lng->txt(
"trac_first_access"),
 
  875            $cols[
"last_access"] = array(
 
  876                "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"),
 
  892            $cols[
"percentage"] = array(
 
  893                "txt" => 
$lng->txt(
"trac_percentage"),
 
  899        if ($olp->isActive()) {
 
  900            $cols[
"status"] = array(
 
  901                "txt" => 
$lng->txt(
"trac_status"),
 
  904            $cols[
'status_changed'] = array(
 
  905                'txt' => 
$lng->txt(
'trac_status_changed'),
 
  910            $cols[
"mark"] = array(
 
  911                "txt" => 
$lng->txt(
"trac_mark"),
 
  915        $cols[
"u_comment"] = array(
 
  916            "txt" => 
$lng->txt(
"trac_comment"),
 
  919        $cols[
"create_date"] = array(
 
  920            "txt" => 
$lng->txt(
"create_date"),
 
  922        $cols[
"language"] = array(
 
  923            "txt" => 
$lng->txt(
"language"),
 
  927        if (!$this->anonymized &&
 
  928            ($a_in_course || $a_in_group)) {
 
  930            include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
 
  933                foreach ($ufs as 
$f => $fd) {
 
  934                    if (!isset(
$cols[
$f]) && 
$f != 
"username" && !$fd[
"lists_hide"]) {
 
  936                            !($fd[
"course_export_fix_value"] || 
$ilSetting->get(
"usr_settings_course_export_" . 
$f))) {
 
  940                            !($fd[
"group_export_fix_value"] || 
$ilSetting->get(
"usr_settings_group_export_" . 
$f))) {
 
  948                        $privacy_fields[] = 
$f;
 
  953                include_once 
'./Services/User/classes/class.ilUserDefinedFields.php';
 
  956                    $user_defined_fields = $user_defined_fields->getCourseExportableFields();
 
  958                    $user_defined_fields = $user_defined_fields->getGroupExportableFields();
 
  960                foreach ($user_defined_fields as $definition) {
 
  962                        $f = 
"udf_" . $definition[
"field_id"];
 
  964                                "txt" => $definition[
"field_name"],
 
  967                        $privacy_fields[] = 
$f;
 
  973        return array(
$cols, $privacy_fields);
 
  981        $users = (array) 
$_POST[
'uid'];
 
  982        include_once 
'./Services/User/classes/class.ilUserClipboard.php';
 
  987        $GLOBALS[
'DIC'][
'lng']->loadLanguageModule(
'user');
 
  988        ilUtil::sendSuccess($this->lng->txt(
'clipboard_user_added'), 
true);
 
 1004        $this->icon_variant = $variant;
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
const QP_COMBINATION_AND
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
@classDescription Date and time handling
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
const LP_MODE_CMIX_COMPLETED_OR_PASSED
const LP_MODE_CMIX_COMPL_WITH_FAILED
const LP_MODE_CMIX_PASSED
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
const LP_MODE_TEST_PASSED
const LP_MODE_VISITED_PAGES
const LP_MODE_LTI_OUTCOME
const LP_MODE_CMIX_COMPLETED
const LP_MODE_CMIX_PASSED_WITH_FAILED
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
TableGUI class for learning progress.
__construct($a_parent_obj, $a_parent_cmd="", $a_template_context="")
ilTable2GUI constructor.
formatSeconds($seconds, $a_shorten_zero=false)
initBaseFilter($a_split_learning_resources=false, $a_include_no_status_filter=true)
Init filter.
setIconVariant(int $variant)
Sets the variant of LP icons that is shown in the table.
addToClipboard()
Add selected users to clipboard.
parseValue($id, $value, $type)
getCurrentFilter($as_query=false)
showTimingsWarning($a_ref_id, $a_user_id)
getMonthsYear($a_year=null, $a_short=false)
getSelectableUserColumns($a_in_course=false, $a_in_group=false)
fillMetaExcel(ilExcel $a_excel, &$a_row)
Add meta information to excel export.
isPercentageAvailable($a_obj_id)
buildValueScale($a_max_value, $a_anonymize=false, $a_format_seconds=false)
sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
parseTitle($a_obj_id, $action, $a_user_id=false)
getIconVariant()
Gets the variant of LP icons that is shown in the table.
anonymizeValue($a_value, $a_force_number=false)
getMonthsFilter($a_short=false)
getExportMeta()
Build export meta data.
buildPath($ref_ids)
Build path with deep-link.
fillMetaCSV($a_csv)
Add meta information to csv export.
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
executeCommand()
Execute command.
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
searchFilterListener($a_ref_id, $a_data)
Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVA...
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getLogger($a_component_id)
Get component logger.
const EXTENDED_DATA_READ_COUNT
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
const EXTENDED_DATA_SPENT_SECONDS
const EXTENDED_DATA_LAST_ACCESS
static _lookupLogin($a_user_id)
lookup login
static _lookupFullname($a_user_id)
Lookup Full Name.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
static getInstance($a_obj_id)
static lookupTxtById($plugin_id, $lang_var)
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getInstance()
Get instance of ilPrivacySettings.
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
resetFilter()
Reset filter.
writeFilterToSession()
Write filter values to session.
setDescription($a_val)
Set description.
determineSelectedFilters()
Determine selected filters.
This class represents a text property in a property form.
static getInstanceByRefId($ref_id)
static & _getTimings($a_ref_id)
static getInstance($a_usr_id)
Get singelton instance.
static _getInstance()
Get instance.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
foreach($_POST as $key=> $value) $res