ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 ()
 
 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)
 
- Public Member Functions inherited from ilLPTableBaseGUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 
 executeCommand ()
 
 searchFilterListener ($a_ref_id, $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED public. More...
 
 initBaseFilter ($a_split_learning_resources=false, $a_include_no_status_filter=true)
 Init filter. More...
 
 getCurrentFilter ($as_query=false)
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
 executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 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 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)
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width 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) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction 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 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)
 
 fillRowExcel (ilExcel $a_excel, &$a_row, $a_set)
 
 fillHeaderCSV ($a_csv)
 
 fillRowCSV ($a_csv, $a_set)
 
- 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)
 
 fillMetaCSV ($a_csv)
 
 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 FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 
- Protected Attributes inherited from ilLPTableBaseGUI
 $filter
 
 $anonymized
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats = []
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Detailed Description

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.

References $ilCtrl, $type, ilObject\_lookupObjId(), ilObject\_lookupType(), ilTable2GUI\addColumn(), array, 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().

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

Member Function Documentation

◆ fillHeaderCSV()

ilTrSummaryTableGUI::fillHeaderCSV (   $a_csv)
protected

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

References $text, ilLearningProgressBaseGUI\_getStatusText(), array, 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.

814  {
815  $a_csv->addColumn($this->lng->txt("title"));
816 
817  $labels = $this->getSelectableColumns();
818  foreach ($this->getSelectedColumns() as $c) {
819  $label = $labels[$c]["txt"];
820  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
821  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
822 
823  if (!$this->isArrayColumn($c)) {
824  $a_csv->addColumn($label);
825  } else {
826  if ($c != "status") {
827  $a_csv->addColumn($label . " #1");
828  $a_csv->addColumn($label . " #1");
829  $a_csv->addColumn($label . " #1 %");
830  $a_csv->addColumn($label . " #2");
831  $a_csv->addColumn($label . " #2");
832  $a_csv->addColumn($label . " #2 %");
833  $a_csv->addColumn($label . " #3");
834  $a_csv->addColumn($label . " #3");
835  $a_csv->addColumn($label . " #3 %");
836  $a_csv->addColumn($label . " " . $this->lng->txt("trac_others"));
837  $a_csv->addColumn($label . " " . $this->lng->txt("trac_others"));
838  $a_csv->addColumn($label . " " . $this->lng->txt("trac_others") . " %");
839  } else {
840  // build status to image map
841  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
842  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
847  foreach ($valid_status as $status) {
849  $a_csv->addColumn($text);
850  $a_csv->addColumn($text . " %");
851  }
852  }
853  }
854  }
855 
856  $a_csv->addRow();
857  }
const LP_STATUS_COMPLETED_NUM
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
const LP_STATUS_IN_PROGRESS_NUM
$text
Definition: errorreport.php:18
getSelectedColumns()
Get selected columns.
Create styles array
The data for the language used.
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:

◆ fillHeaderExcel()

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

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

References $text, ilLearningProgressBaseGUI\_getStatusText(), array, 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().

730  {
731  $a_excel->setCell($a_row, 0, $this->lng->txt("title"));
732 
733  $labels = $this->getSelectableColumns();
734  $cnt = 1;
735  foreach ($this->getSelectedColumns() as $c) {
736  $label = $labels[$c]["txt"];
737  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
738  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
739 
740  if (!$this->isArrayColumn($c)) {
741  $a_excel->setCell($a_row, $cnt, $label);
742  $cnt++;
743  } else {
744  if ($c != "status") {
745  $a_excel->setCell($a_row, $cnt, $label . " #1");
746  $a_excel->setCell($a_row, ++$cnt, $label . " #1");
747  $a_excel->setCell($a_row, ++$cnt, $label . " #1 %");
748  $a_excel->setCell($a_row, ++$cnt, $label . " #2");
749  $a_excel->setCell($a_row, ++$cnt, $label . " #2");
750  $a_excel->setCell($a_row, ++$cnt, $label . " #2 %");
751  $a_excel->setCell($a_row, ++$cnt, $label . " #3");
752  $a_excel->setCell($a_row, ++$cnt, $label . " #3");
753  $a_excel->setCell($a_row, ++$cnt, $label . " #3 %");
754  $a_excel->setCell($a_row, ++$cnt, $label . " " . $this->lng->txt("trac_others"));
755  $a_excel->setCell($a_row, ++$cnt, $label . " " . $this->lng->txt("trac_others"));
756  $a_excel->setCell($a_row, ++$cnt, $label . " " . $this->lng->txt("trac_others") . " %");
757  } else {
758  // build status to image map
759  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
760  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
765  $cnt--;
766  foreach ($valid_status as $status) {
768  $a_excel->setCell($a_row, ++$cnt, $text);
769  $a_excel->setCell($a_row, ++$cnt, $text . " %");
770  }
771  }
772  $cnt++;
773  }
774  }
775 
776  $a_excel->setBold("A" . $a_row . ":" . $a_excel->getColumnCoord($cnt) . $a_row);
777  }
const LP_STATUS_COMPLETED_NUM
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
const LP_STATUS_IN_PROGRESS_NUM
getColumnCoord($a_col)
Get column "name" from number.
setBold($a_coords)
Set cell(s) to bold.
$text
Definition: errorreport.php:18
getSelectedColumns()
Get selected columns.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
Create styles array
The data for the language used.
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:

◆ fillRow()

ilTrSummaryTableGUI::fillRow (   $a_set)
protected

Fill table row.

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

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

608  {
609  global $lng, $ilCtrl;
610 
611  $this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $a_set["type"]));
612  $this->tpl->setVariable("ICON_ALT", $lng->txt($a_set["type"]));
613  $this->tpl->setVariable("TITLE", $a_set["title"]);
614 
615  if ($a_set["offline"] || $a_set["privacy_conflict"]) {
616  $mess = array();
617  if ($a_set["offline"]) {
618  $mess[] = $lng->txt("offline");
619  }
620  if ($a_set["privacy_conflict"]) {
621  $mess[] = $lng->txt("status_no_permission");
622  }
623  $this->tpl->setCurrentBlock("status_bl");
624  $this->tpl->setVariable("TEXT_STATUS", implode(", ", $mess));
625  $this->tpl->parseCurrentBlock();
626  }
627 
628  foreach ($this->getSelectedColumns() as $c) {
629  switch ($c) {
630  case "country":
631  case "gender":
632  case "city":
633  case "language":
634  case "status":
635  case "mark":
636  case "sel_country":
637  $this->renderPercentages($c, $a_set[$c]);
638  break;
639 
640  case "percentage_avg":
641  if ((int) $a_set[$c] === 0 || !$this->isPercentageAvailable($a_set["obj_id"])) {
642  $this->tpl->setVariable(strtoupper($c), "");
643  break;
644  }
645 
646  // no break
647  default:
648  $value = $this->parseValue($c, $a_set[$c], $a_set["type"]);
649  $this->tpl->setVariable(strtoupper($c), $value);
650  break;
651  }
652  }
653 
654  if ($this->is_root) {
655  $path = $this->buildPath($a_set["ref_ids"], false, true);
656  if ($path) {
657  $this->tpl->setCurrentBlock("item_path");
658  foreach ($path as $ref_id => $path_item) {
659  $this->tpl->setVariable("PATH_ITEM", $path_item);
660 
661  if (!$this->anonymized) {
662  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', $ref_id);
663  $this->tpl->setVariable("URL_DETAILS", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(), 'details'));
664  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', '');
665  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('trac_participants'));
666  } else {
667  $this->tpl->setVariable("URL_DETAILS", ilLink::_getLink($ref_id, $a_set["type"]));
668  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('view'));
669  }
670 
671  $this->tpl->parseCurrentBlock();
672  }
673  }
674 
675  $this->tpl->setCurrentBlock("item_command");
676  $ilCtrl->setParameterByClass(get_class($this), 'hide', $a_set["obj_id"]);
677  $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this), 'hide'));
678  $this->tpl->setVariable("TXT_COMMAND", $this->lng->txt('trac_hide'));
679  $this->tpl->parseCurrentBlock();
680 
681  $this->tpl->touchBlock("path_action");
682  } elseif ($a_set["ref_ids"]) { // #18446
683  // #16453
684  include_once './Services/Tree/classes/class.ilPathGUI.php';
685  $path = new ilPathGUI();
686  $path = $path->getPath($this->ref_id, array_pop($a_set["ref_ids"]));
687  if ($path) {
688  $this->tpl->setVariable('COLL_PATH', $this->lng->txt('path') . ': ' . $path);
689  }
690  }
691  }
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.
buildPath($ref_ids)
Build path with deep-link.
global $ilCtrl
Definition: ilias.php:18
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ fillRowCSV()

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

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

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

860  {
861  $a_csv->addColumn($a_set["title"]);
862 
863  foreach ($this->getSelectedColumns() as $c) {
864  if (!$this->isArrayColumn($c)) {
865  $val = $this->parseValue($c, $a_set[$c], $a_set["type"]);
866  $a_csv->addColumn($val);
867  } else {
868  foreach ((array) $a_set[$c] as $idx => $value) {
869  if ($c != "status") {
870  $a_csv->addColumn($value["caption"]);
871  }
872  $a_csv->addColumn((int) $value["absolute"]);
873  $a_csv->addColumn($value["percentage"]);
874  }
875  if (sizeof($a_set[$c]) < 4 && $c != "status") {
876  for ($loop = 4; $loop > sizeof($a_set[$c]); $loop--) {
877  $a_csv->addColumn("");
878  $a_csv->addColumn("");
879  $a_csv->addColumn("");
880  }
881  }
882  }
883  }
884 
885  $a_csv->addRow();
886  }
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ fillRowExcel()

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

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

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

780  {
781  $a_excel->setCell($a_row, 0, $a_set["title"]);
782 
783  $cnt = 1;
784  foreach ($this->getSelectedColumns() as $c) {
785  if (!$this->isArrayColumn($c)) {
786  $val = $this->parseValue($c, $a_set[$c], $a_set["type"]);
787  $a_excel->setCell($a_row, $cnt, $val);
788  $cnt++;
789  } else {
790  foreach ((array) $a_set[$c] as $idx => $value) {
791  if ($c == "status") {
792  $a_excel->setCell($a_row, $cnt, (int) $value["absolute"]);
793  $a_excel->setCell($a_row, ++$cnt, $value["percentage"] . "%");
794  } else {
795  $a_excel->setCell($a_row, $cnt, $value["caption"]);
796  $a_excel->setCell($a_row, ++$cnt, (int) $value["absolute"]);
797  $a_excel->setCell($a_row, ++$cnt, $value["percentage"] . "%");
798  }
799  $cnt++;
800  }
801  if (sizeof($a_set[$c]) < 4 && $c != "status") {
802  for ($loop = 4; $loop > sizeof($a_set[$c]); $loop--) {
803  $a_excel->setCell($a_row, $cnt, "");
804  $a_excel->setCell($a_row, ++$cnt, "");
805  $a_excel->setCell($a_row, ++$cnt, "");
806  $cnt++;
807  }
808  }
809  }
810  }
811  }
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
Create styles array
The data for the language used.
+ 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 321 of file class.ilTrSummaryTableGUI.php.

References ilTableGUI\$data, ilLPTableBaseGUI\$filter, ilTableGUI\$lng, $path, $result, $rows, $sess, $text, $valid, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilObject\_lookupObjId(), array, 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().

322  {
323  global $lng, $rbacsystem;
324 
325  include_once("./Services/Tracking/classes/class.ilTrQuery.php");
326 
327  // show only selected subobjects for lp mode
328  $preselected_obj_ids = $filter = null;
329 
331  if (
332  $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION_MANUAL ||
333  $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_COLLECTION ||
334  $olp->getCurrentMode() == ilLPObjSettings::LP_MODE_MANUAL_BY_TUTOR
335  ) {
336  $collection = $olp->getCollectionInstance();
337  $preselected_obj_ids[$a_object_id][] = $a_ref_id;
338  foreach ($collection->getItems() as $item => $item_info) {
339  $tmp_lp = ilObjectLP::getInstance(ilObject::_lookupObjId($item_info));
340  if ($tmp_lp->isActive()) {
341  $preselected_obj_ids[ilObject::_lookupObjId($item_info)][] = $item_info;
342  }
343  }
344  $filter = $this->getCurrentFilter();
345  } elseif ($this->is_root) {
346  // using search to get all relevant objects
347  // #8498/#8499: restrict to objects with at least "read_learning_progress" access
348  $preselected_obj_ids = $this->searchObjects($this->getCurrentFilter(true), "read_learning_progress");
349  } else {
350  // using summary filters
351  $filter = $this->getCurrentFilter();
352  }
353 
354 
355 
357  $a_object_id,
358  $a_ref_id,
362  ilUtil::stripSlashes($this->getLimit()),
363  $filter,
364  $this->getSelectedColumns(),
365  $preselected_obj_ids
366  );
367 
368  // build status to image map
369  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
370  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
375  $status_map = array();
376  foreach ($valid_status as $status) {
379  $status_map[$status] = ilUtil::img($path, $text);
380  }
381 
382  // language map
383  $lng->loadLanguageModule("meta");
384  $languages = array();
385  foreach ($lng->getInstalledLanguages() as $lang_key) {
386  $languages[$lang_key] = $lng->txt("meta_l_" . $lang_key);
387  }
388 
389  $rows = array();
390  foreach ($data["set"] as $idx => $result) {
391  // sessions have no title
392  if ($result["title"] == "" && $result["type"] == "sess") {
393  include_once "Modules/Session/classes/class.ilObjSession.php";
394  $sess = new ilObjSession($result["obj_id"], false);
395  $data["set"][$idx]["title"] = $sess->getFirstAppointment()->appointmentToString();
396  }
397 
398  $data["set"][$idx]["offline"] = ilLearningProgressBaseGUI::isObjectOffline($result["obj_id"], $result["type"]);
399 
400  // #13807
401  if ($result["ref_ids"]) {
402  $valid = false;
403  foreach ($result["ref_ids"] as $check_ref_id) {
404  include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
405  if (ilLearningProgressAccess::checkPermission('read_learning_progress', $check_ref_id)) {
406  $valid = true;
407  break;
408  }
409  }
410  if (!$valid) {
411  foreach (array_keys($data["set"][$idx]) as $col_id) {
412  if (!in_array($col_id, array("type", "title", "obj_id", "ref_id", "offline"))) {
413  $data["set"][$idx][$col_id] = null;
414  }
415  }
416  $data["set"][$idx]["privacy_conflict"] = true;
417  continue;
418  }
419  }
420 
421  // percentages
422  $users_no = $result["user_total"];
423  $data["set"][$idx]["country"] = $this->getItemsPercentages($result["country"], $users_no);
424  $data["set"][$idx]["gender"] = $this->getItemsPercentages($result["gender"], $users_no, array(
425  "n"=>$lng->txt("gender_n"),
426  "m"=>$lng->txt("gender_m"),
427  "f"=>$lng->txt("gender_f"),
428  ));
429  $data["set"][$idx]["city"] = $this->getItemsPercentages($result["city"], $users_no);
430  $data["set"][$idx]["sel_country"] = $this->getItemsPercentages($result["sel_country"], $users_no, $this->getSelCountryCodes());
431  $data["set"][$idx]["mark"] = $this->getItemsPercentages($result["mark"], $users_no);
432  $data["set"][$idx]["language"] = $this->getItemsPercentages($result["language"], $users_no, $languages);
433 
434  // if we encounter any invalid status codes, e.g. null, map them to not attempted instead
435  foreach ($result["status"] as $status_code => $status_counter) {
436  // null is cast to ""
437  if ($status_code === "" || !in_array($status_code, $valid_status)) {
438  $result["status"][ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM] += $status_counter;
439  unset($result["status"][$status_code]);
440  }
441  }
442  $data["set"][$idx]["status"] = $this->getItemsPercentagesStatus($result["status"], $users_no, $status_map);
443 
444  if (!$this->isPercentageAvailable($result["obj_id"])) {
445  $data["set"][$idx]["percentage_avg"] = null;
446  }
447  }
448 
449  $this->setMaxCount($data["cnt"]);
450  $this->setData($data["set"]);
451  }
const LP_STATUS_COMPLETED_NUM
$result
static _getImagePathForStatus($a_status)
Get image path for status.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
$valid
getItemsPercentages(array $data=null, $overall, array $value_map=null, $limit=3)
Render data as needed for summary list (based on grouped values)
searchObjects(array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
Search objects that match current filters.
const LP_STATUS_IN_PROGRESS_NUM
getOrderDirection()
Get order direction.
static checkPermission($a_permission, $a_ref_id, $a_user_id=null)
wrapper for rbac access checks
getOffset()
Get offset.
static isObjectOffline($a_obj_id, $a_type=null)
static _lookupObjId($a_id)
$text
Definition: errorreport.php:18
getSelectedColumns()
Get selected columns.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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.
Create styles array
The data for the language used.
$rows
Definition: xhr_table.php:10
const LP_STATUS_NOT_ATTEMPTED_NUM
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
getLimit()
Get limit.
setMaxCount($a_max_count)
set max.
getCurrentFilter($as_query=false)
static getInstance($a_obj_id)
getItemsPercentagesStatus(array $data=null, $overall, array $value_map=null)
Render status data as needed for summary list (based on grouped values)
const LP_STATUS_FAILED_NUM
+ 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 462 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

463  {
464  global $lng;
465 
466  if (!$overall) {
467  return false;
468  }
469 
470  $result = array();
471 
472  if ($data) {
473  // if we have only 1 item more than the limit, "others" makes no sense
474  if (sizeof($data) == $limit+1) {
475  $limit++;
476  }
477 
478  $counter = $others_counter = $others_sum = 0;
479  foreach ($data as $id => $count) {
480  $counter++;
481  if ($counter <= $limit) {
482  $caption = $id;
483 
484  if ($value_map && isset($value_map[$id])) {
485  $caption = $value_map[$id];
486  }
487 
488  if ($caption == "") {
489  $caption = $lng->txt("none");
490  }
491 
492  $perc = round($count/$overall*100);
493  $result[] = array(
494  "caption" => $caption,
495  "absolute" => $count, // ." ".($count > 1 ? $lng->txt("users") : $lng->txt("user")),
496  "percentage" => $perc
497  );
498  } else {
499  $others_sum += $count;
500  $others_counter++;
501  }
502  }
503 
504  if ($others_counter) {
505  $perc = round($others_sum/$overall*100);
506  $result[] = array(
507  "caption" => $otherss_counter . " " . $lng->txt("trac_others"),
508  "absolute" => $others_sum, // ." ".($others_sum > 1 ? $lng->txt("users") : $lng->txt("user")),
509  "percentage" => $perc
510  );
511  }
512  }
513 
514  return $result;
515  }
$result
if(!array_key_exists('StateId', $_REQUEST)) $id
$counter
Create styles array
The data for the language used.
+ 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 525 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

526  {
527  global $lng;
528 
529  $result = array();
530  foreach ($value_map as $id => $caption) {
531  $count = 0;
532  if (isset($data[$id])) {
533  $count = $data[$id];
534  }
535  $perc = round($count/$overall*100);
536 
537  $result[] = array(
538  "caption" => $caption,
539  "absolute" => $count,
540  "percentage" => $perc
541  );
542  }
543 
544  return $result;
545  }
$result
if(!array_key_exists('StateId', $_REQUEST)) $id
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getSelCountryCodes()

ilTrSummaryTableGUI::getSelCountryCodes ( )

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

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

Referenced by getItems(), and initFilter().

303  {
304  global $lng;
305 
306  include_once("./Services/Utilities/classes/class.ilCountry.php");
307  $options = array();
308  foreach (ilCountry::getCountryCodes() as $c) {
309  $options[$c] = $lng->txt("meta_c_" . $c);
310  }
311  asort($options);
312  return $options;
313  }
Create styles array
The data for the language used.
static getCountryCodes()
Get country codes (DIN EN 3166-1)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilTrSummaryTableGUI::getSelectableColumns ( )

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

References $column, $columns, $ilSetting, $l, ilTableGUI\$lng, ilTableGUI\$prefix, $txt, array, 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().

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

◆ initFilter()

ilTrSummaryTableGUI::initFilter ( )

Init filter.

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

References $ilSetting, ilTableGUI\$lng, ilTable2GUI\addFilterItemByMetaType(), array, 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, getSelCountryCodes(), 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().

181  {
182  global $lng, $ilSetting;
183 
184  if ($this->is_root) {
185  return parent::initBaseFilter(true, false);
186  }
187 
188  // show only if extended data was activated in lp settings
189  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
190  $tracking = new ilObjUserTracking();
191 
192  $item = $this->addFilterItemByMetaType(
193  "user_total",
195  true,
196  "&#8721; " . $lng->txt("users")
197  );
198  $this->filter["user_total"] = $item->getValue();
199 
200  if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
201  $item = $this->addFilterItemByMetaType(
202  "read_count",
204  true,
205  "&#8721; " . $lng->txt("trac_read_count")
206  );
207  $this->filter["read_count"] = $item->getValue();
208  }
209 
210  if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS)) {
211  if ($this->is_root || !$this->type || ilObjectLP::supportsSpentSeconds($this->type)) {
212  $item = $this->addFilterItemByMetaType(
213  "spent_seconds",
215  true,
216  "&#216; " . $lng->txt("trac_spent_seconds") . " / " . $lng->txt("user")
217  );
218  $this->filter["spent_seconds"]["from"] = $item->getCombinationItem("from")->getValueInSeconds();
219  $this->filter["spent_seconds"]["to"] = $item->getCombinationItem("to")->getValueInSeconds();
220  }
221  }
222 
223  if ($this->is_root || !$this->type || $this->isPercentageAvailable($this->obj_id)) {
224  $item = $this->addFilterItemByMetaType(
225  "percentage",
227  true,
228  "&#216; " . $lng->txt("trac_percentage") . " / " . $lng->txt("user")
229  );
230  $this->filter["percentage"] = $item->getValue();
231  }
232 
233  if ($this->is_root || !$this->olp || $this->olp->isActive()) {
234  include_once "Services/Tracking/classes/class.ilLPStatus.php";
235  $item = $this->addFilterItemByMetaType("status", ilTable2GUI::FILTER_SELECT, true);
236  $item->setOptions(array("" => $lng->txt("trac_all"),
241  $this->filter["status"] = $item->getValue();
242  if ($this->filter["status"]) {
243  $this->filter["status"]--;
244  }
245 
246  $item = $this->addFilterItemByMetaType("trac_status_changed", ilTable2GUI::FILTER_DATE_RANGE, true);
247  $this->filter["status_changed"] = $item->getDate();
248  }
249 
250  if ($this->is_root || !$this->type || ilObjectLP::supportsMark($this->type)) {
251  $item = $this->addFilterItemByMetaType(
252  "mark",
254  true,
255  $lng->txt("trac_mark")
256  );
257  $this->filter["mark"] = $item->getValue();
258  }
259 
260  if ($ilSetting->get("usr_settings_course_export_gender")) {
261  $item = $this->addFilterItemByMetaType("gender", ilTable2GUI::FILTER_SELECT, true);
262  $item->setOptions(array(
263  "" => $lng->txt("trac_all"),
264  "n" => $lng->txt("gender_n"),
265  "m" => $lng->txt("gender_m"),
266  "f" => $lng->txt("gender_f"),
267  ));
268  $this->filter["gender"] = $item->getValue();
269  }
270 
271  if ($ilSetting->get("usr_settings_course_export_city")) {
272  $item = $this->addFilterItemByMetaType("city", ilTable2GUI::FILTER_TEXT, true);
273  $this->filter["city"] = $item->getValue();
274  }
275 
276  if ($ilSetting->get("usr_settings_course_export_country")) {
277  $item = $this->addFilterItemByMetaType("country", ilTable2GUI::FILTER_TEXT, true);
278  $this->filter["country"] = $item->getValue();
279  }
280 
281  if ($ilSetting->get("usr_settings_course_export_sel_country")) {
282  $item = $this->addFilterItemByMetaType("sel_country", ilTable2GUI::FILTER_SELECT, true);
283  $item->setOptions(array("" => $lng->txt("trac_all"))+$this->getSelCountryCodes());
284  $this->filter["sel_country"] = $item->getValue();
285  }
286 
287  $item = $this->addFilterItemByMetaType("language", ilTable2GUI::FILTER_LANGUAGE, true);
288  $this->filter["language"] = $item->getValue();
289 
290  if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
291  $item = $this->addFilterItemByMetaType("trac_first_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
292  $this->filter["first_access"] = $item->getDate();
293 
294  $item = $this->addFilterItemByMetaType("trac_last_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
295  $this->filter["last_access"] = $item->getDate();
296  }
297 
298  $item = $this->addFilterItemByMetaType("registration_filter", ilTable2GUI::FILTER_DATE_RANGE, true);
299  $this->filter["registration"] = $item->getDate();
300  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
const FILTER_NUMBER_RANGE
const LP_STATUS_IN_PROGRESS
const LP_STATUS_FAILED
const FILTER_DATETIME_RANGE
const FILTER_DURATION_RANGE
Create styles array
The data for the language used.
static supportsMark($a_obj_type)
const LP_STATUS_NOT_ATTEMPTED_NUM
static supportsSpentSeconds($a_obj_type)
global $ilSetting
Definition: privfeed.php:17
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED_NUM
+ 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 709 of file class.ilTrSummaryTableGUI.php.

References array.

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

710  {
711  if (in_array($a_name, array("country", "gender", "city", "language", "status", "mark", 'sel_country'))) {
712  return true;
713  }
714  return false;
715  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ numericOrdering()

ilTrSummaryTableGUI::numericOrdering (   $a_field)

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

References $function, and array.

718  {
719  $pos = strrpos($a_field, "_");
720  if ($pos !== false) {
721  $function = strtoupper(substr($a_field, $pos+1));
722  if (in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT", "TOTAL"))) {
723  return true;
724  }
725  }
726  return false;
727  }
Create styles array
The data for the language used.
$function
Definition: cas.php:28

◆ parseValue()

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

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

References $function, $id, ilTableGUI\$lng, $type, array, ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, ilDatePresentation\secondsToString(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

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

548  {
549  global $lng;
550 
551  // get rid of aggregation
552  $pos = strrpos($id, "_");
553  if ($pos !== false) {
554  $function = strtoupper(substr($id, $pos+1));
555  if (in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT"))) {
556  $id = substr($id, 0, $pos);
557  }
558  }
559 
560  if (trim($value) == "") {
561  if ($id == "title") {
562  return "--" . $lng->txt("none") . "--";
563  }
564  return "";
565  }
566  switch ($id) {
567  case 'status_changed':
568  case "first_access":
569  case "create_date":
571  break;
572 
573  case "last_access":
575  break;
576 
577  case "spent_seconds":
578  case "read_count_spent_seconds":
580  $value = "-";
581  } else {
582  $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
583  }
584  break;
585 
586  case "percentage":
587  if (false /* $this->isPercentageAvailable() */) {
588  $value = "-";
589  } else {
590  $value = $value . "%";
591  }
592  break;
593 
594  case "mark":
596  $value = "-";
597  }
598  break;
599  }
600 
601  return $value;
602  }
const IL_CAL_DATETIME
$type
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Date and time handling
Create styles array
The data for the language used.
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
$function
Definition: cas.php:28
+ 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 693 of file class.ilTrSummaryTableGUI.php.

References ilTableGUI\$data, and $id.

Referenced by fillRow().

694  {
695  if ($data) {
696  foreach ($data as $item) {
697  $this->tpl->setCurrentBlock($id . "_row");
698  $this->tpl->setVariable("CAPTION", $item["caption"]);
699  $this->tpl->setVariable("ABSOLUTE", $item["absolute"]);
700  $this->tpl->setVariable("PERCENTAGE", $item["percentage"]);
701  $this->tpl->parseCurrentBlock();
702  }
703  } else {
704  $this->tpl->touchBlock($id);
705  ;
706  }
707  }
if(!array_key_exists('StateId', $_REQUEST)) $id
+ Here is the caller graph for this function:

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