ILIAS  release_4-4 Revision
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...
 
 initFilter ($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)
 
 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)
 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)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val)
 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...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="")
 Add Command button. 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="")
 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 ()
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($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 ($worksheet, &$a_row)
 
 fillRowExcel ($worksheet, &$a_row, $a_set)
 
 fillHeaderCSV ($a_csv)
 
 fillRowCSV ($a_csv, $a_set)
 
- Protected Member Functions inherited from ilLPTableBaseGUI
 searchObjects (array $filter, $permission, array $preset_obj_ids=null)
 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 ($worksheet, &$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)
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. 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 ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel ($worksheet, &$a_row)
 Excel Version of Fill Row. More...
 
 fillRowExcel ($a_worksheet, &$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 = 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
 
 $row_selector_label
 

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, $lng, ilObject\_lookupObjId(), ilTable2GUI\addColumn(), ilObjectLP\getInstance(), getItems(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), initFilter(), ilLPTableBaseGUI\parseTitle(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTableGUI\setLimit(), ilTable2GUI\setPrintMode(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowTemplates().

21  {
22  global $ilCtrl, $lng, $ilAccess, $lng;
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  include_once './Services/Object/classes/class.ilObjectLP.php';
33  $this->olp = ilObjectLP::getInstance($this->obj_id);
34  }
35 
36  parent::__construct($a_parent_obj, $a_parent_cmd);
37 
38  if($a_print_mode)
39  {
40  $this->setPrintMode(true);
41  }
42 
43  $this->parseTitle($this->obj_id, "trac_summary");
44  $this->setLimit(9999);
45  $this->setShowTemplates(true);
46  $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
47 
48  $this->addColumn($this->lng->txt("title"), "title");
49  $this->setDefaultOrderField("title");
50 
51  $labels = $this->getSelectableColumns();
52  foreach ($this->getSelectedColumns() as $c)
53  {
54  $this->addColumn($labels[$c]["txt"], $c);
55  }
56 
57  if($this->is_root)
58  {
59  $this->addColumn($this->lng->txt("path"));
60  $this->addColumn($this->lng->txt("action"));
61  }
62  $this->initFilter();
63 
64  // $this->setExternalSorting(true);
65  $this->setEnableHeader(true);
66  $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
67  $this->setRowTemplate("tpl.trac_summary_row.html", "Services/Tracking");
68 
69  $this->getItems($a_parent_obj->getObjId(), $a_ref_id);
70  }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
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
setLimit($a_limit=0, $a_default_limit=0)
set max.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
Add a column to the header.
static _lookupObjId($a_id)
getSelectedColumns()
Get selected columns.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
global $lng
Definition: privfeed.php:40
setFormAction($a_form_action)
Set Form action parameter.
setEnableHeader($a_enableheader)
Set Enable Header.
static getInstance($a_obj_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilTrSummaryTableGUI::fillHeaderCSV (   $a_csv)
protected

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

References 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.

818  {
819  $a_csv->addColumn($this->lng->txt("title"));
820 
821  $labels = $this->getSelectableColumns();
822  foreach ($this->getSelectedColumns() as $c)
823  {
824  $label = $labels[$c]["txt"];
825  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
826  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
827 
828  if(!$this->isArrayColumn($c))
829  {
830  $a_csv->addColumn($label);
831  }
832  else
833  {
834  if($c != "status")
835  {
836  $a_csv->addColumn($label." #1");
837  $a_csv->addColumn($label." #1");
838  $a_csv->addColumn($label." #1 %");
839  $a_csv->addColumn($label." #2");
840  $a_csv->addColumn($label." #2");
841  $a_csv->addColumn($label." #2 %");
842  $a_csv->addColumn($label." #3");
843  $a_csv->addColumn($label." #3");
844  $a_csv->addColumn($label." #3 %");
845  $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
846  $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
847  $a_csv->addColumn($label." ".$this->lng->txt("trac_others")." %");
848  }
849  else
850  {
851  // build status to image map
852  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
853  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
854  $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
858  foreach($valid_status as $status)
859  {
861  $a_csv->addColumn($text);
862  $a_csv->addColumn($text." %");
863  }
864  }
865  }
866  }
867 
868  $a_csv->addRow();
869  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
_getStatusText($a_status)
Get status alt text.
getSelectedColumns()
Get selected columns.
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:

◆ fillHeaderExcel()

ilTrSummaryTableGUI::fillHeaderExcel (   $worksheet,
$a_row 
)
protected

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

References 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.

718  {
719  $worksheet->write($a_row, 0, $this->lng->txt("title"));
720 
721  $labels = $this->getSelectableColumns();
722  $cnt = 1;
723  foreach ($this->getSelectedColumns() as $c)
724  {
725  $label = $labels[$c]["txt"];
726  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
727  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
728 
729  if(!$this->isArrayColumn($c))
730  {
731  $worksheet->write($a_row, $cnt, $label);
732  $cnt++;
733  }
734  else
735  {
736  if($c != "status")
737  {
738  $worksheet->write($a_row, $cnt, $label." #1");
739  $worksheet->write($a_row, ++$cnt, $label." #1");
740  $worksheet->write($a_row, ++$cnt, $label." #1 %");
741  $worksheet->write($a_row, ++$cnt, $label." #2");
742  $worksheet->write($a_row, ++$cnt, $label." #2");
743  $worksheet->write($a_row, ++$cnt, $label." #2 %");
744  $worksheet->write($a_row, ++$cnt, $label." #3");
745  $worksheet->write($a_row, ++$cnt, $label." #3");
746  $worksheet->write($a_row, ++$cnt, $label." #3 %");
747  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
748  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
749  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others")." %");
750  }
751  else
752  {
753  // build status to image map
754  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
755  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
756  $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
760  $cnt--;
761  foreach($valid_status as $status)
762  {
764  $worksheet->write($a_row, ++$cnt, $text);
765  $worksheet->write($a_row, ++$cnt, $text." %");
766  }
767  }
768  $cnt++;
769  }
770  }
771  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
_getStatusText($a_status)
Get status alt text.
getSelectedColumns()
Get selected columns.
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 594 of file class.ilTrSummaryTableGUI.php.

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

595  {
596  global $lng, $ilCtrl;
597 
598  $this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $a_set["type"]));
599  $this->tpl->setVariable("ICON_ALT", $lng->txt($a_set["type"]));
600  $this->tpl->setVariable("TITLE", $a_set["title"]);
601 
602  if($a_set["offline"])
603  {
604  $this->tpl->setCurrentBlock("offline");
605  $this->tpl->setVariable("TEXT_STATUS", $this->lng->txt("status"));
606  $this->tpl->setVariable("TEXT_OFFLINE", $this->lng->txt("offline"));
607  $this->tpl->parseCurrentBlock();
608  }
609 
610  foreach ($this->getSelectedColumns() as $c)
611  {
612  switch($c)
613  {
614  case "country":
615  case "gender":
616  case "city":
617  case "language":
618  case "status":
619  case "mark":
620  case "sel_country":
621  $this->renderPercentages($c, $a_set[$c]);
622  break;
623 
624  case "percentage_avg":
625  if((int)$a_set[$c] === 0 || !$this->isPercentageAvailable($a_set["obj_id"]))
626  {
627  $this->tpl->setVariable(strtoupper($c), "");
628  break;
629  }
630 
631  default:
632  $value = $this->parseValue($c, $a_set[$c], $a_set["type"]);
633  $this->tpl->setVariable(strtoupper($c), $value);
634  break;
635  }
636  }
637 
638  if($this->is_root)
639  {
640  $path = $this->buildPath($a_set["ref_ids"], false, true);
641  if($path)
642  {
643  $this->tpl->setCurrentBlock("item_path");
644  foreach($path as $ref_id => $path_item)
645  {
646  $this->tpl->setVariable("PATH_ITEM", $path_item);
647 
648  if(!$this->anonymized)
649  {
650  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', $ref_id);
651  $this->tpl->setVariable("URL_DETAILS", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(), 'details'));
652  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', '');
653  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('trac_participants'));
654  }
655  else
656  {
657  $this->tpl->setVariable("URL_DETAILS", ilLink::_getLink($ref_id, $a_set["type"]));
658  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('view'));
659  }
660 
661  $this->tpl->parseCurrentBlock();
662  }
663  }
664 
665  $this->tpl->setCurrentBlock("item_command");
666  $ilCtrl->setParameterByClass(get_class($this),'hide', $a_set["obj_id"]);
667  $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this),'hide'));
668  $this->tpl->setVariable("TXT_COMMAND", $this->lng->txt('trac_hide'));
669  $this->tpl->parseCurrentBlock();
670 
671  $this->tpl->touchBlock("path_action");
672  }
673  }
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.
global $ilCtrl
Definition: ilias.php:18
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
$ref_id
Definition: sahs_server.php:39
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:

◆ fillRowCSV()

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

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

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

872  {
873  $a_csv->addColumn($a_set["title"]);
874 
875  foreach ($this->getSelectedColumns() as $c)
876  {
877  if(!$this->isArrayColumn($c))
878  {
879  $val = $this->parseValue($c, $a_set[$c], "user");
880  $a_csv->addColumn($val);
881  }
882  else
883  {
884  foreach($a_set[$c] as $idx => $value)
885  {
886  if($c != "status")
887  {
888  $a_csv->addColumn($value["caption"]);
889  }
890  $a_csv->addColumn((int)$value["absolute"]);
891  $a_csv->addColumn($value["percentage"]);
892  }
893  if(sizeof($a_set[$c]) < 4 && $c != "status")
894  {
895  for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
896  {
897  $a_csv->addColumn("");
898  $a_csv->addColumn("");
899  $a_csv->addColumn("");
900  }
901  }
902  }
903  }
904 
905  $a_csv->addRow();
906  }
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
+ Here is the call graph for this function:

◆ fillRowExcel()

ilTrSummaryTableGUI::fillRowExcel (   $worksheet,
$a_row,
  $a_set 
)
protected

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

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

774  {
775  $worksheet->write($a_row, 0, $a_set["title"]);
776 
777  $cnt = 1;
778  foreach ($this->getSelectedColumns() as $c)
779  {
780  if(!$this->isArrayColumn($c))
781  {
782  $val = $this->parseValue($c, $a_set[$c], "user");
783  $worksheet->write($a_row, $cnt, $val);
784  $cnt++;
785  }
786  else
787  {
788  foreach($a_set[$c] as $idx => $value)
789  {
790  if($c == "status")
791  {
792  $worksheet->write($a_row, $cnt, (int)$value["absolute"]);
793  $worksheet->write($a_row, ++$cnt, $value["percentage"]);
794  }
795  else
796  {
797  $worksheet->write($a_row, $cnt, $value["caption"]);
798  $worksheet->write($a_row, ++$cnt, (int)$value["absolute"]);
799  $worksheet->write($a_row, ++$cnt, $value["percentage"]);
800  }
801  $cnt++;
802  }
803  if(sizeof($a_set[$c]) < 4 && $c != "status")
804  {
805  for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
806  {
807  $worksheet->write($a_row, $cnt, "");
808  $worksheet->write($a_row, ++$cnt, "");
809  $worksheet->write($a_row, ++$cnt, "");
810  $cnt++;
811  }
812  }
813  }
814  }
815  }
parseValue($id, $value, $type)
getSelectedColumns()
Get selected columns.
+ 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 312 of file class.ilTrSummaryTableGUI.php.

References ilTableGUI\$data, ilLPTableBaseGUI\$filter, $lng, $path, $result, $sess, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilLPTableBaseGUI\getCurrentFilter(), getItemsPercentages(), getItemsPercentagesStatus(), ilTable2GUI\getLimit(), ilTrQuery\getObjectsSummaryForObject(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), getSelCountryCodes(), ilTable2GUI\getSelectedColumns(), ilUtil\img(), ilLearningProgressBaseGUI\isObjectOffline(), ilLPTableBaseGUI\isPercentageAvailable(), 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().

313  {
314  global $lng;
315 
316  include_once("./Services/Tracking/classes/class.ilTrQuery.php");
317 
318  $preselected_obj_ids = $filter = NULL;
319  if($this->is_root)
320  {
321  // using search to get all relevant objects
322  // #8498/#8499: restrict to objects with at least "edit_learning_progress" access
323  $preselected_obj_ids = $this->searchObjects($this->getCurrentFilter(true), "edit_learning_progress");
324  }
325  else
326  {
327  // using summary filters
328  $filter = $this->getCurrentFilter();
329  }
330 
332  $a_object_id,
333  $a_ref_id,
337  ilUtil::stripSlashes($this->getLimit()),
338  $filter,
339  $this->getSelectedColumns(),
340  $preselected_obj_ids
341  );
342 
343  // build status to image map
344  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
345  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
346  $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
350  $status_map = array();
351  foreach($valid_status as $status)
352  {
355  $status_map[$status] = ilUtil::img($path, $text);
356  }
357 
358  // language map
359  $lng->loadLanguageModule("meta");
360  $languages = array();
361  foreach ($lng->getInstalledLanguages() as $lang_key)
362  {
363  $languages[$lang_key] = $lng->txt("meta_l_".$lang_key);
364  }
365 
366  $rows = array();
367  foreach($data["set"] as $idx => $result)
368  {
369  // sessions have no title
370  if($result["title"] == "" && $result["type"] == "sess")
371  {
372  include_once "Modules/Session/classes/class.ilObjSession.php";
373  $sess = new ilObjSession($result["obj_id"], false);
374  $data["set"][$idx]["title"] = $sess->getFirstAppointment()->appointmentToString();
375  }
376 
377  $data["set"][$idx]["offline"] = ilLearningProgressBaseGUI::isObjectOffline($result["obj_id"], $result["type"]);
378 
379  // percentages
380  $users_no = $result["user_total"];
381  $data["set"][$idx]["country"] = $this->getItemsPercentages($result["country"], $users_no);
382  $data["set"][$idx]["gender"] = $this->getItemsPercentages($result["gender"], $users_no, array("m"=>$lng->txt("gender_m"), "f"=>$lng->txt("gender_f")));
383  $data["set"][$idx]["city"] = $this->getItemsPercentages($result["city"], $users_no);
384  $data["set"][$idx]["sel_country"] = $this->getItemsPercentages($result["sel_country"], $users_no, $this->getSelCountryCodes());
385  $data["set"][$idx]["mark"] = $this->getItemsPercentages($result["mark"], $users_no);
386  $data["set"][$idx]["language"] = $this->getItemsPercentages($result["language"], $users_no, $languages);
387 
388  // if we encounter any invalid status codes, e.g. null, map them to not attempted instead
389  foreach($result["status"] as $status_code => $status_counter)
390  {
391  // null is cast to ""
392  if($status_code === "" || !in_array($status_code, $valid_status))
393  {
394  $result["status"][ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM] += $status_counter;
395  unset($result["status"][$status_code]);
396  }
397  }
398  $data["set"][$idx]["status"] = $this->getItemsPercentagesStatus($result["status"], $users_no, $status_map);
399 
400  if(!$this->isPercentageAvailable($result["obj_id"]))
401  {
402  $data["set"][$idx]["percentage_avg"] = NULL;
403  }
404  }
405 
406  $this->setMaxCount($data["cnt"]);
407  $this->setData($data["set"]);
408  }
const LP_STATUS_COMPLETED_NUM
$result
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="")
Build img tag.
const LP_STATUS_IN_PROGRESS_NUM
_getImagePathForStatus($a_status)
Get image path for status.
getOrderDirection()
Get order direction.
_getStatusText($a_status)
Get status alt text.
getOffset()
Get offset.
static isObjectOffline($a_obj_id, $a_type=null)
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.
getSelectedColumns()
Get selected columns.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const LP_STATUS_NOT_ATTEMPTED_NUM
searchObjects(array $filter, $permission, array $preset_obj_ids=null)
Search objects that match current filters.
getItemsPercentagesStatus(array $data=NULL, $overall, array $value_map=NULL)
Render status data as needed for summary list (based on grouped values)
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
getLimit()
Get limit.
setMaxCount($a_max_count)
set max.
getCurrentFilter($as_query=false)
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 419 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

420  {
421  global $lng;
422 
423  if(!$overall)
424  {
425  return false;
426  }
427 
428  $result = array();
429 
430  if($data)
431  {
432  // if we have only 1 item more than the limit, "others" makes no sense
433  if(sizeof($data) == $limit+1)
434  {
435  $limit++;
436  }
437 
438  $counter = $others_counter = $others_sum = 0;
439  foreach($data as $id => $count)
440  {
441  $counter++;
442  if($counter <= $limit)
443  {
444  $caption = $id;
445 
446  if($value_map && isset($value_map[$id]))
447  {
448  $caption = $value_map[$id];
449  }
450 
451  if($caption == "")
452  {
453  $caption = $lng->txt("none");
454  }
455 
456  $perc = round($count/$overall*100);
457  $result[] = array(
458  "caption" => $caption,
459  "absolute" => $count, // ." ".($count > 1 ? $lng->txt("users") : $lng->txt("user")),
460  "percentage" => $perc
461  );
462  }
463  else
464  {
465  $others_sum += $count;
466  $others_counter++;
467  }
468  }
469 
470  if($others_counter)
471  {
472  $perc = round($others_sum/$overall*100);
473  $result[] = array(
474  "caption" => $otherss_counter." ".$lng->txt("trac_others"),
475  "absolute" => $others_sum, // ." ".($others_sum > 1 ? $lng->txt("users") : $lng->txt("user")),
476  "percentage" => $perc
477  );
478  }
479  }
480 
481  return $result;
482  }
$result
global $lng
Definition: privfeed.php:40
+ 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 492 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

493  {
494  global $lng;
495 
496  $result = array();
497  foreach($value_map as $id => $caption)
498  {
499  $count = 0;
500  if(isset($data[$id]))
501  {
502  $count = $data[$id];
503  }
504  $perc = round($count/$overall*100);
505 
506  $result[] = array(
507  "caption" => $caption,
508  "absolute" => $count,
509  "percentage" => $perc
510  );
511  }
512 
513  return $result;
514  }
$result
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getSelCountryCodes()

ilTrSummaryTableGUI::getSelCountryCodes ( )

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

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

Referenced by getItems(), and initFilter().

293  {
294  global $lng;
295 
296  include_once("./Services/Utilities/classes/class.ilCountry.php");
297  $options = array();
298  foreach (ilCountry::getCountryCodes() as $c)
299  {
300  $options[$c] = $lng->txt("meta_c_".$c);
301  }
302  asort($options);
303  return $options;
304  }
if(!is_array($argv)) $options
global $lng
Definition: privfeed.php:40
static getCountryCodes()
Get country codes (DIN EN 3166-1)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilTrSummaryTableGUI::getSelectableColumns ( )

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

References $columns, $ilSetting, $lng, ilTableGUI\$prefix, ilObject\_lookupType(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, and ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS.

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

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

◆ initFilter()

ilTrSummaryTableGUI::initFilter ( )

Init filter.

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

References $ilSetting, $lng, ilObject\_lookupType(), 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, getSelCountryCodes(), 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, and ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM.

Referenced by __construct().

187  {
188  global $lng, $ilSetting;
189 
190  if($this->is_root)
191  {
192  return parent::initFilter(true, false);
193  }
194 
195  // show only if extended data was activated in lp settings
196  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
197  $tracking = new ilObjUserTracking();
198 
199  $item = $this->addFilterItemByMetaType("user_total", ilTable2GUI::FILTER_NUMBER_RANGE, true,
200  "&#8721; ".$lng->txt("users"));
201  $this->filter["user_total"] = $item->getValue();
202 
203  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
204  {
205  $item = $this->addFilterItemByMetaType("read_count", ilTable2GUI::FILTER_NUMBER_RANGE, true,
206  "&#8721; ".$lng->txt("trac_read_count"));
207  $this->filter["read_count"] = $item->getValue();
208  }
209 
210  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
211  {
212  $item = $this->addFilterItemByMetaType("spent_seconds", ilTable2GUI::FILTER_DURATION_RANGE,
213  true, "&#216; ".$lng->txt("trac_spent_seconds")." / ".$lng->txt("user"));
214  $this->filter["spent_seconds"]["from"] = $item->getCombinationItem("from")->getValueInSeconds();
215  $this->filter["spent_seconds"]["to"] = $item->getCombinationItem("to")->getValueInSeconds();
216  }
217 
218  $item = $this->addFilterItemByMetaType("percentage", ilTable2GUI::FILTER_NUMBER_RANGE, true,
219  "&#216; ".$lng->txt("trac_percentage")." / ".$lng->txt("user"));
220  $this->filter["percentage"] = $item->getValue();
221 
222  // do not show status if learning progress is deactivated
223  if($this->olp->isActive())
224  {
225  include_once "Services/Tracking/classes/class.ilLPStatus.php";
226  $item = $this->addFilterItemByMetaType("status", ilTable2GUI::FILTER_SELECT, true);
227  $item->setOptions(array("" => $lng->txt("trac_all"),
232  $this->filter["status"] = $item->getValue();
233  if($this->filter["status"])
234  {
235  $this->filter["status"]--;
236  }
237 
238  $item = $this->addFilterItemByMetaType("trac_status_changed", ilTable2GUI::FILTER_DATE_RANGE, true);
239  $this->filter["status_changed"] = $item->getDate();
240  }
241 
242  if(ilObject::_lookupType($this->obj_id) != "lm")
243  {
244  $item = $this->addFilterItemByMetaType("mark", ilTable2GUI::FILTER_TEXT, true,
245  $lng->txt("trac_mark"));
246  $this->filter["mark"] = $item->getValue();
247  }
248 
249  if($ilSetting->get("usr_settings_course_export_gender"))
250  {
251  $item = $this->addFilterItemByMetaType("gender", ilTable2GUI::FILTER_SELECT, true);
252  $item->setOptions(array("" => $lng->txt("trac_all"), "m" => $lng->txt("gender_m"),
253  "f" => $lng->txt("gender_f")));
254  $this->filter["gender"] = $item->getValue();
255  }
256 
257  if($ilSetting->get("usr_settings_course_export_city"))
258  {
259  $item = $this->addFilterItemByMetaType("city", ilTable2GUI::FILTER_TEXT, true);
260  $this->filter["city"] = $item->getValue();
261  }
262 
263  if($ilSetting->get("usr_settings_course_export_country"))
264  {
265  $item = $this->addFilterItemByMetaType("country", ilTable2GUI::FILTER_TEXT, true);
266  $this->filter["country"] = $item->getValue();
267  }
268 
269  if($ilSetting->get("usr_settings_course_export_sel_country"))
270  {
271  $item = $this->addFilterItemByMetaType("sel_country", ilTable2GUI::FILTER_SELECT, true);
272  $item->setOptions(array("" => $lng->txt("trac_all"))+$this->getSelCountryCodes());
273  $this->filter["sel_country"] = $item->getValue();
274  }
275 
276  $item = $this->addFilterItemByMetaType("language", ilTable2GUI::FILTER_LANGUAGE, true);
277  $this->filter["language"] = $item->getValue();
278 
279  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
280  {
281  $item = $this->addFilterItemByMetaType("trac_first_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
282  $this->filter["first_access"] = $item->getDate();
283 
284  $item = $this->addFilterItemByMetaType("trac_last_access", ilTable2GUI::FILTER_DATETIME_RANGE, true);
285  $this->filter["last_access"] = $item->getDate();
286  }
287 
288  $item = $this->addFilterItemByMetaType("registration_filter", ilTable2GUI::FILTER_DATE_RANGE, true);
289  $this->filter["registration"] = $item->getDate();
290  }
const LP_STATUS_COMPLETED_NUM
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
const FILTER_NUMBER_RANGE
const LP_STATUS_IN_PROGRESS
const LP_STATUS_FAILED
const FILTER_DATETIME_RANGE
const FILTER_DURATION_RANGE
static _lookupType($a_id, $a_reference=false)
lookup object type
const LP_STATUS_NOT_ATTEMPTED_NUM
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
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 694 of file class.ilTrSummaryTableGUI.php.

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

695  {
696  if(in_array($a_name, array("country", "gender", "city", "language", "status", "mark")))
697  {
698  return true;
699  }
700  return false;
701  }
+ Here is the caller graph for this function:

◆ numericOrdering()

ilTrSummaryTableGUI::numericOrdering (   $a_field)

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

704  {
705  $pos = strrpos($a_field, "_");
706  if($pos !== false)
707  {
708  $function = strtoupper(substr($a_field, $pos+1));
709  if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT", "TOTAL")))
710  {
711  return true;
712  }
713  }
714  return false;
715  }

◆ parseValue()

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

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

References $lng, ilFormat\_secondsToString(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, and IL_CAL_UNIX.

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

517  {
518  global $lng;
519 
520  // get rid of aggregation
521  $pos = strrpos($id, "_");
522  if($pos !== false)
523  {
524  $function = strtoupper(substr($id, $pos+1));
525  if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
526  {
527  $id = substr($id, 0, $pos);
528  }
529  }
530 
531  if(trim($value) == "")
532  {
533  if($id == "title")
534  {
535  return "--".$lng->txt("none")."--";
536  }
537  return "";
538  }
539  switch($id)
540  {
541  case 'status_changed':
542  case "first_access":
543  case "create_date":
545  break;
546 
547  case "last_access":
549  break;
550 
551  case "spent_seconds":
552  case "read_count_spent_seconds":
553  if(in_array($type, array("exc")))
554  {
555  $value = "-";
556  }
557  else
558  {
559  include_once("./Services/Utilities/classes/class.ilFormat.php");
560  $value = ilFormat::_secondsToString($value);
561  }
562  break;
563 
564  case "percentage":
565  /* :TODO:
566  if(in_array(strtolower($this->status_class),
567  array("illpstatusmanual", "illpstatusscormpackage", "illpstatustestfinished")) ||
568  $type == "exc"))
569  */
570  if(false)
571  {
572  $value = "-";
573  }
574  else
575  {
576  $value = $value."%";
577  }
578  break;
579 
580  case "mark":
581  if(in_array($type, array("lm", "dbk")))
582  {
583  $value = "-";
584  }
585  break;
586  }
587 
588  return $value;
589  }
const IL_CAL_DATETIME
const IL_CAL_UNIX
_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 public.
Date and time handling
global $lng
Definition: privfeed.php:40
+ 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 675 of file class.ilTrSummaryTableGUI.php.

References ilTableGUI\$data.

Referenced by fillRow().

676  {
677  if($data)
678  {
679  foreach($data as $item)
680  {
681  $this->tpl->setCurrentBlock($id."_row");
682  $this->tpl->setVariable("CAPTION", $item["caption"]);
683  $this->tpl->setVariable("ABSOLUTE", $item["absolute"]);
684  $this->tpl->setVariable("PERCENTAGE", $item["percentage"]);
685  $this->tpl->parseCurrentBlock();
686  }
687  }
688  else
689  {
690  $this->tpl->touchBlock($id);;
691  }
692  }
+ Here is the caller graph for this function:

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