ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLPTableBaseGUI Class Reference

TableGUI class for learning progress. More...

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

Public Member Functions

 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 
 executeCommand ()
 
 searchFilterListener ($a_ref_id, $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED public. More...
 
 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)
 
 getData ()
 
 dataExists ()
 
 setPrefix ($a_prefix)
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname="")
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox, $a_select_all_on_top=false)
 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 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)
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page public More...
 
 setHeaderNames ($a_header_names)
 set table header names public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars public More...
 
 setColumnWidth ($a_column_width)
 set table column widths public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($a_prefix)
 set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort separately) public More...
 
 setOffset ($a_offset)
 set dataset offset public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Protected Member Functions

 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)
 
 fillMetaCSV ($a_csv)
 
 showTimingsWarning ($a_ref_id, $a_user_id)
 
 formatSeconds ($seconds, $a_shorten_zero=false)
 
 anonymizeValue ($a_value, $a_force_number=false)
 
 buildValueScale ($a_max_value, $a_anonymize=false, $a_format_seconds=false)
 
 getMonthsFilter ($a_short=false)
 
 getMonthsYear ($a_year=null, $a_short=false)
 
 getSelectableUserColumns ($a_in_course=false, $a_in_group=false)
 
 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
 
 $select_all_on_top = false
 
 $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 = "" 
)

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

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

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)
+ Here is the call graph for this function:

Member Function Documentation

◆ addToClipboard()

ilLPTableBaseGUI::addToClipboard ( )
protected

Add selected users to clipboard.

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

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

Referenced by executeCommand().

975  {
976  $users = (array) $_POST['uid'];
977  include_once './Services/User/classes/class.ilUserClipboard.php';
978  $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
979  $clip->add($users);
980  $clip->save();
981 
982  $GLOBALS['DIC']['lng']->loadLanguageModule('user');
983  ilUtil::sendSuccess($this->lng->txt('clipboard_user_added'), true);
984  }
static getInstance($a_usr_id)
Get singelton instance.
$users
Definition: authpage.php:44
getId()
Get element id.
$_POST["username"]
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
+ 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 734 of file class.ilLPTableBaseGUI.php.

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

735  {
736  // currently inactive
737  return $a_value;
738 
739  if (is_numeric($a_value)) {
740  $threshold = 3;
741  $a_value = (int) $a_value;
742  if ($a_value <= $threshold) {
743  if (!$a_force_number) {
744  return "0-" . $threshold;
745  } else {
746  return $threshold;
747  }
748  }
749  }
750  return $a_value;
751  }
+ 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 332 of file class.ilLPTableBaseGUI.php.

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

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

333  {
334  global $DIC;
335 
336  $tree = $DIC['tree'];
337  $ilCtrl = $DIC['ilCtrl'];
338 
339  include_once './Services/Link/classes/class.ilLink.php';
340 
341  if (!count($ref_ids)) {
342  return false;
343  }
344  foreach ($ref_ids as $ref_id) {
345  $path = "...";
346  $counter = 0;
347  $path_full = $tree->getPathFull($ref_id);
348  foreach ($path_full as $data) {
349  if (++$counter < (count($path_full) - 1)) {
350  continue;
351  }
352  $path .= " &raquo; ";
353  if ($ref_id != $data['ref_id']) {
354  $path .= $data['title'];
355  } else {
356  $path .= ('<a target="_top" href="' .
357  ilLink::_getLink($data['ref_id'], $data['type']) . '">' .
358  $data['title'] . '</a>');
359  }
360  }
361 
362  $result[$ref_id] = $path;
363  }
364  return $result;
365  }
$path
Definition: aliased.php:25
$result
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
+ 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 753 of file class.ilLPTableBaseGUI.php.

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

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

754  {
755  $step = 0;
756  if ($a_max_value) {
757  $step = $a_max_value / 10;
758  $base = ceil(log($step, 10));
759  $fac = ceil($step / pow(10, ($base - 1)));
760  $step = pow(10, $base - 1) * $fac;
761  }
762  if ($step <= 1) {
763  $step = 1;
764  }
765  $ticks = range(0, $a_max_value + $step, $step);
766 
767  $value_ticks = array(0 => 0);
768  foreach ($ticks as $tick) {
769  $value = $tvalue = $tick;
770  if ($a_anonymize) {
771  $value = $this->anonymizeValue($value, true);
772  $tvalue = $this->anonymizeValue($tvalue);
773  }
774  if ($a_format_seconds) {
775  $tvalue = $this->formatSeconds($value);
776  }
777  $value_ticks[$value] = $tvalue;
778  }
779 
780  return $value_ticks;
781  }
anonymizeValue($a_value, $a_force_number=false)
foreach( $_REQUEST as $var) foreach(array('_POST'=> 'HTTP_POST_VARS', '_GET'=> 'HTTP_GET_VARS', '_COOKIE'=> 'HTTP_COOKIE_VARS', '_SERVER'=> 'HTTP_SERVER_VARS', '_ENV'=> 'HTTP_ENV_VARS', '_FILES'=> 'HTTP_POST_FILES') as $array=> $other) $step
Definition: cssgen.php:155
formatSeconds($seconds, $a_shorten_zero=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

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

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

39  {
40  global $DIC;
41 
42  $ilCtrl = $DIC['ilCtrl'];
43  $lng = $DIC['lng'];
44 
45  $this->determineSelectedFilters();
46 
47  if (!$ilCtrl->getNextClass($this)) {
48  $to_hide = false;
49 
50  switch ($ilCtrl->getCmd()) {
51  case "applyFilter":
52  $this->resetOffset();
53  $this->writeFilterToSession();
54  break;
55 
56  case "resetFilter":
57  $this->resetOffset();
58  $this->resetFilter();
59  break;
60 
61  case "hideSelected":
62  $to_hide = $_POST["item_id"];
63  break;
64 
65  case "hide":
66  $to_hide = array((int) $_GET["hide"]);
67  break;
68 
69  case "mailselectedusers":
70  if (!sizeof($_POST["uid"])) {
71  ilUtil::sendFailure($lng->txt("no_checkbox"), true);
72  } else {
73  $this->sendMail($_POST["uid"], $this->parent_obj, $this->parent_cmd);
74  }
75  break;
76 
77  case 'addToClipboard':
78  if (!sizeof($_POST['uid'])) {
79  ilUtil::sendFailure($lng->txt('no_checkbox'), true);
80  } else {
81  $this->addToClipboard();
82  }
83  break;
84 
85  // page selector
86  default:
87  $this->determineOffsetAndOrder();
88  $this->storeNavParameter();
89  break;
90  }
91 
92  if ($to_hide) {
93  $obj = $this->getFilterItemByPostVar("hide");
94  $value = array_unique(array_merge((array) $obj->getValue(), $to_hide));
95  $obj->setValue($value);
96  $obj->writeToSession();
97  }
98 
99  if (isset($_REQUEST["tbltplcrt"])) {
100  $ilCtrl->setParameter($this->parent_obj, "tbltplcrt", $_REQUEST["tbltplcrt"]);
101  }
102  if (isset($_REQUEST["tbltpldel"])) {
103  $ilCtrl->setParameter($this->parent_obj, "tbltpldel", $_REQUEST["tbltpldel"]);
104  }
105 
106  $ilCtrl->redirect($this->parent_obj, $this->parent_cmd);
107  } else {
108  // e.g. repository selector
109  return parent::executeCommand();
110  }
111  }
global $DIC
Definition: saml.php:7
$_GET["client_id"]
resetOffset($a_in_determination=false)
Reset offset.
getFilterItemByPostVar($a_post_var)
addToClipboard()
Add selected users to clipboard.
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
writeFilterToSession()
Write filter values to session.
sendMail(array $a_user_ids, $a_parent_obj, $a_parent_cmd)
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
determineSelectedFilters()
Determine selected filters.
$_POST["username"]
resetFilter()
Reset filter.
+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV (   $a_csv)
protected

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

References getExportMeta().

689  {
690  foreach ($this->getExportMeta() as $caption => $value) {
691  $a_csv->addColumn(strip_tags($caption));
692  $a_csv->addColumn(strip_tags($value));
693  $a_csv->addRow();
694  }
695  $a_csv->addRow();
696  }
getExportMeta()
Build export meta data.
+ Here is the call graph for this function:

◆ fillMetaExcel()

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

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

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

679  {
680  foreach ($this->getExportMeta() as $caption => $value) {
681  $a_excel->setCell($a_row, 0, $caption);
682  $a_excel->setCell($a_row, 1, $value);
683  $a_row++;
684  }
685  $a_row++;
686  }
getExportMeta()
Build export meta data.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
+ Here is the call graph for this function:

◆ formatSeconds()

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

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

References $rest.

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

715  {
716  $seconds = ((int) $seconds > 0) ? $seconds : 0;
717  if ($a_shorten_zero && !$seconds) {
718  return "-";
719  }
720 
721  $hours = floor($seconds / 3600);
722  $rest = $seconds % 3600;
723 
724  $minutes = floor($rest / 60);
725  $rest = $rest % 60;
726 
727  if ($rest) {
728  $minutes++;
729  }
730 
731  return sprintf("%dh%02dm", $hours, $minutes);
732  }
$rest
Definition: goto.php:46
+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter (   $as_query = false)

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

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

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

511  {
512  $result = array();
513  foreach ((array) $this->filter as $id => $value) {
514  $item = $this->getFilterItemByPostVar($id);
515  switch ($id) {
516  case "title":
517  case "country":
518  case "gender":
519  case "city":
520  case "language":
521  case "login":
522  case "firstname":
523  case "lastname":
524  case "mark":
525  case "u_comment":
526  case "institution":
527  case "department":
528  case "title":
529  case "street":
530  case "zipcode":
531  case "email":
532  case "matriculation":
533  case "sel_country":
534  case "query":
535  case "type":
536  case "area":
537  if ($value) {
538  $result[$id] = $value;
539  }
540  break;
541 
542  case "status":
543  if ($value !== false) {
544  $result[$id] = $value;
545  }
546  break;
547 
548  case "user_total":
549  case "read_count":
550  case "percentage":
551  case "hide":
552  case "spent_seconds":
553  if (is_array($value) && implode("", $value)) {
554  $result[$id] = $value;
555  }
556  break;
557 
558  case "registration":
559  case "create_date":
560  case "first_access":
561  case "last_access":
562  case 'status_changed':
563  if ($value) {
564  if ($value["from"]) {
565  $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
566  }
567  if ($value["to"]) {
568  $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
569  }
570  }
571  break;
572 
573  case "birthday":
574  if ($value) {
575  if ($value["from"]) {
576  $result[$id]["from"] = $value["from"]->get(IL_CAL_DATETIME);
577  $result[$id]["from"] = substr($result[$id]["from"], 0, -8) . "00:00:00";
578  }
579  if ($value["to"]) {
580  $result[$id]["to"] = $value["to"]->get(IL_CAL_DATETIME);
581  $result[$id]["to"] = substr($result[$id]["to"], 0, -8) . "23:59:59";
582  }
583  }
584  break;
585  }
586  }
587 
588  return $result;
589  }
const IL_CAL_DATETIME
$result
if(!array_key_exists('StateId', $_REQUEST)) $id
getFilterItemByPostVar($a_post_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportMeta()

ilLPTableBaseGUI::getExportMeta ( )
protected

Build export meta data.

Returns
array

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

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

Referenced by fillMetaCSV(), and fillMetaExcel().

640  {
641  global $DIC;
642 
643  $lng = $DIC['lng'];
644  $ilObjDataCache = $DIC['ilObjDataCache'];
645  $ilUser = $DIC['ilUser'];
646  $ilClientIniFile = $DIC['ilClientIniFile'];
647 
648  /* see spec
649  Name of installation
650  Name of the course
651  Permalink to course
652  Owner of course object
653  Date of report generation
654  Reporting period
655  Name of person who generated the report.
656  */
657 
659  include_once './Services/Link/classes/class.ilLink.php';
660 
661  $data = array();
662  $data[$lng->txt("trac_name_of_installation")] = $ilClientIniFile->readVariable('client', 'name');
663 
664  if ($this->obj_id) {
665  $data[$lng->txt("trac_object_name")] = $ilObjDataCache->lookupTitle($this->obj_id);
666  if ($this->ref_id) {
667  $data[$lng->txt("trac_object_link")] = ilLink::_getLink($this->ref_id, ilObject::_lookupType($this->obj_id));
668  }
669  $data[$lng->txt("trac_object_owner")] = ilObjUser::_lookupFullname(ilObject::_lookupOwner($this->obj_id));
670  }
671 
672  $data[$lng->txt("trac_report_date")] = ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX));
673  $data[$lng->txt("trac_report_owner")] = $ilUser->getFullName();
674 
675  return $data;
676  }
global $DIC
Definition: saml.php:7
static _lookupFullname($a_user_id)
Lookup Full Name.
static setUseRelativeDates($a_status)
set use relative dates
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Date and time handling
$ilUser
Definition: imgupload.php:18
static _lookupOwner($a_id)
lookup object owner
static _lookupType($a_id, $a_reference=false)
lookup object type
+ 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 783 of file class.ilLPTableBaseGUI.php.

References $DIC, ilTableGUI\$lng, and PHPMailer\PHPMailer\$options.

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

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

◆ getMonthsYear()

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

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

References $DIC, and ilTableGUI\$lng.

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

809  {
810  global $DIC;
811 
812  $lng = $DIC['lng'];
813 
814  if (!$a_year) {
815  $a_year = date("Y");
816  }
817 
818  $all = array();
819  for ($loop = 1; $loop < 13; $loop++) {
820  $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
821  if ($a_year . "-" . $month <= date("Y-m")) {
822  if (!$a_short) {
823  $caption = $lng->txt("month_" . $month . "_long");
824  } else {
825  $caption = $lng->txt("month_" . $month . "_short");
826  }
827  $all[$a_year . "-" . $month] = $caption;
828  }
829  }
830  return $all;
831  }
global $DIC
Definition: saml.php:7
+ 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 374 of file class.ilLPTableBaseGUI.php.

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

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

375  {
376  global $DIC;
377 
378  $lng = $DIC['lng'];
379  $ilPluginAdmin = $DIC['ilPluginAdmin'];
380 
381  $options = array();
382 
383  if ($a_split_learning_resources) {
384  $options['lm'] = $lng->txt('objs_lm');
385  $options['sahs'] = $lng->txt('objs_sahs');
386  $options['htlm'] = $lng->txt('objs_htlm');
387  } else {
388  $options['lres'] = $lng->txt('obj_lrss');
389  }
390 
391  $options['crs'] = $lng->txt('objs_crs');
392  $options['grp'] = $lng->txt('objs_grp');
393  $options['exc'] = $lng->txt('objs_exc');
394  $options['file'] = $lng->txt('objs_file');
395  $options['mcst'] = $lng->txt('objs_mcst');
396  $options['svy'] = $lng->txt('objs_svy');
397  $options['tst'] = $lng->txt('objs_tst');
398  $options['prg'] = $lng->txt('objs_prg');
399  $options['iass'] = $lng->txt('objs_iass');
400  $options['copa'] = $lng->txt('objs_copa');
401  $options['lso'] = $lng->txt('objs_lso');
402 
403  if ($a_allow_undefined_lp) {
404  $options["webr"] = $lng->txt("objs_webr");
405  $options["wiki"] = $lng->txt("objs_wiki");
406  $options["blog"] = $lng->txt("objs_blog");
407  $options["prtf"] = $lng->txt("objs_prtf");
408  $options["prtt"] = $lng->txt("objs_prtt");
409  }
410 
411  // repository plugins (currently only active)
412  include_once 'Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php';
413  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Repository", "robj");
414  foreach ($pl_names as $pl) {
415  $pl_id = $ilPluginAdmin->getId(IL_COMP_SERVICE, "Repository", "robj", $pl);
417  $options[$pl_id] = ilObjectPlugin::lookupTxtById($pl_id, "objs_" . $pl_id);
418  }
419  }
420 
421  asort($options);
422  return $options;
423  }
static isTypePluginWithLP($a_type, $a_active_status=true)
Check whether a repository type is a plugin which has active learning progress.
static lookupTxtById($plugin_id, $lang_var)
global $DIC
Definition: saml.php:7
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableUserColumns()

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

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

References $cols, $DIC, $f, $ilSetting, ilTableGUI\$lng, ilUserDefinedFields\_getInstance(), ilPrivacySettings\_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 ilTrObjectUsersPropsTableGUI\getSelectableColumns(), and ilTrMatrixTableGUI\getSelectableColumns().

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

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

Referenced by ilLPProgressTableGUI\__construct().

256  {
257  global $DIC;
258 
259  $lng = $DIC['lng'];
260  $ilObjDataCache = $DIC['ilObjDataCache'];
261 
262  $this->setDisableFilterHiding(true);
263 
264  // object type selection
265  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
266  $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
267  $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
268  $this->addFilterItem($si);
269  $si->readFromSession();
270  if (!$si->getValue()) {
271  $si->setValue("crs");
272  }
273  $this->filter["type"] = $si->getValue();
274 
275  // hidden items
276  include_once("./Services/Form/classes/class.ilMultiSelectInputGUI.php");
277  $msi = new ilMultiSelectInputGUI($lng->txt("trac_filter_hidden"), "hide");
278  $this->addFilterItem($msi);
279  $msi->readFromSession();
280  $this->filter["hide"] = $msi->getValue();
281  if ($this->filter["hide"]) {
282  // create options from current value
283  $types = $this->getCurrentFilter(true);
284  $type = $types["type"];
285  $options = array();
286  if ($type == 'lres') {
287  $type = array('lm','sahs','htlm');
288  } else {
289  $type = array($type);
290  }
291  foreach ($this->filter["hide"] as $obj_id) {
292  if (in_array($ilObjDataCache->lookupType($obj_id), $type)) {
293  $options[$obj_id] = $ilObjDataCache->lookupTitle($obj_id);
294  }
295  }
296  $msi->setOptions($options);
297  }
298 
299  // title/description
300  include_once("./Services/Form/classes/class.ilTextInputGUI.php");
301  $ti = new ilTextInputGUI($lng->txt("trac_title_description"), "query");
302  $ti->setMaxLength(64);
303  $ti->setSize(20);
304  $this->addFilterItem($ti);
305  $ti->readFromSession();
306  $this->filter["query"] = $ti->getValue();
307 
308  // repository area selection
309  include_once("./Services/Form/classes/class.ilRepositorySelectorInputGUI.php");
310  $rs = new ilRepositorySelectorInputGUI($lng->txt("trac_filter_area"), "area");
311  $rs->setSelectText($lng->txt("trac_select_area"));
312  $this->addFilterItem($rs);
313  $rs->readFromSession();
314  $this->filter["area"] = $rs->getValue();
315 
316  // hide "not started yet"
317  if ($a_include_no_status_filter) {
318  include_once("./Services/Form/classes/class.ilCheckboxInputGUI.php");
319  $cb = new ilCheckboxInputGUI($lng->txt("trac_filter_has_status"), "status");
320  $this->addFilterItem($cb);
321  $cb->readFromSession();
322  $this->filter["status"] = $cb->getChecked();
323  }
324  }
This class represents a selection list property in a property form.
$type
global $DIC
Definition: saml.php:7
This class represents a checkbox property in a property form.
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
getPossibleTypes($a_split_learning_resources=false, $a_include_digilib=false, $a_allow_undefined_lp=false)
Get possible subtypes.
This class represents a multi selection list property in a property form.
This class represents a repository selector in a property form.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
getCurrentFilter($as_query=false)
+ 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 591 of file class.ilLPTableBaseGUI.php.

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 ilTrUserObjectsPropsTableGUI\fillRow(), ilTrSummaryTableGUI\fillRow(), ilLPProgressTableGUI\fillRowCSV(), ilLPProgressTableGUI\fillRowExcel(), ilLPProgressTableGUI\getItems(), ilTrMatrixTableGUI\getItems(), ilTrSummaryTableGUI\getItems(), ilTrSummaryTableGUI\getSelectableColumns(), getSelectableUserColumns(), and ilTrSummaryTableGUI\initFilter().

592  {
593  // :TODO:
594  $olp = ilObjectLP::getInstance($a_obj_id);
595  $mode = $olp->getCurrentMode();
596  if (in_array($mode, array(ilLPObjSettings::LP_MODE_TLT,
601  return true;
602  }
603  return false;
604  }
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTitle()

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

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

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

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

607  {
608  global $DIC;
609 
610  $lng = $DIC['lng'];
611  $ilObjDataCache = $DIC['ilObjDataCache'];
612  $ilUser = $DIC['ilUser'];
613 
614  $user = "";
615  if ($a_user_id) {
616  if ($a_user_id != $ilUser->getId()) {
617  $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
618  } else {
619  $a_user = $ilUser;
620  }
621  $user .= ", " . $a_user->getFullName(); // " [".$a_user->getLogin()."]";
622  }
623 
624  if ($a_obj_id != ROOT_FOLDER_ID) {
625  $this->setTitle($lng->txt($action) . ": " . $ilObjDataCache->lookupTitle($a_obj_id) . $user);
626 
627  $olp = ilObjectLP::getInstance($a_obj_id);
628  $this->setDescription($this->lng->txt('trac_mode') . ": " . $olp->getModeText($olp->getCurrentMode()));
629  } else {
630  $this->setTitle($lng->txt($action));
631  }
632  }
setDescription($a_val)
Set description.
$action
global $DIC
Definition: saml.php:7
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
$ilUser
Definition: imgupload.php:18
$user
Definition: migrateto20.php:57
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance($a_obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

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

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

References $DIC, $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 ilTrObjectUsersPropsTableGUI\fillRow(), ilTrMatrixTableGUI\fillRow(), ilTrObjectUsersPropsTableGUI\fillRowCSV(), ilTrUserObjectsPropsTableGUI\fillRowCSV(), ilTrMatrixTableGUI\fillRowCSV(), ilTrObjectUsersPropsTableGUI\fillRowExcel(), ilTrUserObjectsPropsTableGUI\fillRowExcel(), and ilTrMatrixTableGUI\fillRowExcel().

426  {
427  global $DIC;
428 
429  $lng = $DIC['lng'];
430 
431  // get rid of aggregation
432  $pos = strrpos($id, "_");
433  if ($pos !== false) {
434  $function = strtoupper(substr($id, $pos + 1));
435  if (in_array($function, array("MIN", "MAX", "SUM", "AVG", "COUNT"))) {
436  $id = substr($id, 0, $pos);
437  }
438  }
439 
440  if (trim($value) == "" && $id != "status") {
441  if ($id == "title" &&
442  get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
443  get_class($this) != "ilTrMatrixTableGUI") {
444  return "--" . $lng->txt("none") . "--";
445  }
446  return " ";
447  }
448 
449  switch ($id) {
450  case "first_access":
451  case "create_date":
452  case 'status_changed':
454  break;
455 
456  case "last_access":
458  break;
459 
460  case "birthday":
461  $value = ilDatePresentation::formatDate(new ilDate($value, IL_CAL_DATE));
462  break;
463 
464  case "spent_seconds":
466  $value = "-";
467  } else {
468  $value = ilDatePresentation::secondsToString($value, ($value < 3600 ? true : false)); // #14858
469  }
470  break;
471 
472  case "percentage":
473  if (false /* $this->isPercentageAvailable() */) {
474  $value = "-";
475  } else {
476  $value = $value . "%";
477  }
478  break;
479 
480  case "mark":
482  $value = "-";
483  }
484  break;
485 
486  case "gender":
487  $value = $lng->txt("gender_" . $value);
488  break;
489 
490  case "status":
491  include_once("./Services/Tracking/classes/class.ilLearningProgressBaseGUI.php");
494  $value = ilUtil::img($path, $text);
495  break;
496 
497  case "language":
498  $lng->loadLanguageModule("meta");
499  $value = $lng->txt("meta_l_" . $value);
500  break;
501 
502  case "sel_country":
503  $value = $lng->txt("meta_c_" . $value);
504  break;
505  }
506 
507  return $value;
508  }
$path
Definition: aliased.php:25
const IL_CAL_DATETIME
static _getImagePathForStatus($a_status)
Get image path for status.
$type
global $DIC
Definition: saml.php:7
static _getStatusText($a_status, $a_lng=null)
Get status alt text.
if(!array_key_exists('StateId', $_REQUEST)) $id
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
Class for single dates.
$text
Definition: errorreport.php:18
Date and time handling
static img($a_src, $a_alt=null, $a_width="", $a_height="", $a_border=0, $a_id="", $a_class="")
Build img tag.
static supportsMark($a_obj_type)
const IL_CAL_DATE
static supportsSpentSeconds($a_obj_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchFilterListener()

ilLPTableBaseGUI::searchFilterListener (   $a_ref_id,
  $a_data 
)

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

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

References ilObjectLP\getInstance().

238  {
239  if (is_array($this->filter["hide"]) && in_array($a_data["obj_id"], $this->filter["hide"])) {
240  return false;
241  }
242  $olp = ilObjectLP::getInstance($a_data["obj_id"]);
243  if (get_class($olp) != "ilObjectLP" && // #13654 - LP could be unsupported
244  !$olp->isActive()) {
245  return false;
246  }
247  return true;
248  }
static getInstance($a_obj_id)
+ 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 170 of file class.ilLPTableBaseGUI.php.

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

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

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

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

Referenced by executeCommand().

114  {
115  // see ilObjCourseGUI::sendMailToSelectedUsersObject()
116 
117  require_once 'Services/Mail/classes/class.ilMailFormCall.php';
118 
119  $rcps = array();
120  foreach ($a_user_ids as $usr_id) {
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) {
131  $tmpl_id = $obj_lp->getMailTemplateId();
132 
133  if ($tmpl_id) {
134  $template = array(
135  ilMailFormCall::CONTEXT_KEY => $tmpl_id,
136  'ref_id' => $ref_id,
137  'ts' => time()
138  );
139  } else {
140  include_once './Services/Link/classes/class.ilLink.php';
141  $sig = ilLink::_getLink($ref_id);
142  $sig = rawurlencode(base64_encode($sig));
143  }
144  }
145 
148  $a_parent_obj,
149  $a_parent_cmd,
150  array(),
151  array(
152  'type' => 'new',
153  'rcp_to' => implode(',', $rcps),
154  'sig' => $sig
155  ),
156  $template
157  )
158  );
159  }
static _lookupLogin($a_user_id)
lookup login
$template
static _lookupObjectId($a_ref_id)
lookup object id
const CONTEXT_KEY
Session parameter for the context.
static getRedirectTarget($gui, $cmd, array $gui_params=array(), array $mail_params=array(), array $context_params=array())
static redirect($a_script)
static getInstance($a_obj_id)
+ 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 698 of file class.ilLPTableBaseGUI.php.

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

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

699  {
700  $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
701  if ($timing_cache->isWarningRequired($a_user_id)) {
702  $timings = ilTimingCache::_getTimings($a_ref_id);
703  if ($timings['item']['changeable'] && $timings['user'][$a_user_id]['end']) {
704  $end = $timings['user'][$a_user_id]['end'];
705  } elseif ($timings['item']['suggestion_end']) {
706  $end = $timings['item']['suggestion_end'];
707  } else {
708  $end = true;
709  }
710  return $end;
711  }
712  }
static getInstanceByRefId($ref_id)
static & _getTimings($a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $anonymized

ilLPTableBaseGUI::$anonymized
protected

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

◆ $filter

ilLPTableBaseGUI::$filter
protected

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

Referenced by ilTrSummaryTableGUI\getItems().


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