ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTrSummaryTableGUI Class Reference

name table More...

+ Inheritance diagram for ilTrSummaryTableGUI:
+ Collaboration diagram for ilTrSummaryTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $a_ref_id, $a_print_mode=false)
 Constructor. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 initFilter ()
 Init filter. More...
 
 getSelCountryCodes ()
 
 getItems ($a_object_id, $a_ref_id)
 Build summary item rows for given object and filter(s. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
- Public Member Functions inherited from ilLPTableBaseGUI
 __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

 getItemsPercentages (array $data=NULL, $overall, array $value_map=NULL, $limit=3)
 Render data as needed for summary list (based on grouped values) More...
 
 getItemsPercentagesStatus (array $data=NULL, $overall, array $value_map=NULL)
 Render status data as needed for summary list (based on grouped values) More...
 
 parseValue ($id, $value, $type)
 
 fillRow ($a_set)
 Fill table row. More...
 
 renderPercentages ($id, $data)
 
 isArrayColumn ($a_name)
 
 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...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 
- Protected Member Functions inherited from ilLPTableBaseGUI
 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...
 

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
 
- Protected Attributes inherited from ilLPTableBaseGUI
 $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
 

Detailed Description

name table

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

@ilCtrl_Calls ilTrSummaryTableGUI: ilFormPropertyDispatchGUI

Definition at line 15 of file class.ilTrSummaryTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTrSummaryTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $a_ref_id,
  $a_print_mode = false 
)

Constructor.

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

21 {
22 global $ilCtrl, $objDefinition;
23
24 $this->setId("trsmy");
25
26 $this->ref_id = $a_ref_id;
27 $this->obj_id = ilObject::_lookupObjId($a_ref_id);
28 $this->is_root = ($a_ref_id == ROOT_FOLDER_ID);
29
30 if(!$this->is_root)
31 {
32 // #17084 - are we multi-object or not?
33 // we cannot parse type filter (too complicated)
34 $type = ilObject::_lookupType($this->obj_id);
35 if(!$objDefinition->isContainer($type))
36 {
37 $this->type = $type;
38 include_once './Services/Object/classes/class.ilObjectLP.php';
39 $this->olp = ilObjectLP::getInstance($this->obj_id);
40 }
41 }
42
43 parent::__construct($a_parent_obj, $a_parent_cmd);
44
45 if($a_print_mode)
46 {
47 $this->setPrintMode(true);
48 }
49
50 $this->parseTitle($this->obj_id, "trac_summary");
51 $this->setLimit(9999);
52 $this->setShowTemplates(true);
53 $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
54
55 $this->addColumn($this->lng->txt("title"), "title");
56 $this->setDefaultOrderField("title");
57
58 $labels = $this->getSelectableColumns();
59 foreach ($this->getSelectedColumns() as $c)
60 {
61 $this->addColumn($labels[$c]["txt"], $c);
62 }
63
64 if($this->is_root)
65 {
66 $this->addColumn($this->lng->txt("path"));
67 $this->addColumn($this->lng->txt("action"));
68 }
69
70
71 // $this->setExternalSorting(true);
72 $this->setEnableHeader(true);
73 $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
74 $this->setRowTemplate("tpl.trac_summary_row.html", "Services/Tracking");
75 $this->initFilter();
76
77 $this->getItems($a_parent_obj->getObjId(), $a_ref_id);
78 }
parseTitle($a_obj_id, $action, $a_user_id=false)
static getInstance($a_obj_id)
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
getSelectedColumns()
Get selected columns.
setEnableHeader($a_enableheader)
Set Enable Header.
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.
setExportFormats(array $formats)
Set available export formats.
setPrintMode($a_value=false)
Toogle print mode.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setShowTemplates($a_value)
Toggle templates.
getSelectableColumns()
Get selectable columns.
getItems($a_object_id, $a_ref_id)
Build summary item rows for given object and filter(s.
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilTable2GUI\addColumn(), ilObjectLP\getInstance(), getItems(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), initFilter(), ilLPTableBaseGUI\parseTitle(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setLimit(), ilTable2GUI\setPrintMode(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowTemplates().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilTrSummaryTableGUI::fillHeaderCSV (   $a_csv)
protected

CSV Version of Fill Header.

Likely to be overwritten by derived class.

Parameters
object$a_csvcurrent file

Reimplemented from ilTable2GUI.

Definition at line 903 of file class.ilTrSummaryTableGUI.php.

904 {
905 $a_csv->addColumn($this->lng->txt("title"));
906
907 $labels = $this->getSelectableColumns();
908 foreach ($this->getSelectedColumns() as $c)
909 {
910 $label = $labels[$c]["txt"];
911 $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
912 $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
913
914 if(!$this->isArrayColumn($c))
915 {
916 $a_csv->addColumn($label);
917 }
918 else
919 {
920 if($c != "status")
921 {
922 $a_csv->addColumn($label." #1");
923 $a_csv->addColumn($label." #1");
924 $a_csv->addColumn($label." #1 %");
925 $a_csv->addColumn($label." #2");
926 $a_csv->addColumn($label." #2");
927 $a_csv->addColumn($label." #2 %");
928 $a_csv->addColumn($label." #3");
929 $a_csv->addColumn($label." #3");
930 $a_csv->addColumn($label." #3 %");
931 $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
932 $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
933 $a_csv->addColumn($label." ".$this->lng->txt("trac_others")." %");
934 }
935 else
936 {
937 // build status to image map
938 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
939 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
940 $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
944 foreach($valid_status as $status)
945 {
947 $a_csv->addColumn($text);
948 $a_csv->addColumn($text." %");
949 }
950 }
951 }
952 }
953
954 $a_csv->addRow();
955 }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
$text

References $text, ilLearningProgressBaseGUI\_getStatusText(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), isArrayColumn(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

+ Here is the call graph for this function:

◆ fillHeaderExcel()

ilTrSummaryTableGUI::fillHeaderExcel ( ilExcel  $a_excel,
$a_row 
)
protected

Excel Version of Fill Header.

Likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter

Reimplemented from ilTable2GUI.

Definition at line 801 of file class.ilTrSummaryTableGUI.php.

802 {
803 $a_excel->setCell($a_row, 0, $this->lng->txt("title"));
804
805 $labels = $this->getSelectableColumns();
806 $cnt = 1;
807 foreach ($this->getSelectedColumns() as $c)
808 {
809 $label = $labels[$c]["txt"];
810 $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
811 $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
812
813 if(!$this->isArrayColumn($c))
814 {
815 $a_excel->setCell($a_row, $cnt, $label);
816 $cnt++;
817 }
818 else
819 {
820 if($c != "status")
821 {
822 $a_excel->setCell($a_row, $cnt, $label." #1");
823 $a_excel->setCell($a_row, ++$cnt, $label." #1");
824 $a_excel->setCell($a_row, ++$cnt, $label." #1 %");
825 $a_excel->setCell($a_row, ++$cnt, $label." #2");
826 $a_excel->setCell($a_row, ++$cnt, $label." #2");
827 $a_excel->setCell($a_row, ++$cnt, $label." #2 %");
828 $a_excel->setCell($a_row, ++$cnt, $label." #3");
829 $a_excel->setCell($a_row, ++$cnt, $label." #3");
830 $a_excel->setCell($a_row, ++$cnt, $label." #3 %");
831 $a_excel->setCell($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
832 $a_excel->setCell($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
833 $a_excel->setCell($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others")." %");
834 }
835 else
836 {
837 // build status to image map
838 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
839 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
840 $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
844 $cnt--;
845 foreach($valid_status as $status)
846 {
848 $a_excel->setCell($a_row, ++$cnt, $text);
849 $a_excel->setCell($a_row, ++$cnt, $text." %");
850 }
851 }
852 $cnt++;
853 }
854 }
855
856 $a_excel->setBold("A".$a_row.":".$a_excel->getColumnCoord($cnt).$a_row);
857 }
setCell($a_row, $a_col, $a_value)
Set cell value.
setBold($a_coords)
Set cell(s) to bold.
getColumnCoord($a_col)
Get column "name" from number.

References $text, ilLearningProgressBaseGUI\_getStatusText(), ilExcel\getColumnCoord(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), isArrayColumn(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilExcel\setBold(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ fillRow()

ilTrSummaryTableGUI::fillRow (   $a_set)
protected

Fill table row.

Reimplemented from ilTable2GUI.

Definition at line 659 of file class.ilTrSummaryTableGUI.php.

660 {
661 global $lng, $ilCtrl;
662
663 $this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $a_set["type"]));
664 $this->tpl->setVariable("ICON_ALT", $lng->txt($a_set["type"]));
665 $this->tpl->setVariable("TITLE", $a_set["title"]);
666
667 if($a_set["offline"] || $a_set["privacy_conflict"])
668 {
669 $mess = array();
670 if($a_set["offline"])
671 {
672 $mess[] = $lng->txt("offline");
673 }
674 if($a_set["privacy_conflict"])
675 {
676 $mess[] = $lng->txt("status_no_permission");
677 }
678 $this->tpl->setCurrentBlock("status_bl");
679 $this->tpl->setVariable("TEXT_STATUS", implode(", ", $mess));
680 $this->tpl->parseCurrentBlock();
681 }
682
683 foreach ($this->getSelectedColumns() as $c)
684 {
685 switch($c)
686 {
687 case "country":
688 case "gender":
689 case "city":
690 case "language":
691 case "status":
692 case "mark":
693 case "sel_country":
694 $this->renderPercentages($c, $a_set[$c]);
695 break;
696
697 case "percentage_avg":
698 if((int)$a_set[$c] === 0 || !$this->isPercentageAvailable($a_set["obj_id"]))
699 {
700 $this->tpl->setVariable(strtoupper($c), "");
701 break;
702 }
703
704 default:
705 $value = $this->parseValue($c, $a_set[$c], $a_set["type"]);
706 $this->tpl->setVariable(strtoupper($c), $value);
707 break;
708 }
709 }
710
711 if($this->is_root)
712 {
713 $path = $this->buildPath($a_set["ref_ids"], false, true);
714 if($path)
715 {
716 $this->tpl->setCurrentBlock("item_path");
717 foreach($path as $ref_id => $path_item)
718 {
719 $this->tpl->setVariable("PATH_ITEM", $path_item);
720
721 if(!$this->anonymized)
722 {
723 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', $ref_id);
724 $this->tpl->setVariable("URL_DETAILS", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(), 'details'));
725 $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', '');
726 $this->tpl->setVariable("TXT_DETAILS", $lng->txt('trac_participants'));
727 }
728 else
729 {
730 $this->tpl->setVariable("URL_DETAILS", ilLink::_getLink($ref_id, $a_set["type"]));
731 $this->tpl->setVariable("TXT_DETAILS", $lng->txt('view'));
732 }
733
734 $this->tpl->parseCurrentBlock();
735 }
736 }
737
738 $this->tpl->setCurrentBlock("item_command");
739 $ilCtrl->setParameterByClass(get_class($this),'hide', $a_set["obj_id"]);
740 $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this),'hide'));
741 $this->tpl->setVariable("TXT_COMMAND", $this->lng->txt('trac_hide'));
742 $this->tpl->parseCurrentBlock();
743
744 $this->tpl->touchBlock("path_action");
745 }
746 else if($a_set["ref_ids"]) // #18446
747 {
748 // #16453
749 include_once './Services/Tree/classes/class.ilPathGUI.php';
750 $path = new ilPathGUI();
751 $path = $path->getPath($this->ref_id, array_pop($a_set["ref_ids"]));
752 if($path)
753 {
754 $this->tpl->setVariable('COLL_PATH', $this->lng->txt('path').': '.$path);
755 }
756 }
757 }
$path
Definition: aliased.php:25
buildPath($ref_ids)
Build path with deep-link.
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
Creates a path for a start and endnode.
parseValue($id, $value, $type)
global $lng
Definition: privfeed.php:17
$ref_id
Definition: sahs_server.php:39

References $ilCtrl, $lng, $path, $ref_id, ilObject\_getIcon(), ilLink\_getLink(), ilLPTableBaseGUI\buildPath(), ilTable2GUI\getSelectedColumns(), ilLPTableBaseGUI\isPercentageAvailable(), parseValue(), and renderPercentages().

+ Here is the call graph for this function:

◆ fillRowCSV()

ilTrSummaryTableGUI::fillRowCSV (   $a_csv,
  $a_set 
)
protected

CSV Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
object$a_csvcurrent file
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 957 of file class.ilTrSummaryTableGUI.php.

958 {
959 $a_csv->addColumn($a_set["title"]);
960
961 foreach ($this->getSelectedColumns() as $c)
962 {
963 if(!$this->isArrayColumn($c))
964 {
965 $val = $this->parseValue($c, $a_set[$c], $a_set["type"]);
966 $a_csv->addColumn($val);
967 }
968 else
969 {
970 foreach((array) $a_set[$c] as $idx => $value)
971 {
972 if($c != "status")
973 {
974 $a_csv->addColumn($value["caption"]);
975 }
976 $a_csv->addColumn((int)$value["absolute"]);
977 $a_csv->addColumn($value["percentage"]);
978 }
979 if(sizeof($a_set[$c]) < 4 && $c != "status")
980 {
981 for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
982 {
983 $a_csv->addColumn("");
984 $a_csv->addColumn("");
985 $a_csv->addColumn("");
986 }
987 }
988 }
989 }
990
991 $a_csv->addRow();
992 }

References ilTable2GUI\getSelectedColumns(), isArrayColumn(), and parseValue().

+ Here is the call graph for this function:

◆ fillRowExcel()

ilTrSummaryTableGUI::fillRowExcel ( ilExcel  $a_excel,
$a_row,
  $a_set 
)
protected

Excel Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 859 of file class.ilTrSummaryTableGUI.php.

860 {
861 $a_excel->setCell($a_row, 0, $a_set["title"]);
862
863 $cnt = 1;
864 foreach ($this->getSelectedColumns() as $c)
865 {
866 if(!$this->isArrayColumn($c))
867 {
868 $val = $this->parseValue($c, $a_set[$c], $a_set["type"]);
869 $a_excel->setCell($a_row, $cnt, $val);
870 $cnt++;
871 }
872 else
873 {
874 foreach((array) $a_set[$c] as $idx => $value)
875 {
876 if($c == "status")
877 {
878 $a_excel->setCell($a_row, $cnt, (int)$value["absolute"]);
879 $a_excel->setCell($a_row, ++$cnt, $value["percentage"]."%");
880 }
881 else
882 {
883 $a_excel->setCell($a_row, $cnt, $value["caption"]);
884 $a_excel->setCell($a_row, ++$cnt, (int)$value["absolute"]);
885 $a_excel->setCell($a_row, ++$cnt, $value["percentage"]."%");
886 }
887 $cnt++;
888 }
889 if(sizeof($a_set[$c]) < 4 && $c != "status")
890 {
891 for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
892 {
893 $a_excel->setCell($a_row, $cnt, "");
894 $a_excel->setCell($a_row, ++$cnt, "");
895 $a_excel->setCell($a_row, ++$cnt, "");
896 $cnt++;
897 }
898 }
899 }
900 }
901 }

References ilTable2GUI\getSelectedColumns(), isArrayColumn(), parseValue(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ getItems()

ilTrSummaryTableGUI::getItems (   $a_object_id,
  $a_ref_id 
)

Build summary item rows for given object and filter(s.

Parameters
int$a_object_id
int$a_ref_id

Definition at line 333 of file class.ilTrSummaryTableGUI.php.

334 {
335 global $lng, $rbacsystem;
336
337 include_once("./Services/Tracking/classes/class.ilTrQuery.php");
338
339 // show only selected subobjects for lp mode
340 $preselected_obj_ids = $filter = NULL;
341
343 if(
344 $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL ||
345 $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION ||
346 $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR
347 )
348 {
349 $collection = $olp->getCollectionInstance();
350 $preselected_obj_ids[$a_object_id][] = $a_ref_id;
351 foreach($collection->getItems() as $item => $item_info)
352 {
353 $tmp_lp = ilObjectLP::getInstance(ilObject::_lookupObjId($item_info));
354 if($tmp_lp->isActive())
355 {
356 $preselected_obj_ids[ilObject::_lookupObjId($item_info)][] = $item_info;
357 }
358 }
359 $filter = $this->getCurrentFilter();
360 }
361 elseif($this->is_root)
362 {
363 // using search to get all relevant objects
364 // #8498/#8499: restrict to objects with at least "read_learning_progress" access
365 $preselected_obj_ids = $this->searchObjects($this->getCurrentFilter(true), "read_learning_progress");
366 }
367 else
368 {
369 // using summary filters
370 $filter = $this->getCurrentFilter();
371 }
372
373
374
376 $a_object_id,
377 $a_ref_id,
382 $filter,
383 $this->getSelectedColumns(),
384 $preselected_obj_ids
385 );
386
387 // build status to image map
388 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
389 include_once("./Services/Tracking/classes/class.ilLPStatus.php");
390 $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
394 $status_map = array();
395 foreach($valid_status as $status)
396 {
399 $status_map[$status] = ilUtil::img($path, $text);
400 }
401
402 // language map
403 $lng->loadLanguageModule("meta");
404 $languages = array();
405 foreach ($lng->getInstalledLanguages() as $lang_key)
406 {
407 $languages[$lang_key] = $lng->txt("meta_l_".$lang_key);
408 }
409
410 $rows = array();
411 foreach($data["set"] as $idx => $result)
412 {
413 // sessions have no title
414 if($result["title"] == "" && $result["type"] == "sess")
415 {
416 include_once "Modules/Session/classes/class.ilObjSession.php";
417 $sess = new ilObjSession($result["obj_id"], false);
418 $data["set"][$idx]["title"] = $sess->getFirstAppointment()->appointmentToString();
419 }
420
421 $data["set"][$idx]["offline"] = ilLearningProgressBaseGUI::isObjectOffline($result["obj_id"], $result["type"]);
422
423 // #13807
424 if($result["ref_ids"])
425 {
426 $valid = false;
427 foreach($result["ref_ids"] as $check_ref_id)
428 {
429 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
430 if(ilLearningProgressAccess::checkPermission('read_learning_progress', $check_ref_id))
431 {
432 $valid = true;
433 break;
434 }
435 }
436 if(!$valid)
437 {
438 foreach(array_keys($data["set"][$idx]) as $col_id)
439 {
440 if(!in_array($col_id, array("type", "title", "obj_id", "ref_id", "offline")))
441 {
442 $data["set"][$idx][$col_id] = null;
443 }
444 }
445 $data["set"][$idx]["privacy_conflict"] = true;
446 continue;
447 }
448 }
449
450 // percentages
451 $users_no = $result["user_total"];
452 $data["set"][$idx]["country"] = $this->getItemsPercentages($result["country"], $users_no);
453 $data["set"][$idx]["gender"] = $this->getItemsPercentages($result["gender"], $users_no, array("m"=>$lng->txt("gender_m"), "f"=>$lng->txt("gender_f")));
454 $data["set"][$idx]["city"] = $this->getItemsPercentages($result["city"], $users_no);
455 $data["set"][$idx]["sel_country"] = $this->getItemsPercentages($result["sel_country"], $users_no, $this->getSelCountryCodes());
456 $data["set"][$idx]["mark"] = $this->getItemsPercentages($result["mark"], $users_no);
457 $data["set"][$idx]["language"] = $this->getItemsPercentages($result["language"], $users_no, $languages);
458
459 // if we encounter any invalid status codes, e.g. null, map them to not attempted instead
460 foreach($result["status"] as $status_code => $status_counter)
461 {
462 // null is cast to ""
463 if($status_code === "" || !in_array($status_code, $valid_status))
464 {
465 $result["status"][ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM] += $status_counter;
466 unset($result["status"][$status_code]);
467 }
468 }
469 $data["set"][$idx]["status"] = $this->getItemsPercentagesStatus($result["status"], $users_no, $status_map);
470
471 if(!$this->isPercentageAvailable($result["obj_id"]))
472 {
473 $data["set"][$idx]["percentage_avg"] = NULL;
474 }
475 }
476
477 $this->setMaxCount($data["cnt"]);
478 $this->setData($data["set"]);
479 }
$result
getCurrentFilter($as_query=false)
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
static _getImagePathForStatus($a_status)
Get image path for status.
static isObjectOffline($a_obj_id, $a_type=null)
setData($a_data)
set table data @access public
getLimit()
Get limit.
getOffset()
Get offset.
getOrderDirection()
Get order direction.
setMaxCount($a_max_count)
set max.
static getObjectsSummaryForObject($a_parent_obj_id, $a_parent_ref_id, $a_order_field="", $a_order_dir="", $a_offset=0, $a_limit=9999, array $a_filters=NULL, array $a_additional_fields=NULL, $a_preselected_obj_ids=NULL)
Get all aggregated tracking data for parent object.
getItemsPercentagesStatus(array $data=NULL, $overall, array $value_map=NULL)
Render status data as needed for summary list (based on grouped values)
getItemsPercentages(array $data=NULL, $overall, array $value_map=NULL, $limit=3)
Render data as needed for summary list (based on grouped values)
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$languages
Definition: cssgen2.php:34
$valid

References ilTableGUI\$data, ilLPTableBaseGUI\$filter, $languages, $lng, $path, $result, $sess, $text, $valid, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilObject\_lookupObjId(), ilLearningProgressAccess\checkPermission(), ilLPTableBaseGUI\getCurrentFilter(), ilObjectLP\getInstance(), getItemsPercentages(), getItemsPercentagesStatus(), ilTable2GUI\getLimit(), ilTrQuery\getObjectsSummaryForObject(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), getSelCountryCodes(), ilTable2GUI\getSelectedColumns(), ilUtil\img(), ilLearningProgressBaseGUI\isObjectOffline(), ilLPTableBaseGUI\isPercentageAvailable(), ilLPObjSettings\LP_MODE_COLLECTION, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_MANUAL_BY_TUTOR, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilLPTableBaseGUI\searchObjects(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), and ilUtil\stripSlashes().

Referenced by __construct().

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

◆ getItemsPercentages()

ilTrSummaryTableGUI::getItemsPercentages ( array  $data = NULL,
  $overall,
array  $value_map = NULL,
  $limit = 3 
)
protected

Render data as needed for summary list (based on grouped values)

Parameters
array$datarows data
int$overalloverall number of entries
array$value_maplabels for values
int$limitsummarize all entries beyond limit
Returns
array

Definition at line 490 of file class.ilTrSummaryTableGUI.php.

491 {
492 global $lng;
493
494 if(!$overall)
495 {
496 return false;
497 }
498
499 $result = array();
500
501 if($data)
502 {
503 // if we have only 1 item more than the limit, "others" makes no sense
504 if(sizeof($data) == $limit+1)
505 {
506 $limit++;
507 }
508
509 $counter = $others_counter = $others_sum = 0;
510 foreach($data as $id => $count)
511 {
512 $counter++;
513 if($counter <= $limit)
514 {
515 $caption = $id;
516
517 if($value_map && isset($value_map[$id]))
518 {
519 $caption = $value_map[$id];
520 }
521
522 if($caption == "")
523 {
524 $caption = $lng->txt("none");
525 }
526
527 $perc = round($count/$overall*100);
528 $result[] = array(
529 "caption" => $caption,
530 "absolute" => $count, // ." ".($count > 1 ? $lng->txt("users") : $lng->txt("user")),
531 "percentage" => $perc
532 );
533 }
534 else
535 {
536 $others_sum += $count;
537 $others_counter++;
538 }
539 }
540
541 if($others_counter)
542 {
543 $perc = round($others_sum/$overall*100);
544 $result[] = array(
545 "caption" => $otherss_counter." ".$lng->txt("trac_others"),
546 "absolute" => $others_sum, // ." ".($others_sum > 1 ? $lng->txt("users") : $lng->txt("user")),
547 "percentage" => $perc
548 );
549 }
550 }
551
552 return $result;
553 }
$counter

References $counter, ilTableGUI\$data, ilTableGUI\$limit, $lng, and $result.

Referenced by getItems().

+ Here is the caller graph for this function:

◆ getItemsPercentagesStatus()

ilTrSummaryTableGUI::getItemsPercentagesStatus ( array  $data = NULL,
  $overall,
array  $value_map = NULL 
)
protected

Render status data as needed for summary list (based on grouped values)

Parameters
array$datarows data
int$overalloverall number of entries
array$value_maplabels for values
Returns
array

Definition at line 563 of file class.ilTrSummaryTableGUI.php.

564 {
565 global $lng;
566
567 $result = array();
568 foreach($value_map as $id => $caption)
569 {
570 $count = 0;
571 if(isset($data[$id]))
572 {
573 $count = $data[$id];
574 }
575 $perc = round($count/$overall*100);
576
577 $result[] = array(
578 "caption" => $caption,
579 "absolute" => $count,
580 "percentage" => $perc
581 );
582 }
583
584 return $result;
585 }

References ilTableGUI\$data, $lng, and $result.

Referenced by getItems().

+ Here is the caller graph for this function:

◆ getSelCountryCodes()

ilTrSummaryTableGUI::getSelCountryCodes ( )

Definition at line 313 of file class.ilTrSummaryTableGUI.php.

314 {
315 global $lng;
316
317 include_once("./Services/Utilities/classes/class.ilCountry.php");
318 $options = array();
319 foreach (ilCountry::getCountryCodes() as $c)
320 {
321 $options[$c] = $lng->txt("meta_c_".$c);
322 }
323 asort($options);
324 return $options;
325 }
static getCountryCodes()
Get country codes (DIN EN 3166-1)
if(!is_array($argv)) $options

References $lng, $options, and ilCountry\getCountryCodes().

Referenced by getItems().

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

◆ getSelectableColumns()

ilTrSummaryTableGUI::getSelectableColumns ( )

Get selectable columns.

Returns
array key: column id, val: true/false -> default on/off

Reimplemented from ilTable2GUI.

Definition at line 80 of file class.ilTrSummaryTableGUI.php.

81 {
82 global $lng, $ilSetting;
83
84 $lng_map = array("user_total" => "users", "first_access_min" => "trac_first_access",
85 "last_access_max" => "trac_last_access", "mark" => "trac_mark", "status" => "trac_status",
86 'status_changed_max' => 'trac_status_changed',
87 "spent_seconds_avg" => "trac_spent_seconds", "percentage_avg" => "trac_percentage",
88 "read_count_sum" => "trac_read_count", "read_count_avg" => "trac_read_count",
89 "read_count_spent_seconds_avg" => "trac_read_count_spent_seconds"
90 );
91
92
93 $all = array("user_total");
94 $default = array();
95
96 // show only if extended data was activated in lp settings
97 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
98 $tracking = new ilObjUserTracking();
99 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
100 {
101 $all[] = "read_count_sum";
102 $all[] = "read_count_avg";
103 $default[] = "read_count_sum";
104 }
105 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
106 {
107 if($this->is_root || !$this->type || ilObjectLP::supportsSpentSeconds($this->type))
108 {
109 $all[] = "spent_seconds_avg";
110 $default[] = "spent_seconds_avg";
111 }
112 }
113 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT) &&
114 $tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
115 {
116 if($this->is_root || !$this->type || ilObjectLP::supportsSpentSeconds($this->type))
117 {
118 $all[] = "read_count_spent_seconds_avg";
119 // $default[] = "read_count_spent_seconds_avg";
120 }
121 }
122
123
124 if($this->is_root || !$this->type || $this->isPercentageAvailable($this->obj_id))
125 {
126 $all[] = "percentage_avg";
127 }
128
129 if($this->is_root || !$this->olp || $this->olp->isActive())
130 {
131 $all[] = "status";
132 $all[] = 'status_changed_max';
133 }
134
135 if($this->is_root || !$this->type || ilObjectLP::supportsMark($this->type))
136 {
137 $all[] = "mark";
138 }
139
140 $privacy = array("gender", "city", "country", "sel_country");
141 foreach($privacy as $field)
142 {
143 if($ilSetting->get("usr_settings_course_export_".$field))
144 {
145 $all[] = $field;
146 }
147 }
148
149 $all[] = "language";
150
151 $default[] = "percentage_avg";
152 $default[] = "status";
153 $default[] = "mark";
154
155 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
156 {
157 $all[] = "first_access_min";
158 $all[] = "last_access_max";
159 }
160
161 $all[] = "create_date_min";
162 $all[] = "create_date_max";
163
164 $columns = array();
165 foreach($all as $column)
166 {
167 $l = $column;
168
169 $prefix = false;
170 if(substr($l, -3) == "avg")
171 {
172 $prefix = "&#216; ";
173 }
174 else if(substr($l, -3) == "sum" || $l == "user_total")
175 {
176 $prefix = "&#8721; ";
177 }
178
179 if(isset($lng_map[$l]))
180 {
181 $l = $lng_map[$l];
182 }
183
184 $txt = $prefix.$lng->txt($l);
185
186 if(in_array($column, array("read_count_avg", "spent_seconds_avg", "percentage_avg")))
187 {
188 $txt .= " / ".$lng->txt("user");
189 }
190
191 $columns[$column] = array(
192 "txt" => $txt,
193 "default" => (in_array($column, $default) ? true :false)
194 );
195 }
196 return $columns;
197 }
$column
Definition: 39dropdown.php:62
if(! $in) $columns
Definition: Utf8Test.php:45
global $l
Definition: afr.php:30
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
$txt
Definition: error.php:12
global $ilSetting
Definition: privfeed.php:17

References $column, $columns, $ilSetting, $l, $lng, ilTableGUI\$prefix, $txt, ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilLPTableBaseGUI\isPercentageAvailable(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

Referenced by __construct(), fillHeaderCSV(), and fillHeaderExcel().

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

◆ initFilter()

ilTrSummaryTableGUI::initFilter ( )

Init filter.

Reimplemented from ilTable2GUI.

Definition at line 202 of file class.ilTrSummaryTableGUI.php.

203 {
204 global $lng, $ilSetting;
205
206 if($this->is_root)
207 {
208 return parent::initBaseFilter(true, false);
209 }
210
211 // show only if extended data was activated in lp settings
212 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
213 $tracking = new ilObjUserTracking();
214
215 $item = $this->addFilterItemByMetaType("user_total", ilTable2GUI::FILTER_NUMBER_RANGE, true,
216 "&#8721; ".$lng->txt("users"));
217 $this->filter["user_total"] = $item->getValue();
218
219 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
220 {
221 $item = $this->addFilterItemByMetaType("read_count", ilTable2GUI::FILTER_NUMBER_RANGE, true,
222 "&#8721; ".$lng->txt("trac_read_count"));
223 $this->filter["read_count"] = $item->getValue();
224 }
225
226 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
227 {
228 if($this->is_root || !$this->type || ilObjectLP::supportsSpentSeconds($this->type))
229 {
230 $item = $this->addFilterItemByMetaType("spent_seconds", ilTable2GUI::FILTER_DURATION_RANGE,
231 true, "&#216; ".$lng->txt("trac_spent_seconds")." / ".$lng->txt("user"));
232 $this->filter["spent_seconds"]["from"] = $item->getCombinationItem("from")->getValueInSeconds();
233 $this->filter["spent_seconds"]["to"] = $item->getCombinationItem("to")->getValueInSeconds();
234 }
235 }
236
237 if($this->is_root || !$this->type || $this->isPercentageAvailable($this->obj_id))
238 {
239 $item = $this->addFilterItemByMetaType("percentage", ilTable2GUI::FILTER_NUMBER_RANGE, true,
240 "&#216; ".$lng->txt("trac_percentage")." / ".$lng->txt("user"));
241 $this->filter["percentage"] = $item->getValue();
242 }
243
244 if($this->is_root || !$this->olp || $this->olp->isActive())
245 {
246 include_once "Services/Tracking/classes/class.ilLPStatus.php";
247 $item = $this->addFilterItemByMetaType("status", ilTable2GUI::FILTER_SELECT, true);
248 $item->setOptions(array("" => $lng->txt("trac_all"),
253 $this->filter["status"] = $item->getValue();
254 if($this->filter["status"])
255 {
256 $this->filter["status"]--;
257 }
258
259 $item = $this->addFilterItemByMetaType("trac_status_changed", ilTable2GUI::FILTER_DATE_RANGE, true);
260 $this->filter["status_changed"] = $item->getDate();
261 }
262
263 if($this->is_root || !$this->type || ilObjectLP::supportsMark($this->type))
264 {
265 $item = $this->addFilterItemByMetaType("mark", ilTable2GUI::FILTER_TEXT, true,
266 $lng->txt("trac_mark"));
267 $this->filter["mark"] = $item->getValue();
268 }
269
270 if($ilSetting->get("usr_settings_course_export_gender"))
271 {
272 $item = $this->addFilterItemByMetaType("gender", ilTable2GUI::FILTER_SELECT, true);
273 $item->setOptions(array("" => $lng->txt("trac_all"), "m" => $lng->txt("gender_m"),
274 "f" => $lng->txt("gender_f")));
275 $this->filter["gender"] = $item->getValue();
276 }
277
278 if($ilSetting->get("usr_settings_course_export_city"))
279 {
280 $item = $this->addFilterItemByMetaType("city", ilTable2GUI::FILTER_TEXT, true);
281 $this->filter["city"] = $item->getValue();
282 }
283
284 if($ilSetting->get("usr_settings_course_export_country"))
285 {
286 $item = $this->addFilterItemByMetaType("country", ilTable2GUI::FILTER_TEXT, true);
287 $this->filter["country"] = $item->getValue();
288 }
289
290 if($ilSetting->get("usr_settings_course_export_sel_country"))
291 {
292 $item = $this->addFilterItemByMetaType("sel_country", ilTable2GUI::FILTER_SELECT, true);
293 $item->setOptions(array("" => $lng->txt("trac_all"))+$this->getSelCountryCodes());
294 $this->filter["sel_country"] = $item->getValue();
295 }
296
297 $item = $this->addFilterItemByMetaType("language", ilTable2GUI::FILTER_LANGUAGE, true);
298 $this->filter["language"] = $item->getValue();
299
300 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
301 {
302 $item = $this->addFilterItemByMetaType("trac_first_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
303 $this->filter["first_access"] = $item->getDate();
304
305 $item = $this->addFilterItemByMetaType("trac_last_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
306 $this->filter["last_access"] = $item->getDate();
307 }
308
309 $item = $this->addFilterItemByMetaType("registration_filter", ilTable2GUI::FILTER_DATE_RANGE, true);
310 $this->filter["registration"] = $item->getDate();
311 }
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
const FILTER_DURATION_RANGE
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
const FILTER_NUMBER_RANGE
const FILTER_DATETIME_RANGE

References $ilSetting, $lng, ilTable2GUI\addFilterItemByMetaType(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilTable2GUI\FILTER_DATE_RANGE, ilTable2GUI\FILTER_DATETIME_RANGE, ilTable2GUI\FILTER_DURATION_RANGE, ilTable2GUI\FILTER_LANGUAGE, ilTable2GUI\FILTER_NUMBER_RANGE, ilTable2GUI\FILTER_SELECT, ilTable2GUI\FILTER_TEXT, ilLPTableBaseGUI\isPercentageAvailable(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

Referenced by __construct().

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

◆ isArrayColumn()

ilTrSummaryTableGUI::isArrayColumn (   $a_name)
protected

Definition at line 778 of file class.ilTrSummaryTableGUI.php.

779 {
780 if(in_array($a_name, array("country", "gender", "city", "language", "status", "mark", 'sel_country')))
781 {
782 return true;
783 }
784 return false;
785 }

Referenced by fillHeaderCSV(), fillHeaderExcel(), fillRowCSV(), and fillRowExcel().

+ Here is the caller graph for this function:

◆ numericOrdering()

ilTrSummaryTableGUI::numericOrdering (   $a_field)

Should this field be sorted numeric?

Returns
boolean numeric ordering; default is false

Reimplemented from ilTable2GUI.

Definition at line 787 of file class.ilTrSummaryTableGUI.php.

788 {
789 $pos = strrpos($a_field, "_");
790 if($pos !== false)
791 {
792 $function = strtoupper(substr($a_field, $pos+1));
793 if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT", "TOTAL")))
794 {
795 return true;
796 }
797 }
798 return false;
799 }

◆ parseValue()

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

Reimplemented from ilLPTableBaseGUI.

Definition at line 587 of file class.ilTrSummaryTableGUI.php.

588 {
589 global $lng;
590
591 // get rid of aggregation
592 $pos = strrpos($id, "_");
593 if($pos !== false)
594 {
595 $function = strtoupper(substr($id, $pos+1));
596 if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
597 {
598 $id = substr($id, 0, $pos);
599 }
600 }
601
602 if(trim($value) == "")
603 {
604 if($id == "title")
605 {
606 return "--".$lng->txt("none")."--";
607 }
608 return "";
609 }
610 switch($id)
611 {
612 case 'status_changed':
613 case "first_access":
614 case "create_date":
616 break;
617
618 case "last_access":
620 break;
621
622 case "spent_seconds":
623 case "read_count_spent_seconds":
625 {
626 $value = "-";
627 }
628 else
629 {
630 $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
631 }
632 break;
633
634 case "percentage":
635 if(false /* $this->isPercentageAvailable() */)
636 {
637 $value = "-";
638 }
639 else
640 {
641 $value = $value."%";
642 }
643 break;
644
645 case "mark":
646 if(!ilObjectLP::supportsMark($type))
647 {
648 $value = "-";
649 }
650 break;
651 }
652
653 return $value;
654 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling

References $lng, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilDatePresentation\secondsToString(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

Referenced by fillRow(), fillRowCSV(), and fillRowExcel().

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

◆ renderPercentages()

ilTrSummaryTableGUI::renderPercentages (   $id,
  $data 
)
protected

Definition at line 759 of file class.ilTrSummaryTableGUI.php.

760 {
761 if($data)
762 {
763 foreach($data as $item)
764 {
765 $this->tpl->setCurrentBlock($id."_row");
766 $this->tpl->setVariable("CAPTION", $item["caption"]);
767 $this->tpl->setVariable("ABSOLUTE", $item["absolute"]);
768 $this->tpl->setVariable("PERCENTAGE", $item["percentage"]);
769 $this->tpl->parseCurrentBlock();
770 }
771 }
772 else
773 {
774 $this->tpl->touchBlock($id);;
775 }
776 }

References ilTableGUI\$data.

Referenced by fillRow().

+ Here is the caller graph for this function:

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