4include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
 
    5include_once  
'./Services/Search/classes/class.ilSearchSettings.php';
 
    6require_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)) {
 
   59                    $to_hide = 
$_POST[
"item_id"];
 
   63                    $to_hide = array((
int) 
$_GET[
"hide"]);
 
   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),
 
  167    protected function searchObjects(array 
$filter, $permission, array $preset_obj_ids = 
null, $a_check_lp_activation = 
true)
 
  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');
 
  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') {
 
  279                $type = array(
'lm',
'sahs',
'htlm');
 
  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");
 
  294        $ti->setMaxLength(64);
 
  297        $ti->readFromSession();
 
  298        $this->filter[
"query"] = $ti->getValue();
 
  301        include_once(
"./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
 
  303        $rs->setSelectText(
$lng->txt(
"trac_select_area"));
 
  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']) {
 
  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) {
 
  387        if ($a_allow_undefined_lp) {
 
  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);
 
  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;
 
  806        $cols = $privacy_fields = array();
 
  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();
 
  816        $cols[
"login"] = array(
 
  817            "txt" => 
$lng->txt(
"login"),
 
  820        if (!$this->anonymized) {
 
  821            $cols[
"firstname"] = array(
 
  822                "txt" => 
$lng->txt(
"firstname"),
 
  824            $cols[
"lastname"] = array(
 
  825                "txt" => 
$lng->txt(
"lastname"),
 
  830        include_once 
'Services/Tracking/classes/class.ilObjUserTracking.php';
 
  833            $cols[
"first_access"] = array(
 
  834                "txt" => 
$lng->txt(
"trac_first_access"),
 
  836            $cols[
"last_access"] = array(
 
  837                "txt" => 
$lng->txt(
"trac_last_access"),
 
  841            $cols[
"read_count"] = array(
 
  842                "txt" => 
$lng->txt(
"trac_read_count"),
 
  847            $cols[
"spent_seconds"] = array(
 
  848                "txt" => 
$lng->txt(
"trac_spent_seconds"),
 
  853            $cols[
"percentage"] = array(
 
  854                "txt" => 
$lng->txt(
"trac_percentage"),
 
  860        if ($olp->isActive()) {
 
  861            $cols[
"status"] = array(
 
  862                "txt" => 
$lng->txt(
"trac_status"),
 
  865            $cols[
'status_changed'] = array(
 
  866                'txt' => 
$lng->txt(
'trac_status_changed'),
 
  871            $cols[
"mark"] = array(
 
  872                "txt" => 
$lng->txt(
"trac_mark"),
 
  876        $cols[
"u_comment"] = array(
 
  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');
 
sprintf('%.4f', $callTime)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
An exception for terminatinating execution or to throw for unit testing.
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)
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_TEST_PASSED
const LP_MODE_VISITED_PAGES
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.
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)
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 _getStatusText($a_status, $a_lng=null)
Get status alt text.
static _getImagePathForStatus($a_status)
Get image path for status.
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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
foreach($_POST as $key=> $value) $res