ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilLPTableBaseGUI Class Reference

TableGUI class for learning progress. More...

+ Inheritance diagram for ilLPTableBaseGUI:
+ Collaboration diagram for ilLPTableBaseGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 searchFilterListener ($a_ref_id, $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED @access public. More...
 
 initBaseFilter ($a_split_learning_resources=false, $a_include_no_status_filter=true)
 Init filter. More...
 
 getCurrentFilter ($as_query=false)
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
 executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) @access public More...
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname="")
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox, $a_select_all_on_top=false)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table @access public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template @access public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title @access public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page @access public More...
 
 setHeaderNames ($a_header_names)
 set table header names @access public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns @access public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars @access public More...
 
 setColumnWidth ($a_column_width)
 set table column widths @access public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width @access public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) @access public More...
 
 setOffset ($a_offset)
 set dataset offset @access public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column @access public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction @access public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction @access public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table @access public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Protected Member Functions

 sendMail (array $a_user_ids, $a_parent_obj, $a_parent_cmd)
 
 searchObjects (array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
 Search objects that match current filters. More...
 
 buildPath ($ref_ids)
 Build path with deep-link. More...
 
 getPossibleTypes ($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
 Get possible subtypes. More...
 
 parseValue ($id, $value, $type)
 
 isPercentageAvailable ($a_obj_id)
 
 parseTitle ($a_obj_id, $action, $a_user_id=false)
 
 getExportMeta ()
 Build export meta data. More...
 
 fillMetaExcel (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 showTimingsWarning ($a_ref_id, $a_user_id)
 
 formatSeconds ($seconds, $a_shorten_zero=false)
 
 anonymizeValue ($a_value, $a_force_number=false)
 
 buildValueScale ($a_max_value, $a_anonymize=false, $a_format_seconds=false)
 
 getMonthsFilter ($a_short=false)
 
 getMonthsYear ($a_year=null, $a_short=false)
 
 getSelectableUserColumns ($a_in_course=false, $a_in_group=false)
 
 addToClipboard ()
 Add selected users to clipboard. More...
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

 $filter
 
 $anonymized
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats = []
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $select_all_on_top = false
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Detailed Description

TableGUI class for learning progress.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 16 of file class.ilLPTableBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPTableBaseGUI::__construct (   $a_parent_obj,
  $a_parent_cmd = "",
  $a_template_context = "" 
)

ilTable2GUI constructor.

Parameters
object$a_parent_objob Mostly ILIAS-GUI-Classes
string$a_parent_cmd
string$a_template_context

Reimplemented from ilTable2GUI.

Reimplemented in ilTrMatrixTableGUI.

Definition at line 21 of file class.ilLPTableBaseGUI.php.

22 {
23 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
24
25 // country names
26 $this->lng->loadLanguageModule("meta");
27
28 include_once("./Services/Object/classes/class.ilObjectLP.php");
29
30 $this->anonymized = (bool) !ilObjUserTracking::_enabledUserRelatedData();
31 if (!$this->anonymized && $this->obj_id) {
32 include_once "Services/Object/classes/class.ilObjectLP.php";
33 $olp = ilObjectLP::getInstance($this->obj_id);
34 $this->anonymized = $olp->isAnonymized();
35 }
36 }
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static getInstance($a_obj_id)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), ilObjUserTracking\_enabledUserRelatedData(), and ilObjectLP\getInstance().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToClipboard()

ilLPTableBaseGUI::addToClipboard ( )
protected

Add selected users to clipboard.

Definition at line 983 of file class.ilLPTableBaseGUI.php.

984 {
985 $users = (array) $_POST['uid'];
986 include_once './Services/User/classes/class.ilUserClipboard.php';
987 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
988 $clip->add($users);
989 $clip->save();
990
991 $GLOBALS['DIC']['lng']->loadLanguageModule('user');
992 ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
993 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$_POST["username"]
getId()
Get element id.
static getInstance($a_usr_id)
Get singelton instance.

References $_POST, $GLOBALS, ilTable2GUI\getId(), and ilUserClipboard\getInstance().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ anonymizeValue()

ilLPTableBaseGUI::anonymizeValue (   $a_value,
  $a_force_number = false 
)
protected

Definition at line 743 of file class.ilLPTableBaseGUI.php.

744 {
745 // currently inactive
746 return $a_value;
747
748 if (is_numeric($a_value)) {
749 $threshold = 3;
750 $a_value = (int) $a_value;
751 if ($a_value <= $threshold) {
752 if (!$a_force_number) {
753 return "0-" . $threshold;
754 } else {
755 return $threshold;
756 }
757 }
758 }
759 return $a_value;
760 }

Referenced by buildValueScale(), ilLPObjectStatisticsDailyTableGUI\fillRow(), ilLPObjectStatisticsLPTableGUI\fillRow(), ilLPObjectStatisticsTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRow(), ilLPObjectStatisticsDailyTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPObjectStatisticsDailyTableGUI\getGraph(), ilLPObjectStatisticsLPTableGUI\getGraph(), and ilLPObjectStatisticsTableGUI\getGraph().

+ Here is the caller graph for this function:

◆ buildPath()

ilLPTableBaseGUI::buildPath (   $ref_ids)
protected

Build path with deep-link.

Parameters
array$ref_ids
Returns
array

Definition at line 332 of file class.ilLPTableBaseGUI.php.

333 {
334 global $DIC;
335
336 $tree = $DIC['tree'];
337 $ilCtrl = $DIC['ilCtrl'];
338
339 include_once './Services/Link/classes/class.ilLink.php';
340
341 if (!count($ref_ids)) {
342 return false;
343 }
344 foreach ($ref_ids as $ref_id) {
345 $path = "...";
346 $counter = 0;
347 $path_full = $tree->getPathFull($ref_id);
348 foreach ($path_full as $data) {
349 if (++$counter < (count($path_full) - 1)) {
350 continue;
351 }
352 $path .= " &raquo; ";
353 if ($ref_id != $data['ref_id']) {
354 $path .= $data['title'];
355 } else {
356 $path .= ('<a target="_top" href="' .
357 ilLink::_getLink($data['ref_id'], $data['type']) . '">' .
358 $data['title'] . '</a>');
359 }
360 }
361
362 $result[$ref_id] = $path;
363 }
364 return $result;
365 }
$result
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

References ilTableGUI\$data, $DIC, $ilCtrl, $result, and ilLink\_getLink().

Referenced by ilLPProgressTableGUI\fillRow(), and ilTrSummaryTableGUI\fillRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildValueScale()

ilLPTableBaseGUI::buildValueScale (   $a_max_value,
  $a_anonymize = false,
  $a_format_seconds = false 
)
protected

Definition at line 762 of file class.ilLPTableBaseGUI.php.

763 {
764 $step = 0;
765 if ($a_max_value) {
766 $step = $a_max_value / 10;
767 $base = ceil(log($step, 10));
768 $fac = ceil($step / pow(10, ($base - 1)));
769 $step = pow(10, $base - 1) * $fac;
770 }
771 if ($step <= 1) {
772 $step = 1;
773 }
774 $ticks = range(0, $a_max_value + $step, $step);
775
776 $value_ticks = array(0 => 0);
777 foreach ($ticks as $tick) {
778 $value = $tvalue = $tick;
779 if ($a_anonymize) {
780 $value = $this->anonymizeValue($value, true);
781 $tvalue = $this->anonymizeValue($tvalue);
782 }
783 if ($a_format_seconds) {
784 $tvalue = $this->formatSeconds($value);
785 }
786 $value_ticks[$value] = $tvalue;
787 }
788
789 return $value_ticks;
790 }
formatSeconds($seconds, $a_shorten_zero=false)
anonymizeValue($a_value, $a_force_number=false)

References ilTableGUI\$base, anonymizeValue(), and formatSeconds().

Referenced by ilLPObjectStatisticsDailyTableGUI\getGraph(), ilLPObjectStatisticsLPTableGUI\getGraph(), and ilLPObjectStatisticsTableGUI\getGraph().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

Execute command.

Reimplemented from ilTable2GUI.

Definition at line 38 of file class.ilLPTableBaseGUI.php.

39 {
40 global $DIC;
41
42 $ilCtrl = $DIC['ilCtrl'];
43 $lng = $DIC['lng'];
44
46
47 if (!$ilCtrl->getNextClass($this)) {
48 $to_hide = false;
49
50 switch ($ilCtrl->getCmd()) {
51 case "applyFilter":
52 $this->resetOffset();
53 $this->writeFilterToSession();
54 break;
55
56 case "resetFilter":
57 $this->resetOffset();
58 $this->resetFilter();
59 break;
60
61 case "hideSelected":
62 $to_hide = $_POST["item_id"];
63 break;
64
65 case "hide":
66 $to_hide = array((int) $_GET["hide"]);
67 break;
68
69 case "mailselectedusers":
70 if (!sizeof($_POST["uid"])) {
71 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
72 } else {
73 $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
74 }
75 break;
76
77 case 'addToClipboard':
78 if (!sizeof($_POST['uid'])) {
79 ilUtil::sendFailure($lng->txt('no_checkbox'), true);
80 } else {
81 $this->addToClipboard();
82 }
83 break;
84
85 // page selector
86 default:
88 $this->storeNavParameter();
89 break;
90 }
91
92 if ($to_hide) {
93 $obj = $this->getFilterItemByPostVar("hide");
94 $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
95 $obj->setValue($value);
96 $obj->writeToSession();
97 }
98
99 if (isset($_REQUEST["tbltplcrt"])) {
100 $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
101 }
102 if (isset($_REQUEST["tbltpldel"])) {
103 $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
104 }
105
106 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
107 } else {
108 // e.g. repository selector
109 return parent::executeCommand();
110 }
111 }
$_GET["client_id"]
addToClipboard()
Add selected users to clipboard.
sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
resetFilter()
Reset filter.
writeFilterToSession()
Write filter values to session.
determineSelectedFilters()
Determine selected filters.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $_GET, $_POST, $DIC, $ilCtrl, ilTableGUI\$lng, addToClipboard(), ilTable2GUI\determineOffsetAndOrder(), ilTable2GUI\determineSelectedFilters(), ilTable2GUI\getFilterItemByPostVar(), ilTable2GUI\resetFilter(), ilTable2GUI\resetOffset(), ilUtil\sendFailure(), sendMail(), ilTable2GUI\storeNavParameter(), and ilTable2GUI\writeFilterToSession().

+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV (   $a_csv)
protected

Add meta information to csv export.

Likely to be overwritten by derived class.

Parameters
object$a_csvcurrent file

Reimplemented from ilTable2GUI.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

Definition at line 697 of file class.ilLPTableBaseGUI.php.

698 {
699 foreach ($this->getExportMeta() as $caption => $value) {
700 $a_csv->addColumn(strip_tags($caption));
701 $a_csv->addColumn(strip_tags($value));
702 $a_csv->addRow();
703 }
704 $a_csv->addRow();
705 }
getExportMeta()
Build export meta data.

References getExportMeta().

+ Here is the call graph for this function:

◆ fillMetaExcel()

ilLPTableBaseGUI::fillMetaExcel ( ilExcel  $a_excel,
$a_row 
)
protected

Add meta information to excel export.

Likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter

Reimplemented from ilTable2GUI.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

Definition at line 687 of file class.ilLPTableBaseGUI.php.

688 {
689 foreach ($this->getExportMeta() as $caption => $value) {
690 $a_excel->setCell($a_row, 0, $caption);
691 $a_excel->setCell($a_row, 1, $value);
692 $a_row++;
693 }
694 $a_row++;
695 }
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.

References getExportMeta(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ formatSeconds()

ilLPTableBaseGUI::formatSeconds (   $seconds,
  $a_shorten_zero = false 
)
protected

Definition at line 723 of file class.ilLPTableBaseGUI.php.

724 {
725 $seconds = ((int) $seconds > 0) ? $seconds : 0;
726 if ($a_shorten_zero && !$seconds) {
727 return "-";
728 }
729
730 $hours = floor($seconds / 3600);
731 $rest = $seconds % 3600;
732
733 $minutes = floor($rest / 60);
734 $rest = $rest % 60;
735
736 if ($rest) {
737 $minutes++;
738 }
739
740 return sprintf("%dh%02dm", $hours, $minutes);
741 }
$rest
Definition: goto.php:46

References $rest.

Referenced by buildValueScale(), ilLPObjectStatisticsDailyTableGUI\fillRow(), and ilLPObjectStatisticsTableGUI\fillRow().

+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter (   $as_query = false)

Definition at line 512 of file class.ilLPTableBaseGUI.php.

513 {
514 $result = array();
515 foreach ((array) $this->filter as $id => $value) {
516 $item = $this->getFilterItemByPostVar($id);
517 switch ($id) {
518 case "title":
519 case "country":
520 case "gender":
521 case "city":
522 case "language":
523 case "login":
524 case "firstname":
525 case "lastname":
526 case "mark":
527 case "u_comment":
528 case "institution":
529 case "department":
530 case "title":
531 case "street":
532 case "zipcode":
533 case "email":
534 case "matriculation":
535 case "sel_country":
536 case "query":
537 case "type":
538 case "area":
539 if ($value) {
540 $result[$id] = $value;
541 }
542 break;
543
544 case "status":
545 if ($value !== false) {
546 $result[$id] = $value;
547 }
548 break;
549
550 case "user_total":
551 case "read_count":
552 case "percentage":
553 case "hide":
554 case "spent_seconds":
555 if (is_array($value) && implode("", $value)) {
556 $result[$id] = $value;
557 }
558 break;
559
560 case "registration":
561 case "create_date":
562 case "first_access":
563 case "last_access":
564 case 'status_changed':
565 if ($value) {
566 if ($value["from"]) {
567 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
568 }
569 if ($value["to"]) {
570 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
571 }
572 }
573 break;
574
575 case "birthday":
576 if ($value) {
577 if ($value["from"]) {
578 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
579 $result[$id]["from"] = substr($result[$id]["from"], 0, -8) . "00:00:00";
580 }
581 if ($value["to"]) {
582 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
583 $result[$id]["to"] = substr($result[$id]["to"], 0, -8) . "23:59:59";
584 }
585 }
586 break;
587 }
588 }
589
590 return $result;
591 }
const IL_CAL_DATETIME

References $result, ilTable2GUI\getFilterItemByPostVar(), and IL_CAL_DATETIME.

Referenced by ilTrSummaryTableGUI\getItems(), ilLPObjectStatisticsDailyTableGUI\getItems(), ilLPObjectStatisticsLPTableGUI\getItems(), ilLPObjectStatisticsTableGUI\getItems(), ilLPProgressTableGUI\getItems(), ilTrObjectUsersPropsTableGUI\getItems(), and initBaseFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportMeta()

ilLPTableBaseGUI::getExportMeta ( )
protected

Build export meta data.

Returns
array

Definition at line 648 of file class.ilLPTableBaseGUI.php.

649 {
650 global $DIC;
651
652 $lng = $DIC['lng'];
653 $ilObjDataCache = $DIC['ilObjDataCache'];
654 $ilUser = $DIC['ilUser'];
655 $ilClientIniFile = $DIC['ilClientIniFile'];
656
657 /* see spec
658 Name of installation
659 Name of the course
660 Permalink to course
661 Owner of course object
662 Date of report generation
663 Reporting period
664 Name of person who generated the report.
665 */
666
668 include_once './Services/Link/classes/class.ilLink.php';
669
670 $data = array();
671 $data[$lng->txt("trac_name_of_installation")] = $ilClientIniFile->readVariable('client', 'name');
672
673 if ($this->obj_id) {
674 $data[$lng->txt("trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
675 if ($this->ref_id) {
676 $data[$lng->txt("trac_object_link")] = ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id));
677 }
678 $data[$lng->txt("trac_object_owner")] = ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id));
679 }
680
681 $data[$lng->txt("trac_report_date")] = ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX));
682 $data[$lng->txt("trac_report_owner")] = $ilUser->getFullName();
683
684 return $data;
685 }
const IL_CAL_UNIX
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
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
$ilUser
Definition: imgupload.php:18

References ilTableGUI\$data, $DIC, $ilUser, ilTableGUI\$lng, ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObject\_lookupOwner(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, and ilDatePresentation\setUseRelativeDates().

Referenced by fillMetaCSV(), and fillMetaExcel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

Definition at line 792 of file class.ilLPTableBaseGUI.php.

793 {
794 global $DIC;
795
796 $lng = $DIC['lng'];
797
798 $options = array();
799 for ($loop = 0; $loop < 10; $loop++) {
800 $year = date("Y") - $loop;
801 $options[$year] = $year;
802 for ($loop2 = 12; $loop2 > 0; $loop2--) {
803 $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
804 if ($year . $month <= date("Ym")) {
805 if (!$a_short) {
806 $caption = $year . " / " . $lng->txt("month_" . $month . "_long");
807 } else {
808 $caption = $year . "/" . $month;
809 }
810 $options[$year . "-" . $month] = $caption;
811 }
812 }
813 }
814 return $options;
815 }

References $DIC, and ilTableGUI\$lng.

Referenced by ilLPObjectStatisticsDailyTableGUI\initFilter(), ilLPObjectStatisticsLPTableGUI\initFilter(), and ilLPObjectStatisticsTableGUI\initFilter().

+ Here is the caller graph for this function:

◆ getMonthsYear()

ilLPTableBaseGUI::getMonthsYear (   $a_year = null,
  $a_short = false 
)
protected

Definition at line 817 of file class.ilLPTableBaseGUI.php.

818 {
819 global $DIC;
820
821 $lng = $DIC['lng'];
822
823 if (!$a_year) {
824 $a_year = date("Y");
825 }
826
827 $all = array();
828 for ($loop = 1; $loop < 13; $loop++) {
829 $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
830 if ($a_year . "-" . $month <= date("Y-m")) {
831 if (!$a_short) {
832 $caption = $lng->txt("month_" . $month . "_long");
833 } else {
834 $caption = $lng->txt("month_" . $month . "_short");
835 }
836 $all[$a_year . "-" . $month] = $caption;
837 }
838 }
839 return $all;
840 }

References $DIC, and ilTableGUI\$lng.

Referenced by ilLPObjectStatisticsTableGUI\__construct(), ilLPObjectStatisticsTypesTableGUI\__construct(), ilLPObjectStatisticsLPTableGUI\__construct(), ilLPObjectStatisticsLPTableGUI\fillRow(), ilLPObjectStatisticsTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRow(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPObjectStatisticsLPTableGUI\getGraph(), ilLPObjectStatisticsTableGUI\getGraph(), ilLPObjectStatisticsTypesTableGUI\getGraph(), and ilLPObjectStatisticsLPTableGUI\getItems().

+ Here is the caller graph for this function:

◆ getPossibleTypes()

ilLPTableBaseGUI::getPossibleTypes (   $a_split_learning_resources = false,
  $a_include_digilib = false,
  $a_allow_undefined_lp = false 
)
protected

Get possible subtypes.

Parameters
bool$a_split_learning_resources
bool$a_include_digilib
bool$a_allow_undefined_lp

Definition at line 374 of file class.ilLPTableBaseGUI.php.

375 {
376 global $DIC;
377
378 $lng = $DIC['lng'];
379 $ilPluginAdmin = $DIC['ilPluginAdmin'];
380
381 $options = array();
382
383 if ($a_split_learning_resources) {
384 $options['lm'] = $lng->txt('objs_lm');
385 $options['sahs'] = $lng->txt('objs_sahs');
386 $options['htlm'] = $lng->txt('objs_htlm');
387 } else {
388 $options['lres'] = $lng->txt('obj_lrss');
389 }
390
391 $options['crs'] = $lng->txt('objs_crs');
392 $options['grp'] = $lng->txt('objs_grp');
393 $options['exc'] = $lng->txt('objs_exc');
394 $options['file'] = $lng->txt('objs_file');
395 $options['mcst'] = $lng->txt('objs_mcst');
396 $options['svy'] = $lng->txt('objs_svy');
397 $options['tst'] = $lng->txt('objs_tst');
398 $options['prg'] = $lng->txt('objs_prg');
399 $options['iass'] = $lng->txt('objs_iass');
400 $options['copa'] = $lng->txt('objs_copa');
401 $options['cmix'] = $lng->txt('objs_cmix');
402 $options['lti'] = $lng->txt('objs_lti');
403 $options['lso'] = $lng->txt('objs_lso');
404
405 if ($a_allow_undefined_lp) {
406 $options["webr"] = $lng->txt("objs_webr");
407 $options["wiki"] = $lng->txt("objs_wiki");
408 $options["blog"] = $lng->txt("objs_blog");
409 $options["prtf"] = $lng->txt("objs_prtf");
410 $options["prtt"] = $lng->txt("objs_prtt");
411 }
412
413 // repository plugins (currently only active)
414 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
415 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
416 foreach ($pl_names as $pl) {
417 $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
419 $options[$pl_id] = ilObjectPlugin::lookupTxtById($pl_id, "objs_" . $pl_id);
420 }
421 }
422
423 asort($options);
424 return $options;
425 }
const IL_COMP_SERVICE
static lookupTxtById($plugin_id, $lang_var)
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.

References $DIC, ilTableGUI\$lng, IL_COMP_SERVICE, ilRepositoryObjectPluginSlot\isTypePluginWithLP(), and ilObjectPlugin\lookupTxtById().

Referenced by initBaseFilter(), ilLPObjectStatisticsDailyTableGUI\initFilter(), and ilLPObjectStatisticsTableGUI\initFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableUserColumns()

ilLPTableBaseGUI::getSelectableUserColumns (   $a_in_course = false,
  $a_in_group = false 
)
protected

Definition at line 842 of file class.ilLPTableBaseGUI.php.

843 {
844 global $DIC;
845
846 $lng = $DIC['lng'];
847 $ilSetting = $DIC['ilSetting'];
848
849 $cols = $privacy_fields = array();
850
851 include_once("./Services/User/classes/class.ilUserProfile.php");
852 $up = new ilUserProfile();
853 $up->skipGroup("preferences");
854 $up->skipGroup("settings");
855 $up->skipGroup("interests");
856 $ufs = $up->getStandardFields();
857
858 // default fields
859 $cols["login"] = array(
860 "txt" => $lng->txt("login"),
861 "default" => true);
862
863 if (!$this->anonymized) {
864 $cols["firstname"] = array(
865 "txt" => $lng->txt("firstname"),
866 "default" => true);
867 $cols["lastname"] = array(
868 "txt" => $lng->txt("lastname"),
869 "default" => true);
870 }
871
872 // show only if extended data was activated in lp settings
873 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
874 $tracking = new ilObjUserTracking();
875 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
876 $cols["first_access"] = array(
877 "txt" => $lng->txt("trac_first_access"),
878 "default" => true);
879 $cols["last_access"] = array(
880 "txt" => $lng->txt("trac_last_access"),
881 "default" => true);
882 }
883 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
884 $cols["read_count"] = array(
885 "txt" => $lng->txt("trac_read_count"),
886 "default" => true);
887 }
888 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS) &&
890 $cols["spent_seconds"] = array(
891 "txt" => $lng->txt("trac_spent_seconds"),
892 "default" => true);
893 }
894
895 if ($this->isPercentageAvailable($this->obj_id)) {
896 $cols["percentage"] = array(
897 "txt" => $lng->txt("trac_percentage"),
898 "default" => true);
899 }
900
901 // do not show status if learning progress is deactivated
902 $olp = ilObjectLP::getInstance($this->obj_id);
903 if ($olp->isActive()) {
904 $cols["status"] = array(
905 "txt" => $lng->txt("trac_status"),
906 "default" => true);
907
908 $cols['status_changed'] = array(
909 'txt' => $lng->txt('trac_status_changed'),
910 'default' => false);
911 }
912
913 if (ilObjectLP::supportsMark($this->type)) {
914 $cols["mark"] = array(
915 "txt" => $lng->txt("trac_mark"),
916 "default" => true);
917 }
918
919 $cols["u_comment"] = array(
920 "txt" => $lng->txt("trac_comment"),
921 "default" => false);
922
923 $cols["create_date"] = array(
924 "txt" => $lng->txt("create_date"),
925 "default" => false);
926 $cols["language"] = array(
927 "txt" => $lng->txt("language"),
928 "default" => false);
929
930 // add user data only if object is [part of] course
931 if (!$this->anonymized &&
932 ($a_in_course || $a_in_group)) {
933 // only show if export permission is granted
934 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
935 if (ilPrivacySettings::_getInstance()->checkExportAccess($this->ref_id)) {
936 // other user profile fields
937 foreach ($ufs as $f => $fd) {
938 if (!isset($cols[$f]) && $f != "username" && !$fd["lists_hide"]) {
939 if ($a_in_course &&
940 !($fd["course_export_fix_value"] || $ilSetting->get("usr_settings_course_export_" . $f))) {
941 continue;
942 }
943 if ($a_in_group &&
944 !($fd["group_export_fix_value"] || $ilSetting->get("usr_settings_group_export_" . $f))) {
945 continue;
946 }
947
948 $cols[$f] = array(
949 "txt" => $lng->txt($f),
950 "default" => false);
951
952 $privacy_fields[] = $f;
953 }
954 }
955
956 // additional defined user data fields
957 include_once './Services/User/classes/class.ilUserDefinedFields.php';
958 $user_defined_fields = ilUserDefinedFields::_getInstance();
959 if ($a_in_course) {
960 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
961 } else {
962 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
963 }
964 foreach ($user_defined_fields as $definition) {
965 if ($definition["field_type"] != UDF_TYPE_WYSIWYG) {
966 $f = "udf_" . $definition["field_id"];
967 $cols[$f] = array(
968 "txt" => $definition["field_name"],
969 "default" => false);
970
971 $privacy_fields[] = $f;
972 }
973 }
974 }
975 }
976
977 return array($cols, $privacy_fields);
978 }
const UDF_TYPE_WYSIWYG
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance.
Class ilUserProfile.
global $ilSetting
Definition: privfeed.php:17
$cols
Definition: xhr_table.php:11

References $cols, $DIC, Vendor\Package\$f, $ilSetting, ilTableGUI\$lng, ilPrivacySettings\_getInstance(), ilUserDefinedFields\_getInstance(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilObjectLP\getInstance(), isPercentageAvailable(), ilObjectLP\supportsMark(), ilObjectLP\supportsSpentSeconds(), and UDF_TYPE_WYSIWYG.

Referenced by ilTrMatrixTableGUI\getSelectableColumns(), and ilTrObjectUsersPropsTableGUI\getSelectableColumns().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initBaseFilter()

ilLPTableBaseGUI::initBaseFilter (   $a_split_learning_resources = false,
  $a_include_no_status_filter = true 
)

Init filter.

Parameters
bool$a_split_learning_resources

Definition at line 255 of file class.ilLPTableBaseGUI.php.

256 {
257 global $DIC;
258
259 $lng = $DIC['lng'];
260 $ilObjDataCache = $DIC['ilObjDataCache'];
261
262 $this->setDisableFilterHiding(true);
263
264 // object type selection
265 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
266 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
267 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
268 $this->addFilterItem($si);
269 $si->readFromSession();
270 if (!$si->getValue()) {
271 $si->setValue("crs");
272 }
273 $this->filter["type"] = $si->getValue();
274
275 // hidden items
276 include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
277 $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
278 $this->addFilterItem($msi);
279 $msi->readFromSession();
280 $this->filter["hide"] = $msi->getValue();
281 if ($this->filter["hide"]) {
282 // create options from current value
283 $types = $this->getCurrentFilter(true);
284 $type = $types["type"];
285 $options = array();
286 if ($type == 'lres') {
287 $type = array('lm','sahs','htlm');
288 } else {
289 $type = array($type);
290 }
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);
294 }
295 }
296 $msi->setOptions($options);
297 }
298
299 // title/description
300 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
301 $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
302 $ti->setMaxLength(64);
303 $ti->setSize(20);
304 $this->addFilterItem($ti);
305 $ti->readFromSession();
306 $this->filter["query"] = $ti->getValue();
307
308 // repository area selection
309 include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
310 $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
311 $rs->setSelectText($lng->txt("trac_select_area"));
312 $this->addFilterItem($rs);
313 $rs->readFromSession();
314 $this->filter["area"] = $rs->getValue();
315
316 // hide "not started yet"
317 if ($a_include_no_status_filter) {
318 include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
319 $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
320 $this->addFilterItem($cb);
321 $cb->readFromSession();
322 $this->filter["status"] = $cb->getChecked();
323 }
324 }
This class represents a checkbox property in a property form.
getCurrentFilter($as_query=false)
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
This class represents a multi selection list property in a property form.
This class represents a repository selector in a property form.
This class represents a selection list property in a property form.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
This class represents a text property in a property form.
$type

References $DIC, ilTableGUI\$lng, $si, $type, ilTable2GUI\addFilterItem(), getCurrentFilter(), getPossibleTypes(), and ilTable2GUI\setDisableFilterHiding().

Referenced by ilLPProgressTableGUI\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable (   $a_obj_id)
protected

Definition at line 593 of file class.ilLPTableBaseGUI.php.

594 {
595 // :TODO:
596 $olp = ilObjectLP::getInstance($a_obj_id);
597 $mode = $olp->getCurrentMode();
598 if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
610 return true;
611 }
612 return false;
613 }
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED

References ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED, ilLPObjSettings\LP_MODE_CMIX_COMPL_WITH_FAILED, ilLPObjSettings\LP_MODE_CMIX_COMPLETED, ilLPObjSettings\LP_MODE_CMIX_COMPLETED_OR_PASSED, ilLPObjSettings\LP_MODE_CMIX_PASSED, ilLPObjSettings\LP_MODE_CMIX_PASSED_WITH_FAILED, ilLPObjSettings\LP_MODE_LTI_OUTCOME, ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_TEST_PASSED, ilLPObjSettings\LP_MODE_TLT, ilLPObjSettings\LP_MODE_VISITED_PAGES, and ilLPObjSettings\LP_MODE_VISITS.

Referenced by ilTrSummaryTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), ilTrSummaryTableGUI\getItems(), ilLPProgressTableGUI\getItems(), ilTrMatrixTableGUI\getItems(), ilTrSummaryTableGUI\getSelectableColumns(), getSelectableUserColumns(), and ilTrSummaryTableGUI\initFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTitle()

ilLPTableBaseGUI::parseTitle (   $a_obj_id,
  $action,
  $a_user_id = false 
)
protected

Definition at line 615 of file class.ilLPTableBaseGUI.php.

616 {
617 global $DIC;
618
619 $lng = $DIC['lng'];
620 $ilObjDataCache = $DIC['ilObjDataCache'];
621 $ilUser = $DIC['ilUser'];
622
623 $user = "";
624 if ($a_user_id) {
625 if ($a_user_id != $ilUser->getId()) {
626 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
627 } else {
628 $a_user = $ilUser;
629 }
630 $user .= ", " . $a_user->getFullName(); // " [".$a_user->getLogin()."]";
631 }
632
633 if ($a_obj_id != ROOT_FOLDER_ID) {
634 $this->setTitle($lng->txt($action) . ": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
635
636 $olp = ilObjectLP::getInstance($a_obj_id);
637 $this->setDescription($this->lng->txt('trac_mode') . ": " . $olp->getModeText($olp->getCurrentMode()));
638 } else {
639 $this->setTitle($lng->txt($action));
640 }
641 }
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setDescription($a_val)
Set description.

References $DIC, $ilUser, ilTableGUI\$lng, ilObjectLP\getInstance(), ilObjectFactory\getInstanceByObjId(), ilTable2GUI\setDescription(), and ilTable2GUI\setTitle().

Referenced by ilTrObjectUsersPropsTableGUI\__construct(), ilTrSummaryTableGUI\__construct(), ilTrUserObjectsPropsTableGUI\__construct(), and ilTrMatrixTableGUI\__construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

ilLPTableBaseGUI::parseValue (   $id,
  $value,
  $type 
)
protected

Reimplemented in ilTrSummaryTableGUI.

Definition at line 427 of file class.ilLPTableBaseGUI.php.

428 {
429 global $DIC;
430
431 $lng = $DIC['lng'];
432
433 // get rid of aggregation
434 $pos = strrpos($id, "_");
435 if ($pos !== false) {
436 $function = strtoupper(substr($id, $pos + 1));
437 if (in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT"))) {
438 $id = substr($id, 0, $pos);
439 }
440 }
441
442 if (trim($value) == "" && $id != "status") {
443 if ($id == "title" &&
444 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
445 get_class($this) != "ilTrMatrixTableGUI") {
446 return "--" . $lng->txt("none") . "--";
447 }
448 return " ";
449 }
450
451 switch ($id) {
452 case "first_access":
453 case "create_date":
454 case 'status_changed':
456 break;
457
458 case "last_access":
460 break;
461
462 case "birthday":
464 break;
465
466 case "spent_seconds":
468 $value = "-";
469 } else {
470 $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
471 }
472 break;
473
474 case "percentage":
475 if (false /* $this->isPercentageAvailable() */) {
476 $value = "-";
477 } else {
478 $value = $value . "%";
479 }
480 break;
481
482 case "mark":
484 $value = "-";
485 }
486 break;
487
488 case "gender":
489 $value = $lng->txt("gender_" . $value);
490 break;
491
492 case "status":
493 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
496 $value = ilUtil::img($path, $text);
497 break;
498
499 case "language":
500 $lng->loadLanguageModule("meta");
501 $value = $lng->txt("meta_l_" . $value);
502 break;
503
504 case "sel_country":
505 $value = $lng->txt("meta_c_" . $value);
506 break;
507 }
508
509 return $value;
510 }
const IL_CAL_DATE
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
static _getImagePathForStatus($a_status)
Get image path for status.
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.

References $DIC, ilTableGUI\$lng, $type, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilDatePresentation\formatDate(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, ilUtil\img(), ilDatePresentation\secondsToString(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

Referenced by ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRow(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowExcel(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), and ilTrUserObjectsPropsTableGUI\fillRowExcel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchFilterListener()

ilLPTableBaseGUI::searchFilterListener (   $a_ref_id,
  $a_data 
)

Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED @access public.

Definition at line 237 of file class.ilLPTableBaseGUI.php.

238 {
239 if (is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"])) {
240 return false;
241 }
242 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
243 if (get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
244 !$olp->isActive()) {
245 return false;
246 }
247 return true;
248 }

References ilObjectLP\getInstance().

+ Here is the call graph for this function:

◆ searchObjects()

ilLPTableBaseGUI::searchObjects ( array  $filter,
  $permission,
array  $preset_obj_ids = null,
  $a_check_lp_activation = true 
)
protected

Search objects that match current filters.

Parameters
array$filter
string$permission
arraypreset obj_ids
boolcheck lp activation
Returns
array

Definition at line 170 of file class.ilLPTableBaseGUI.php.

171 {
172 global $DIC;
173
174 $ilObjDataCache = $DIC['ilObjDataCache'];
175
176 include_once './Services/Search/classes/class.ilQueryParser.php';
177
178 $query_parser = new ilQueryParser($filter["query"]);
179 $query_parser->setMinWordLength(0);
180 $query_parser->setCombination(QP_COMBINATION_AND);
181 $query_parser->parse();
182 if (!$query_parser->validate()) {
183 ilLoggerFactory::getLogger('trac')->notice($query_parser->getMessage());
184 // echo $query_parser->getMessage();
185 return false;
186 }
187
188 if ($filter["type"] == "lres") {
189 $filter["type"] = array('lm','sahs','htlm');
190 } else {
191 $filter["type"] = array($filter["type"]);
192 }
193
194 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
195 $object_search = new ilLikeObjectSearch($query_parser);
196 $object_search->setFilter($filter["type"]);
197 if ($preset_obj_ids) {
198 $object_search->setIdFilter($preset_obj_ids);
199 }
200 $res = &$object_search->performSearch();
201
202 if ($permission) {
203 $res->setRequiredPermission($permission);
204 }
205
206 $res->setMaxHits(1000);
207
208 if ($a_check_lp_activation) {
209 $res->addObserver($this, "searchFilterListener");
210 }
211
212 if (!$this->filter["area"]) {
213 $res->filter(ROOT_FOLDER_ID, false);
214 } else {
215 $res->filter($this->filter["area"], false);
216 }
217
218 $objects = array();
219 foreach ($res->getResults() as $obj_data) {
220 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
221 }
222
223 // Check if search max hits is reached
224 if ($res->isLimitReached()) {
225 $this->lng->loadLanguageModule("search");
226 ilUtil::sendFailure(sprintf($this->lng->txt("search_limit_reached"), 1000));
227 }
228
229 return $objects ? $objects : array();
230 }
const QP_COMBINATION_AND
static getLogger($a_component_id)
Get component logger.
foreach($_POST as $key=> $value) $res

References $DIC, $filter, $res, ilLoggerFactory\getLogger(), QP_COMBINATION_AND, and ilUtil\sendFailure().

Referenced by ilTrSummaryTableGUI\getItems(), ilLPObjectStatisticsDailyTableGUI\getItems(), ilLPObjectStatisticsLPTableGUI\getItems(), ilLPObjectStatisticsTableGUI\getItems(), and ilLPProgressTableGUI\getItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMail()

ilLPTableBaseGUI::sendMail ( array  $a_user_ids,
  $a_parent_obj,
  $a_parent_cmd 
)
protected

Definition at line 113 of file class.ilLPTableBaseGUI.php.

114 {
115 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
116
117 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
118
119 $rcps = array();
120 foreach ($a_user_ids as $usr_id) {
121 $rcps[] = ilObjUser::_lookupLogin($usr_id);
122 }
123
124 $template = array();
125 $sig = null;
126
127 // repository-object-specific
128 $ref_id = (int) $_REQUEST["ref_id"];
129 if ($ref_id) {
131 $tmpl_id = $obj_lp->getMailTemplateId();
132
133 if ($tmpl_id) {
134 $template = array(
135 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
136 'ref_id' => $ref_id,
137 'ts' => time()
138 );
139 } else {
140 include_once './Services/Link/classes/class.ilLink.php';
141 $sig = ilLink::_getLink($ref_id);
142 $sig = rawurlencode(base64_encode($sig));
143 }
144 }
145
148 $a_parent_obj,
149 $a_parent_cmd,
150 array(),
151 array(
152 'type' => 'new',
153 'rcp_to' => implode(',', $rcps),
154 'sig' => $sig
155 ),
156 $template
157 )
158 );
159 }
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
const CONTEXT_KEY
Session parameter for the context.
static _lookupLogin($a_user_id)
lookup login
static _lookupObjectId($a_ref_id)
lookup object id
static redirect($a_script)

References ilLink\_getLink(), ilObjUser\_lookupLogin(), ilObject\_lookupObjectId(), ilMailFormCall\CONTEXT_KEY, ilObjectLP\getInstance(), ilMailFormCall\getRedirectTarget(), and ilUtil\redirect().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTimingsWarning()

ilLPTableBaseGUI::showTimingsWarning (   $a_ref_id,
  $a_user_id 
)
protected

Definition at line 707 of file class.ilLPTableBaseGUI.php.

708 {
709 $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
710 if ($timing_cache->isWarningRequired($a_user_id)) {
711 $timings = ilTimingCache::_getTimings($a_ref_id);
712 if ($timings['item']['changeable'] && $timings['user'][$a_user_id]['end']) {
713 $end = $timings['user'][$a_user_id]['end'];
714 } elseif ($timings['item']['suggestion_end']) {
715 $end = $timings['item']['suggestion_end'];
716 } else {
717 $end = true;
718 }
719 return $end;
720 }
721 }
static getInstanceByRefId($ref_id)
static & _getTimings($a_ref_id)

References ilTimingCache\_getTimings(), and ilTimingCache\getInstanceByRefId().

Referenced by ilLPProgressTableGUI\fillRow(), ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRow(), and ilTrUserObjectsPropsTableGUI\fillRow().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $anonymized

ilLPTableBaseGUI::$anonymized
protected

Definition at line 19 of file class.ilLPTableBaseGUI.php.

◆ $filter

ilLPTableBaseGUI::$filter
protected

Definition at line 18 of file class.ilLPTableBaseGUI.php.

Referenced by ilTrSummaryTableGUI\getItems(), and searchObjects().


The documentation for this class was generated from the following file: