ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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="")
 ilTable2GUI 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...
 
 initBaseFilter ($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="")
 ilTable2GUI 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...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. 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
 __construct ($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 (ilExcel $a_excel, &$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)
 
 addToClipboard ()
 Add selected users to clipboard. More...
 
- Protected Member Functions inherited from ilTable2GUI
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. 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 (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$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
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $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 = []
 
 $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
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

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 FILTER_CHECKBOX = 9
 
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 16 of file class.ilLPTableBaseGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

ilTable2GUI constructor.

Parameters
object$a_parent_objob Mostly ILIAS-GUI-Classes
string$a_parent_cmd
string$a_template_context

Reimplemented from ilTable2GUI.

Reimplemented in ilTrMatrixTableGUI.

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

22 {
23 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
24
25 // country names
26 $this->lng->loadLanguageModule("meta");
27
28 include_once("./Services/Object/classes/class.ilObjectLP.php");
29
30 $this->anonymized = (bool) !ilObjUserTracking::_enabledUserRelatedData();
31 if (!$this->anonymized && $this->obj_id) {
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

◆ addToClipboard()

ilLPTableBaseGUI::addToClipboard ( )
protected

Add selected users to clipboard.

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

941 {
942 $users = (array) $_POST['uid'];
943 include_once './Services/User/classes/class.ilUserClipboard.php';
944 $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
945 $clip->add($users);
946 $clip->save();
947
948 $GLOBALS['lng']->loadLanguageModule('user');
949 ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
950 }
$users
Definition: authpage.php:44
$_POST["username"]
getId()
Get element id.
static getInstance($a_usr_id)
Get singelton instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

References $_POST, $GLOBALS, $users, ilTable2GUI\getId(), ilUserClipboard\getInstance(), and ilUtil\sendSuccess().

Referenced by executeCommand().

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

◆ anonymizeValue()

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

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

708 {
709 // currently inactive
710 return $a_value;
711
712 if (is_numeric($a_value)) {
713 $threshold = 3;
714 $a_value = (int) $a_value;
715 if ($a_value <= $threshold) {
716 if (!$a_force_number) {
717 return "0-" . $threshold;
718 } else {
719 return $threshold;
720 }
721 }
722 }
723 return $a_value;
724 }

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

325 {
326 global $tree, $ilCtrl;
327
328 include_once './Services/Link/classes/class.ilLink.php';
329
330 if (!count($ref_ids)) {
331 return false;
332 }
333 foreach ($ref_ids as $ref_id) {
334 $path = "...";
335 $counter = 0;
336 $path_full = $tree->getPathFull($ref_id);
337 foreach ($path_full as $data) {
338 if (++$counter < (count($path_full)-1)) {
339 continue;
340 }
341 $path .= " &raquo; ";
342 if ($ref_id != $data['ref_id']) {
343 $path .= $data['title'];
344 } else {
345 $path .= ('<a target="_top" href="' .
346 ilLink::_getLink($data['ref_id'], $data['type']) . '">' .
347 $data['title'] . '</a>');
348 }
349 }
350
351 $result[$ref_id] = $path;
352 }
353 return $result;
354 }
$result
$counter
global $ilCtrl
Definition: ilias.php:18

References $counter, ilTableGUI\$data, $ilCtrl, $path, $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 726 of file class.ilLPTableBaseGUI.php.

727 {
728 $step = 0;
729 if ($a_max_value) {
730 $step = $a_max_value / 10;
731 $base = ceil(log($step, 10));
732 $fac = ceil($step / pow(10, ($base - 1)));
733 $step = pow(10, $base - 1) * $fac;
734 }
735 if ($step <= 1) {
736 $step = 1;
737 }
738 $ticks = range(0, $a_max_value+$step, $step);
739
740 $value_ticks = array(0 => 0);
741 foreach ($ticks as $tick) {
742 $value = $tvalue = $tick;
743 if ($a_anonymize) {
744 $value = $this->anonymizeValue($value, true);
745 $tvalue = $this->anonymizeValue($tvalue);
746 }
747 if ($a_format_seconds) {
748 $tvalue = $this->formatSeconds($value);
749 }
750 $value_ticks[$value] = $tvalue;
751 }
752
753 return $value_ticks;
754 }
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 $to_hide = false;
46
47 switch ($ilCtrl->getCmd()) {
48 case "applyFilter":
49 $this->resetOffset();
50 $this->writeFilterToSession();
51 break;
52
53 case "resetFilter":
54 $this->resetOffset();
55 $this->resetFilter();
56 break;
57
58 case "hideSelected":
59 $to_hide = $_POST["item_id"];
60 break;
61
62 case "hide":
63 $to_hide = array((int) $_GET["hide"]);
64 break;
65
66 case "mailselectedusers":
67 if (!sizeof($_POST["uid"])) {
68 ilUtil::sendFailure($lng->txt("no_checkbox"), true);
69 } else {
70 $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
71 }
72 break;
73
74 case 'addToClipboard':
75 if (!sizeof($_POST['uid'])) {
76 ilUtil::sendFailure($lng->txt('no_checkbox'), true);
77 } else {
78 $this->addToClipboard();
79 }
80 break;
81
82 // page selector
83 default:
85 $this->storeNavParameter();
86 break;
87 }
88
89 if ($to_hide) {
90 $obj = $this->getFilterItemByPostVar("hide");
91 $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
92 $obj->setValue($value);
93 $obj->writeToSession();
94 }
95
96 if (isset($_REQUEST["tbltplcrt"])) {
97 $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
98 }
99 if (isset($_REQUEST["tbltpldel"])) {
100 $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
101 }
102
103 $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
104 } else {
105 // e.g. repository selector
106 return parent::executeCommand();
107 }
108 }
$_GET["client_id"]
addToClipboard()
Add selected users to clipboard.
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.

References $_GET, $_POST, $ilCtrl, ilTableGUI\$lng, addToClipboard(), 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.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

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

662 {
663 foreach ($this->getExportMeta() as $caption => $value) {
664 $a_csv->addColumn(strip_tags($caption));
665 $a_csv->addColumn(strip_tags($value));
666 $a_csv->addRow();
667 }
668 $a_csv->addRow();
669 }
getExportMeta()
Build export meta data.

References getExportMeta().

+ Here is the call graph for this function:

◆ fillMetaExcel()

ilLPTableBaseGUI::fillMetaExcel ( ilExcel  $a_excel,
$a_row 
)
protected

Add meta information to excel export.

Likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter

Reimplemented from ilTable2GUI.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

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

652 {
653 foreach ($this->getExportMeta() as $caption => $value) {
654 $a_excel->setCell($a_row, 0, $caption);
655 $a_excel->setCell($a_row, 1, $value);
656 $a_row++;
657 }
658 $a_row++;
659 }
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.

References getExportMeta(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ formatSeconds()

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

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

688 {
689 $seconds = ((int) $seconds > 0) ? $seconds : 0;
690 if ($a_shorten_zero && !$seconds) {
691 return "-";
692 }
693
694 $hours = floor($seconds / 3600);
695 $rest = $seconds % 3600;
696
697 $minutes = floor($rest / 60);
698 $rest = $rest % 60;
699
700 if ($rest) {
701 $minutes++;
702 }
703
704 return sprintf("%dh%02dm", $hours, $minutes);
705 }
sprintf('%.4f', $callTime)
$rest
Definition: goto.php:46

References $rest, and sprintf.

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

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

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

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

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

618 {
619 global $lng, $ilObjDataCache, $ilUser, $ilClientIniFile;
620
621 /* see spec
622 Name of installation
623 Name of the course
624 Permalink to course
625 Owner of course object
626 Date of report generation
627 Reporting period
628 Name of person who generated the report.
629 */
630
632 include_once './Services/Link/classes/class.ilLink.php';
633
634 $data = array();
635 $data[$lng->txt("trac_name_of_installation")] = $ilClientIniFile->readVariable('client', 'name');
636
637 if ($this->obj_id) {
638 $data[$lng->txt("trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
639 if ($this->ref_id) {
640 $data[$lng->txt("trac_object_link")] = ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id));
641 }
642 $data[$lng->txt("trac_object_owner")] = ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id));
643 }
644
645 $data[$lng->txt("trac_report_date")] = ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX));
646 $data[$lng->txt("trac_report_owner")] = $ilUser->getFullName();
647
648 return $data;
649 }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
@classDescription Date and time handling
static _lookupFullname($a_user_id)
Lookup Full Name.
static _lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
$ilUser
Definition: imgupload.php:18

References ilTableGUI\$data, $ilUser, ilTableGUI\$lng, ilLink\_getLink(), ilObjUser\_lookupFullname(), ilObject\_lookupOwner(), ilObject\_lookupType(), ilDatePresentation\formatDate(), 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 756 of file class.ilLPTableBaseGUI.php.

757 {
758 global $lng;
759
760 $options = array();
761 for ($loop = 0; $loop < 10; $loop++) {
762 $year = date("Y")-$loop;
763 $options[$year] = $year;
764 for ($loop2 = 12; $loop2 > 0; $loop2--) {
765 $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
766 if ($year . $month <= date("Ym")) {
767 if (!$a_short) {
768 $caption = $year . " / " . $lng->txt("month_" . $month . "_long");
769 } else {
770 $caption = $year . "/" . $month;
771 }
772 $options[$year . "-" . $month] = $caption;
773 }
774 }
775 }
776 return $options;
777 }
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20

References ilTableGUI\$lng, $options, and date.

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

780 {
781 global $lng;
782
783 if (!$a_year) {
784 $a_year = date("Y");
785 }
786
787 $all = array();
788 for ($loop = 1; $loop<13; $loop++) {
789 $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
790 if ($a_year . "-" . $month <= date("Y-m")) {
791 if (!$a_short) {
792 $caption = $lng->txt("month_" . $month . "_long");
793 } else {
794 $caption = $lng->txt("month_" . $month . "_short");
795 }
796 $all[$a_year . "-" . $month] = $caption;
797 }
798 }
799 return $all;
800 }

References ilTableGUI\$lng, and date.

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

364 {
365 global $lng, $ilPluginAdmin;
366
367 $options = array();
368
369 if ($a_split_learning_resources) {
370 $options['lm'] = $lng->txt('objs_lm');
371 $options['sahs'] = $lng->txt('objs_sahs');
372 $options['htlm'] = $lng->txt('objs_htlm');
373 } else {
374 $options['lres'] = $lng->txt('learning_resources');
375 }
376
377 $options['crs'] = $lng->txt('objs_crs');
378 $options['grp'] = $lng->txt('objs_grp');
379 $options['exc'] = $lng->txt('objs_exc');
380 $options['file'] = $lng->txt('objs_file');
381 $options['mcst'] = $lng->txt('objs_mcst');
382 $options['svy'] = $lng->txt('objs_svy');
383 $options['tst'] = $lng->txt('objs_tst');
384 $options['prg'] = $lng->txt('objs_prg');
385 $options['iass'] = $lng->txt('objs_iass');
386
387 if ($a_allow_undefined_lp) {
388 $options["webr"] = $lng->txt("objs_webr");
389 $options["wiki"] = $lng->txt("objs_wiki");
390 $options["blog"] = $lng->txt("objs_blog");
391 $options["prtf"] = $lng->txt("objs_prtf");
392 $options["prtt"] = $lng->txt("objs_prtt");
393 }
394
395 // repository plugins (currently only active)
396 include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
397 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
398 foreach ($pl_names as $pl) {
399 $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
401 $options[$pl_id] = ilObjectPlugin::lookupTxtById($pl_id, "objs_" . $pl_id);
402 }
403 }
404
405 asort($options);
406 return $options;
407 }
const IL_COMP_SERVICE
static lookupTxtById($plugin_id, $lang_var)
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.

References ilTableGUI\$lng, $options, IL_COMP_SERVICE, ilRepositoryObjectPluginSlot\isTypePluginWithLP(), and ilObjectPlugin\lookupTxtById().

Referenced by initBaseFilter(), 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 802 of file class.ilLPTableBaseGUI.php.

803 {
804 global $lng, $ilSetting;
805
806 $cols = $privacy_fields = array();
807
808 include_once("./Services/User/classes/class.ilUserProfile.php");
809 $up = new ilUserProfile();
810 $up->skipGroup("preferences");
811 $up->skipGroup("settings");
812 $up->skipGroup("interests");
813 $ufs = $up->getStandardFields();
814
815 // default fields
816 $cols["login"] = array(
817 "txt" => $lng->txt("login"),
818 "default" => true);
819
820 if (!$this->anonymized) {
821 $cols["firstname"] = array(
822 "txt" => $lng->txt("firstname"),
823 "default" => true);
824 $cols["lastname"] = array(
825 "txt" => $lng->txt("lastname"),
826 "default" => true);
827 }
828
829 // show only if extended data was activated in lp settings
830 include_once 'Services/Tracking/classes/class.ilObjUserTracking.php';
831 $tracking = new ilObjUserTracking();
832 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_LAST_ACCESS)) {
833 $cols["first_access"] = array(
834 "txt" => $lng->txt("trac_first_access"),
835 "default" => true);
836 $cols["last_access"] = array(
837 "txt" => $lng->txt("trac_last_access"),
838 "default" => true);
839 }
840 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_READ_COUNT)) {
841 $cols["read_count"] = array(
842 "txt" => $lng->txt("trac_read_count"),
843 "default" => true);
844 }
845 if ($tracking->hasExtendedData(ilObjUserTracking::EXTENDED_DATA_SPENT_SECONDS) &&
847 $cols["spent_seconds"] = array(
848 "txt" => $lng->txt("trac_spent_seconds"),
849 "default" => true);
850 }
851
852 if ($this->isPercentageAvailable($this->obj_id)) {
853 $cols["percentage"] = array(
854 "txt" => $lng->txt("trac_percentage"),
855 "default" => true);
856 }
857
858 // do not show status if learning progress is deactivated
859 $olp = ilObjectLP::getInstance($this->obj_id);
860 if ($olp->isActive()) {
861 $cols["status"] = array(
862 "txt" => $lng->txt("trac_status"),
863 "default" => true);
864
865 $cols['status_changed'] = array(
866 'txt' => $lng->txt('trac_status_changed'),
867 'default' => false);
868 }
869
870 if (ilObjectLP::supportsMark($this->type)) {
871 $cols["mark"] = array(
872 "txt" => $lng->txt("trac_mark"),
873 "default" => true);
874 }
875
876 $cols["u_comment"] = array(
877 "txt" => $lng->txt("trac_comment"),
878 "default" => false);
879
880 $cols["create_date"] = array(
881 "txt" => $lng->txt("create_date"),
882 "default" => false);
883 $cols["language"] = array(
884 "txt" => $lng->txt("language"),
885 "default" => false);
886
887 // add user data only if object is [part of] course
888 if (!$this->anonymized &&
889 ($a_in_course || $a_in_group)) {
890 // only show if export permission is granted
891 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
892 if (ilPrivacySettings::_getInstance()->checkExportAccess($this->ref_id)) {
893 // other user profile fields
894 foreach ($ufs as $f => $fd) {
895 if (!isset($cols[$f]) && $f != "username" && !$fd["lists_hide"]) {
896 if ($a_in_course &&
897 !($fd["course_export_fix_value"] || $ilSetting->get("usr_settings_course_export_" . $f))) {
898 continue;
899 }
900 if ($a_in_group &&
901 !($fd["group_export_fix_value"] || $ilSetting->get("usr_settings_group_export_" . $f))) {
902 continue;
903 }
904
905 $cols[$f] = array(
906 "txt" => $lng->txt($f),
907 "default" => false);
908
909 $privacy_fields[] = $f;
910 }
911 }
912
913 // additional defined user data fields
914 include_once './Services/User/classes/class.ilUserDefinedFields.php';
915 $user_defined_fields = ilUserDefinedFields::_getInstance();
916 if ($a_in_course) {
917 $user_defined_fields = $user_defined_fields->getCourseExportableFields();
918 } else {
919 $user_defined_fields = $user_defined_fields->getGroupExportableFields();
920 }
921 foreach ($user_defined_fields as $definition) {
922 if ($definition["field_type"] != UDF_TYPE_WYSIWYG) {
923 $f = "udf_" . $definition["field_id"];
924 $cols[$f] = array(
925 "txt" => $definition["field_name"],
926 "default" => false);
927
928 $privacy_fields[] = $f;
929 }
930 }
931 }
932 }
933
934 return array($cols, $privacy_fields);
935 }
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:17
$cols
Definition: xhr_table.php:11

References $cols, $ilSetting, ilTableGUI\$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:

◆ initBaseFilter()

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

Init filter.

Parameters
bool$a_split_learning_resources

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

251 {
252 global $lng, $ilObjDataCache;
253
254 $this->setDisableFilterHiding(true);
255
256 // object type selection
257 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
258 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
259 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
260 $this->addFilterItem($si);
261 $si->readFromSession();
262 if (!$si->getValue()) {
263 $si->setValue("crs");
264 }
265 $this->filter["type"] = $si->getValue();
266
267 // hidden items
268 include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
269 $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
270 $this->addFilterItem($msi);
271 $msi->readFromSession();
272 $this->filter["hide"] = $msi->getValue();
273 if ($this->filter["hide"]) {
274 // create options from current value
275 $types = $this->getCurrentFilter(true);
276 $type = $types["type"];
277 $options = array();
278 if ($type == 'lres') {
279 $type = array('lm','sahs','htlm');
280 } else {
281 $type = array($type);
282 }
283 foreach ($this->filter["hide"] as $obj_id) {
284 if (in_array($ilObjDataCache->lookupType($obj_id), $type)) {
285 $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
286 }
287 }
288 $msi->setOptions($options);
289 }
290
291 // title/description
292 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
293 $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
294 $ti->setMaxLength(64);
295 $ti->setSize(20);
296 $this->addFilterItem($ti);
297 $ti->readFromSession();
298 $this->filter["query"] = $ti->getValue();
299
300 // repository area selection
301 include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
302 $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
303 $rs->setSelectText($lng->txt("trac_select_area"));
304 $this->addFilterItem($rs);
305 $rs->readFromSession();
306 $this->filter["area"] = $rs->getValue();
307
308 // hide "not started yet"
309 if ($a_include_no_status_filter) {
310 include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
311 $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
312 $this->addFilterItem($cb);
313 $cb->readFromSession();
314 $this->filter["status"] = $cb->getChecked();
315 }
316 }
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.
$type

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

Referenced by ilLPProgressTableGUI\__construct().

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

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable (   $a_obj_id)
protected

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

574 {
575 // :TODO:
576 $olp = ilObjectLP::getInstance($a_obj_id);
577 $mode = $olp->getCurrentMode();
578 if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
583 return true;
584 }
585 return false;
586 }

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(), ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), 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 588 of file class.ilLPTableBaseGUI.php.

589 {
590 global $lng, $ilObjDataCache, $ilUser;
591
592 $user = "";
593 if ($a_user_id) {
594 if ($a_user_id != $ilUser->getId()) {
595 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
596 } else {
597 $a_user = $ilUser;
598 }
599 $user .= ", " . $a_user->getFullName(); // " [".$a_user->getLogin()."]";
600 }
601
602 if ($a_obj_id != ROOT_FOLDER_ID) {
603 $this->setTitle($lng->txt($action) . ": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
604
605 $olp = ilObjectLP::getInstance($a_obj_id);
606 $this->setDescription($this->lng->txt('trac_mode') . ": " . $olp->getModeText($olp->getCurrentMode()));
607 } else {
608 $this->setTitle($lng->txt($action));
609 }
610 }
static 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.
$action

References $action, $ilUser, ilTableGUI\$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 409 of file class.ilLPTableBaseGUI.php.

410 {
411 global $lng;
412
413 // get rid of aggregation
414 $pos = strrpos($id, "_");
415 if ($pos !== false) {
416 $function = strtoupper(substr($id, $pos+1));
417 if (in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT"))) {
418 $id = substr($id, 0, $pos);
419 }
420 }
421
422 if (trim($value) == "" && $id != "status") {
423 if ($id == "title" &&
424 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
425 get_class($this) != "ilTrMatrixTableGUI") {
426 return "--" . $lng->txt("none") . "--";
427 }
428 return " ";
429 }
430
431 switch ($id) {
432 case "first_access":
433 case "create_date":
434 case 'status_changed':
436 break;
437
438 case "last_access":
440 break;
441
442 case "birthday":
444 break;
445
446 case "spent_seconds":
448 $value = "-";
449 } else {
450 $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
451 }
452 break;
453
454 case "percentage":
455 if (false /* $this->isPercentageAvailable() */) {
456 $value = "-";
457 } else {
458 $value = $value . "%";
459 }
460 break;
461
462 case "mark":
464 $value = "-";
465 }
466 break;
467
468 case "gender":
469 $value = $lng->txt("gender_" . $value);
470 break;
471
472 case "status":
473 include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
476 $value = ilUtil::img($path, $text);
477 break;
478
479 case "language":
480 $lng->loadLanguageModule("meta");
481 $value = $lng->txt("meta_l_" . $value);
482 break;
483
484 case "sel_country":
485 $value = $lng->txt("meta_c_" . $value);
486 break;
487 }
488
489 return $value;
490 }
$function
Definition: cas.php:28
const IL_CAL_DATE
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
static _getImagePathForStatus($a_status)
Get image path for status.
static img($a_src, $a_alt="", $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
$text
Definition: errorreport.php:18

References $function, $id, ilTableGUI\$lng, $path, $text, $type, ilLearningProgressBaseGUI\_getImagePathForStatus(), ilLearningProgressBaseGUI\_getStatusText(), ilDatePresentation\formatDate(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, ilUtil\img(), ilDatePresentation\secondsToString(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

Referenced by ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\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 232 of file class.ilLPTableBaseGUI.php.

233 {
234 if (is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"])) {
235 return false;
236 }
237 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
238 if (get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
239 !$olp->isActive()) {
240 return false;
241 }
242 return true;
243 }

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

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

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

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

111 {
112 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
113
114 require_once 'Services/Mail/classes/class.ilMailFormCall.php';
115
116 $rcps = array();
117 foreach ($a_user_ids as $usr_id) {
118 $rcps[] = ilObjUser::_lookupLogin($usr_id);
119 }
120
121 $template = array();
122 $sig = null;
123
124 // repository-object-specific
125 $ref_id = (int) $_REQUEST["ref_id"];
126 if ($ref_id) {
128 $tmpl_id = $obj_lp->getMailTemplateId();
129
130 if ($tmpl_id) {
131 $template = array(
132 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
133 'ref_id' => $ref_id,
134 'ts' => time()
135 );
136 } else {
137 include_once './Services/Link/classes/class.ilLink.php';
138 $sig = ilLink::_getLink($ref_id);
139 $sig = rawurlencode(base64_encode($sig));
140 }
141 }
142
145 $a_parent_obj,
146 $a_parent_cmd,
147 array(),
148 array(
149 'type' => 'new',
150 'rcp_to' => implode(',', $rcps),
151 'sig' => $sig
152 ),
154 )
155 );
156 }
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)
$template

References $template, 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 671 of file class.ilLPTableBaseGUI.php.

672 {
673 $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
674 if ($timing_cache->isWarningRequired($a_user_id)) {
675 $timings = ilTimingCache::_getTimings($a_ref_id);
676 if ($timings['item']['changeable'] && $timings['user'][$a_user_id]['end']) {
677 $end = $timings['user'][$a_user_id]['end'];
678 } elseif ($timings['item']['suggestion_end']) {
679 $end = $timings['item']['suggestion_end'];
680 } else {
681 $end = true;
682 }
683 return $end;
684 }
685 }
static getInstanceByRefId($ref_id)
static & _getTimings($a_ref_id)
$end
Definition: saml1-acs.php:18

References $end, ilTimingCache\_getTimings(), and ilTimingCache\getInstanceByRefId().

Referenced by ilLPProgressTableGUI\fillRow(), ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRow(), and ilTrUserObjectsPropsTableGUI\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 19 of file class.ilLPTableBaseGUI.php.

◆ $filter

ilLPTableBaseGUI::$filter
protected

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

Referenced by ilTrSummaryTableGUI\getItems(), and searchObjects().


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