ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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="")
 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="")
 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)
 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
 $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 = null
 
 $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
 

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 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 = "" 
)

Constructor.

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 {
33 include_once "Services/Object/classes/class.ilObjectLP.php";
34 $olp = ilObjectLP::getInstance($this->obj_id);
35 $this->anonymized = $olp->isAnonymized();
36 }
37 }
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static getInstance($a_obj_id)

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

1080 {
1081 $users = (array) $_POST['uid'];
1082 include_once './Services/User/classes/class.ilUserClipboard.php';
1083 $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
1084 $clip->add($users);
1085 $clip->save();
1086
1087 $GLOBALS['lng']->loadLanguageModule('user');
1088 ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'),true);
1089
1090 }
$_POST["username"]
getId()
Get element id.
static getInstance($a_usr_id)
Get singelton instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

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

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

807 {
808 // currently inactive
809 return $a_value;
810
811 if(is_numeric($a_value))
812 {
813 $threshold = 3;
814 $a_value = (int)$a_value;
815 if($a_value <= $threshold)
816 {
817 if(!$a_force_number)
818 {
819 return "0-".$threshold;
820 }
821 else
822 {
823 return $threshold;
824 }
825 }
826 }
827 return $a_value;
828 }

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

366 {
367 global $tree, $ilCtrl;
368
369 include_once './Services/Link/classes/class.ilLink.php';
370
371 if(!count($ref_ids))
372 {
373 return false;
374 }
375 foreach($ref_ids as $ref_id)
376 {
377 $path = "...";
378 $counter = 0;
379 $path_full = $tree->getPathFull($ref_id);
380 foreach($path_full as $data)
381 {
382 if(++$counter < (count($path_full)-1))
383 {
384 continue;
385 }
386 $path .= " &raquo; ";
387 if($ref_id != $data['ref_id'])
388 {
389 $path .= $data['title'];
390 }
391 else
392 {
393 $path .= ('<a target="_top" href="'.
394 ilLink::_getLink($data['ref_id'],$data['type']).'">'.
395 $data['title'].'</a>');
396 }
397 }
398
400 }
401 return $result;
402 }
$result
$path
Definition: aliased.php:25
$counter
global $ilCtrl
Definition: ilias.php:18
$ref_id
Definition: sahs_server.php:39

References $counter, ilTableGUI\$data, $ilCtrl, $path, $ref_id, $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 830 of file class.ilLPTableBaseGUI.php.

831 {
832 $step = 0;
833 if($a_max_value)
834 {
835 $step = $a_max_value / 10;
836 $base = ceil(log($step, 10));
837 $fac = ceil($step / pow(10, ($base - 1)));
838 $step = pow(10, $base - 1) * $fac;
839 }
840 if ($step <= 1)
841 {
842 $step = 1;
843 }
844 $ticks = range(0, $a_max_value+$step, $step);
845
846 $value_ticks = array(0 => 0);
847 foreach($ticks as $tick)
848 {
849 $value = $tvalue = $tick;
850 if($a_anonymize)
851 {
852 $value = $this->anonymizeValue($value, true);
853 $tvalue = $this->anonymizeValue($tvalue);
854 }
855 if($a_format_seconds)
856 {
857 $tvalue = $this->formatSeconds($value);
858 }
859 $value_ticks[$value] = $tvalue;
860 }
861
862 return $value_ticks;
863 }
formatSeconds($seconds, $a_shorten_zero=false)
anonymizeValue($a_value, $a_force_number=false)
foreach($_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
Definition: cssgen.php:155

References ilTableGUI\$base, $step, 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 39 of file class.ilLPTableBaseGUI.php.

40 {
41 global $ilCtrl, $lng;
42
44
45 if(!$ilCtrl->getNextClass($this))
46 {
47 $to_hide = false;
48
49 switch($ilCtrl->getCmd())
50 {
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 {
72 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
73 }
74 else
75 {
76 $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
77 }
78 break;
79
80 case 'addToClipboard':
81 if(!sizeof($_POST['uid']))
82 {
83 ilUtil::sendFailure($lng->txt('no_checkbox'), true);
84 }
85 else
86 {
87 $this->addToClipboard();
88 }
89 break;
90
91 // page selector
92 default:
94 $this->storeNavParameter();
95 break;
96 }
97
98 if($to_hide)
99 {
100 $obj = $this->getFilterItemByPostVar("hide");
101 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
102 $obj->setValue($value);
103 $obj->writeToSession();
104 }
105
106 if(isset($_REQUEST["tbltplcrt"]))
107 {
108 $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
109 }
110 if(isset($_REQUEST["tbltpldel"]))
111 {
112 $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
113 }
114
115 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
116 }
117 else
118 {
119 // e.g. repository selector
120 return parent::executeCommand();
121 }
122 }
$_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.
global $lng
Definition: privfeed.php:17

References $_GET, $_POST, $ilCtrl, $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 751 of file class.ilLPTableBaseGUI.php.

752 {
753 foreach($this->getExportMeta() as $caption => $value)
754 {
755 $a_csv->addColumn(strip_tags($caption));
756 $a_csv->addColumn(strip_tags($value));
757 $a_csv->addRow();
758 }
759 $a_csv->addRow();
760 }
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 740 of file class.ilLPTableBaseGUI.php.

741 {
742 foreach($this->getExportMeta() as $caption => $value)
743 {
744 $a_excel->setCell($a_row, 0, $caption);
745 $a_excel->setCell($a_row, 1, $value);
746 $a_row++;
747 }
748 $a_row++;
749 }
setCell($a_row, $a_col, $a_value)
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 784 of file class.ilLPTableBaseGUI.php.

785 {
786 $seconds = ((int)$seconds > 0) ? $seconds : 0;
787 if($a_shorten_zero && !$seconds)
788 {
789 return "-";
790 }
791
792 $hours = floor($seconds / 3600);
793 $rest = $seconds % 3600;
794
795 $minutes = floor($rest / 60);
796 $rest = $rest % 60;
797
798 if($rest)
799 {
800 $minutes++;
801 }
802
803 return sprintf("%dh%02dm",$hours,$minutes);
804 }
sprintf('%.4f', $callTime)
$rest
Definition: goto.php:48

References $rest, and sprintf.

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

559 {
560 $result = array();
561 foreach((array)$this->filter as $id => $value)
562 {
563 $item = $this->getFilterItemByPostVar($id);
564 switch($id)
565 {
566 case "title":
567 case "country":
568 case "gender":
569 case "city":
570 case "language":
571 case "login":
572 case "firstname":
573 case "lastname":
574 case "mark":
575 case "u_comment":
576 case "institution":
577 case "department":
578 case "title":
579 case "street":
580 case "zipcode":
581 case "email":
582 case "matriculation":
583 case "sel_country":
584 case "query":
585 case "type":
586 case "area":
587 if($value)
588 {
589 $result[$id] = $value;
590 }
591 break;
592
593 case "status":
594 if($value !== false)
595 {
596 $result[$id] = $value;
597 }
598 break;
599
600 case "user_total":
601 case "read_count":
602 case "percentage":
603 case "hide":
604 case "spent_seconds":
605 if(is_array($value) && implode("", $value))
606 {
607 $result[$id] = $value;
608 }
609 break;
610
611 case "registration":
612 case "create_date":
613 case "first_access":
614 case "last_access":
615 case 'status_changed':
616 if($value)
617 {
618 if($value["from"])
619 {
620 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
621 }
622 if($value["to"])
623 {
624 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
625 }
626 }
627 break;
628
629 case "birthday":
630 if($value)
631 {
632 if($value["from"])
633 {
634 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
635 $result[$id]["from"] = substr($result[$id]["from"], 0, -8)."00:00:00";
636 }
637 if($value["to"])
638 {
639 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
640 $result[$id]["to"] = substr($result[$id]["to"], 0, -8)."23:59:59";
641 }
642 }
643 break;
644 }
645 }
646
647 return $result;
648 }
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 703 of file class.ilLPTableBaseGUI.php.

704 {
705 global $lng, $ilObjDataCache, $ilUser, $ilClientIniFile;
706
707 /* see spec
708 Name of installation
709 Name of the course
710 Permalink to course
711 Owner of course object
712 Date of report generation
713 Reporting period
714 Name of person who generated the report.
715 */
716
718 include_once './Services/Link/classes/class.ilLink.php';
719
720 $data = array();
721 $data[$lng->txt("trac_name_of_installation")] = $ilClientIniFile->readVariable('client', 'name');
722
723 if($this->obj_id)
724 {
725 $data[$lng->txt("trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
726 if($this->ref_id)
727 {
728 $data[$lng->txt("trac_object_link")] = ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id));
729 }
730 $data[$lng->txt("trac_object_owner")] = ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id));
731 }
732
733 $data[$lng->txt("trac_report_date")] =
735 $data[$lng->txt("trac_report_owner")] = $ilUser->getFullName();
736
737 return $data;
738 }
const IL_CAL_UNIX
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@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, $ilUser, $lng, ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObject\_lookupOwner(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, 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 865 of file class.ilLPTableBaseGUI.php.

866 {
867 global $lng;
868
869 $options = array();
870 for($loop = 0; $loop < 10; $loop++)
871 {
872 $year = date("Y")-$loop;
873 $options[$year] = $year;
874 for($loop2 = 12; $loop2 > 0; $loop2--)
875 {
876 $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
877 if($year.$month <= date("Ym"))
878 {
879 if(!$a_short)
880 {
881 $caption = $year." / ".$lng->txt("month_".$month."_long");
882 }
883 else
884 {
885 $caption = $year."/".$month;
886 }
887 $options[$year."-".$month] = $caption;
888 }
889 }
890 }
891 return $options;
892 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!is_array($argv)) $options

References $lng, $options, and date.

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

895 {
896 global $lng;
897
898 if(!$a_year)
899 {
900 $a_year = date("Y");
901 }
902
903 $all = array();
904 for($loop = 1; $loop<13; $loop++)
905 {
906 $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
907 if($a_year."-".$month <= date("Y-m"))
908 {
909 if(!$a_short)
910 {
911 $caption = $lng->txt("month_".$month."_long");
912 }
913 else
914 {
915 $caption = $lng->txt("month_".$month."_short");
916 }
917 $all[$a_year."-".$month] = $caption;
918 }
919 }
920 return $all;
921 }

References $lng, and date.

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

412 {
413 global $lng, $ilPluginAdmin;
414
415 $options = array();
416
417 if($a_split_learning_resources)
418 {
419 $options['lm'] = $lng->txt('objs_lm');
420 $options['sahs'] = $lng->txt('objs_sahs');
421 $options['htlm'] = $lng->txt('objs_htlm');
422 }
423 else
424 {
425 $options['lres'] = $lng->txt('learning_resources');
426 }
427
428 $options['crs'] = $lng->txt('objs_crs');
429 $options['grp'] = $lng->txt('objs_grp');
430 $options['exc'] = $lng->txt('objs_exc');
431 $options['file'] = $lng->txt('objs_file');
432 $options['mcst'] = $lng->txt('objs_mcst');
433 $options['svy'] = $lng->txt('objs_svy');
434 $options['tst'] = $lng->txt('objs_tst');
435 $options['prg'] = $lng->txt('objs_prg');
436 $options['iass'] = $lng->txt('objs_iass');
437
438 if($a_allow_undefined_lp)
439 {
440 $options["webr"] = $lng->txt("objs_webr");
441 $options["wiki"] = $lng->txt("objs_wiki");
442 $options["blog"] = $lng->txt("objs_blog");
443 $options["prtf"] = $lng->txt("objs_prtf");
444 $options["prtt"] = $lng->txt("objs_prtt");
445 }
446
447 // repository plugins (currently only active)
448 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
449 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
450 foreach ($pl_names as $pl)
451 {
452 $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
454 {
455 $options[$pl_id] = ilObjectPlugin::lookupTxtById($pl_id, "objs_".$pl_id);
456 }
457 }
458
459 asort($options);
460 return $options;
461 }
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 $lng, $options, 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 923 of file class.ilLPTableBaseGUI.php.

924 {
925 global $lng, $ilSetting;
926
927 $cols = $privacy_fields = array();
928
929 include_once("./Services/User/classes/class.ilUserProfile.php");
930 $up = new ilUserProfile();
931 $up->skipGroup("preferences");
932 $up->skipGroup("settings");
933 $up->skipGroup("interests");
934 $ufs = $up->getStandardFields();
935
936 // default fields
937 $cols["login"] = array(
938 "txt" => $lng->txt("login"),
939 "default" => true);
940
941 if(!$this->anonymized)
942 {
943 $cols["firstname"] = array(
944 "txt" => $lng->txt("firstname"),
945 "default" => true);
946 $cols["lastname"] = array(
947 "txt" => $lng->txt("lastname"),
948 "default" => true);
949 }
950
951 // show only if extended data was activated in lp settings
952 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
953 $tracking = new ilObjUserTracking();
954 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
955 {
956 $cols["first_access"] = array(
957 "txt" => $lng->txt("trac_first_access"),
958 "default" => true);
959 $cols["last_access"] = array(
960 "txt" => $lng->txt("trac_last_access"),
961 "default" => true);
962 }
963 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
964 {
965 $cols["read_count"] = array(
966 "txt" => $lng->txt("trac_read_count"),
967 "default" => true);
968 }
969 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS) &&
971 {
972 $cols["spent_seconds"] = array(
973 "txt" => $lng->txt("trac_spent_seconds"),
974 "default" => true);
975 }
976
977 if($this->isPercentageAvailable($this->obj_id))
978 {
979 $cols["percentage"] = array(
980 "txt" => $lng->txt("trac_percentage"),
981 "default" => true);
982 }
983
984 // do not show status if learning progress is deactivated
985 $olp = ilObjectLP::getInstance($this->obj_id);
986 if($olp->isActive())
987 {
988 $cols["status"] = array(
989 "txt" => $lng->txt("trac_status"),
990 "default" => true);
991
992 $cols['status_changed'] = array(
993 'txt' => $lng->txt('trac_status_changed'),
994 'default' => false);
995 }
996
997 if(ilObjectLP::supportsMark($this->type))
998 {
999 $cols["mark"] = array(
1000 "txt" => $lng->txt("trac_mark"),
1001 "default" => true);
1002 }
1003
1004 $cols["u_comment"] = array(
1005 "txt" => $lng->txt("trac_comment"),
1006 "default" => false);
1007
1008 $cols["create_date"] = array(
1009 "txt" => $lng->txt("create_date"),
1010 "default" => false);
1011 $cols["language"] = array(
1012 "txt" => $lng->txt("language"),
1013 "default" => false);
1014
1015 // add user data only if object is [part of] course
1016 if(!$this->anonymized &&
1017 ($a_in_course || $a_in_group))
1018 {
1019 // only show if export permission is granted
1020 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1021 if(ilPrivacySettings::_getInstance()->checkExportAccess($this->ref_id))
1022 {
1023 // other user profile fields
1024 foreach ($ufs as $f => $fd)
1025 {
1026 if (!isset($cols[$f]) && $f != "username" && !$fd["lists_hide"])
1027 {
1028 if($a_in_course &&
1029 !($fd["course_export_fix_value"] || $ilSetting->get("usr_settings_course_export_".$f)))
1030 {
1031 continue;
1032 }
1033 if($a_in_group &&
1034 !($fd["group_export_fix_value"] || $ilSetting->get("usr_settings_group_export_".$f)))
1035 {
1036 continue;
1037 }
1038
1039 $cols[$f] = array(
1040 "txt" => $lng->txt($f),
1041 "default" => false);
1042
1043 $privacy_fields[] = $f;
1044 }
1045 }
1046
1047 // additional defined user data fields
1048 include_once './Services/User/classes/class.ilUserDefinedFields.php';
1049 $user_defined_fields = ilUserDefinedFields::_getInstance();
1050 if($a_in_course)
1051 {
1052 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
1053 }
1054 else
1055 {
1056 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
1057 }
1058 foreach($user_defined_fields as $definition)
1059 {
1060 if($definition["field_type"] != UDF_TYPE_WYSIWYG)
1061 {
1062 $f = "udf_".$definition["field_id"];
1063 $cols[$f] = array(
1064 "txt" => $definition["field_name"],
1065 "default" => false);
1066
1067 $privacy_fields[] = $f;
1068 }
1069 }
1070 }
1071 }
1072
1073 return array($cols, $privacy_fields);
1074 }
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

References $ilSetting, $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 283 of file class.ilLPTableBaseGUI.php.

284 {
285 global $lng, $ilObjDataCache;
286
287 $this->setDisableFilterHiding(true);
288
289 // object type selection
290 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
291 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
292 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
293 $this->addFilterItem($si);
294 $si->readFromSession();
295 if(!$si->getValue())
296 {
297 $si->setValue("crs");
298 }
299 $this->filter["type"] = $si->getValue();
300
301 // hidden items
302 include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
303 $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
304 $this->addFilterItem($msi);
305 $msi->readFromSession();
306 $this->filter["hide"] = $msi->getValue();
307 if($this->filter["hide"])
308 {
309 // create options from current value
310 $types = $this->getCurrentFilter(true);
311 $type = $types["type"];
312 $options = array();
313 if($type == 'lres')
314 {
315 $type = array('lm','sahs','htlm');
316 }
317 else
318 {
319 $type = array($type);
320 }
321 foreach($this->filter["hide"] as $obj_id)
322 {
323 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
324 {
325 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
326 }
327 }
328 $msi->setOptions($options);
329 }
330
331 // title/description
332 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
333 $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
334 $ti->setMaxLength(64);
335 $ti->setSize(20);
336 $this->addFilterItem($ti);
337 $ti->readFromSession();
338 $this->filter["query"] = $ti->getValue();
339
340 // repository area selection
341 include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
342 $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
343 $rs->setSelectText($lng->txt("trac_select_area"));
344 $this->addFilterItem($rs);
345 $rs->readFromSession();
346 $this->filter["area"] = $rs->getValue();
347
348 // hide "not started yet"
349 if($a_include_no_status_filter)
350 {
351 include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
352 $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
353 $this->addFilterItem($cb);
354 $cb->readFromSession();
355 $this->filter["status"] = $cb->getChecked();
356 }
357 }
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.

References $lng, $options, $si, 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 650 of file class.ilLPTableBaseGUI.php.

651 {
652 // :TODO:
653 $olp = ilObjectLP::getInstance($a_obj_id);
654 $mode = $olp->getCurrentMode();
655 if(in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
657 // ilLPObjSettings::LP_MODE_OBJECTIVES,
661 {
662 return true;
663 }
664 return false;
665 }

References ilObjectLP\getInstance(), 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(), 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 667 of file class.ilLPTableBaseGUI.php.

668 {
669 global $lng, $ilObjDataCache, $ilUser;
670
671 $user = "";
672 if($a_user_id)
673 {
674 if($a_user_id != $ilUser->getId())
675 {
676 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
677 }
678 else
679 {
680 $a_user = $ilUser;
681 }
682 $user .= ", ".$a_user->getFullName(); // " [".$a_user->getLogin()."]";
683 }
684
685 if($a_obj_id != ROOT_FOLDER_ID)
686 {
687 $this->setTitle($lng->txt($action).": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
688
689 $olp = ilObjectLP::getInstance($a_obj_id);
690 $this->setDescription($this->lng->txt('trac_mode').": ".$olp->getModeText($olp->getCurrentMode()));
691 }
692 else
693 {
694 $this->setTitle($lng->txt($action));
695 }
696 }
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 $ilUser, $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 463 of file class.ilLPTableBaseGUI.php.

464 {
465 global $lng;
466
467 // get rid of aggregation
468 $pos = strrpos($id, "_");
469 if($pos !== false)
470 {
471 $function = strtoupper(substr($id, $pos+1));
472 if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
473 {
474 $id = substr($id, 0, $pos);
475 }
476 }
477
478 if(trim($value) == "" && $id != "status")
479 {
480 if($id == "title" &&
481 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
482 get_class($this) != "ilTrMatrixTableGUI")
483 {
484 return "--".$lng->txt("none")."--";
485 }
486 return " ";
487 }
488
489 switch($id)
490 {
491 case "first_access":
492 case "create_date":
493 case 'status_changed':
495 break;
496
497 case "last_access":
499 break;
500
501 case "birthday":
503 break;
504
505 case "spent_seconds":
507 {
508 $value = "-";
509 }
510 else
511 {
512 $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
513 }
514 break;
515
516 case "percentage":
517 if(false /* $this->isPercentageAvailable() */)
518 {
519 $value = "-";
520 }
521 else
522 {
523 $value = $value."%";
524 }
525 break;
526
527 case "mark":
528 if(!ilObjectLP::supportsMark($type))
529 {
530 $value = "-";
531 }
532 break;
533
534 case "gender":
535 $value = $lng->txt("gender_".$value);
536 break;
537
538 case "status":
539 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
542 $value = ilUtil::img($path, $text);
543 break;
544
545 case "language":
546 $lng->loadLanguageModule("meta");
547 $value = $lng->txt("meta_l_".$value);
548 break;
549
550 case "sel_country":
551 $value = $lng->txt("meta_c_".$value);
552 break;
553 }
554
555 return $value;
556 }
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="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
$text

References $lng, $path, $text, 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 263 of file class.ilLPTableBaseGUI.php.

264 {
265 if(is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"]))
266 {
267 return false;
268 }
269 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
270 if(get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
271 !$olp->isActive())
272 {
273 return false;
274 }
275 return true;
276 }

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

187 {
188 global $ilObjDataCache;
189
190 include_once './Services/Search/classes/class.ilQueryParser.php';
191
192 $query_parser = new ilQueryParser($filter["query"]);
193 $query_parser->setMinWordLength(0);
194 $query_parser->setCombination(QP_COMBINATION_AND);
195 $query_parser->parse();
196 if(!$query_parser->validate())
197 {
198 ilLoggerFactory::getLogger('trac')->notice($query_parser->getMessage());
199 // echo $query_parser->getMessage();
200 return false;
201 }
202
203 if($filter["type"] == "lres")
204 {
205 $filter["type"] = array('lm','sahs','htlm');
206 }
207 else
208 {
209 $filter["type"] = array($filter["type"]);
210 }
211
212 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
213 $object_search = new ilLikeObjectSearch($query_parser);
214 $object_search->setFilter($filter["type"]);
215 if($preset_obj_ids)
216 {
217 $object_search->setIdFilter($preset_obj_ids);
218 }
219 $res =& $object_search->performSearch();
220
221 if($permission)
222 {
223 $res->setRequiredPermission($permission);
224 }
225
226 $res->setMaxHits(1000);
227
228 if($a_check_lp_activation)
229 {
230 $res->addObserver($this, "searchFilterListener");
231 }
232
233 if(!$this->filter["area"])
234 {
235 $res->filter(ROOT_FOLDER_ID, false);
236 }
237 else
238 {
239 $res->filter($this->filter["area"], false);
240 }
241
242 $objects = array();
243 foreach($res->getResults() as $obj_data)
244 {
245 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
246 }
247
248 // Check if search max hits is reached
249 if($res->isLimitReached())
250 {
251 $this->lng->loadLanguageModule("search");
252 ilUtil::sendFailure(sprintf($this->lng->txt("search_limit_reached"), 1000));
253 }
254
255 return $objects ? $objects : array();
256 }
const QP_COMBINATION_AND
static getLogger($a_component_id)
Get component logger.

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

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

125 {
126 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
127
128 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
129
130 $rcps = array();
131 foreach($a_user_ids as $usr_id)
132 {
133 $rcps[] = ilObjUser::_lookupLogin($usr_id);
134 }
135
136 $template = array();
137 $sig = null;
138
139 // repository-object-specific
140 $ref_id = (int)$_REQUEST["ref_id"];
141 if($ref_id)
142 {
144 $tmpl_id = $obj_lp->getMailTemplateId();
145
146 if($tmpl_id)
147 {
148 $template = array(
149 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
150 'ref_id' => $ref_id,
151 'ts' => time()
152 );
153 }
154 else
155 {
156 include_once './Services/Link/classes/class.ilLink.php';
158 $sig = rawurlencode(base64_encode($sig));
159 }
160 }
161
164 $a_parent_obj,
165 $a_parent_cmd,
166 array(),
167 array(
168 'type' => 'new',
169 'rcp_to' => implode(',', $rcps),
170 'sig' => $sig
171 ),
172 $template
173 )
174 );
175 }
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)
http redirect to other script

References $ref_id, 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 762 of file class.ilLPTableBaseGUI.php.

763 {
764 include_once 'Modules/Course/classes/Timings/class.ilTimingCache.php';
765 if(ilTimingCache::_showWarning($a_ref_id, $a_user_id))
766 {
767 $timings = ilTimingCache::_getTimings($a_ref_id);
768 if($timings['item']['changeable'] && $timings['user'][$a_user_id]['end'])
769 {
770 $end = $timings['user'][$a_user_id]['end'];
771 }
772 else if ($timings['item']['suggestion_end'])
773 {
774 $end = $timings['item']['suggestion_end'];
775 }
776 else
777 {
778 $end = true;
779 }
780 return $end;
781 }
782 }
static _showWarning($a_ref_id, $a_usr_id)
static & _getTimings($a_ref_id)

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

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: