ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTrMatrixTableGUI Class Reference

name table More...

+ Inheritance diagram for ilTrMatrixTableGUI:
+ Collaboration diagram for ilTrMatrixTableGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd, $ref_id)
 Constructor. More...
 
 initFilter ()
 
 getSelectableColumns ()
 
 getItems (array $a_user_fields, array $a_privary_fields=null)
 
 fillRow (array $a_set)
 
- 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

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

Protected Attributes

 $obj_ids = NULL
 
 $objective_ids = NULL
 
 $sco_ids = NULL
 
 $subitem_ids = NULL
 
 $in_course
 
 $in_group
 
 $privacy_fields
 
 $privacy_cols = array()
 
- 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
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Detailed Description

name table

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

Definition at line 14 of file class.ilTrMatrixTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTrMatrixTableGUI::__construct (   $a_parent_obj,
  $a_parent_cmd,
  $ref_id 
)

Constructor.

Definition at line 28 of file class.ilTrMatrixTableGUI.php.

References ilTableGUI\$icon, $ilCtrl, $lng, $ref_id, ilTableGUI\$title, ilObject\_lookupObjId(), ilTable2GUI\addColumn(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), initFilter(), ilLPTableBaseGUI\parseTitle(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTableGUI\setLimit(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowTemplates().

29  {
30  global $ilCtrl, $lng, $tree;
31 
32  $this->setId("trsmtx_".$ref_id);
33  $this->ref_id = $ref_id;
34  $this->obj_id = ilObject::_lookupObjId($ref_id);
35 
36  $this->in_group = $tree->checkForParentType($this->ref_id, "grp");
37  if($this->in_group)
38  {
39  $this->in_group = ilObject::_lookupObjId($this->in_group);
40  }
41  else
42  {
43  $this->in_course = $tree->checkForParentType($this->ref_id, "crs");
44  if($this->in_course)
45  {
46  $this->in_course = ilObject::_lookupObjId($this->in_course);
47  }
48  }
49 
50  // has to be before constructor to work
51  $this->initFilter();
52 
53  parent::__construct($a_parent_obj, $a_parent_cmd);
54 
55  $this->setLimit(9999);
56  $this->parseTitle($this->obj_id, "trac_matrix");
57 
58  $this->setEnableHeader(true);
59  $this->setFormAction($ilCtrl->getFormActionByClass(get_class($this)));
60  $this->setRowTemplate("tpl.user_object_matrix_row.html", "Services/Tracking");
61  $this->setDefaultOrderField("login");
62  $this->setDefaultOrderDirection("asc");
63  $this->setShowTemplates(true);
64 
65  $this->addColumn($this->lng->txt("login"), "login");
66 
67  $labels = $this->getSelectableColumns();
68  $selected = $this->getSelectedColumns();
69  foreach ($selected as $c)
70  {
71  $title = $labels[$c]["txt"];
72 
73  if(isset($labels[$c]["no_permission"]) && (bool)$labels[$c]["no_permission"])
74  {
75  $title .= " (".$lng->txt("status_no_permission").")";
76  }
77 
78  $tooltip = "";
79  if(isset($labels[$c]["icon"]))
80  {
81  $alt = $lng->txt($labels[$c]["type"]);
82  $icon = '<img src="'.$labels[$c]["icon"].'" alt="'.$alt.'" />';
83  if(sizeof($selected) > 5)
84  {
85  $tooltip = $title;
86  $title = $icon;
87  }
88  else
89  {
90  $title = $icon.' '.$title;
91  }
92  }
93 
94  if(isset($labels[$c]["id"]))
95  {
96  $sort_id = $labels[$c]["id"];
97  }
98  else
99  {
100  // list cannot be sorted by udf fields (separate query)
101  $sort_id = (substr($c, 0, 4) == "udf_") ? "" : $c;
102  }
103 
104  $this->addColumn($title, $sort_id, "", false, "", $tooltip);
105  }
106 
107  $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
108  }
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
setShowTemplates($a_value)
Toggle templates.
parseTitle($a_obj_id, $action, $a_user_id=false)
setId($a_val)
Set id.
global $ilCtrl
Definition: ilias.php:18
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
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.
$ref_id
Definition: sahs_server.php:39
global $lng
Definition: privfeed.php:40
setEnableHeader($a_enableheader)
Set Enable Header.
+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilTrMatrixTableGUI::fillHeaderCSV (   $a_csv)
protected

Definition at line 568 of file class.ilTrMatrixTableGUI.php.

References getSelectableColumns(), and ilTable2GUI\getSelectedColumns().

569  {
570  global $ilObjDataCache;
571 
572  $a_csv->addColumn($this->lng->txt("login"));
573 
574  $labels = $this->getSelectableColumns();
575  foreach ($this->getSelectedColumns() as $c)
576  {
577  if(substr($c, 0, 4) == "obj_")
578  {
579  $obj_id = substr($c, 4);
580  $type = $ilObjDataCache->lookupType($obj_id);
581  $a_csv->addColumn("(".$this->lng->txt($type).") ".$labels[$c]["txt"]);
582 
583  if(is_array($this->perc_map) && $this->perc_map[$obj_id])
584  {
585  $a_csv->addColumn($this->lng->txt("trac_percentage")." (%)");
586  }
587  }
588  else
589  {
590  $a_csv->addColumn($labels[$c]["txt"]);
591  }
592  }
593 
594  $a_csv->addRow();
595  }
getSelectedColumns()
Get selected columns.
+ Here is the call graph for this function:

◆ fillHeaderExcel()

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

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

References getSelectableColumns(), and ilTable2GUI\getSelectedColumns().

491  {
492  global $ilObjDataCache;
493 
494  $worksheet->write($a_row, 0, $this->lng->txt("login"));
495 
496  $labels = $this->getSelectableColumns();
497  $cnt = 1;
498  foreach ($this->getSelectedColumns() as $c)
499  {
500  if(substr($c, 0, 4) == "obj_")
501  {
502  $obj_id = substr($c, 4);
503  $type = $ilObjDataCache->lookupType($obj_id);
504  $worksheet->write($a_row, $cnt, "(".$this->lng->txt($type).") ".$labels[$c]["txt"]);
505 
506  if(is_array($this->perc_map) && $this->perc_map[$obj_id])
507  {
508  $cnt++;
509  $worksheet->write($a_row, $cnt, $this->lng->txt("trac_percentage")." (%)");
510  }
511  }
512  else
513  {
514  $worksheet->write($a_row, $cnt, $labels[$c]["txt"]);
515  }
516  $cnt++;
517  }
518  }
getSelectedColumns()
Get selected columns.
+ Here is the call graph for this function:

◆ fillRow()

ilTrMatrixTableGUI::fillRow ( array  $a_set)

Definition at line 378 of file class.ilTrMatrixTableGUI.php.

References $lng, ilUtil\getImagePath(), ilTable2GUI\getSelectedColumns(), IL_CAL_UNIX, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilLPTableBaseGUI\parseValue(), and ilLPTableBaseGUI\showTimingsWarning().

379  {
380  global $lng;
381 
382  foreach ($this->getSelectedColumns() as $c)
383  {
384  switch($c)
385  {
386  case (substr($c, 0, 4) == "obj_"):
387  $obj_id = substr($c, 4);
388 
389  // object without read-lp-permission
390  if(in_array($obj_id, $this->privacy_cols) ||
391  $a_set["privacy_conflict"])
392  {
393  $this->tpl->setCurrentBlock("objects");
394  $this->tpl->setVariable("VAL_STATUS", "&nbsp;");
395  $this->tpl->parseCurrentBlock();
396  continue;
397  }
398 
399  $status = isset($a_set[$c])
400  ? (int)$a_set[$c]
402  $percentage = isset($a_set[$c."_perc"])
403  ? (int)$a_set[$c."_perc"]
404  : null;
405 
407  {
408  $timing = $this->showTimingsWarning($this->ref_ids[$obj_id], $a_set["usr_id"]);
409  if($timing)
410  {
411  if($timing !== true)
412  {
413  $timing = ": ".ilDatePresentation::formatDate(new ilDate($timing, IL_CAL_UNIX));
414  }
415  else
416  {
417  $timing = "";
418  }
419  $this->tpl->setCurrentBlock('warning_img');
420  $this->tpl->setVariable('WARNING_IMG', ilUtil::getImagePath('time_warn.svg'));
421  $this->tpl->setVariable('WARNING_ALT', $this->lng->txt('trac_time_passed').$timing);
422  $this->tpl->parseCurrentBlock();
423  }
424  }
425 
426  $this->tpl->setCurrentBlock("objects");
427  $this->tpl->setVariable("VAL_STATUS", $this->parseValue("status", $status, ""));
428  $this->tpl->setVariable("VAL_PERCENTAGE", $this->parseValue("percentage", $percentage, ""));
429  $this->tpl->parseCurrentBlock();
430  break;
431 
432 
433  case (substr($c, 0, 6) == "objtv_"):
434  case (substr($c, 0, 7) == "objsco_"):
435  case (substr($c, 0, 7) == "objsub_"):
436  $status = isset($a_set[$c])
437  ? (int)$a_set[$c]
439 
440  $this->tpl->setCurrentBlock("objects");
441  if(!$a_set["privacy_conflict"])
442  {
443  $this->tpl->setVariable("VAL_STATUS", $this->parseValue("status", $status, ""));
444  }
445  else
446  {
447  $this->tpl->setVariable("VAL_STATUS", "&nbsp;");
448  }
449  $this->tpl->parseCurrentBlock();
450  break;
451 
452  default:
453  $this->tpl->setCurrentBlock("user_field");
454  if(!$a_set["privacy_conflict"])
455  {
456  $this->tpl->setVariable("VAL_UF", $this->parseValue($c, $a_set[$c], ""));
457  }
458  else
459  {
460  $this->tpl->setVariable("VAL_UF", "&nbsp;");
461  }
462  $this->tpl->parseCurrentBlock();
463  break;
464  }
465  }
466 
467  // #7694
468  if(!$a_set["active"] || $a_set["privacy_conflict"])
469  {
470  $mess = array();
471  if($a_set["privacy_conflict"])
472  {
473  $mess[] = $lng->txt("status_no_permission");
474  }
475  else if(!$a_set["active"])
476  {
477  $mess[] = $lng->txt("inactive");
478  }
479  $this->tpl->setCurrentBlock('inactive_bl');
480  $this->tpl->setVariable('TXT_INACTIVE', implode(", ", $mess));
481  $this->tpl->parseCurrentBlock();
482  }
483 
484  $login = !$a_set["privacy_conflict"]
485  ? $a_set["login"]
486  : "&nbsp;";
487  $this->tpl->setVariable("VAL_LOGIN", $login);
488  }
const LP_STATUS_COMPLETED_NUM
const IL_CAL_UNIX
parseValue($id, $value, $type)
Class for single dates.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getSelectedColumns()
Get selected columns.
const LP_STATUS_NOT_ATTEMPTED_NUM
global $lng
Definition: privfeed.php:40
showTimingsWarning($a_ref_id, $a_user_id)
+ Here is the call graph for this function:

◆ fillRowCSV()

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

Definition at line 597 of file class.ilTrMatrixTableGUI.php.

References ilLearningProgressBaseGUI\_getStatusText(), ilTable2GUI\getSelectedColumns(), and ilLPTableBaseGUI\parseValue().

598  {
599  $a_csv->addColumn($a_set["login"]);
600 
601  foreach ($this->getSelectedColumns() as $c)
602  {
603  switch($c)
604  {
605  case (substr($c, 0, 4) == "obj_"):
606  $obj_id = substr($c, 4);
607  $val = ilLearningProgressBaseGUI::_getStatusText((int)$a_set[$c]);
608  $a_csv->addColumn($val);
609 
610  if(is_array($this->perc_map) && $this->perc_map[$obj_id])
611  {
612  $perc = (int)$a_set[$c."_perc"];
613  if(!$perc)
614  {
615  $perc = null;
616  }
617  $a_csv->addColumn($perc);
618  }
619  break;
620 
621  case (substr($c, 0, 6) == "objtv_"):
622  case (substr($c, 0, 7) == "objsco_"):
623  case (substr($c, 0, 7) == "objsub_"):
624  $val = ilLearningProgressBaseGUI::_getStatusText((int)$a_set[$c]);
625  $a_csv->addColumn($val);
626  break;
627 
628  /* #14142
629  case "last_access":
630  case "spent_seconds":
631  case "status_changed":
632  */
633  default:
634  $val = $this->parseValue($c, $a_set[$c], "user");
635  $a_csv->addColumn($val);
636  break;
637 
638  }
639  }
640 
641  $a_csv->addRow();
642  }
parseValue($id, $value, $type)
_getStatusText($a_status)
Get status alt text.
getSelectedColumns()
Get selected columns.
+ Here is the call graph for this function:

◆ fillRowExcel()

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

Definition at line 520 of file class.ilTrMatrixTableGUI.php.

References ilLearningProgressBaseGUI\_getStatusText(), ilTable2GUI\getSelectedColumns(), and ilLPTableBaseGUI\parseValue().

521  {
522  $worksheet->write($a_row, 0, $a_set["login"]);
523 
524  $cnt = 1;
525  foreach ($this->getSelectedColumns() as $c)
526  {
527  switch($c)
528  {
529  case (substr($c, 0, 4) == "obj_"):
530  $obj_id = substr($c, 4);
531  $val = ilLearningProgressBaseGUI::_getStatusText((int)$a_set[$c]);
532  $worksheet->write($a_row, $cnt, $val);
533 
534  if(is_array($this->perc_map) && $this->perc_map[$obj_id])
535  {
536  $cnt++;
537  $perc = (int)$a_set[$c."_perc"];
538  if(!$perc)
539  {
540  $perc = null;
541  }
542  $worksheet->write($a_row, $cnt, $perc);
543  }
544  break;
545 
546  case (substr($c, 0, 6) == "objtv_"):
547  case (substr($c, 0, 7) == "objsco_"):
548  case (substr($c, 0, 7) == "objsub_"):
549  $val = ilLearningProgressBaseGUI::_getStatusText((int)$a_set[$c]);
550  $worksheet->write($a_row, $cnt, $val);
551  break;
552 
553  /* #14142
554  case "last_access":
555  case "spent_seconds":
556  case "status_changed":
557  */
558  default:
559  $val = $this->parseValue($c, $a_set[$c], "user");
560  $worksheet->write($a_row, $cnt, $val);
561  break;
562 
563  }
564  $cnt++;
565  }
566  }
parseValue($id, $value, $type)
_getStatusText($a_status)
Get status alt text.
getSelectedColumns()
Get selected columns.
+ Here is the call graph for this function:

◆ getItems()

ilTrMatrixTableGUI::getItems ( array  $a_user_fields,
array  $a_privary_fields = null 
)

Definition at line 228 of file class.ilTrMatrixTableGUI.php.

References ilTableGUI\$data, $in_course, $in_group, $row, ilPrivacySettings\_getInstance(), ilTrQuery\getObjectIds(), ilTrQuery\getUserObjectiveMatrix(), ilTrQuery\getUserObjectMatrix(), ilCourseObjective\lookupObjectiveTitle(), ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ilTable2GUI\setData(), and ilTableGUI\setMaxCount().

Referenced by getSelectableColumns().

229  {
230  include_once("./Services/Tracking/classes/class.ilTrQuery.php");
231  $collection = ilTrQuery::getObjectIds($this->obj_id, $this->ref_id, true);
232  if($collection["object_ids"])
233  {
234  // we need these for the timing warnings
235  $this->ref_ids = $collection["ref_ids"];
236 
237  // only if object is [part of] course/group
238  $check_agreement = false;
239  if($this->in_course)
240  {
241  // privacy (if course agreement is activated)
242  include_once "Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
243  $privacy = ilPrivacySettings::_getInstance();
244  if($privacy->courseConfirmationRequired())
245  {
246  $check_agreement = $this->in_course;
247  }
248  }
249  else if($this->in_group)
250  {
251  // privacy (if group agreement is activated)
252  include_once "Services/PrivacySecurity/classes/class.ilPrivacySettings.php";
253  $privacy = ilPrivacySettings::_getInstance();
254  if($privacy->groupConfirmationRequired())
255  {
256  $check_agreement = $this->in_group;
257  }
258  }
259 
260  $data = ilTrQuery::getUserObjectMatrix($this->ref_id, $collection["object_ids"], $this->filter["name"], $a_user_fields, $a_privary_fields, $check_agreement);
261  if($collection["objectives_parent_id"] && $data["users"])
262  {
263  // sub-items: learning objectives
264  $objectives = ilTrQuery::getUserObjectiveMatrix($collection["objectives_parent_id"], $data["users"]);
265 
266  $this->objective_ids = array();
267 
268  foreach($objectives as $user_id => $objectives)
269  {
270  if(isset($data["set"][$user_id]))
271  {
272  foreach($objectives as $objective_id => $status)
273  {
274  $obj_id = "objtv_".$objective_id;
275  $data["set"][$user_id][$obj_id] = $status;
276 
277  if(!in_array($obj_id, $this->objective_ids))
278  {
279  $this->objective_ids[$objective_id] = ilCourseObjective::lookupObjectiveTitle($objective_id);
280  }
281  }
282  }
283  }
284  }
285 
286  // sub-items: SCOs
287  if($collection["scorm"] && $data["set"])
288  {
289  $this->sco_ids = array();
290  foreach(array_keys($data["set"]) as $user_id)
291  {
292  foreach($collection["scorm"]["scos"] as $sco)
293  {
294  if(!in_array($sco, $this->sco_ids))
295  {
296  $this->sco_ids[$sco] = $collection["scorm"]["scos_title"][$sco];
297  }
298 
299  // alex, 5 Nov 2011: we got users being in failed and in
300  // completed status, I changed the setting in: first check failed
301  // then check completed since failed should superseed completed
302  // (before completed has been checked before failed)
304  if(in_array($user_id, $collection["scorm"]["failed"][$sco]))
305  {
307  }
308  else if(in_array($user_id, $collection["scorm"]["completed"][$sco]))
309  {
311  }
312  else if(in_array($user_id, $collection["scorm"]["in_progress"][$sco]))
313  {
315  }
316 
317  $obj_id = "objsco_".$sco;
318  $data["set"][$user_id][$obj_id] = $status;
319  }
320  }
321  }
322 
323  // sub-items: generic, e.g. lm chapter
324  if($collection["subitems"] && $data["set"])
325  {
326  foreach(array_keys($data["set"]) as $user_id)
327  {
328  foreach($collection["subitems"]["items"] as $item_id)
329  {
330  $this->subitem_ids[$item_id] = $collection["subitems"]["item_titles"][$item_id];
331 
333  if(in_array($user_id, $collection["subitems"]["completed"][$item_id]))
334  {
336  }
337  else if(is_array($collection["subitems"]["in_progress"]) &&
338  in_array($user_id, $collection["subitems"]["in_progress"][$item_id]))
339  {
341  }
342 
343  $obj_id = "objsub_".$item_id;
344  $data["set"][$user_id][$obj_id] = $status;
345  }
346  }
347  }
348 
349  // percentage export
350  if($data["set"])
351  {
352  $this->perc_map = array();
353  foreach($data["set"] as $row)
354  {
355  foreach($row as $column => $value)
356  {
357  if(substr($column, -5) == "_perc")
358  {
359  if((int)$value > 0)
360  {
361  $obj_id = explode("_", $column);
362  $obj_id = (int)$obj_id[1];
363  $this->perc_map[$obj_id] = true;
364  }
365  }
366  }
367  }
368  }
369 
370  $this->setMaxCount($data["cnt"]);
371  $this->setData($data["set"]);
372 
373  return $collection["object_ids"];
374  }
375  return false;
376  }
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
static lookupObjectiveTitle($a_objective_id)
static getObjectIds($a_parent_obj_id, $a_parent_ref_id=false, $use_collection=true, $a_refresh_status=true, $a_user_ids=null)
Get (sub)objects for given object, also handles learning objectives (course only) ...
static getUserObjectiveMatrix($a_parent_obj_id, $a_users)
const LP_STATUS_NOT_ATTEMPTED_NUM
static getUserObjectMatrix($a_parent_ref_id, $a_obj_ids, $a_user_filter=NULL, array $a_additional_fields=null, array $a_privacy_fields=null, $a_check_agreement=null)
Get status matrix for users on objects.
static _getInstance()
Get instance of ilPrivacySettings.
setMaxCount($a_max_count)
set max.
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilTrMatrixTableGUI::getSelectableColumns ( )

Definition at line 125 of file class.ilTrMatrixTableGUI.php.

References $columns, ilTableGUI\$icon, $ref_id, $sess, ilTableGUI\$title, ilObject\_getIcon(), getItems(), ilLPTableBaseGUI\getSelectableUserColumns(), and ilUtil\getTypeIconPath().

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

126  {
127  global $ilObjDataCache, $rbacsystem;
128 
129  $user_cols = $this->getSelectableUserColumns($this->in_course, $this->in_group);
130 
131  if($this->obj_ids === NULL)
132  {
133  // we cannot use the selected columns because they are not ready yet
134  // so we use all available columns, should be ok anyways
135  $this->obj_ids = $this->getItems(array_keys($user_cols[0]), $user_cols[1]);
136  }
137  if($this->obj_ids)
138  {
139  $tmp_cols = array();
140  foreach($this->obj_ids as $obj_id)
141  {
142  if($obj_id == $this->obj_id)
143  {
144  $parent = array("txt" => $this->lng->txt("status"),
145  "default" => true);
146  }
147  else
148  {
149  $no_perm = false;
150 
151  $ref_id = $this->ref_ids[$obj_id];
152  if($ref_id &&
153  !$rbacsystem->checkAccess('read_learning_progress', $ref_id))
154  {
155  $no_perm = true;
156  $this->privacy_cols[] = $obj_id;
157  }
158 
159  $title = $ilObjDataCache->lookupTitle($obj_id);
160  $type = $ilObjDataCache->lookupType($obj_id);
161  $icon = ilObject::_getIcon("", "tiny", $type);
162  if($type == "sess")
163  {
164  include_once "Modules/Session/classes/class.ilObjSession.php";
165  $sess = new ilObjSession($obj_id, false);
166  $title = $sess->getPresentationTitle();
167  }
168  $tmp_cols[strtolower($title)."#~#obj_".$obj_id] = array("txt" => $title, "icon" => $icon, "type" => $type, "default" => true, "no_permission" => $no_perm);
169  }
170  }
171  if(sizeof($this->objective_ids))
172  {
173  foreach($this->objective_ids as $obj_id => $title)
174  {
175  $tmp_cols[strtolower($title)."#~#objtv_".$obj_id] = array("txt" => $title, "default" => true);
176  }
177  }
178  if(sizeof($this->sco_ids))
179  {
180  foreach($this->sco_ids as $obj_id => $title)
181  {
182  $icon = ilUtil::getTypeIconPath("sco", $obj_id, "tiny");
183  $tmp_cols[strtolower($title)."#~#objsco_".$obj_id] = array("txt" => $title, "icon"=>$icon, "default" => true);
184  }
185  }
186  if(sizeof($this->subitem_ids))
187  {
188  foreach($this->subitem_ids as $obj_id => $title)
189  {
190  $icon = ilUtil::getTypeIconPath("st", $obj_id, "tiny");
191  $tmp_cols[strtolower($title)."#~#objsub_".$obj_id] = array("txt" => $title, "icon"=>$icon, "default" => true);
192  }
193  }
194 
195  // alex, 5 Nov 2011: Do not sort SCORM items or "chapters"
196  if(!sizeof($this->sco_ids) && !sizeof($this->subitem_ids))
197  {
198  ksort($tmp_cols);
199  }
200  foreach($tmp_cols as $id => $def)
201  {
202  $id = explode('#~#', $id);
203  $columns[$id[1]] = $def;
204  }
205  unset($tmp_cols);
206 
207  if($parent)
208  {
209  $columns["obj_".$this->obj_id] = $parent;
210  }
211  }
212 
213  unset($user_cols[0]["status"]);
214  unset($user_cols[0]["login"]);
215  foreach($user_cols[0] as $col_id => $col_def)
216  {
217  if(!isset($columns[$col_id]))
218  {
219  // these are all additional fields, no default
220  $col_def["default"] = false;
221  $columns[$col_id] = $col_def;
222  }
223  }
224 
225  return $columns;
226  }
getSelectableUserColumns($a_in_course=false, $a_in_group=false)
static _getIcon($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
getItems(array $a_user_fields, array $a_privary_fields=null)
$ref_id
Definition: sahs_server.php:39
if(! $in) $columns
Definition: Utf8Test.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilTrMatrixTableGUI::initFilter ( )

Definition at line 110 of file class.ilTrMatrixTableGUI.php.

References $_GET, $lng, ilTable2GUI\addFilterItemByMetaType(), and ilTable2GUI\FILTER_TEXT.

Referenced by __construct().

111  {
112  global $lng;
113 
114  $item = $this->addFilterItemByMetaType("name", ilTable2GUI::FILTER_TEXT);
115  $this->filter["name"] = $item->getValue();
116 
117  // #14949 - is called before constructor, so we have to do it ourselves
118  if(isset($_GET[$this->prefix."_tpl"]))
119  {
120  $this->filter["name"] = null;
121  $item->setValue(null);
122  }
123  }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
$_GET["client_id"]
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $in_course

ilTrMatrixTableGUI::$in_course
protected

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

Referenced by getItems().

◆ $in_group

ilTrMatrixTableGUI::$in_group
protected

Definition at line 21 of file class.ilTrMatrixTableGUI.php.

Referenced by getItems().

◆ $obj_ids

ilTrMatrixTableGUI::$obj_ids = NULL
protected

Definition at line 16 of file class.ilTrMatrixTableGUI.php.

◆ $objective_ids

ilTrMatrixTableGUI::$objective_ids = NULL
protected

Definition at line 17 of file class.ilTrMatrixTableGUI.php.

◆ $privacy_cols

ilTrMatrixTableGUI::$privacy_cols = array()
protected

Definition at line 23 of file class.ilTrMatrixTableGUI.php.

◆ $privacy_fields

ilTrMatrixTableGUI::$privacy_fields
protected

Definition at line 22 of file class.ilTrMatrixTableGUI.php.

◆ $sco_ids

ilTrMatrixTableGUI::$sco_ids = NULL
protected

Definition at line 18 of file class.ilTrMatrixTableGUI.php.

◆ $subitem_ids

ilTrMatrixTableGUI::$subitem_ids = NULL
protected

Definition at line 19 of file class.ilTrMatrixTableGUI.php.


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