ILIAS  release_7 Revision v7.30-3-g800a261c036
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)
 
 getIconVariant ()
 Gets the variant of LP icons that is shown in the table. More...
 
 setIconVariant (int $variant)
 Sets the variant of LP icons that is shown in the table. More...
 
- 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)
 

Data Fields

const HIT_LIMIT = 5000
 
- 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
 

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
 
 $icon_variant = ilLPStatusIcons::ICON_VARIANT_LONG
 
- 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...
 

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 24 of file class.ilLPTableBaseGUI.php.

25 {
26 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
27
28 // country names
29 $this->lng->loadLanguageModule("meta");
30
31 include_once("./Services/Object/classes/class.ilObjectLP.php");
32
33 $this->anonymized = (bool) !ilObjUserTracking::_enabledUserRelatedData();
34 if (!$this->anonymized && $this->obj_id) {
35 include_once "Services/Object/classes/class.ilObjectLP.php";
36 $olp = ilObjectLP::getInstance($this->obj_id);
37 $this->anonymized = $olp->isAnonymized();
38 }
39 }
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 979 of file class.ilLPTableBaseGUI.php.

980 {
981 $users = (array) $_POST['uid'];
982 include_once './Services/User/classes/class.ilUserClipboard.php';
983 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
984 $clip->add($users);
985 $clip->save();
986
987 $GLOBALS['DIC']['lng']->loadLanguageModule('user');
988 ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
989 }
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 739 of file class.ilLPTableBaseGUI.php.

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

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 328 of file class.ilLPTableBaseGUI.php.

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

References ilTableGUI\$data, $DIC, $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 758 of file class.ilLPTableBaseGUI.php.

759 {
760 $step = 0;
761 if ($a_max_value) {
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;
766 }
767 if ($step <= 1) {
768 $step = 1;
769 }
770 $ticks = range(0, $a_max_value + $step, $step);
771
772 $value_ticks = array(0 => 0);
773 foreach ($ticks as $tick) {
774 $value = $tvalue = $tick;
775 if ($a_anonymize) {
776 $value = $this->anonymizeValue($value, true);
777 $tvalue = $this->anonymizeValue($tvalue);
778 }
779 if ($a_format_seconds) {
780 $tvalue = $this->formatSeconds($value);
781 }
782 $value_ticks[$value] = $tvalue;
783 }
784
785 return $value_ticks;
786 }
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 41 of file class.ilLPTableBaseGUI.php.

42 {
43 global $DIC;
44
45 $ilCtrl = $DIC['ilCtrl'];
46 $lng = $DIC['lng'];
47
49
50 if (!$ilCtrl->getNextClass($this)) {
51 $to_hide = false;
52
53 switch ($ilCtrl->getCmd()) {
54 case "applyFilter":
55 $this->resetOffset();
56 $this->writeFilterToSession();
57 break;
58
59 case "resetFilter":
60 $this->resetOffset();
61 $this->resetFilter();
62 break;
63
64 case "hideSelected":
65 $to_hide = $_POST["item_id"];
66 break;
67
68 case "hide":
69 $to_hide = array((int) $_GET["hide"]);
70 break;
71
72 case "mailselectedusers":
73 if (!sizeof($_POST["uid"])) {
74 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
75 } else {
76 $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
77 }
78 break;
79
80 case 'addToClipboard':
81 if (!sizeof($_POST['uid'])) {
82 ilUtil::sendFailure($lng->txt('no_checkbox'), true);
83 } else {
84 $this->addToClipboard();
85 }
86 break;
87
88 // page selector
89 default:
91 $this->storeNavParameter();
92 break;
93 }
94
95 if ($to_hide) {
96 $obj = $this->getFilterItemByPostVar("hide");
97 $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
98 $obj->setValue($value);
99 $obj->writeToSession();
100 }
101
102 if (isset($_REQUEST["tbltplcrt"])) {
103 $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
104 }
105 if (isset($_REQUEST["tbltpldel"])) {
106 $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
107 }
108
109 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
110 } else {
111 // e.g. repository selector
112 return parent::executeCommand();
113 }
114 }
$_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, 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 693 of file class.ilLPTableBaseGUI.php.

694 {
695 foreach ($this->getExportMeta() as $caption => $value) {
696 $a_csv->addColumn(strip_tags($caption));
697 $a_csv->addColumn(strip_tags($value));
698 $a_csv->addRow();
699 }
700 $a_csv->addRow();
701 }
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 683 of file class.ilLPTableBaseGUI.php.

684 {
685 foreach ($this->getExportMeta() as $caption => $value) {
686 $a_excel->setCell($a_row, 0, $caption);
687 $a_excel->setCell($a_row, 1, $value);
688 $a_row++;
689 }
690 $a_row++;
691 }
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 719 of file class.ilLPTableBaseGUI.php.

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

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 508 of file class.ilLPTableBaseGUI.php.

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

References $result, filter(), 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 644 of file class.ilLPTableBaseGUI.php.

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

◆ getIconVariant()

ilLPTableBaseGUI::getIconVariant ( )

Gets the variant of LP icons that is shown in the table.

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

994 : int
995 {
996 return $this->icon_variant;
997 }

References $icon_variant.

Referenced by parseValue().

+ Here is the caller graph for this function:

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

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

789 {
790 global $DIC;
791
792 $lng = $DIC['lng'];
793
794 $options = array();
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")) {
801 if (!$a_short) {
802 $caption = $year . " / " . $lng->txt("month_" . $month . "_long");
803 } else {
804 $caption = $year . "/" . $month;
805 }
806 $options[$year . "-" . $month] = $caption;
807 }
808 }
809 }
810 return $options;
811 }

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 813 of file class.ilLPTableBaseGUI.php.

814 {
815 global $DIC;
816
817 $lng = $DIC['lng'];
818
819 if (!$a_year) {
820 $a_year = date("Y");
821 }
822
823 $all = array();
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")) {
827 if (!$a_short) {
828 $caption = $lng->txt("month_" . $month . "_long");
829 } else {
830 $caption = $lng->txt("month_" . $month . "_short");
831 }
832 $all[$a_year . "-" . $month] = $caption;
833 }
834 }
835 return $all;
836 }

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 370 of file class.ilLPTableBaseGUI.php.

371 {
372 global $DIC;
373
374 $lng = $DIC['lng'];
375 $ilPluginAdmin = $DIC['ilPluginAdmin'];
376
377 $options = array();
378
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');
383 } else {
384 $options['lres'] = $lng->txt('obj_lrss');
385 }
386
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');
400
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");
409 }
410
411 // repository plugins (currently only active)
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);
417 $options[$pl_id] = ilObjectPlugin::lookupTxtById($pl_id, "objs_" . $pl_id);
418 }
419 }
420
421 asort($options);
422 return $options;
423 }
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 838 of file class.ilLPTableBaseGUI.php.

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

252 {
253 global $DIC;
254
255 $lng = $DIC['lng'];
256 $ilObjDataCache = $DIC['ilObjDataCache'];
257
258 $this->setDisableFilterHiding(true);
259
260 // object type selection
261 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
262 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
263 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
264 $this->addFilterItem($si);
265 $si->readFromSession();
266 if (!$si->getValue()) {
267 $si->setValue("crs");
268 }
269 $this->filter["type"] = $si->getValue();
270
271 // hidden items
272 include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
273 $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
274 $this->addFilterItem($msi);
275 $msi->readFromSession();
276 $this->filter["hide"] = $msi->getValue();
277 if ($this->filter["hide"]) {
278 // create options from current value
279 $types = $this->getCurrentFilter(true);
280 $type = $types["type"];
281 $options = array();
282 if ($type == 'lres') {
283 $type = array('lm','sahs','htlm');
284 } else {
285 $type = array($type);
286 }
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);
290 }
291 }
292 $msi->setOptions($options);
293 }
294
295 // title/description
296 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
297 $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
298 $ti->setMaxLength(64);
299 $ti->setSize(20);
300 $this->addFilterItem($ti);
301 $ti->readFromSession();
302 $this->filter["query"] = $ti->getValue();
303
304 // repository area selection
305 include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
306 $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
307 $rs->setSelectText($lng->txt("trac_select_area"));
308 $this->addFilterItem($rs);
309 $rs->readFromSession();
310 $this->filter["area"] = $rs->getValue();
311
312 // hide "not started yet"
313 if ($a_include_no_status_filter) {
314 include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
315 $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
316 $this->addFilterItem($cb);
317 $cb->readFromSession();
318 $this->filter["status"] = $cb->getChecked();
319 }
320 }
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(), filter(), 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 589 of file class.ilLPTableBaseGUI.php.

590 {
591 // :TODO:
592 $olp = ilObjectLP::getInstance($a_obj_id);
593 $mode = $olp->getCurrentMode();
594 if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
606 return true;
607 }
608 return false;
609 }
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 611 of file class.ilLPTableBaseGUI.php.

612 {
613 global $DIC;
614
615 $lng = $DIC['lng'];
616 $ilObjDataCache = $DIC['ilObjDataCache'];
617 $ilUser = $DIC['ilUser'];
618
619 $user = "";
620 if ($a_user_id) {
621 if ($a_user_id != $ilUser->getId()) {
622 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
623 } else {
624 $a_user = $ilUser;
625 }
626 $user .= ", " . $a_user->getFullName(); // " [".$a_user->getLogin()."]";
627 }
628
629 if ($a_obj_id != ROOT_FOLDER_ID) {
630 $this->setTitle($lng->txt($action) . ": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
631
632 $olp = ilObjectLP::getInstance($a_obj_id);
633 $this->setDescription($this->lng->txt('trac_mode') . ": " . $olp->getModeText($olp->getCurrentMode()));
634 } else {
635 $this->setTitle($lng->txt($action));
636 }
637 }
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.
const ROOT_FOLDER_ID
Definition: constants.php:30

References $DIC, $ilUser, ilTableGUI\$lng, ilObjectLP\getInstance(), ilObjectFactory\getInstanceByObjId(), ROOT_FOLDER_ID, 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 425 of file class.ilLPTableBaseGUI.php.

426 {
427 global $DIC;
428
429 $lng = $DIC['lng'];
430
431 // get rid of aggregation
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);
437 }
438 }
439
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") . "--";
445 }
446 return " ";
447 }
448
449 switch ($id) {
450 case "first_access":
451 case "create_date":
452 case 'status_changed':
454 break;
455
456 case "last_access":
458 break;
459
460 case "birthday":
462 break;
463
464 case "spent_seconds":
466 $value = "-";
467 } else {
468 $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
469 }
470 break;
471
472 case "percentage":
473 if (false /* $this->isPercentageAvailable() */) {
474 $value = "-";
475 } else {
476 $value = $value . "%";
477 }
478 break;
479
480 case "mark":
482 $value = "-";
483 }
484 break;
485
486 case "gender":
487 $value = $lng->txt("gender_" . $value);
488 break;
489
490 case "status":
492 $value = $icons->renderIconForStatus((int) $value);
493 break;
494
495 case "language":
496 $lng->loadLanguageModule("meta");
497 $value = $lng->txt("meta_l_" . $value);
498 break;
499
500 case "sel_country":
501 $value = $lng->txt("meta_c_" . $value);
502 break;
503 }
504
505 return $value;
506 }
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 getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
getIconVariant()
Gets the variant of LP icons that is shown in the table.

References $DIC, ilTableGUI\$lng, $type, ilDatePresentation\formatDate(), getIconVariant(), ilLPStatusIcons\getInstance(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, 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 233 of file class.ilLPTableBaseGUI.php.

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

References filter(), and 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 173 of file class.ilLPTableBaseGUI.php.

174 {
175 global $DIC;
176
177 $ilObjDataCache = $DIC['ilObjDataCache'];
178
179 include_once './Services/Search/classes/class.ilQueryParser.php';
180
181 $query_parser = new ilQueryParser($filter["query"]);
182 $query_parser->setMinWordLength(0);
183 $query_parser->setCombination(QP_COMBINATION_AND);
184 $query_parser->parse();
185 if (!$query_parser->validate()) {
186 ilLoggerFactory::getLogger('trac')->notice($query_parser->getMessage());
187 // echo $query_parser->getMessage();
188 return false;
189 }
190
191 if ($filter["type"] == "lres") {
192 $filter["type"] = array('lm','sahs','htlm');
193 } else {
194 $filter["type"] = array($filter["type"]);
195 }
196
197 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
198 $object_search = new ilLikeObjectSearch($query_parser);
199 $object_search->setFilter($filter["type"]);
200 if ($preset_obj_ids) {
201 $object_search->setIdFilter($preset_obj_ids);
202 }
203 $res = $object_search->performSearch();
204
205 if ($permission) {
206 $res->setRequiredPermission($permission);
207 }
208
209 $res->setMaxHits(self::HIT_LIMIT);
210
211 if ($a_check_lp_activation) {
212 $res->addObserver($this, "searchFilterListener");
213 }
214
215 if (!$this->filter["area"]) {
216 $res->filter(ROOT_FOLDER_ID, false);
217 } else {
218 $res->filter($this->filter["area"], false);
219 }
220
221 $objects = array();
222 foreach ($res->getResults() as $obj_data) {
223 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
224 }
225 return $objects ? $objects : array();
226 }
const QP_COMBINATION_AND
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger($a_component_id)
Get component logger.
foreach($_POST as $key=> $value) $res

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

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 116 of file class.ilLPTableBaseGUI.php.

117 {
118 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
119
120 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
121
122 $rcps = array();
123 foreach ($a_user_ids as $usr_id) {
124 $rcps[] = ilObjUser::_lookupLogin($usr_id);
125 }
126
127 $template = array();
128 $sig = null;
129
130 // repository-object-specific
131 $ref_id = (int) $_REQUEST["ref_id"];
132 if ($ref_id) {
134 $tmpl_id = $obj_lp->getMailTemplateId();
135
136 if ($tmpl_id) {
137 $template = array(
138 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
139 'ref_id' => $ref_id,
140 'ts' => time()
141 );
142 } else {
143 include_once './Services/Link/classes/class.ilLink.php';
144 $sig = ilLink::_getLink($ref_id);
145 $sig = rawurlencode(base64_encode($sig));
146 }
147 }
148
151 $a_parent_obj,
152 $a_parent_cmd,
153 array(),
154 array(
155 'type' => 'new',
156 'rcp_to' => implode(',', $rcps),
157 'sig' => $sig
158 ),
159 $template
160 )
161 );
162 }
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
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:

◆ setIconVariant()

ilLPTableBaseGUI::setIconVariant ( int  $variant)

Sets the variant of LP icons that is shown in the table.

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

1002 : void
1003 {
1004 $this->icon_variant = $variant;
1005 }

◆ showTimingsWarning()

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

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

704 {
705 $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
706 if ($timing_cache->isWarningRequired($a_user_id)) {
707 $timings = ilTimingCache::_getTimings($a_ref_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'];
712 } else {
713 $end = true;
714 }
715 return $end;
716 }
717 }
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 21 of file class.ilLPTableBaseGUI.php.

◆ $filter

ilLPTableBaseGUI::$filter
protected

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

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

◆ $icon_variant

ilLPTableBaseGUI::$icon_variant = ilLPStatusIcons::ICON_VARIANT_LONG
protected

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

Referenced by getIconVariant().

◆ HIT_LIMIT

const ilLPTableBaseGUI::HIT_LIMIT = 5000

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


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