ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
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, $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...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButton $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="")
 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...
 
- 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 Header. 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 = true
 
 $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
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $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.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $lng
Definition: privfeed.php:40
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 851 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.

852  {
853  $a_csv->addColumn($this->lng->txt("title"));
854 
855  $labels = $this->getSelectableColumns();
856  foreach ($this->getSelectedColumns() as $c)
857  {
858  $label = $labels[$c]["txt"];
859  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
860  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
861 
862  if(!$this->isArrayColumn($c))
863  {
864  $a_csv->addColumn($label);
865  }
866  else
867  {
868  if($c != "status")
869  {
870  $a_csv->addColumn($label." #1");
871  $a_csv->addColumn($label." #1");
872  $a_csv->addColumn($label." #1 %");
873  $a_csv->addColumn($label." #2");
874  $a_csv->addColumn($label." #2");
875  $a_csv->addColumn($label." #2 %");
876  $a_csv->addColumn($label." #3");
877  $a_csv->addColumn($label." #3");
878  $a_csv->addColumn($label." #3 %");
879  $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
880  $a_csv->addColumn($label." ".$this->lng->txt("trac_others"));
881  $a_csv->addColumn($label." ".$this->lng->txt("trac_others")." %");
882  }
883  else
884  {
885  // build status to image map
886  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
887  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
888  $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
892  foreach($valid_status as $status)
893  {
895  $a_csv->addColumn($text);
896  $a_csv->addColumn($text." %");
897  }
898  }
899  }
900  }
901 
902  $a_csv->addRow();
903  }
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 751 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.

752  {
753  $worksheet->write($a_row, 0, $this->lng->txt("title"));
754 
755  $labels = $this->getSelectableColumns();
756  $cnt = 1;
757  foreach ($this->getSelectedColumns() as $c)
758  {
759  $label = $labels[$c]["txt"];
760  $label = str_replace("Ø", $this->lng->txt("trac_average"), $label);
761  $label = str_replace("∑", $this->lng->txt("trac_sum"), $label);
762 
763  if(!$this->isArrayColumn($c))
764  {
765  $worksheet->write($a_row, $cnt, $label);
766  $cnt++;
767  }
768  else
769  {
770  if($c != "status")
771  {
772  $worksheet->write($a_row, $cnt, $label." #1");
773  $worksheet->write($a_row, ++$cnt, $label." #1");
774  $worksheet->write($a_row, ++$cnt, $label." #1 %");
775  $worksheet->write($a_row, ++$cnt, $label." #2");
776  $worksheet->write($a_row, ++$cnt, $label." #2");
777  $worksheet->write($a_row, ++$cnt, $label." #2 %");
778  $worksheet->write($a_row, ++$cnt, $label." #3");
779  $worksheet->write($a_row, ++$cnt, $label." #3");
780  $worksheet->write($a_row, ++$cnt, $label." #3 %");
781  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
782  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others"));
783  $worksheet->write($a_row, ++$cnt, $label." ".$this->lng->txt("trac_others")." %");
784  }
785  else
786  {
787  // build status to image map
788  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
789  include_once("./Services/Tracking/classes/class.ilLPStatus.php");
790  $valid_status = array(ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM,
794  $cnt--;
795  foreach($valid_status as $status)
796  {
798  $worksheet->write($a_row, ++$cnt, $text);
799  $worksheet->write($a_row, ++$cnt, $text." %");
800  }
801  }
802  $cnt++;
803  }
804  }
805  }
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 620 of file class.ilTrSummaryTableGUI.php.

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

621  {
622  global $lng, $ilCtrl;
623 
624  $this->tpl->setVariable("ICON", ilObject::_getIcon("", "tiny", $a_set["type"]));
625  $this->tpl->setVariable("ICON_ALT", $lng->txt($a_set["type"]));
626  $this->tpl->setVariable("TITLE", $a_set["title"]);
627 
628  if($a_set["offline"] || $a_set["privacy_conflict"])
629  {
630  $mess = array();
631  if($a_set["offline"])
632  {
633  $mess[] = $lng->txt("offline");
634  }
635  if($a_set["privacy_conflict"])
636  {
637  $mess[] = $lng->txt("status_no_permission");
638  }
639  $this->tpl->setCurrentBlock("status_bl");
640  $this->tpl->setVariable("TEXT_STATUS", implode(", ", $mess));
641  $this->tpl->parseCurrentBlock();
642  }
643 
644  foreach ($this->getSelectedColumns() as $c)
645  {
646  switch($c)
647  {
648  case "country":
649  case "gender":
650  case "city":
651  case "language":
652  case "status":
653  case "mark":
654  case "sel_country":
655  $this->renderPercentages($c, $a_set[$c]);
656  break;
657 
658  case "percentage_avg":
659  if((int)$a_set[$c] === 0 || !$this->isPercentageAvailable($a_set["obj_id"]))
660  {
661  $this->tpl->setVariable(strtoupper($c), "");
662  break;
663  }
664 
665  default:
666  $value = $this->parseValue($c, $a_set[$c], $a_set["type"]);
667  $this->tpl->setVariable(strtoupper($c), $value);
668  break;
669  }
670  }
671 
672  if($this->is_root)
673  {
674  $path = $this->buildPath($a_set["ref_ids"], false, true);
675  if($path)
676  {
677  $this->tpl->setCurrentBlock("item_path");
678  foreach($path as $ref_id => $path_item)
679  {
680  $this->tpl->setVariable("PATH_ITEM", $path_item);
681 
682  if(!$this->anonymized)
683  {
684  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', $ref_id);
685  $this->tpl->setVariable("URL_DETAILS", $ilCtrl->getLinkTargetByClass($ilCtrl->getCmdClass(), 'details'));
686  $ilCtrl->setParameterByClass($ilCtrl->getCmdClass(), 'details_id', '');
687  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('trac_participants'));
688  }
689  else
690  {
691  $this->tpl->setVariable("URL_DETAILS", ilLink::_getLink($ref_id, $a_set["type"]));
692  $this->tpl->setVariable("TXT_DETAILS", $lng->txt('view'));
693  }
694 
695  $this->tpl->parseCurrentBlock();
696  }
697  }
698 
699  $this->tpl->setCurrentBlock("item_command");
700  $ilCtrl->setParameterByClass(get_class($this),'hide', $a_set["obj_id"]);
701  $this->tpl->setVariable("HREF_COMMAND", $ilCtrl->getLinkTargetByClass(get_class($this),'hide'));
702  $this->tpl->setVariable("TXT_COMMAND", $this->lng->txt('trac_hide'));
703  $this->tpl->parseCurrentBlock();
704 
705  $this->tpl->touchBlock("path_action");
706  }
707  }
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 905 of file class.ilTrSummaryTableGUI.php.

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

906  {
907  $a_csv->addColumn($a_set["title"]);
908 
909  foreach ($this->getSelectedColumns() as $c)
910  {
911  if(!$this->isArrayColumn($c))
912  {
913  $val = $this->parseValue($c, $a_set[$c], "user");
914  $a_csv->addColumn($val);
915  }
916  else
917  {
918  foreach($a_set[$c] as $idx => $value)
919  {
920  if($c != "status")
921  {
922  $a_csv->addColumn($value["caption"]);
923  }
924  $a_csv->addColumn((int)$value["absolute"]);
925  $a_csv->addColumn($value["percentage"]);
926  }
927  if(sizeof($a_set[$c]) < 4 && $c != "status")
928  {
929  for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
930  {
931  $a_csv->addColumn("");
932  $a_csv->addColumn("");
933  $a_csv->addColumn("");
934  }
935  }
936  }
937  }
938 
939  $a_csv->addRow();
940  }
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 807 of file class.ilTrSummaryTableGUI.php.

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

808  {
809  $worksheet->write($a_row, 0, $a_set["title"]);
810 
811  $cnt = 1;
812  foreach ($this->getSelectedColumns() as $c)
813  {
814  if(!$this->isArrayColumn($c))
815  {
816  $val = $this->parseValue($c, $a_set[$c], "user");
817  $worksheet->write($a_row, $cnt, $val);
818  $cnt++;
819  }
820  else
821  {
822  foreach($a_set[$c] as $idx => $value)
823  {
824  if($c == "status")
825  {
826  $worksheet->write($a_row, $cnt, (int)$value["absolute"]);
827  $worksheet->write($a_row, ++$cnt, $value["percentage"]);
828  }
829  else
830  {
831  $worksheet->write($a_row, $cnt, $value["caption"]);
832  $worksheet->write($a_row, ++$cnt, (int)$value["absolute"]);
833  $worksheet->write($a_row, ++$cnt, $value["percentage"]);
834  }
835  $cnt++;
836  }
837  if(sizeof($a_set[$c]) < 4 && $c != "status")
838  {
839  for($loop = 4; $loop > sizeof($a_set[$c]); $loop--)
840  {
841  $worksheet->write($a_row, $cnt, "");
842  $worksheet->write($a_row, ++$cnt, "");
843  $worksheet->write($a_row, ++$cnt, "");
844  $cnt++;
845  }
846  }
847  }
848  }
849  }
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, $valid, 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, $rbacsystem;
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 "read_learning_progress" access
323  $preselected_obj_ids = $this->searchObjects($this->getCurrentFilter(true), "read_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  // #13807
380  if($result["ref_ids"])
381  {
382  $valid = false;
383  foreach($result["ref_ids"] as $check_ref_id)
384  {
385  if($rbacsystem->checkAccess("read_learning_progress", $check_ref_id))
386  {
387  $valid = true;
388  break;
389  }
390  }
391  if(!$valid)
392  {
393  foreach(array_keys($data["set"][$idx]) as $col_id)
394  {
395  if(!in_array($col_id, array("type", "title", "obj_id", "ref_id", "offline")))
396  {
397  $data["set"][$idx][$col_id] = null;
398  }
399  }
400  $data["set"][$idx]["privacy_conflict"] = true;
401  continue;
402  }
403  }
404 
405  // percentages
406  $users_no = $result["user_total"];
407  $data["set"][$idx]["country"] = $this->getItemsPercentages($result["country"], $users_no);
408  $data["set"][$idx]["gender"] = $this->getItemsPercentages($result["gender"], $users_no, array("m"=>$lng->txt("gender_m"), "f"=>$lng->txt("gender_f")));
409  $data["set"][$idx]["city"] = $this->getItemsPercentages($result["city"], $users_no);
410  $data["set"][$idx]["sel_country"] = $this->getItemsPercentages($result["sel_country"], $users_no, $this->getSelCountryCodes());
411  $data["set"][$idx]["mark"] = $this->getItemsPercentages($result["mark"], $users_no);
412  $data["set"][$idx]["language"] = $this->getItemsPercentages($result["language"], $users_no, $languages);
413 
414  // if we encounter any invalid status codes, e.g. null, map them to not attempted instead
415  foreach($result["status"] as $status_code => $status_counter)
416  {
417  // null is cast to ""
418  if($status_code === "" || !in_array($status_code, $valid_status))
419  {
420  $result["status"][ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM] += $status_counter;
421  unset($result["status"][$status_code]);
422  }
423  }
424  $data["set"][$idx]["status"] = $this->getItemsPercentagesStatus($result["status"], $users_no, $status_map);
425 
426  if(!$this->isPercentageAvailable($result["obj_id"]))
427  {
428  $data["set"][$idx]["percentage_avg"] = NULL;
429  }
430  }
431 
432  $this->setMaxCount($data["cnt"]);
433  $this->setData($data["set"]);
434  }
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)
$valid
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
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
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 445 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

446  {
447  global $lng;
448 
449  if(!$overall)
450  {
451  return false;
452  }
453 
454  $result = array();
455 
456  if($data)
457  {
458  // if we have only 1 item more than the limit, "others" makes no sense
459  if(sizeof($data) == $limit+1)
460  {
461  $limit++;
462  }
463 
464  $counter = $others_counter = $others_sum = 0;
465  foreach($data as $id => $count)
466  {
467  $counter++;
468  if($counter <= $limit)
469  {
470  $caption = $id;
471 
472  if($value_map && isset($value_map[$id]))
473  {
474  $caption = $value_map[$id];
475  }
476 
477  if($caption == "")
478  {
479  $caption = $lng->txt("none");
480  }
481 
482  $perc = round($count/$overall*100);
483  $result[] = array(
484  "caption" => $caption,
485  "absolute" => $count, // ." ".($count > 1 ? $lng->txt("users") : $lng->txt("user")),
486  "percentage" => $perc
487  );
488  }
489  else
490  {
491  $others_sum += $count;
492  $others_counter++;
493  }
494  }
495 
496  if($others_counter)
497  {
498  $perc = round($others_sum/$overall*100);
499  $result[] = array(
500  "caption" => $otherss_counter." ".$lng->txt("trac_others"),
501  "absolute" => $others_sum, // ." ".($others_sum > 1 ? $lng->txt("users") : $lng->txt("user")),
502  "percentage" => $perc
503  );
504  }
505  }
506 
507  return $result;
508  }
$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 518 of file class.ilTrSummaryTableGUI.php.

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

Referenced by getItems().

519  {
520  global $lng;
521 
522  $result = array();
523  foreach($value_map as $id => $caption)
524  {
525  $count = 0;
526  if(isset($data[$id]))
527  {
528  $count = $data[$id];
529  }
530  $perc = round($count/$overall*100);
531 
532  $result[] = array(
533  "caption" => $caption,
534  "absolute" => $count,
535  "percentage" => $perc
536  );
537  }
538 
539  return $result;
540  }
$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, $txt, 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  }
$txt
Definition: error.php:10
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 728 of file class.ilTrSummaryTableGUI.php.

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

729  {
730  if(in_array($a_name, array("country", "gender", "city", "language", "status", "mark")))
731  {
732  return true;
733  }
734  return false;
735  }
+ Here is the caller graph for this function:

◆ numericOrdering()

ilTrSummaryTableGUI::numericOrdering (   $a_field)

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

738  {
739  $pos = strrpos($a_field, "_");
740  if($pos !== false)
741  {
742  $function = strtoupper(substr($a_field, $pos+1));
743  if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT", "TOTAL")))
744  {
745  return true;
746  }
747  }
748  return false;
749  }

◆ parseValue()

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

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

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

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

543  {
544  global $lng;
545 
546  // get rid of aggregation
547  $pos = strrpos($id, "_");
548  if($pos !== false)
549  {
550  $function = strtoupper(substr($id, $pos+1));
551  if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
552  {
553  $id = substr($id, 0, $pos);
554  }
555  }
556 
557  if(trim($value) == "")
558  {
559  if($id == "title")
560  {
561  return "--".$lng->txt("none")."--";
562  }
563  return "";
564  }
565  switch($id)
566  {
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":
579  if(in_array($type, array("exc")))
580  {
581  $value = "-";
582  }
583  else
584  {
585  include_once("./Services/Utilities/classes/class.ilFormat.php");
586  $value = ilFormat::_secondsToString($value, ($value < 3600 ? true : false)); // #14858
587  }
588  break;
589 
590  case "percentage":
591  /* :TODO:
592  if(in_array(strtolower($this->status_class),
593  array("illpstatusmanual", "illpstatusscormpackage", "illpstatustestfinished")) ||
594  $type == "exc"))
595  */
596  if(false)
597  {
598  $value = "-";
599  }
600  else
601  {
602  $value = $value."%";
603  }
604  break;
605 
606  case "mark":
607  if(in_array($type, array("lm", "dbk")))
608  {
609  $value = "-";
610  }
611  break;
612  }
613 
614  return $value;
615  }
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 709 of file class.ilTrSummaryTableGUI.php.

References ilTableGUI\$data.

Referenced by fillRow().

710  {
711  if($data)
712  {
713  foreach($data as $item)
714  {
715  $this->tpl->setCurrentBlock($id."_row");
716  $this->tpl->setVariable("CAPTION", $item["caption"]);
717  $this->tpl->setVariable("ABSOLUTE", $item["absolute"]);
718  $this->tpl->setVariable("PERCENTAGE", $item["percentage"]);
719  $this->tpl->parseCurrentBlock();
720  }
721  }
722  else
723  {
724  $this->tpl->touchBlock($id);;
725  }
726  }
+ Here is the caller graph for this function:

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