ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLPTableBaseGUI Class Reference

TableGUI class for learning progress. More...

+ Inheritance diagram for ilLPTableBaseGUI:
+ Collaboration diagram for ilLPTableBaseGUI:

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 
 executeCommand ()
 
 searchFilterListener ($a_ref_id, $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED public. More...
 
 initFilter ($a_split_learning_resources=false, $a_include_no_status_filter=true)
 Init filter. More...
 
 getCurrentFilter ($as_query=false)
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 Constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname)
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="")
 Add Command button. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="")
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate (&$a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Protected Member Functions

 searchObjects (array $filter, $permission, array $preset_obj_ids=null)
 Search objects that match current filters. More...
 
 buildPath ($ref_ids)
 Build path with deep-link. More...
 
 getPossibleTypes ($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
 Get possible subtypes. More...
 
 parseValue ($id, $value, $type)
 
 isPercentageAvailable ($a_obj_id)
 
 parseTitle ($a_obj_id, $action, $a_user_id=false)
 
 getExportMeta ()
 Build export meta data. More...
 
 fillMetaExcel ($worksheet, &$a_row)
 
 fillMetaCSV ($a_csv)
 
 showTimingsWarning ($a_ref_id, $a_user_id)
 
 formatSeconds ($seconds, $a_shorten_zero=false)
 
 anonymizeValue ($a_value, $a_force_number=false)
 
 buildValueScale ($a_max_value, $a_anonymize=false, $a_format_seconds=false)
 
 getMonthsFilter ($a_short=false)
 
 getMonthsYear ($a_year=null, $a_short=false)
 
 getSelectableUserColumns ($a_in_course=false, $a_in_group=false)
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel ($worksheet, &$a_row)
 Excel Version of Fill Row. More...
 
 fillRowExcel ($a_worksheet, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

 $filter
 
 $anonymized
 
- Protected Attributes inherited from ilTable2GUI
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = null
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $row_selector_label
 

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

TableGUI class for learning progress.

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 15 of file class.ilLPTableBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilLPTableBaseGUI::__construct (   $a_parent_obj,
  $a_parent_cmd = "",
  $a_template_context = "" 
)

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

References ilObjUserTracking\_enabledUserRelatedData(), and ilObjectLP\getInstance().

21  {
22  parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
23 
24  // country names
25  $this->lng->loadLanguageModule("meta");
26 
27  include_once("./Services/Object/classes/class.ilObjectLP.php");
28 
29  $this->anonymized = (bool)!ilObjUserTracking::_enabledUserRelatedData();
30  if(!$this->anonymized && $this->obj_id)
31  {
32  include_once "Services/Object/classes/class.ilObjectLP.php";
33  $olp = ilObjectLP::getInstance($this->obj_id);
34  $this->anonymized = $olp->isAnonymized();
35  }
36  }
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static getInstance($a_obj_id)
+ Here is the call graph for this function:

Member Function Documentation

◆ anonymizeValue()

ilLPTableBaseGUI::anonymizeValue (   $a_value,
  $a_force_number = false 
)
protected

Definition at line 722 of file class.ilLPTableBaseGUI.php.

Referenced by buildValueScale(), ilLPObjectStatisticsDailyTableGUI\fillRow(), ilLPObjectStatisticsTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRow(), ilLPObjectStatisticsLPTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPObjectStatisticsDailyTableGUI\fillRowExcel(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPObjectStatisticsDailyTableGUI\getGraph(), ilLPObjectStatisticsTableGUI\getGraph(), and ilLPObjectStatisticsLPTableGUI\getGraph().

723  {
724  // currently inactive
725  return $a_value;
726 
727  if(is_numeric($a_value))
728  {
729  $threshold = 3;
730  $a_value = (int)$a_value;
731  if($a_value <= $threshold)
732  {
733  if(!$a_force_number)
734  {
735  return "0-".$threshold;
736  }
737  else
738  {
739  return $threshold;
740  }
741  }
742  }
743  return $a_value;
744  }
+ Here is the caller graph for this function:

◆ buildPath()

ilLPTableBaseGUI::buildPath (   $ref_ids)
protected

Build path with deep-link.

Parameters
array$ref_ids
Returns
array

Definition at line 288 of file class.ilLPTableBaseGUI.php.

References ilTableGUI\$data, $ilCtrl, $path, $ref_id, $result, and ilLink\_getLink().

Referenced by ilLPProgressTableGUI\fillRow(), and ilTrSummaryTableGUI\fillRow().

289  {
290  global $tree, $ilCtrl;
291 
292  include_once './Services/Link/classes/class.ilLink.php';
293 
294  if(!count($ref_ids))
295  {
296  return false;
297  }
298  foreach($ref_ids as $ref_id)
299  {
300  $path = "...";
301  $counter = 0;
302  $path_full = $tree->getPathFull($ref_id);
303  foreach($path_full as $data)
304  {
305  if(++$counter < (count($path_full)-1))
306  {
307  continue;
308  }
309  $path .= " &raquo; ";
310  if($ref_id != $data['ref_id'])
311  {
312  $path .= $data['title'];
313  }
314  else
315  {
316  $path .= ('<a target="_top" href="'.
317  ilLink::_getLink($data['ref_id'],$data['type']).'">'.
318  $data['title'].'</a>');
319  }
320  }
321 
322  $result[$ref_id] = $path;
323  }
324  return $result;
325  }
$result
global $ilCtrl
Definition: ilias.php:18
$ref_id
Definition: sahs_server.php:39
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildValueScale()

ilLPTableBaseGUI::buildValueScale (   $a_max_value,
  $a_anonymize = false,
  $a_format_seconds = false 
)
protected

Definition at line 746 of file class.ilLPTableBaseGUI.php.

References ilTableGUI\$base, anonymizeValue(), and formatSeconds().

Referenced by ilLPObjectStatisticsDailyTableGUI\getGraph(), ilLPObjectStatisticsTableGUI\getGraph(), and ilLPObjectStatisticsLPTableGUI\getGraph().

747  {
748  $step = 0;
749  if($a_max_value)
750  {
751  $step = $a_max_value / 10;
752  $base = ceil(log($step, 10));
753  $fac = ceil($step / pow(10, ($base - 1)));
754  $step = pow(10, $base - 1) * $fac;
755  }
756  if ($step <= 1)
757  {
758  $step = 1;
759  }
760  $ticks = range(0, $a_max_value+$step, $step);
761 
762  $value_ticks = array(0 => 0);
763  foreach($ticks as $tick)
764  {
765  $value = $tvalue = $tick;
766  if($a_anonymize)
767  {
768  $value = $this->anonymizeValue($value, true);
769  $tvalue = $this->anonymizeValue($tvalue);
770  }
771  if($a_format_seconds)
772  {
773  $tvalue = $this->formatSeconds($value);
774  }
775  $value_ticks[$value] = $tvalue;
776  }
777 
778  return $value_ticks;
779  }
anonymizeValue($a_value, $a_force_number=false)
formatSeconds($seconds, $a_shorten_zero=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

Definition at line 38 of file class.ilLPTableBaseGUI.php.

References $_GET, $_POST, $_REQUEST, $ilCtrl, ilTable2GUI\determineOffsetAndOrder(), ilTable2GUI\determineSelectedFilters(), ilTable2GUI\getFilterItemByPostVar(), ilTable2GUI\resetFilter(), ilTable2GUI\resetOffset(), ilTable2GUI\storeNavParameter(), and ilTable2GUI\writeFilterToSession().

39  {
40  global $ilCtrl;
41 
42  $this->determineSelectedFilters();
43 
44  if(!$ilCtrl->getNextClass($this))
45  {
46  $to_hide = false;
47 
48  switch($ilCtrl->getCmd())
49  {
50  case "applyFilter":
51  $this->resetOffset();
52  $this->writeFilterToSession();
53  break;
54 
55  case "resetFilter":
56  $this->resetOffset();
57  $this->resetFilter();
58  break;
59 
60  case "hideSelected":
61  $to_hide = $_POST["item_id"];
62  break;
63 
64  case "hide":
65  $to_hide = array((int)$_GET["hide"]);
66  break;
67 
68  // page selector
69  default:
70  $this->determineOffsetAndOrder();
71  $this->storeNavParameter();
72  break;
73  }
74 
75  if($to_hide)
76  {
77  $obj = $this->getFilterItemByPostVar("hide");
78  $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
79  $obj->setValue($value);
80  $obj->writeToSession();
81  }
82 
83  if(isset($_REQUEST["tbltplcrt"]))
84  {
85  $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
86  }
87  if(isset($_REQUEST["tbltpldel"]))
88  {
89  $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
90  }
91 
92  $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
93  }
94  else
95  {
96  // e.g. repository selector
97  return parent::executeCommand();
98  }
99  }
$_POST['username']
Definition: cron.php:12
$_GET["client_id"]
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
global $ilCtrl
Definition: ilias.php:18
writeFilterToSession()
Write filter values to session.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
determineSelectedFilters()
Determine selected filters.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
resetFilter()
Reset filter.
+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV (   $a_csv)
protected

Definition at line 667 of file class.ilLPTableBaseGUI.php.

References getExportMeta().

668  {
669  foreach($this->getExportMeta() as $caption => $value)
670  {
671  $a_csv->addColumn(strip_tags($caption));
672  $a_csv->addColumn(strip_tags($value));
673  $a_csv->addRow();
674  }
675  $a_csv->addRow();
676  }
getExportMeta()
Build export meta data.
+ Here is the call graph for this function:

◆ fillMetaExcel()

ilLPTableBaseGUI::fillMetaExcel (   $worksheet,
$a_row 
)
protected

Definition at line 656 of file class.ilLPTableBaseGUI.php.

References getExportMeta().

657  {
658  foreach($this->getExportMeta() as $caption => $value)
659  {
660  $worksheet->write($a_row, 0, $caption);
661  $worksheet->write($a_row, 1, $value);
662  $a_row++;
663  }
664  $a_row++;
665  }
getExportMeta()
Build export meta data.
+ Here is the call graph for this function:

◆ formatSeconds()

ilLPTableBaseGUI::formatSeconds (   $seconds,
  $a_shorten_zero = false 
)
protected

Definition at line 700 of file class.ilLPTableBaseGUI.php.

References $rest.

Referenced by buildValueScale(), ilLPObjectStatisticsDailyTableGUI\fillRow(), and ilLPObjectStatisticsTableGUI\fillRow().

701  {
702  $seconds = ((int)$seconds > 0) ? $seconds : 0;
703  if($a_shorten_zero && !$seconds)
704  {
705  return "-";
706  }
707 
708  $hours = floor($seconds / 3600);
709  $rest = $seconds % 3600;
710 
711  $minutes = floor($rest / 60);
712  $rest = $rest % 60;
713 
714  if($rest)
715  {
716  $minutes++;
717  }
718 
719  return sprintf("%dh%02dm",$hours,$minutes);
720  }
$rest
Definition: goto.php:85
+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter (   $as_query = false)

Definition at line 483 of file class.ilLPTableBaseGUI.php.

References $result, ilTable2GUI\getFilterItemByPostVar(), and IL_CAL_DATETIME.

Referenced by ilLPProgressTableGUI\getItems(), ilTrObjectUsersPropsTableGUI\getItems(), ilLPObjectStatisticsDailyTableGUI\getItems(), ilLPObjectStatisticsTableGUI\getItems(), ilLPObjectStatisticsLPTableGUI\getItems(), ilTrSummaryTableGUI\getItems(), and initFilter().

484  {
485  $result = array();
486  foreach($this->filter as $id => $value)
487  {
488  $item = $this->getFilterItemByPostVar($id);
489  switch($id)
490  {
491  case "title":
492  case "country":
493  case "gender":
494  case "city":
495  case "language":
496  case "login":
497  case "firstname":
498  case "lastname":
499  case "mark":
500  case "u_comment":
501  case "institution":
502  case "department":
503  case "title":
504  case "street":
505  case "zipcode":
506  case "email":
507  case "matriculation":
508  case "sel_country":
509  case "query":
510  case "type":
511  case "area":
512  if($value)
513  {
514  $result[$id] = $value;
515  }
516  break;
517 
518  case "status":
519  if($value !== false)
520  {
521  $result[$id] = $value;
522  }
523  break;
524 
525  case "user_total":
526  case "read_count":
527  case "percentage":
528  case "hide":
529  case "spent_seconds":
530  if(is_array($value) && implode("", $value))
531  {
532  $result[$id] = $value;
533  }
534  break;
535 
536  case "registration":
537  case "create_date":
538  case "first_access":
539  case "last_access":
540  case 'status_changed':
541  if($value)
542  {
543  if($value["from"])
544  {
545  $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
546  }
547  if($value["to"])
548  {
549  $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
550  }
551  }
552  break;
553 
554  case "birthday":
555  if($value)
556  {
557  if($value["from"])
558  {
559  $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
560  $result[$id]["from"] = substr($result[$id]["from"], 0, -8)."00:00:00";
561  }
562  if($value["to"])
563  {
564  $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
565  $result[$id]["to"] = substr($result[$id]["to"], 0, -8)."23:59:59";
566  }
567  }
568  break;
569  }
570  }
571 
572  return $result;
573  }
const IL_CAL_DATETIME
$result
getFilterItemByPostVar($a_post_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportMeta()

ilLPTableBaseGUI::getExportMeta ( )
protected

Build export meta data.

Returns
array

Definition at line 627 of file class.ilLPTableBaseGUI.php.

References ilTableGUI\$data, $ilUser, $lng, ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObject\_lookupOwner(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, IL_CAL_UNIX, and ilDatePresentation\setUseRelativeDates().

Referenced by fillMetaCSV(), and fillMetaExcel().

628  {
629  global $lng, $ilObjDataCache, $ilUser, $ilClientIniFile;
630 
631  /* see spec
632  Name of installation
633  Name of the course
634  Permalink to course
635  Owner of course object
636  Date of report generation
637  Reporting period
638  Name of person who generated the report.
639  */
640 
642  include_once './Services/Link/classes/class.ilLink.php';
643 
644  $data = array(
645  $lng->txt("trac_name_of_installation") => $ilClientIniFile->readVariable('client', 'name'),
646  $lng->txt("trac_object_name") => $ilObjDataCache->lookupTitle($this->obj_id),
647  $lng->txt("trac_object_link") => ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id)),
648  $lng->txt("trac_object_owner") => ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id)),
649  $lng->txt("trac_report_date") =>
651  $lng->txt("trac_report_owner") => $ilUser->getFullName()
652  );
653  return $data;
654  }
_lookupOwner($a_id)
lookup object owner
const IL_CAL_DATETIME
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
_lookupFullname($a_user_id)
Lookup Full Name.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

Definition at line 781 of file class.ilLPTableBaseGUI.php.

References $lng, and $options.

Referenced by ilLPObjectStatisticsDailyTableGUI\initFilter(), ilLPObjectStatisticsTableGUI\initFilter(), and ilLPObjectStatisticsLPTableGUI\initFilter().

782  {
783  global $lng;
784 
785  $options = array();
786  for($loop = 0; $loop < 10; $loop++)
787  {
788  $year = date("Y")-$loop;
789  $options[$year] = $year;
790  for($loop2 = 12; $loop2 > 0; $loop2--)
791  {
792  $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
793  if($year.$month <= date("Ym"))
794  {
795  if(!$a_short)
796  {
797  $caption = $year." / ".$lng->txt("month_".$month."_long");
798  }
799  else
800  {
801  $caption = $year."/".$month;
802  }
803  $options[$year."-".$month] = $caption;
804  }
805  }
806  }
807  return $options;
808  }
if(!is_array($argv)) $options
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getMonthsYear()

ilLPTableBaseGUI::getMonthsYear (   $a_year = null,
  $a_short = false 
)
protected

Definition at line 810 of file class.ilLPTableBaseGUI.php.

References $lng.

Referenced by ilLPObjectStatisticsTableGUI\__construct(), ilLPObjectStatisticsTypesTableGUI\__construct(), ilLPObjectStatisticsLPTableGUI\__construct(), ilLPObjectStatisticsTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRow(), ilLPObjectStatisticsLPTableGUI\fillRow(), ilLPObjectStatisticsTypesTableGUI\fillRowCSV(), ilLPObjectStatisticsTableGUI\fillRowCSV(), ilLPObjectStatisticsTypesTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\fillRowExcel(), ilLPObjectStatisticsTableGUI\getGraph(), ilLPObjectStatisticsTypesTableGUI\getGraph(), ilLPObjectStatisticsLPTableGUI\getGraph(), and ilLPObjectStatisticsLPTableGUI\getItems().

811  {
812  global $lng;
813 
814  if(!$a_year)
815  {
816  $a_year = date("Y");
817  }
818 
819  $all = array();
820  for($loop = 1; $loop<13; $loop++)
821  {
822  $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
823  if($a_year."-".$month <= date("Y-m"))
824  {
825  if(!$a_short)
826  {
827  $caption = $lng->txt("month_".$month."_long");
828  }
829  else
830  {
831  $caption = $lng->txt("month_".$month."_short");
832  }
833  $all[$a_year."-".$month] = $caption;
834  }
835  }
836  return $all;
837  }
global $lng
Definition: privfeed.php:40
+ Here is the caller graph for this function:

◆ getPossibleTypes()

ilLPTableBaseGUI::getPossibleTypes (   $a_split_learning_resources = false,
  $a_include_digilib = false,
  $a_allow_undefined_lp = false 
)
protected

Get possible subtypes.

Parameters
bool$a_split_learning_resources
bool$a_include_digilib
bool$a_allow_undefined_lp

Definition at line 334 of file class.ilLPTableBaseGUI.php.

References $lng, $options, IL_COMP_SERVICE, ilRepositoryObjectPluginSlot\isTypePluginWithLP(), and ilPlugin\lookupTxt().

Referenced by ilLPObjectStatisticsDailyTableGUI\initFilter(), ilLPObjectStatisticsTableGUI\initFilter(), and initFilter().

335  {
336  global $lng, $ilPluginAdmin;
337 
338  $options = array();
339 
340  if($a_split_learning_resources)
341  {
342  $options['lm'] = $lng->txt('objs_lm');
343  $options['sahs'] = $lng->txt('objs_sahs');
344  $options['htlm'] = $lng->txt('objs_htlm');
345 
346  if($a_include_digilib)
347  {
348  $options['dbk'] = $lng->txt('objs_dbk');
349  }
350  }
351  else
352  {
353  $options['lres'] = $lng->txt('learning_resources');
354  }
355 
356  $options['crs'] = $lng->txt('objs_crs');
357  $options['grp'] = $lng->txt('objs_grp');
358  $options['exc'] = $lng->txt('objs_exc');
359  $options['tst'] = $lng->txt('objs_tst');
360 
361  if($a_allow_undefined_lp)
362  {
363  $options["file"] = $lng->txt("objs_file");
364  $options["webr"] = $lng->txt("objs_webr");
365  $options["wiki"] = $lng->txt("objs_wiki");
366  }
367 
368  // repository plugins (currently only active)
369  include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
370  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
371  foreach ($pl_names as $pl)
372  {
373  $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
375  {
376  $options[$pl_id] = ilPlugin::lookupTxt("rep_robj", $pl_id, "objs_".$pl_id);
377  }
378  }
379 
380  asort($options);
381  return $options;
382  }
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
if(!is_array($argv)) $options
global $lng
Definition: privfeed.php:40
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableUserColumns()

ilLPTableBaseGUI::getSelectableUserColumns (   $a_in_course = false,
  $a_in_group = false 
)
protected

Definition at line 839 of file class.ilLPTableBaseGUI.php.

References $ilSetting, $lng, ilUserDefinedFields\_getInstance(), ilPrivacySettings\_getInstance(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilObjectLP\getInstance(), isPercentageAvailable(), and UDF_TYPE_WYSIWYG.

Referenced by ilTrObjectUsersPropsTableGUI\getSelectableColumns(), and ilTrMatrixTableGUI\getSelectableColumns().

840  {
841  global $lng, $ilSetting;
842 
843  $cols = $privacy_fields = array();
844 
845  include_once("./Services/User/classes/class.ilUserProfile.php");
846  $up = new ilUserProfile();
847  $up->skipGroup("preferences");
848  $up->skipGroup("settings");
849  $ufs = $up->getStandardFields();
850 
851  // default fields
852  $cols["login"] = array(
853  "txt" => $lng->txt("login"),
854  "default" => true);
855 
856  if(!$this->anonymized)
857  {
858  $cols["firstname"] = array(
859  "txt" => $lng->txt("firstname"),
860  "default" => true);
861  $cols["lastname"] = array(
862  "txt" => $lng->txt("lastname"),
863  "default" => true);
864  }
865 
866  // show only if extended data was activated in lp settings
867  include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
868  $tracking = new ilObjUserTracking();
869  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
870  {
871  $cols["first_access"] = array(
872  "txt" => $lng->txt("trac_first_access"),
873  "default" => true);
874  $cols["last_access"] = array(
875  "txt" => $lng->txt("trac_last_access"),
876  "default" => true);
877  }
878  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
879  {
880  $cols["read_count"] = array(
881  "txt" => $lng->txt("trac_read_count"),
882  "default" => true);
883  }
884  if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS))
885  {
886  $cols["spent_seconds"] = array(
887  "txt" => $lng->txt("trac_spent_seconds"),
888  "default" => true);
889  }
890 
891  if($this->isPercentageAvailable($this->obj_id))
892  {
893  $cols["percentage"] = array(
894  "txt" => $lng->txt("trac_percentage"),
895  "default" => true);
896  }
897 
898  // do not show status if learning progress is deactivated
899  $olp = ilObjectLP::getInstance($this->obj_id);
900  if($olp->isActive())
901  {
902  $cols["status"] = array(
903  "txt" => $lng->txt("trac_status"),
904  "default" => true);
905 
906  $cols['status_changed'] = array(
907  'txt' => $lng->txt('trac_status_changed'),
908  'default' => false);
909  }
910 
911  if($this->type != "lm")
912  {
913  $cols["mark"] = array(
914  "txt" => $lng->txt("trac_mark"),
915  "default" => true);
916  }
917 
918  $cols["u_comment"] = array(
919  "txt" => $lng->txt("trac_comment"),
920  "default" => false);
921 
922  $cols["create_date"] = array(
923  "txt" => $lng->txt("create_date"),
924  "default" => false);
925  $cols["language"] = array(
926  "txt" => $lng->txt("language"),
927  "default" => false);
928 
929  // add user data only if object is [part of] course
930  if(!$this->anonymized &&
931  ($a_in_course || $a_in_group))
932  {
933  // only show if export permission is granted
934  include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
935  if(ilPrivacySettings::_getInstance()->checkExportAccess($this->ref_id))
936  {
937  // other user profile fields
938  foreach ($ufs as $f => $fd)
939  {
940  if (!isset($cols[$f]) && $f != "username" && !$fd["lists_hide"])
941  {
942  if($a_in_course &&
943  !($fd["course_export_fix_value"] || $ilSetting->get("usr_settings_course_export_".$f)))
944  {
945  continue;
946  }
947  if($a_in_group &&
948  !($fd["group_export_fix_value"] || $ilSetting->get("usr_settings_group_export_".$f)))
949  {
950  continue;
951  }
952 
953  $cols[$f] = array(
954  "txt" => $lng->txt($f),
955  "default" => false);
956 
957  $privacy_fields[] = $f;
958  }
959  }
960 
961  // additional defined user data fields
962  include_once './Services/User/classes/class.ilUserDefinedFields.php';
963  $user_defined_fields = ilUserDefinedFields::_getInstance();
964  if($a_in_course)
965  {
966  $user_defined_fields = $user_defined_fields->getCourseExportableFields();
967  }
968  else
969  {
970  $user_defined_fields = $user_defined_fields->getGroupExportableFields();
971  }
972  foreach($user_defined_fields as $definition)
973  {
974  if($definition["field_type"] != UDF_TYPE_WYSIWYG)
975  {
976  $f = "udf_".$definition["field_id"];
977  $cols[$f] = array(
978  "txt" => $definition["field_name"],
979  "default" => false);
980 
981  $privacy_fields[] = $f;
982  }
983  }
984  }
985  }
986 
987  return array($cols, $privacy_fields);
988  }
static _getInstance()
Get instance.
Class ilUserProfile.
const UDF_TYPE_WYSIWYG
global $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
static _getInstance()
Get instance of ilPrivacySettings.
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFilter()

ilLPTableBaseGUI::initFilter (   $a_split_learning_resources = false,
  $a_include_no_status_filter = true 
)

Init filter.

Parameters
bool$a_split_learning_resources

Definition at line 206 of file class.ilLPTableBaseGUI.php.

References $lng, $options, $si, ilTable2GUI\addFilterItem(), getCurrentFilter(), getPossibleTypes(), ilTable2GUI\setDisableFilterHiding(), ilTextInputGUI\setMaxLength(), and ilRepositorySelectorInputGUI\setSelectText().

207  {
208  global $lng, $ilObjDataCache;
209 
210  $this->setDisableFilterHiding(true);
211 
212  // object type selection
213  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
214  $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
215  $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
216  $this->addFilterItem($si);
217  $si->readFromSession();
218  if(!$si->getValue())
219  {
220  $si->setValue("crs");
221  }
222  $this->filter["type"] = $si->getValue();
223 
224  // hidden items
225  include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
226  $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
227  $this->addFilterItem($msi);
228  $msi->readFromSession();
229  $this->filter["hide"] = $msi->getValue();
230  if($this->filter["hide"])
231  {
232  // create options from current value
233  $types = $this->getCurrentFilter(true);
234  $type = $types["type"];
235  $options = array();
236  if($type == 'lres')
237  {
238  $type = array('lm','sahs','htlm','dbk');
239  }
240  else
241  {
242  $type = array($type);
243  }
244  foreach($this->filter["hide"] as $obj_id)
245  {
246  if(in_array($ilObjDataCache->lookupType($obj_id), $type))
247  {
248  $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
249  }
250  }
251  $msi->setOptions($options);
252  }
253 
254  // title/description
255  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
256  $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
257  $ti->setMaxLength(64);
258  $ti->setSize(20);
259  $this->addFilterItem($ti);
260  $ti->readFromSession();
261  $this->filter["query"] = $ti->getValue();
262 
263  // repository area selection
264  include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
265  $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
266  $rs->setSelectText($lng->txt("trac_select_area"));
267  $this->addFilterItem($rs);
268  $rs->readFromSession();
269  $this->filter["area"] = $rs->getValue();
270 
271  // hide "not started yet"
272  if($a_include_no_status_filter)
273  {
274  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
275  $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
276  $this->addFilterItem($cb);
277  $cb->readFromSession();
278  $this->filter["status"] = $cb->getChecked();
279  }
280  }
This class represents a selection list property in a property form.
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
This class represents a multi selection list property in a property form.
if(!is_array($argv)) $options
This class represents a repository selector in a property form.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:40
getCurrentFilter($as_query=false)
+ Here is the call graph for this function:

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable (   $a_obj_id)
protected

Definition at line 575 of file class.ilLPTableBaseGUI.php.

References ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_OBJECTIVES, ilLPObjSettings\LP_MODE_SCORM, ilLPObjSettings\LP_MODE_TEST_PASSED, ilLPObjSettings\LP_MODE_TLT, and ilLPObjSettings\LP_MODE_VISITS.

Referenced by ilLPProgressTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilTrSummaryTableGUI\fillRow(), ilTrSummaryTableGUI\getItems(), and getSelectableUserColumns().

576  {
577  // :TODO:
578  $olp = ilObjectLP::getInstance($a_obj_id);
579  $mode = $olp->getCurrentMode();
580  if(in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
585  {
586  return true;
587  }
588  return false;
589  }
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTitle()

ilLPTableBaseGUI::parseTitle (   $a_obj_id,
  $action,
  $a_user_id = false 
)
protected

Definition at line 591 of file class.ilLPTableBaseGUI.php.

References $ilUser, $lng, ilObjectLP\getInstance(), ilObjectFactory\getInstanceByObjId(), ilTable2GUI\setDescription(), and ilTable2GUI\setTitle().

Referenced by ilTrSummaryTableGUI\__construct(), ilTrUserObjectsPropsTableGUI\__construct(), ilLPProgressTableGUI\__construct(), ilTrMatrixTableGUI\__construct(), and ilTrObjectUsersPropsTableGUI\__construct().

592  {
593  global $lng, $ilObjDataCache, $ilUser;
594 
595  $user = "";
596  if($a_user_id)
597  {
598  if($a_user_id != $ilUser->getId())
599  {
600  $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
601  }
602  else
603  {
604  $a_user = $ilUser;
605  }
606  $user .= ", ".$a_user->getFullName(); // " [".$a_user->getLogin()."]";
607  }
608 
609  if($a_obj_id != ROOT_FOLDER_ID)
610  {
611  $this->setTitle($lng->txt($action).": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
612 
613  $olp = ilObjectLP::getInstance($a_obj_id);
614  $this->setDescription($this->lng->txt('trac_mode').": ".$olp->getModeText($olp->getCurrentMode()));
615  }
616  else
617  {
618  $this->setTitle($lng->txt($action));
619  }
620  }
setDescription($a_val)
Set description.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

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

Definition at line 384 of file class.ilLPTableBaseGUI.php.

References $lng, $path, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilFormat\_secondsToString(), ilDatePresentation\formatDate(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, and ilUtil\img().

Referenced by ilTrObjectUsersPropsTableGUI\fillRow(), ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), and ilTrMatrixTableGUI\fillRowExcel().

385  {
386  global $lng;
387 
388  // get rid of aggregation
389  $pos = strrpos($id, "_");
390  if($pos !== false)
391  {
392  $function = strtoupper(substr($id, $pos+1));
393  if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
394  {
395  $id = substr($id, 0, $pos);
396  }
397  }
398 
399  if(trim($value) == "" && $id != "status")
400  {
401  if($id == "title" && get_class($this) != "ilTrObjectUsersPropsTableGUI")
402  {
403  return "--".$lng->txt("none")."--";
404  }
405  return " ";
406  }
407 
408  switch($id)
409  {
410  case "first_access":
411  case "create_date":
412  case 'status_changed':
414  break;
415 
416  case "last_access":
418  break;
419 
420  case "birthday":
421  $value = ilDatePresentation::formatDate(new ilDate($value, IL_CAL_DATE));
422  break;
423 
424  case "spent_seconds":
425  if(in_array($type, array("exc")))
426  {
427  $value = "-";
428  }
429  else
430  {
431  include_once("./Services/Utilities/classes/class.ilFormat.php");
432  $value = ilFormat::_secondsToString($value);
433  }
434  break;
435 
436  case "percentage":
437  /* :TODO:
438  if(in_array(strtolower($this->status_class),
439  array("illpstatusmanual", "illpstatusscormpackage", "illpstatustestfinished")) ||
440  $type == "exc"))
441  */
442  if(false)
443  {
444  $value = "-";
445  }
446  else
447  {
448  $value = $value."%";
449  }
450  break;
451 
452  case "mark":
453  if(in_array($type, array("lm", "dbk")))
454  {
455  $value = "-";
456  }
457  break;
458 
459  case "gender":
460  $value = $lng->txt("gender_".$value);
461  break;
462 
463  case "status":
464  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
467  $value = ilUtil::img($path, $text);
468  break;
469 
470  case "language":
471  $lng->loadLanguageModule("meta");
472  $value = $lng->txt("meta_l_".$value);
473  break;
474 
475  case "sel_country":
476  $value = $lng->txt("meta_c_".$value);
477  break;
478  }
479 
480  return $value;
481  }
const IL_CAL_DATETIME
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="")
Build img tag.
_getImagePathForStatus($a_status)
Get image path for status.
const IL_CAL_UNIX
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
_getStatusText($a_status)
Get status alt text.
Class for single dates.
static formatDate(ilDateTime $date)
Format a date public.
Date and time handling
const IL_CAL_DATE
global $lng
Definition: privfeed.php:40
$path
Definition: index.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchFilterListener()

ilLPTableBaseGUI::searchFilterListener (   $a_ref_id,
  $a_data 
)

Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED public.

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

References ilObjectLP\getInstance().

187  {
188  if(is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"]))
189  {
190  return false;
191  }
192  $olp = ilObjectLP::getInstance($a_data["obj_id"]);
193  if(get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
194  !$olp->isActive())
195  {
196  return false;
197  }
198  return true;
199  }
static getInstance($a_obj_id)
+ Here is the call graph for this function:

◆ searchObjects()

ilLPTableBaseGUI::searchObjects ( array  $filter,
  $permission,
array  $preset_obj_ids = null 
)
protected

Search objects that match current filters.

Parameters
array$filter
string$permission
Returns
array

Definition at line 108 of file class.ilLPTableBaseGUI.php.

References $res, QP_COMBINATION_AND, and ilUtil\sendFailure().

Referenced by ilLPProgressTableGUI\getItems(), ilLPObjectStatisticsDailyTableGUI\getItems(), ilLPObjectStatisticsTableGUI\getItems(), ilLPObjectStatisticsLPTableGUI\getItems(), and ilTrSummaryTableGUI\getItems().

109  {
110  global $ilObjDataCache;
111 
112  /* for performance issues: fast search WITHOUT any permission checks
113  include_once "Services/Tracking/classes/class.ilTrQuery.php";
114  return ilTrQuery::searchObjects($filter["type"], $filter["query"],
115  $filter["area"], $filter["hide"], $preset_obj_ids);
116  */
117 
118  include_once './Services/Search/classes/class.ilQueryParser.php';
119 
120  $query_parser =& new ilQueryParser($filter["query"]);
121  $query_parser->setMinWordLength(0);
122  $query_parser->setCombination(QP_COMBINATION_AND);
123  $query_parser->parse();
124  if(!$query_parser->validate())
125  {
126  // echo $query_parser->getMessage();
127  return false;
128  }
129 
130  if($filter["type"] == "lres")
131  {
132  $filter["type"] = array('lm','sahs','htlm','dbk');
133  }
134  else
135  {
136  $filter["type"] = array($filter["type"]);
137  }
138 
139  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
140  $object_search =& new ilLikeObjectSearch($query_parser);
141  $object_search->setFilter($filter["type"]);
142  if($preset_obj_ids)
143  {
144  $object_search->setIdFilter($preset_obj_ids);
145  }
146  $res =& $object_search->performSearch();
147 
148  if($permission)
149  {
150  $res->setRequiredPermission($permission);
151  }
152 
153  $res->setMaxHits(1000);
154  $res->addObserver($this, "searchFilterListener");
155 
156  if(!$this->filter["area"])
157  {
158  $res->filter(ROOT_FOLDER_ID, false);
159  }
160  else
161  {
162  $res->filter($this->filter["area"], false);
163  }
164 
165  $objects = array();
166  foreach($res->getResults() as $obj_data)
167  {
168  $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
169  }
170 
171  // Check if search max hits is reached
172  if($res->isLimitReached())
173  {
174  $this->lng->loadLanguageModule("search");
175  ilUtil::sendFailure(sprintf($this->lng->txt("search_limit_reached"), 1000));
176  }
177 
178  return $objects ? $objects : array();
179  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const QP_COMBINATION_AND
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTimingsWarning()

ilLPTableBaseGUI::showTimingsWarning (   $a_ref_id,
  $a_user_id 
)
protected

Definition at line 678 of file class.ilLPTableBaseGUI.php.

References ilTimingCache\_getTimings(), and ilTimingCache\_showWarning().

Referenced by ilLPProgressTableGUI\fillRow(), ilTrUserObjectsPropsTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRow(), and ilTrMatrixTableGUI\fillRow().

679  {
680  include_once 'Modules/Course/classes/Timings/class.ilTimingCache.php';
681  if(ilTimingCache::_showWarning($a_ref_id, $a_user_id))
682  {
683  $timings = ilTimingCache::_getTimings($a_ref_id);
684  if($timings['item']['changeable'] and $timings['user'][$a_user_id]['end'])
685  {
686  $end = $timings['user'][$a_user_id]['end'];
687  }
688  else if ($timings['item']['suggestion_end'])
689  {
690  $end = $timings['item']['suggestion_end'];
691  }
692  else
693  {
694  $end = true;
695  }
696  return $end;
697  }
698  }
_showWarning($a_ref_id, $a_usr_id)
& _getTimings($a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $anonymized

ilLPTableBaseGUI::$anonymized
protected

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

◆ $filter

ilLPTableBaseGUI::$filter
protected

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

Referenced by ilTrSummaryTableGUI\getItems().


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