ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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="")
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 searchFilterListener ($a_ref_id, $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED @access 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)
 set table data @access public More...
 
 getData ()
 
 dataExists ()
 
 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) @access public More...
 
 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 (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table @access public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 ilTableGUI ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate (&$a_tpl)
 set template @access public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title @access public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page @access public More...
 
 setHeaderNames ($a_header_names)
 set table header names @access public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns @access public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars @access public More...
 
 setColumnWidth ($a_column_width)
 set table column widths @access public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width @access 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) @access public More...
 
 setOffset ($a_offset)
 set dataset offset @access public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column @access public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction @access public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction @access 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 @access 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

 sendMail (array $a_user_ids, $a_parent_obj, $a_parent_cmd)
 
 searchObjects (array $filter, $permission, array $preset_obj_ids=null, $a_check_lp_activation=true)
 Search objects that match current filters. More...
 
 buildPath ($ref_ids)
 Build path with deep-link. More...
 
 getPossibleTypes ($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
 Get possible subtypes. More...
 
 parseValue ($id, $value, $type)
 
 isPercentageAvailable ($a_obj_id)
 
 parseTitle ($a_obj_id, $action, $a_user_id=false)
 
 getExportMeta ()
 Build export meta data. More...
 
 fillMetaExcel ($worksheet, &$a_row)
 Add meta information to excel export. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 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...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel ($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

 $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
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $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

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 = "" 
)

Constructor.

Reimplemented from ilTable2GUI.

Reimplemented in ilTrMatrixTableGUI.

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

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)

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

+ Here is the call graph for this function:

Member Function Documentation

◆ anonymizeValue()

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

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

797 {
798 // currently inactive
799 return $a_value;
800
801 if(is_numeric($a_value))
802 {
803 $threshold = 3;
804 $a_value = (int)$a_value;
805 if($a_value <= $threshold)
806 {
807 if(!$a_force_number)
808 {
809 return "0-".$threshold;
810 }
811 else
812 {
813 return $threshold;
814 }
815 }
816 }
817 return $a_value;
818 }

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

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

354 {
355 global $tree, $ilCtrl;
356
357 include_once './Services/Link/classes/class.ilLink.php';
358
359 if(!count($ref_ids))
360 {
361 return false;
362 }
363 foreach($ref_ids as $ref_id)
364 {
365 $path = "...";
366 $counter = 0;
367 $path_full = $tree->getPathFull($ref_id);
368 foreach($path_full as $data)
369 {
370 if(++$counter < (count($path_full)-1))
371 {
372 continue;
373 }
374 $path .= " &raquo; ";
375 if($ref_id != $data['ref_id'])
376 {
377 $path .= $data['title'];
378 }
379 else
380 {
381 $path .= ('<a target="_top" href="'.
382 ilLink::_getLink($data['ref_id'],$data['type']).'">'.
383 $data['title'].'</a>');
384 }
385 }
386
388 }
389 return $result;
390 }
$result
global $ilCtrl
Definition: ilias.php:18
$ref_id
Definition: sahs_server.php:39
$path
Definition: index.php:22

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

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

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

821 {
822 $step = 0;
823 if($a_max_value)
824 {
825 $step = $a_max_value / 10;
826 $base = ceil(log($step, 10));
827 $fac = ceil($step / pow(10, ($base - 1)));
828 $step = pow(10, $base - 1) * $fac;
829 }
830 if ($step <= 1)
831 {
832 $step = 1;
833 }
834 $ticks = range(0, $a_max_value+$step, $step);
835
836 $value_ticks = array(0 => 0);
837 foreach($ticks as $tick)
838 {
839 $value = $tvalue = $tick;
840 if($a_anonymize)
841 {
842 $value = $this->anonymizeValue($value, true);
843 $tvalue = $this->anonymizeValue($tvalue);
844 }
845 if($a_format_seconds)
846 {
847 $tvalue = $this->formatSeconds($value);
848 }
849 $value_ticks[$value] = $tvalue;
850 }
851
852 return $value_ticks;
853 }
formatSeconds($seconds, $a_shorten_zero=false)
anonymizeValue($a_value, $a_force_number=false)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

Execute command.

Reimplemented from ilTable2GUI.

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

39 {
40 global $ilCtrl, $lng;
41
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 case "mailselectedusers":
69 if(!sizeof($_POST["uid"]))
70 {
71 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
72 }
73 else
74 {
75 $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
76 }
77 break;
78
79 // page selector
80 default:
82 $this->storeNavParameter();
83 break;
84 }
85
86 if($to_hide)
87 {
88 $obj = $this->getFilterItemByPostVar("hide");
89 $value = array_unique(array_merge((array)$obj->getValue(), $to_hide));
90 $obj->setValue($value);
91 $obj->writeToSession();
92 }
93
94 if(isset($_REQUEST["tbltplcrt"]))
95 {
96 $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
97 }
98 if(isset($_REQUEST["tbltpldel"]))
99 {
100 $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
101 }
102
103 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
104 }
105 else
106 {
107 // e.g. repository selector
108 return parent::executeCommand();
109 }
110 }
$_GET["client_id"]
sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
resetFilter()
Reset filter.
writeFilterToSession()
Write filter values to session.
determineSelectedFilters()
Determine selected filters.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST['username']
Definition: cron.php:12
global $lng
Definition: privfeed.php:40
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7

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

+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV (   $a_csv)
protected

Add meta information to csv export.

Likely to be overwritten by derived class.

Parameters
object$a_csvcurrent file

Reimplemented from ilTable2GUI.

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

742 {
743 foreach($this->getExportMeta() as $caption => $value)
744 {
745 $a_csv->addColumn(strip_tags($caption));
746 $a_csv->addColumn(strip_tags($value));
747 $a_csv->addRow();
748 }
749 $a_csv->addRow();
750 }
getExportMeta()
Build export meta data.

References getExportMeta().

+ Here is the call graph for this function:

◆ fillMetaExcel()

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

Add meta information to excel export.

Likely to be overwritten by derived class.

Parameters
object$a_worksheetcurrent sheet
int$a_rowrow counter

Reimplemented from ilTable2GUI.

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

731 {
732 foreach($this->getExportMeta() as $caption => $value)
733 {
734 $worksheet->write($a_row, 0, $caption);
735 $worksheet->write($a_row, 1, $value);
736 $a_row++;
737 }
738 $a_row++;
739 }

References getExportMeta().

+ Here is the call graph for this function:

◆ formatSeconds()

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

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

775 {
776 $seconds = ((int)$seconds > 0) ? $seconds : 0;
777 if($a_shorten_zero && !$seconds)
778 {
779 return "-";
780 }
781
782 $hours = floor($seconds / 3600);
783 $rest = $seconds % 3600;
784
785 $minutes = floor($rest / 60);
786 $rest = $rest % 60;
787
788 if($rest)
789 {
790 $minutes++;
791 }
792
793 return sprintf("%dh%02dm",$hours,$minutes);
794 }
$rest
Definition: goto.php:85

References $rest.

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

+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter (   $as_query = false)

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

549 {
550 $result = array();
551 foreach($this->filter as $id => $value)
552 {
553 $item = $this->getFilterItemByPostVar($id);
554 switch($id)
555 {
556 case "title":
557 case "country":
558 case "gender":
559 case "city":
560 case "language":
561 case "login":
562 case "firstname":
563 case "lastname":
564 case "mark":
565 case "u_comment":
566 case "institution":
567 case "department":
568 case "title":
569 case "street":
570 case "zipcode":
571 case "email":
572 case "matriculation":
573 case "sel_country":
574 case "query":
575 case "type":
576 case "area":
577 if($value)
578 {
579 $result[$id] = $value;
580 }
581 break;
582
583 case "status":
584 if($value !== false)
585 {
586 $result[$id] = $value;
587 }
588 break;
589
590 case "user_total":
591 case "read_count":
592 case "percentage":
593 case "hide":
594 case "spent_seconds":
595 if(is_array($value) && implode("", $value))
596 {
597 $result[$id] = $value;
598 }
599 break;
600
601 case "registration":
602 case "create_date":
603 case "first_access":
604 case "last_access":
605 case 'status_changed':
606 if($value)
607 {
608 if($value["from"])
609 {
610 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
611 }
612 if($value["to"])
613 {
614 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
615 }
616 }
617 break;
618
619 case "birthday":
620 if($value)
621 {
622 if($value["from"])
623 {
624 $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
625 $result[$id]["from"] = substr($result[$id]["from"], 0, -8)."00:00:00";
626 }
627 if($value["to"])
628 {
629 $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
630 $result[$id]["to"] = substr($result[$id]["to"], 0, -8)."23:59:59";
631 }
632 }
633 break;
634 }
635 }
636
637 return $result;
638 }
const IL_CAL_DATETIME

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

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

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

694 {
695 global $lng, $ilObjDataCache, $ilUser, $ilClientIniFile;
696
697 /* see spec
698 Name of installation
699 Name of the course
700 Permalink to course
701 Owner of course object
702 Date of report generation
703 Reporting period
704 Name of person who generated the report.
705 */
706
708 include_once './Services/Link/classes/class.ilLink.php';
709
710 $data = array();
711 $data[$lng->txt("trac_name_of_installation")] = $ilClientIniFile->readVariable('client', 'name');
712
713 if($this->obj_id)
714 {
715 $data[$lng->txt("trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
716 if($this->ref_id)
717 {
718 $data[$lng->txt("trac_object_link")] = ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id));
719 }
720 $data[$lng->txt("trac_object_owner")] = ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id));
721 }
722
723 $data[$lng->txt("trac_report_date")] =
725 $data[$lng->txt("trac_report_owner")] = $ilUser->getFullName();
726
727 return $data;
728 }
const IL_CAL_UNIX
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
_lookupFullname($a_user_id)
Lookup Full Name.
_lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
global $ilUser
Definition: imgupload.php:15

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

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

856 {
857 global $lng;
858
859 $options = array();
860 for($loop = 0; $loop < 10; $loop++)
861 {
862 $year = date("Y")-$loop;
863 $options[$year] = $year;
864 for($loop2 = 12; $loop2 > 0; $loop2--)
865 {
866 $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
867 if($year.$month <= date("Ym"))
868 {
869 if(!$a_short)
870 {
871 $caption = $year." / ".$lng->txt("month_".$month."_long");
872 }
873 else
874 {
875 $caption = $year."/".$month;
876 }
877 $options[$year."-".$month] = $caption;
878 }
879 }
880 }
881 return $options;
882 }
if(!is_array($argv)) $options

References $lng, and $options.

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

+ Here is the caller graph for this function:

◆ getMonthsYear()

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

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

885 {
886 global $lng;
887
888 if(!$a_year)
889 {
890 $a_year = date("Y");
891 }
892
893 $all = array();
894 for($loop = 1; $loop<13; $loop++)
895 {
896 $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
897 if($a_year."-".$month <= date("Y-m"))
898 {
899 if(!$a_short)
900 {
901 $caption = $lng->txt("month_".$month."_long");
902 }
903 else
904 {
905 $caption = $lng->txt("month_".$month."_short");
906 }
907 $all[$a_year."-".$month] = $caption;
908 }
909 }
910 return $all;
911 }

References $lng.

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

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

400 {
401 global $lng, $ilPluginAdmin;
402
403 $options = array();
404
405 if($a_split_learning_resources)
406 {
407 $options['lm'] = $lng->txt('objs_lm');
408 $options['sahs'] = $lng->txt('objs_sahs');
409 $options['htlm'] = $lng->txt('objs_htlm');
410
411 if($a_include_digilib)
412 {
413 $options['dbk'] = $lng->txt('objs_dbk');
414 }
415 }
416 else
417 {
418 $options['lres'] = $lng->txt('learning_resources');
419 }
420
421 $options['crs'] = $lng->txt('objs_crs');
422 $options['grp'] = $lng->txt('objs_grp');
423 $options['exc'] = $lng->txt('objs_exc');
424 $options['file'] = $lng->txt('objs_file');
425 $options['mcst'] = $lng->txt('objs_mcst');
426 $options['svy'] = $lng->txt('objs_svy');
427 $options['tst'] = $lng->txt('objs_tst');
428 $options['prg'] = $lng->txt('objs_prg');
429
430 if($a_allow_undefined_lp)
431 {
432 $options["webr"] = $lng->txt("objs_webr");
433 $options["wiki"] = $lng->txt("objs_wiki");
434 }
435
436 // repository plugins (currently only active)
437 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
438 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
439 foreach ($pl_names as $pl)
440 {
441 $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
443 {
444 $options[$pl_id] = ilPlugin::lookupTxt("rep_robj", $pl_id, "objs_".$pl_id);
445 }
446 }
447
448 asort($options);
449 return $options;
450 }
const IL_COMP_SERVICE
static lookupTxt($a_mod_prefix, $a_pl_id, $a_lang_var)
Lookup language text.
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.

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

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

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

914 {
915 global $lng, $ilSetting;
916
917 $cols = $privacy_fields = array();
918
919 include_once("./Services/User/classes/class.ilUserProfile.php");
920 $up = new ilUserProfile();
921 $up->skipGroup("preferences");
922 $up->skipGroup("settings");
923 $up->skipGroup("interests");
924 $ufs = $up->getStandardFields();
925
926 // default fields
927 $cols["login"] = array(
928 "txt" => $lng->txt("login"),
929 "default" => true);
930
931 if(!$this->anonymized)
932 {
933 $cols["firstname"] = array(
934 "txt" => $lng->txt("firstname"),
935 "default" => true);
936 $cols["lastname"] = array(
937 "txt" => $lng->txt("lastname"),
938 "default" => true);
939 }
940
941 // show only if extended data was activated in lp settings
942 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
943 $tracking = new ilObjUserTracking();
944 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS))
945 {
946 $cols["first_access"] = array(
947 "txt" => $lng->txt("trac_first_access"),
948 "default" => true);
949 $cols["last_access"] = array(
950 "txt" => $lng->txt("trac_last_access"),
951 "default" => true);
952 }
953 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT))
954 {
955 $cols["read_count"] = array(
956 "txt" => $lng->txt("trac_read_count"),
957 "default" => true);
958 }
959 if($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS) &&
961 {
962 $cols["spent_seconds"] = array(
963 "txt" => $lng->txt("trac_spent_seconds"),
964 "default" => true);
965 }
966
967 if($this->isPercentageAvailable($this->obj_id))
968 {
969 $cols["percentage"] = array(
970 "txt" => $lng->txt("trac_percentage"),
971 "default" => true);
972 }
973
974 // do not show status if learning progress is deactivated
975 $olp = ilObjectLP::getInstance($this->obj_id);
976 if($olp->isActive())
977 {
978 $cols["status"] = array(
979 "txt" => $lng->txt("trac_status"),
980 "default" => true);
981
982 $cols['status_changed'] = array(
983 'txt' => $lng->txt('trac_status_changed'),
984 'default' => false);
985 }
986
987 if(ilObjectLP::supportsMark($this->type))
988 {
989 $cols["mark"] = array(
990 "txt" => $lng->txt("trac_mark"),
991 "default" => true);
992 }
993
994 $cols["u_comment"] = array(
995 "txt" => $lng->txt("trac_comment"),
996 "default" => false);
997
998 $cols["create_date"] = array(
999 "txt" => $lng->txt("create_date"),
1000 "default" => false);
1001 $cols["language"] = array(
1002 "txt" => $lng->txt("language"),
1003 "default" => false);
1004
1005 // add user data only if object is [part of] course
1006 if(!$this->anonymized &&
1007 ($a_in_course || $a_in_group))
1008 {
1009 // only show if export permission is granted
1010 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
1011 if(ilPrivacySettings::_getInstance()->checkExportAccess($this->ref_id))
1012 {
1013 // other user profile fields
1014 foreach ($ufs as $f => $fd)
1015 {
1016 if (!isset($cols[$f]) && $f != "username" && !$fd["lists_hide"])
1017 {
1018 if($a_in_course &&
1019 !($fd["course_export_fix_value"] || $ilSetting->get("usr_settings_course_export_".$f)))
1020 {
1021 continue;
1022 }
1023 if($a_in_group &&
1024 !($fd["group_export_fix_value"] || $ilSetting->get("usr_settings_group_export_".$f)))
1025 {
1026 continue;
1027 }
1028
1029 $cols[$f] = array(
1030 "txt" => $lng->txt($f),
1031 "default" => false);
1032
1033 $privacy_fields[] = $f;
1034 }
1035 }
1036
1037 // additional defined user data fields
1038 include_once './Services/User/classes/class.ilUserDefinedFields.php';
1039 $user_defined_fields = ilUserDefinedFields::_getInstance();
1040 if($a_in_course)
1041 {
1042 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
1043 }
1044 else
1045 {
1046 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
1047 }
1048 foreach($user_defined_fields as $definition)
1049 {
1050 if($definition["field_type"] != UDF_TYPE_WYSIWYG)
1051 {
1052 $f = "udf_".$definition["field_id"];
1053 $cols[$f] = array(
1054 "txt" => $definition["field_name"],
1055 "default" => false);
1056
1057 $privacy_fields[] = $f;
1058 }
1059 }
1060 }
1061 }
1062
1063 return array($cols, $privacy_fields);
1064 }
const UDF_TYPE_WYSIWYG
static supportsMark($a_obj_type)
static supportsSpentSeconds($a_obj_type)
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance.
Class ilUserProfile.
global $ilSetting
Definition: privfeed.php:40

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

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

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

272 {
273 global $lng, $ilObjDataCache;
274
275 $this->setDisableFilterHiding(true);
276
277 // object type selection
278 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
279 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
280 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
281 $this->addFilterItem($si);
282 $si->readFromSession();
283 if(!$si->getValue())
284 {
285 $si->setValue("crs");
286 }
287 $this->filter["type"] = $si->getValue();
288
289 // hidden items
290 include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
291 $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
292 $this->addFilterItem($msi);
293 $msi->readFromSession();
294 $this->filter["hide"] = $msi->getValue();
295 if($this->filter["hide"])
296 {
297 // create options from current value
298 $types = $this->getCurrentFilter(true);
299 $type = $types["type"];
300 $options = array();
301 if($type == 'lres')
302 {
303 $type = array('lm','sahs','htlm','dbk');
304 }
305 else
306 {
307 $type = array($type);
308 }
309 foreach($this->filter["hide"] as $obj_id)
310 {
311 if(in_array($ilObjDataCache->lookupType($obj_id), $type))
312 {
313 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
314 }
315 }
316 $msi->setOptions($options);
317 }
318
319 // title/description
320 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
321 $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
322 $ti->setMaxLength(64);
323 $ti->setSize(20);
324 $this->addFilterItem($ti);
325 $ti->readFromSession();
326 $this->filter["query"] = $ti->getValue();
327
328 // repository area selection
329 include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
330 $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
331 $rs->setSelectText($lng->txt("trac_select_area"));
332 $this->addFilterItem($rs);
333 $rs->readFromSession();
334 $this->filter["area"] = $rs->getValue();
335
336 // hide "not started yet"
337 if($a_include_no_status_filter)
338 {
339 include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
340 $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
341 $this->addFilterItem($cb);
342 $cb->readFromSession();
343 $this->filter["status"] = $cb->getChecked();
344 }
345 }
This class represents a checkbox property in a property form.
getCurrentFilter($as_query=false)
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.
This class represents a repository selector in a property form.
This class represents a selection list property in a property form.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
This class represents a text property in a property form.

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

+ Here is the call graph for this function:

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable (   $a_obj_id)
protected

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

641 {
642 // :TODO:
643 $olp = ilObjectLP::getInstance($a_obj_id);
644 $mode = $olp->getCurrentMode();
645 if(in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
647 // ilLPObjSettings::LP_MODE_OBJECTIVES,
651 {
652 return true;
653 }
654 return false;
655 }

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

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

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

658 {
659 global $lng, $ilObjDataCache, $ilUser;
660
661 $user = "";
662 if($a_user_id)
663 {
664 if($a_user_id != $ilUser->getId())
665 {
666 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
667 }
668 else
669 {
670 $a_user = $ilUser;
671 }
672 $user .= ", ".$a_user->getFullName(); // " [".$a_user->getLogin()."]";
673 }
674
675 if($a_obj_id != ROOT_FOLDER_ID)
676 {
677 $this->setTitle($lng->txt($action).": ".$ilObjDataCache->lookupTitle($a_obj_id).$user);
678
679 $olp = ilObjectLP::getInstance($a_obj_id);
680 $this->setDescription($this->lng->txt('trac_mode').": ".$olp->getModeText($olp->getCurrentMode()));
681 }
682 else
683 {
684 $this->setTitle($lng->txt($action));
685 }
686 }
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setDescription($a_val)
Set description.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

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

Reimplemented in ilTrSummaryTableGUI.

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

453 {
454 global $lng;
455
456 // get rid of aggregation
457 $pos = strrpos($id, "_");
458 if($pos !== false)
459 {
460 $function = strtoupper(substr($id, $pos+1));
461 if(in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT")))
462 {
463 $id = substr($id, 0, $pos);
464 }
465 }
466
467 if(trim($value) == "" && $id != "status")
468 {
469 if($id == "title" &&
470 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
471 get_class($this) != "ilTrMatrixTableGUI")
472 {
473 return "--".$lng->txt("none")."--";
474 }
475 return " ";
476 }
477
478 switch($id)
479 {
480 case "first_access":
481 case "create_date":
482 case 'status_changed':
484 break;
485
486 case "last_access":
488 break;
489
490 case "birthday":
492 break;
493
494 case "spent_seconds":
496 {
497 $value = "-";
498 }
499 else
500 {
501 include_once("./Services/Utilities/classes/class.ilFormat.php");
502 $value = ilFormat::_secondsToString($value, ($value < 3600 ? true : false)); // #14858
503 }
504 break;
505
506 case "percentage":
507 if(false /* $this->isPercentageAvailable() */)
508 {
509 $value = "-";
510 }
511 else
512 {
513 $value = $value."%";
514 }
515 break;
516
517 case "mark":
518 if(!ilObjectLP::supportsMark($type))
519 {
520 $value = "-";
521 }
522 break;
523
524 case "gender":
525 $value = $lng->txt("gender_".$value);
526 break;
527
528 case "status":
529 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
532 $value = ilUtil::img($path, $text);
533 break;
534
535 case "language":
536 $lng->loadLanguageModule("meta");
537 $value = $lng->txt("meta_l_".$value);
538 break;
539
540 case "sel_country":
541 $value = $lng->txt("meta_c_".$value);
542 break;
543 }
544
545 return $value;
546 }
const IL_CAL_DATE
Class for single dates.
_secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
_getImagePathForStatus($a_status)
Get image path for status.
_getStatusText($a_status, $a_lng=null)
Get status alt text.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
$text

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

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

+ 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 @access public.

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

252 {
253 if(is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"]))
254 {
255 return false;
256 }
257 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
258 if(get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
259 !$olp->isActive())
260 {
261 return false;
262 }
263 return true;
264 }

References ilObjectLP\getInstance().

+ Here is the call graph for this function:

◆ searchObjects()

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

Search objects that match current filters.

Parameters
array$filter
string$permission
arraypreset obj_ids
boolcheck lp activation
Returns
array

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

175 {
176 global $ilObjDataCache;
177
178 include_once './Services/Search/classes/class.ilQueryParser.php';
179
180 $query_parser =& new ilQueryParser($filter["query"]);
181 $query_parser->setMinWordLength(0);
182 $query_parser->setCombination(QP_COMBINATION_AND);
183 $query_parser->parse();
184 if(!$query_parser->validate())
185 {
186 ilLoggerFactory::getLogger('trac')->notice($query_parser->getMessage());
187 // echo $query_parser->getMessage();
188 return false;
189 }
190
191 if($filter["type"] == "lres")
192 {
193 $filter["type"] = array('lm','sahs','htlm','dbk');
194 }
195 else
196 {
197 $filter["type"] = array($filter["type"]);
198 }
199
200 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
201 $object_search =& new ilLikeObjectSearch($query_parser);
202 $object_search->setFilter($filter["type"]);
203 if($preset_obj_ids)
204 {
205 $object_search->setIdFilter($preset_obj_ids);
206 }
207 $res =& $object_search->performSearch();
208
209 if($permission)
210 {
211 $res->setRequiredPermission($permission);
212 }
213
214 $res->setMaxHits(1000);
215
216 if($a_check_lp_activation)
217 {
218 $res->addObserver($this, "searchFilterListener");
219 }
220
221 if(!$this->filter["area"])
222 {
223 $res->filter(ROOT_FOLDER_ID, false);
224 }
225 else
226 {
227 $res->filter($this->filter["area"], false);
228 }
229
230 $objects = array();
231 foreach($res->getResults() as $obj_data)
232 {
233 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
234 }
235
236 // Check if search max hits is reached
237 if($res->isLimitReached())
238 {
239 $this->lng->loadLanguageModule("search");
240 ilUtil::sendFailure(sprintf($this->lng->txt("search_limit_reached"), 1000));
241 }
242
243 return $objects ? $objects : array();
244 }
const QP_COMBINATION_AND
static getLogger($a_component_id)
Get component logger.

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendMail()

ilLPTableBaseGUI::sendMail ( array  $a_user_ids,
  $a_parent_obj,
  $a_parent_cmd 
)
protected

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

113 {
114 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
115
116 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
117
118 $rcps = array();
119 foreach($a_user_ids as $usr_id)
120 {
121 $rcps[] = ilObjUser::_lookupLogin($usr_id);
122 }
123
124 $template = array();
125 $sig = null;
126
127 // repository-object-specific
128 $ref_id = (int)$_REQUEST["ref_id"];
129 if($ref_id)
130 {
132 $tmpl_id = $obj_lp->getMailTemplateId();
133
134 if($tmpl_id)
135 {
136 $template = array(
137 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
138 'ref_id' => $ref_id,
139 'ts' => time()
140 );
141 }
142 else
143 {
144 include_once './Services/Link/classes/class.ilLink.php';
146 $sig = rawurlencode(base64_encode($sig));
147 }
148 }
149
152 $a_parent_obj,
153 $a_parent_cmd,
154 array(),
155 array(
156 'type' => 'new',
157 'rcp_to' => implode(',', $rcps),
158 'sig' => $sig
159 ),
160 $template
161 )
162 );
163 }
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
const CONTEXT_KEY
Session parameter for the context.
static _lookupLogin($a_user_id)
lookup login
static _lookupObjectId($a_ref_id)
lookup object id
static redirect($a_script)
http redirect to other script

References $_REQUEST, $ref_id, ilLink\_getLink(), ilObjUser\_lookupLogin(), ilObject\_lookupObjectId(), ilMailFormCall\CONTEXT_KEY, ilObjectLP\getInstance(), ilMailFormCall\getRedirectTarget(), and ilUtil\redirect().

Referenced by executeCommand().

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

753 {
754 include_once 'Modules/Course/classes/Timings/class.ilTimingCache.php';
755 if(ilTimingCache::_showWarning($a_ref_id, $a_user_id))
756 {
757 $timings = ilTimingCache::_getTimings($a_ref_id);
758 if($timings['item']['changeable'] && $timings['user'][$a_user_id]['end'])
759 {
760 $end = $timings['user'][$a_user_id]['end'];
761 }
762 else if ($timings['item']['suggestion_end'])
763 {
764 $end = $timings['item']['suggestion_end'];
765 }
766 else
767 {
768 $end = true;
769 }
770 return $end;
771 }
772 }
& _getTimings($a_ref_id)
_showWarning($a_ref_id, $a_usr_id)

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

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

+ 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(), and searchObjects().


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