ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLPTableBaseGUI Class Reference

TableGUI class for learning progress. More...

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

Public Member Functions

 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 executeCommand ()
 
 searchFilterListener (int $a_ref_id, array $a_data)
 Listener for SearchResultFilter Checks wheather the object is hidden and mode is not LP_MODE_DEACTIVATED public. More...
 
 initBaseFilter (bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true)
 Init filter. More...
 
 getCurrentFilter (bool $as_query=false)
 
 getIconVariant ()
 Gets the variant of LP icons that is shown in the table. More...
 
 setIconVariant (int $variant)
 Sets the variant of LP icons that is shown in the table. More...
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 addColumn (string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 setPrefix (string $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) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Data Fields

const HIT_LIMIT = 5000
 
- 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
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Protected Member Functions

 initItemIdFromPost ()
 
 initUidFromPost ()
 
 findReferencesForObjId (int $a_obj_id)
 
 sendMail (array $a_user_ids, $a_parent_obj, string $a_parent_cmd)
 
 searchObjects (array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
 Search objects that match current filters. More...
 
 isForwardingToFormDispatcher ()
 
 initRepositoryFilter (array $filter)
 
 buildPath (array $ref_ids)
 
 getPossibleTypes (bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
 
 parseValue (string $id, ?string $value, string $type)
 
 isPercentageAvailable (int $a_obj_id)
 
 parseTitle (int $a_obj_id, string $action, int $a_user_id=0)
 
 getExportMeta ()
 Build export meta data. More...
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 
 fillMetaCSV (ilCSVWriter $a_csv)
 
 showTimingsWarning (int $a_ref_id, int $a_user_id)
 
 formatSeconds (int $seconds, bool $a_shorten_zero=false)
 
 anonymizeValue ($a_value, bool $a_force_number=false)
 
 buildValueScale (int $a_max_value, bool $a_anonymize=false, bool $a_format_seconds=false)
 
 getMonthsFilter ($a_short=false)
 
 getMonthsYear ($a_year=null, $a_short=false)
 
 getSelectableUserColumns (int $a_in_course=0, int $a_in_group=0)
 
 addToClipboard ()
 Add selected users to clipboard. More...
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 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, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

RefineryFactory $refinery
 
HttpService $http
 
array $filter = []
 
bool $anonymized = true
 
int $icon_variant = ilLPStatusIcons::ICON_VARIANT_LONG
 
ilSetting $setting
 
ilObjectDataCache $ilObjDataCache
 
ilObjectDefinition $objDefinition
 
ilTree $tree
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Attributes

ilObjUser $user
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), ilObjUserTracking\_enabledUserRelatedData(), ilObjectLP\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\Repository\user().

50  {
51  global $DIC;
52  $this->main_tpl = $DIC->ui()->mainTemplate();
53 
54  $this->objDefinition = $DIC['objDefinition'];
55  $this->ilObjDataCache = $DIC['ilObjDataCache'];
56  $this->tree = $DIC->repositoryTree();
57  $this->user = $DIC->user();
58  $this->setting = $DIC->settings();
59  $this->http = $DIC->http();
60  $this->refinery = $DIC->refinery();
61 
62  $this->anonymized = !ilObjUserTracking::_enabledUserRelatedData();
63  if (!$this->anonymized && isset($this->obj_id) && $this->obj_id > 0) {
64  $olp = ilObjectLP::getInstance($this->obj_id);
65  $this->anonymized = $olp->isAnonymized();
66  }
67 
68  /*
69  * BT 35453: parent constructor needs to be called after $this->anonymized
70  * is set, in order for getSelectableUserColumns to also properly return
71  * user defined fields (e.g. firstname, lastname, and other user data).
72  */
73  parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
74 
75  // country names
76  $this->lng->loadLanguageModule("meta");
77  }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(VocabulariesInterface $vocabularies)
static getInstance(int $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 1192 of file class.ilLPTableBaseGUI.php.

References ilUserClipboard\getInstance(), initUidFromPost(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

Referenced by executeCommand().

1192  : void
1193  {
1194  $users = $this->initUidFromPost();
1195  $clip = ilUserClipboard::getInstance($this->user->getId());
1196  $clip->add($users);
1197  $clip->save();
1198  $this->lng->loadLanguageModule('user');
1199  $this->main_tpl->setOnScreenMessage(
1200  'success',
1201  $this->lng->txt(
1202  'clipboard_user_added'
1203  ),
1204  true
1205  );
1206  }
static getInstance(int $a_usr_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ anonymizeValue()

◆ buildPath()

ilLPTableBaseGUI::buildPath ( array  $ref_ids)
protected

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

References ilTableGUI\$data, $path, and $ref_id.

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

469  : array
470  {
471  if (!count($ref_ids)) {
472  return [];
473  }
474  $result = [];
475  foreach ($ref_ids as $ref_id) {
476  $path = "...";
477  $counter = 0;
478  $path_full = $this->tree->getPathFull($ref_id);
479  foreach ($path_full as $data) {
480  if (++$counter < (count($path_full) - 1)) {
481  continue;
482  }
483  $path .= " &raquo; ";
484  if ($ref_id != $data['ref_id']) {
485  $path .= $data['title'];
486  } else {
487  $path .= ('<a target="_top" href="' .
488  ilLink::_getLink(
489  $data['ref_id'],
490  $data['type']
491  ) . '">' .
492  $data['title'] . '</a>');
493  }
494  }
495 
496  $result[$ref_id] = $path;
497  }
498  return $result;
499  }
$path
Definition: ltiservices.php:32
$ref_id
Definition: ltiauth.php:67
+ Here is the caller graph for this function:

◆ buildValueScale()

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

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

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

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

957  : array {
958  $step = 0;
959  if ($a_max_value) {
960  $step = $a_max_value / 10;
961  $base = ceil(log($step, 10));
962  $fac = ceil($step / pow(10, ($base - 1)));
963  $step = pow(10, $base - 1) * $fac;
964  }
965  if ($step <= 1) {
966  $step = 1;
967  }
968  $ticks = range(0, $a_max_value + $step, $step);
969 
970  $value_ticks = array(0 => 0);
971  foreach ($ticks as $tick) {
972  $value = $tvalue = $tick;
973  if ($a_anonymize) {
974  $value = $this->anonymizeValue($value, true);
975  $tvalue = $this->anonymizeValue($tvalue);
976  }
977  if ($a_format_seconds) {
978  $tvalue = $this->formatSeconds($value);
979  }
980  $value_ticks[$value] = $tvalue;
981  }
982 
983  return $value_ticks;
984  }
anonymizeValue($a_value, bool $a_force_number=false)
formatSeconds(int $seconds, bool $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 105 of file class.ilLPTableBaseGUI.php.

References addToClipboard(), ILIAS\Repository\ctrl(), ilTable2GUI\determineOffsetAndOrder(), ilTable2GUI\determineSelectedFilters(), ilTable2GUI\getFilterItemByPostVar(), ilTable2GUI\getOffset(), ILIAS\FileDelivery\http(), initItemIdFromPost(), initUidFromPost(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilTable2GUI\resetFilter(), ilTable2GUI\resetOffset(), sendMail(), ilTable2GUI\storeNavParameter(), ilTable2GUI\storeProperty(), and ilTable2GUI\writeFilterToSession().

105  : bool
106  {
107  $this->determineSelectedFilters();
108  if (!$this->ctrl->getNextClass($this)) {
109  $to_hide = false;
110 
111  switch ($this->ctrl->getCmd()) {
112  case "applyFilter":
113  $this->resetOffset();
114  $this->writeFilterToSession();
115  $this->storeProperty("offset", "0");
116  break;
117 
118  case "resetFilter":
119  $this->resetOffset();
120  $this->resetFilter();
121  $this->storeProperty("offset", "0");
122  break;
123 
124  case "hideSelected":
125  $to_hide = $this->initItemIdFromPost();
126  break;
127 
128  case "hide":
129  $hide = 0;
130  if ($this->http->wrapper()->query()->has('hide')) {
131  $hide = $this->http->wrapper()->query()->retrieve(
132  'hide',
133  $this->refinery->kindlyTo()->int()
134  );
135  }
136  $to_hide = [$hide];
137  break;
138 
139  case "mailselectedusers":
140  if (!$this->initUidFromPost()) {
141  $this->main_tpl->setOnScreenMessage(
142  'failure',
143  $this->lng->txt(
144  "no_checkbox"
145  ),
146  true
147  );
148  } else {
149  $this->sendMail(
150  $this->initUidFromPost(),
151  $this->parent_obj,
152  $this->parent_cmd
153  );
154  }
155  break;
156 
157  case 'addToClipboard':
158  if (!$this->initUidFromPost()) {
159  $this->main_tpl->setOnScreenMessage(
160  'failure',
161  $this->lng->txt(
162  'no_checkbox'
163  ),
164  true
165  );
166  } else {
167  $this->addToClipboard();
168  }
169  break;
170 
171  // page selector
172  default:
173  $this->determineOffsetAndOrder();
174  $this->storeNavParameter();
175  $this->storeProperty("offset", (string) $this->getOffset());
176  break;
177  }
178 
179  if ($to_hide) {
180  $obj = $this->getFilterItemByPostVar("hide");
181  $value = array_unique(
182  array_merge((array) $obj->getValue(), $to_hide)
183  );
184  $obj->setValue($value);
185  $obj->writeToSession();
186  }
187 
188  if ($this->requested_tmpl_create !== "") {
189  $this->ctrl->setParameter(
190  $this->parent_obj,
191  "tbltplcrt",
192  $this->requested_tmpl_create
193  );
194  }
195  if ($this->requested_tmpl_delete !== "") {
196  $this->ctrl->setParameter(
197  $this->parent_obj,
198  "tbltpldel",
199  $this->requested_tmpl_delete
200  );
201  }
202  $this->ctrl->redirect($this->parent_obj, $this->parent_cmd);
203  } else {
204  // e.g. repository selector
205  return parent::executeCommand();
206  }
207  return true;
208  }
sendMail(array $a_user_ids, $a_parent_obj, string $a_parent_cmd)
addToClipboard()
Add selected users to clipboard.
getFilterItemByPostVar(string $a_post_var)
resetOffset(bool $a_in_determination=false)
static http()
Fetches the global http state from ILIAS.
determineOffsetAndOrder(bool $a_omit_offset=false)
storeProperty(string $type, string $value)
+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV ( ilCSVWriter  $a_csv)
protected

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

References ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and getExportMeta().

884  : void
885  {
886  foreach ($this->getExportMeta() as $caption => $value) {
887  $a_csv->addColumn(strip_tags($caption));
888  $a_csv->addColumn(strip_tags($value));
889  $a_csv->addRow();
890  }
891  $a_csv->addRow();
892  }
addColumn(string $a_col)
getExportMeta()
Build export meta data.
+ Here is the call graph for this function:

◆ fillMetaExcel()

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

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

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

874  : void
875  {
876  foreach ($this->getExportMeta() as $caption => $value) {
877  $a_excel->setCell($a_row, 0, $caption);
878  $a_excel->setCell($a_row, 1, $value);
879  $a_row++;
880  }
881  $a_row++;
882  }
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
getExportMeta()
Build export meta data.
+ Here is the call graph for this function:

◆ findReferencesForObjId()

ilLPTableBaseGUI::findReferencesForObjId ( int  $a_obj_id)
protected
Returns
int[]

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

References ilObject\_getAllReferences().

Referenced by ilLPObjectStatisticsDailyTableGUI\getItems(), and ilLPObjectStatisticsLPTableGUI\getItems().

213  : array
214  {
215  $ref_ids = array_keys(ilObject::_getAllReferences($a_obj_id));
216  sort($ref_ids, SORT_NUMERIC);
217  return $ref_ids;
218  }
static _getAllReferences(int $id)
get all reference ids for object ID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ formatSeconds()

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

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

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

923  : string {
924  $seconds = ($seconds > 0) ? $seconds : 0;
925  if ($a_shorten_zero && !$seconds) {
926  return "-";
927  }
928 
929  $hours = floor($seconds / 3600);
930  $rest = $seconds % 3600;
931 
932  $minutes = floor($rest / 60);
933  $rest = $rest % 60;
934 
935  if ($rest) {
936  $minutes++;
937  }
938 
939  return sprintf("%dh%02dm", $hours, $minutes);
940  }
+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter ( bool  $as_query = false)

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

References ilTable2GUI\$id, ILIAS\Repository\filter(), ilTable2GUI\getFilterItemByPostVar(), and IL_CAL_DATETIME.

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

658  : array
659  {
660  $result = array();
661  foreach ($this->filter as $id => $value) {
662  $item = $this->getFilterItemByPostVar($id);
663  switch ($id) {
664  case "title":
665  case "country":
666  case "gender":
667  case "city":
668  case "language":
669  case "login":
670  case "firstname":
671  case "lastname":
672  case "mark":
673  case "u_comment":
674  case "institution":
675  case "department":
676  case "street":
677  case "zipcode":
678  case "email":
679  case "matriculation":
680  case "sel_country":
681  case "query":
682  case "type":
683  case "area":
684  if ($value) {
685  $result[$id] = $value;
686  }
687  break;
688 
689  case "status":
690  if (!is_null($value) && $value !== "") {
691  $result[$id] = $value;
692  }
693  break;
694 
695  case "user_total":
696  case "read_count":
697  case "percentage":
698  case "hide":
699  case "spent_seconds":
700  if (is_array($value) && implode("", $value)) {
701  $result[$id] = $value;
702  }
703  break;
704 
705  case "registration":
706  case "create_date":
707  case "first_access":
708  case "last_access":
709  case 'status_changed':
710  if ($value) {
711  if ($value["from"]) {
712  $result[$id]["from"] = $value["from"]->get(
714  );
715  }
716  if ($value["to"]) {
717  $result[$id]["to"] = $value["to"]->get(
719  );
720  }
721  }
722  break;
723 
724  case "birthday":
725  if ($value) {
726  if ($value["from"]) {
727  $result[$id]["from"] = $value["from"]->get(
729  );
730  $result[$id]["from"] = substr(
731  $result[$id]["from"],
732  0,
733  -8
734  ) . "00:00:00";
735  }
736  if ($value["to"]) {
737  $result[$id]["to"] = $value["to"]->get(
739  );
740  $result[$id]["to"] = substr(
741  $result[$id]["to"],
742  0,
743  -8
744  ) . "23:59:59";
745  }
746  }
747  break;
748  }
749  }
750  return $result;
751  }
const IL_CAL_DATETIME
getFilterItemByPostVar(string $a_post_var)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getExportMeta()

ilLPTableBaseGUI::getExportMeta ( )
protected

Build export meta data.

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

References ilTableGUI\$data, $DIC, ilObjUser\_lookupFullname(), ilObject\_lookupOwner(), ilObject\_lookupType(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ILIAS\Repository\lng(), ilDatePresentation\setUseRelativeDates(), and ILIAS\Repository\user().

Referenced by fillMetaCSV(), and fillMetaExcel().

820  : array
821  {
822  global $DIC;
823 
824  $ilClientIniFile = $DIC['ilClientIniFile'];
825 
826  /* see spec
827  Name of installation
828  Name of the course
829  Permalink to course
830  Owner of course object
831  Date of report generation
832  Reporting period
833  Name of person who generated the report.
834  */
835 
837 
838  $data = array();
839  $data[$this->lng->txt(
840  "trac_name_of_installation"
841  )] = $ilClientIniFile->readVariable('client', 'name');
842 
843  if ($this->obj_id) {
844  $data[$this->lng->txt(
845  "trac_object_name"
846  )] = $this->ilObjDataCache->lookupTitle((int) $this->obj_id);
847  if ($this->ref_id) {
848  $data[$this->lng->txt("trac_object_link")] = ilLink::_getLink(
849  $this->ref_id,
850  ilObject::_lookupType($this->obj_id)
851  );
852  }
853  $data[$this->lng->txt(
854  "trac_object_owner"
856  ilObject::_lookupOwner($this->obj_id)
857  );
858  }
859 
860  $data[$this->lng->txt(
861  "trac_report_date"
863  new ilDateTime(
864  time(),
866  )
867  );
868  $data[$this->lng->txt("trac_report_owner")] = $this->user->getFullName(
869  );
870 
871  return $data;
872  }
static _lookupFullname(int $a_user_id)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static _lookupOwner(int $obj_id)
Lookup owner user ID for object ID.
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
static _lookupType(int $id, bool $reference=false)
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIconVariant()

ilLPTableBaseGUI::getIconVariant ( )

Gets the variant of LP icons that is shown in the table.

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

References $icon_variant.

Referenced by parseValue().

1211  : int
1212  {
1213  return $this->icon_variant;
1214  }
+ Here is the caller graph for this function:

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

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

References ILIAS\Repository\lng().

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

986  : array
987  {
988  $options = array();
989  for ($loop = 0; $loop < 10; $loop++) {
990  $year = date("Y") - $loop;
991  $options[$year] = $year;
992  for ($loop2 = 12; $loop2 > 0; $loop2--) {
993  $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
994  if ($year . $month <= date("Ym")) {
995  if (!$a_short) {
996  $caption = $year . " / " . $this->lng->txt(
997  "month_" . $month . "_long"
998  );
999  } else {
1000  $caption = $year . "/" . $month;
1001  }
1002  $options[$year . "-" . $month] = $caption;
1003  }
1004  }
1005  }
1006  return $options;
1007  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMonthsYear()

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

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

References ILIAS\Repository\lng().

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

1009  : array
1010  {
1011  if (!$a_year) {
1012  $a_year = date("Y");
1013  }
1014 
1015  $all = array();
1016  for ($loop = 1; $loop < 13; $loop++) {
1017  $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
1018  if ($a_year . "-" . $month <= date("Y-m")) {
1019  if (!$a_short) {
1020  $caption = $this->lng->txt("month_" . $month . "_long");
1021  } else {
1022  $caption = $this->lng->txt("month_" . $month . "_short");
1023  }
1024  $all[$a_year . "-" . $month] = $caption;
1025  }
1026  }
1027  return $all;
1028  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleTypes()

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

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

References $DIC, ilRepositoryObjectPluginSlot\isTypePluginWithLP(), ILIAS\Repository\lng(), and ilObjectPlugin\lookupTxtById().

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

505  : array {
506  global $DIC;
507 
508  $component_repository = $DIC['component.repository'];
509 
510  $options = array();
511 
512  if ($a_split_learning_resources) {
513  $options['lm'] = $this->lng->txt('objs_lm');
514  $options['sahs'] = $this->lng->txt('objs_sahs');
515  $options['htlm'] = $this->lng->txt('objs_htlm');
516  } else {
517  $options['lres'] = $this->lng->txt('obj_lrss');
518  }
519 
520  $options['crs'] = $this->lng->txt('objs_crs');
521  $options['grp'] = $this->lng->txt('objs_grp');
522  $options['exc'] = $this->lng->txt('objs_exc');
523  $options['file'] = $this->lng->txt('objs_file');
524  $options['mcst'] = $this->lng->txt('objs_mcst');
525  $options['svy'] = $this->lng->txt('objs_svy');
526  $options['tst'] = $this->lng->txt('objs_tst');
527  $options['prg'] = $this->lng->txt('objs_prg');
528  $options['iass'] = $this->lng->txt('objs_iass');
529  $options['copa'] = $this->lng->txt('objs_copa');
530  $options['frm'] = $this->lng->txt('objs_frm');
531  $options['cmix'] = $this->lng->txt('objs_cmix');
532  $options['lti'] = $this->lng->txt('objs_lti');
533  $options['lso'] = $this->lng->txt('objs_lso');
534  $options['dcl'] = $this->lng->txt('objs_dcl');
535 
536  if ($a_allow_undefined_lp) {
537  $options['root'] = $this->lng->txt('obj_reps');
538  $options['cat'] = $this->lng->txt('objs_cat');
539  $options["webr"] = $this->lng->txt("objs_webr");
540  $options["wiki"] = $this->lng->txt("objs_wiki");
541  $options["blog"] = $this->lng->txt("objs_blog");
542  $options["prtf"] = $this->lng->txt("objs_prtf");
543  $options["prtt"] = $this->lng->txt("objs_prtt");
544  }
545 
546  // repository plugins (currently only active)
547  $plugins = $component_repository->getPluginSlotById(
548  "robj"
549  )->getActivePlugins();
550  foreach ($plugins as $pl) {
551  $pl_id = $pl->getId();
553  $options[$pl_id] = ilObjectPlugin::lookupTxtById(
554  $pl_id,
555  "objs_" . $pl_id
556  );
557  }
558  }
559 
560  asort($options);
561  return $options;
562  }
global $DIC
Definition: feed.php:28
static lookupTxtById(string $plugin_id, string $lang_var)
static isTypePluginWithLP(string $a_type, bool $a_active_status=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableUserColumns()

ilLPTableBaseGUI::getSelectableUserColumns ( int  $a_in_course = 0,
int  $a_in_group = 0 
)
protected

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

References Vendor\Package\$f, ilUserDefinedFields\_getInstance(), ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, ilObjectLP\getInstance(), ilPrivacySettings\getInstance(), isPercentageAvailable(), ILIAS\Repository\lng(), ilObjectLP\supportsMark(), ilObjectLP\supportsSpentSeconds(), and UDF_TYPE_WYSIWYG.

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

1033  : array {
1034  $cols = $privacy_fields = array();
1035 
1036  $up = new ilUserProfile();
1037  $up->skipGroup("preferences");
1038  $up->skipGroup("settings");
1039  $up->skipGroup("interests");
1040  $ufs = $up->getStandardFields();
1041 
1042  // default fields
1043  $cols["login"] = array(
1044  "txt" => $this->lng->txt("login"),
1045  "default" => true
1046  );
1047 
1048  if (!$this->anonymized) {
1049  $cols["firstname"] = array(
1050  "txt" => $this->lng->txt("firstname"),
1051  "default" => true
1052  );
1053  $cols["lastname"] = array(
1054  "txt" => $this->lng->txt("lastname"),
1055  "default" => true
1056  );
1057  }
1058 
1059  // show only if extended data was activated in lp settings
1060  $tracking = new ilObjUserTracking();
1061  if ($tracking->hasExtendedData(
1063  )) {
1064  $cols["first_access"] = array(
1065  "txt" => $this->lng->txt("trac_first_access"),
1066  "default" => true
1067  );
1068  $cols["last_access"] = array(
1069  "txt" => $this->lng->txt("trac_last_access"),
1070  "default" => true
1071  );
1072  }
1073  if ($tracking->hasExtendedData(
1075  )) {
1076  $cols["read_count"] = array(
1077  "txt" => $this->lng->txt("trac_read_count"),
1078  "default" => true
1079  );
1080  }
1081  if ($tracking->hasExtendedData(
1083  ) &&
1084  ilObjectLP::supportsSpentSeconds($this->type)) {
1085  $cols["spent_seconds"] = array(
1086  "txt" => $this->lng->txt("trac_spent_seconds"),
1087  "default" => true
1088  );
1089  }
1090 
1091  if ($this->isPercentageAvailable($this->obj_id)) {
1092  $cols["percentage"] = array(
1093  "txt" => $this->lng->txt("trac_percentage"),
1094  "default" => true
1095  );
1096  }
1097 
1098  // do not show status if learning progress is deactivated
1099  $olp = ilObjectLP::getInstance($this->obj_id);
1100  if ($olp->isActive()) {
1101  $cols["status"] = array(
1102  "txt" => $this->lng->txt("trac_status"),
1103  "default" => true
1104  );
1105 
1106  $cols['status_changed'] = array(
1107  'txt' => $this->lng->txt('trac_status_changed'),
1108  'default' => false
1109  );
1110  }
1111 
1112  if (ilObjectLP::supportsMark($this->type)) {
1113  $cols["mark"] = array(
1114  "txt" => $this->lng->txt("trac_mark"),
1115  "default" => true
1116  );
1117  }
1118 
1119  $cols["u_comment"] = array(
1120  "txt" => $this->lng->txt("trac_comment"),
1121  "default" => false
1122  );
1123 
1124  $cols["create_date"] = array(
1125  "txt" => $this->lng->txt("create_date"),
1126  "default" => false
1127  );
1128  $cols["language"] = array(
1129  "txt" => $this->lng->txt("language"),
1130  "default" => false
1131  );
1132 
1133  // add user data only if object is [part of] course
1134  if (!$this->anonymized &&
1135  ($a_in_course || $a_in_group)) {
1136  // only show if export permission is granted
1137  if (ilPrivacySettings::getInstance()->checkExportAccess(
1138  $a_in_group === 0 ? $a_in_course : $a_in_group
1139  )) {
1140  // other user profile fields
1141  foreach ($ufs as $f => $fd) {
1142  if (!isset($cols[$f]) && $f != "username" && !($fd["lists_hide"] ?? false)) {
1143  if ($a_in_course &&
1144  !(($fd["course_export_fix_value"] ?? false) || $this->setting->get(
1145  "usr_settings_course_export_" . $f
1146  ))) {
1147  continue;
1148  }
1149  if ($a_in_group &&
1150  !(($fd["group_export_fix_value"] ?? false) || $this->setting->get(
1151  "usr_settings_group_export_" . $f
1152  ))) {
1153  continue;
1154  }
1155 
1156  $cols[$f] = array(
1157  "txt" => $this->lng->txt($f),
1158  "default" => false
1159  );
1160  $privacy_fields[] = $f;
1161  }
1162  }
1163 
1164  // additional defined user data fields
1165  $user_defined_fields = ilUserDefinedFields::_getInstance();
1166  if ($a_in_course) {
1167  $user_defined_fields = $user_defined_fields->getCourseExportableFields(
1168  );
1169  } else {
1170  $user_defined_fields = $user_defined_fields->getGroupExportableFields(
1171  );
1172  }
1173  foreach ($user_defined_fields as $definition) {
1174  if ($definition["field_type"] != UDF_TYPE_WYSIWYG) {
1175  $f = "udf_" . $definition["field_id"];
1176  $cols[$f] = array(
1177  "txt" => $definition["field_name"],
1178  "default" => false
1179  );
1180 
1181  $privacy_fields[] = $f;
1182  }
1183  }
1184  }
1185  }
1186  return array($cols, $privacy_fields);
1187  }
Class ilUserProfile.
isPercentageAvailable(int $a_obj_id)
const UDF_TYPE_WYSIWYG
static supportsSpentSeconds(string $obj_type)
static supportsMark(string $obj_type)
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initBaseFilter()

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

Init filter.

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

References ilTable2GUI\addFilterItem(), ILIAS\Repository\filter(), getCurrentFilter(), getPossibleTypes(), ILIAS\Repository\lng(), ilTable2GUI\setDisableFilterHiding(), ilSelectInputGUI\setOptions(), and ilRepositorySelectorInputGUI\setSelectText().

Referenced by ilLPProgressTableGUI\__construct().

390  {
391  $this->setDisableFilterHiding(true);
392 
393  // object type selection
394  $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
395  $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
396  $this->addFilterItem($si);
397  $si->readFromSession();
398  if (!$si->getValue()) {
399  $si->setValue("crs");
400  }
401  $this->filter["type"] = $si->getValue();
402 
403  // hidden items
404  $msi = new ilMultiSelectInputGUI(
405  $this->lng->txt("trac_filter_hidden"),
406  "hide"
407  );
408  $this->addFilterItem($msi);
409  $msi->readFromSession();
410  $this->filter["hide"] = $msi->getValue();
411  if ($this->filter["hide"]) {
412  // create options from current value
413  $types = $this->getCurrentFilter(true);
414  $type = $types["type"];
415  $options = array();
416  if ($type == 'lres') {
417  $type = array('lm', 'sahs', 'htlm');
418  } else {
419  $type = array($type);
420  }
421  foreach ($this->filter["hide"] as $obj_id) {
422  if (in_array(
423  $this->ilObjDataCache->lookupType((int) $obj_id),
424  $type
425  )) {
426  $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
427  (int) $obj_id
428  );
429  }
430  }
431  $msi->setOptions($options);
432  }
433 
434  // title/description
435  $ti = new ilTextInputGUI(
436  $this->lng->txt("trac_title_description"),
437  "query"
438  );
439  $ti->setMaxLength(64);
440  $ti->setSize(20);
441  $this->addFilterItem($ti);
442  $ti->readFromSession();
443  $this->filter["query"] = $ti->getValue();
444 
445  // repository area selection
447  $this->lng->txt("trac_filter_area"),
448  "area"
449  );
450  $rs->setSelectText($this->lng->txt("trac_select_area"));
451  $this->addFilterItem($rs);
452  $rs->readFromSession();
453  $this->filter["area"] = $rs->getValue();
454 
455  // hide "not started yet"
456  if ($a_include_no_status_filter) {
457  $cb = new ilCheckboxInputGUI(
458  $this->lng->txt("trac_filter_has_status"),
459  "status"
460  );
461  $this->addFilterItem($cb);
462  $cb->readFromSession();
463  $this->filter["status"] = $cb->getChecked();
464  }
465  }
getPossibleTypes(bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
getCurrentFilter(bool $as_query=false)
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setDisableFilterHiding(bool $a_val=true)
setOptions(array $a_options)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initItemIdFromPost()

ilLPTableBaseGUI::initItemIdFromPost ( )
protected

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

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

79  : array
80  {
81  if ($this->http->wrapper()->post()->has('item_id')) {
82  return $this->http->wrapper()->post()->retrieve(
83  'item_id',
84  $this->refinery->kindlyTo()->listOf(
85  $this->refinery->kindlyTo()->int()
86  )
87  );
88  }
89  return [];
90  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRepositoryFilter()

ilLPTableBaseGUI::initRepositoryFilter ( array  $filter)
protected

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

References $filter, ilTable2GUI\addFilterItem(), ILIAS\Repository\int(), isForwardingToFormDispatcher(), and ILIAS\Repository\lng().

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

363  : array
364  {
365  $repo = new ilRepositorySelector2InputGUI(
366  $this->lng->txt('trac_filter_area'),
367  'effective_from',
368  false,
369  ($this->isForwardingToFormDispatcher()) ? $this : null
370  );
371  $white_list = [];
372  foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
373  if ($this->objDefinition->isContainer($type)) {
374  $white_list[] = $type;
375  }
376  }
377  $repo->getExplorerGUI()->setTypeWhiteList($white_list);
378  $this->addFilterItem($repo);
379  $repo->readFromSession();
380  $filter['area'] = (int) $repo->getValue();
381  return $filter;
382  }
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initUidFromPost()

ilLPTableBaseGUI::initUidFromPost ( )
protected

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

References ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

Referenced by addToClipboard(), and executeCommand().

92  : array
93  {
94  if ($this->http->wrapper()->post()->has('uid')) {
95  return $this->http->wrapper()->post()->retrieve(
96  'uid',
97  $this->refinery->kindlyTo()->listOf(
98  $this->refinery->kindlyTo()->int()
99  )
100  );
101  }
102  return [];
103  }
static http()
Fetches the global http state from ILIAS.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isForwardingToFormDispatcher()

ilLPTableBaseGUI::isForwardingToFormDispatcher ( )
protected

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

Referenced by initRepositoryFilter().

358  : bool
359  {
360  return false;
361  }
+ Here is the caller graph for this function:

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable ( int  $a_obj_id)
protected

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

References ilObjectLP\getInstance(), ilLPObjSettings\LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED, ilLPObjSettings\LP_MODE_CMIX_COMPL_WITH_FAILED, ilLPObjSettings\LP_MODE_CMIX_COMPLETED, ilLPObjSettings\LP_MODE_CMIX_COMPLETED_OR_PASSED, ilLPObjSettings\LP_MODE_CMIX_PASSED, ilLPObjSettings\LP_MODE_CMIX_PASSED_WITH_FAILED, ilLPObjSettings\LP_MODE_LTI_OUTCOME, 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().

753  : bool
754  {
755  if ($a_obj_id === 0) {
756  return false;
757  }
758  $olp = ilObjectLP::getInstance($a_obj_id);
759  $mode = $olp->getCurrentMode();
760  if (in_array(
761  $mode,
774  )
775  )) {
776  return true;
777  }
778  return false;
779  }
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseTitle()

ilLPTableBaseGUI::parseTitle ( int  $a_obj_id,
string  $action,
int  $a_user_id = 0 
)
protected

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

References $DIC, $user, ilObjectLP\getInstance(), ilObjectFactory\getInstanceByObjId(), ILIAS\Repository\lng(), ROOT_FOLDER_ID, ilTable2GUI\setDescription(), ilTable2GUI\setTitle(), and ILIAS\Repository\user().

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

785  {
786  global $DIC;
787 
788  $user = "";
789  if ($a_user_id) {
790  if ($a_user_id != $this->user->getId()) {
791  $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
792  } else {
793  $a_user = $this->user;
794  }
795  $user .= ", " . $a_user->getFullName(
796  ); // " [".$a_user->getLogin()."]";
797  }
798 
799  if ($a_obj_id != ROOT_FOLDER_ID) {
800  $this->setTitle(
801  $this->lng->txt(
802  $action
803  ) . ": " . $this->ilObjDataCache->lookupTitle($a_obj_id) . $user
804  );
805 
806  $olp = ilObjectLP::getInstance($a_obj_id);
807  $this->setDescription(
808  $this->lng->txt('trac_mode') . ": " . $olp->getModeText(
809  $olp->getCurrentMode()
810  )
811  );
812  } else {
813  $this->setTitle($this->lng->txt($action));
814  }
815  }
const ROOT_FOLDER_ID
Definition: constants.php:32
setDescription(string $a_val)
global $DIC
Definition: feed.php:28
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstance(int $obj_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseValue()

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

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

References ilDatePresentation\formatDate(), getIconVariant(), ilLPStatusIcons\getInstance(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, ILIAS\Repository\lng(), 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().

568  : string {
569  // get rid of aggregation
570  $pos = strrpos($id, "_");
571  if ($pos !== false) {
572  $function = strtoupper(substr($id, $pos + 1));
573  if (in_array(
574  $function,
575  array("MIN", "MAX", "SUM", "AVG", "COUNT")
576  )) {
577  $id = substr($id, 0, $pos);
578  }
579  }
580 
581  if ((trim((string) $value) == "") && $id != "status") {
582  if ($id == "title" &&
583  get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
584  get_class($this) != "ilTrMatrixTableGUI") {
585  return "--" . $this->lng->txt("none") . "--";
586  }
587  return " ";
588  }
589 
590  switch ($id) {
591  case "first_access":
592  case "create_date":
593  case 'status_changed':
595  new ilDateTime($value, IL_CAL_DATETIME)
596  );
597  break;
598 
599  case "last_access":
601  new ilDateTime($value, IL_CAL_UNIX)
602  );
603  break;
604 
605  case "birthday":
607  new ilDate($value, IL_CAL_DATE)
608  );
609  break;
610 
611  case "spent_seconds":
612  if (!ilObjectLP::supportsSpentSeconds($type)) {
613  $value = "-";
614  } else {
616  (int) $value,
617  ((int) $value < 3600 ? true : false)
618  ); // #14858
619  }
620  break;
621 
622  case "percentage":
623  if (false /* $this->isPercentageAvailable() */) {
624  $value = "-";
625  } else {
626  $value = $value . "%";
627  }
628  break;
629 
630  case "mark":
631  if (!ilObjectLP::supportsMark($type)) {
632  $value = "-";
633  }
634  break;
635 
636  case "gender":
637  $value = $this->lng->txt("gender_" . $value);
638  break;
639 
640  case "status":
641  $icons = ilLPStatusIcons::getInstance($this->getIconVariant());
642  $value = $icons->renderIconForStatus((int) $value);
643  break;
644 
645  case "language":
646  $this->lng->loadLanguageModule("meta");
647  $value = $this->lng->txt("meta_l_" . $value);
648  break;
649 
650  case "sel_country":
651  $value = $this->lng->txt("meta_c_" . $value);
652  break;
653  }
654 
655  return $value ?? '';
656  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
const IL_CAL_UNIX
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
getIconVariant()
Gets the variant of LP icons that is shown in the table.
static supportsSpentSeconds(string $obj_type)
const IL_CAL_DATE
static supportsMark(string $obj_type)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ searchFilterListener()

ilLPTableBaseGUI::searchFilterListener ( int  $a_ref_id,
array  $a_data 
)

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

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

References ILIAS\Repository\filter(), and ilObjectLP\getInstance().

340  : bool
341  {
342  if (is_array($this->filter["hide"]) && in_array(
343  $a_data["obj_id"],
344  $this->filter["hide"]
345  )) {
346  return false;
347  }
348  $olp = ilObjectLP::getInstance($a_data["obj_id"]);
349  if (get_class(
350  $olp
351  ) != "ilObjectLP" && // #13654 - LP could be unsupported
352  !$olp->isActive()) {
353  return false;
354  }
355  return true;
356  }
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ searchObjects()

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

Search objects that match current filters.

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

References $res, ILIAS\Repository\filter(), ilLoggerFactory\getLogger(), ilQueryParser\QP_COMBINATION_AND, and ROOT_FOLDER_ID.

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

286  : array {
287  $query_parser = new ilQueryParser($filter["query"] ?? '');
288  $query_parser->setMinWordLength(0);
289  $query_parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
290  $query_parser->parse();
291  if (!$query_parser->validate()) {
292  ilLoggerFactory::getLogger('trac')->notice(
293  $query_parser->getMessage()
294  );
295  // echo $query_parser->getMessage();
296  return [];
297  }
298 
299  if ($filter["type"] == "lres") {
300  $filter["type"] = array('lm', 'sahs', 'htlm');
301  } else {
302  $filter["type"] = array($filter["type"]);
303  }
304 
305  $object_search = new ilLikeObjectSearch($query_parser);
306  $object_search->setFilter($filter["type"]);
307  if ($preset_obj_ids) {
308  $object_search->setIdFilter($preset_obj_ids);
309  }
310  $res = $object_search->performSearch();
311 
312  if ($permission) {
313  $res->setRequiredPermission($permission);
314  }
315 
316  $res->setMaxHits(self::HIT_LIMIT);
317 
318  if ($a_check_lp_activation) {
319  $res->addObserver($this, "searchFilterListener");
320  }
321 
322  if (!$this->filter["area"]) {
323  $res->filter(ROOT_FOLDER_ID, true);
324  } else {
325  $res->filter($this->filter["area"], true);
326  }
327 
328  $objects = array();
329  foreach ($res->getResults() as $obj_data) {
330  $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
331  }
332  return $objects ?: array();
333  }
$res
Definition: ltiservices.php:69
static getLogger(string $a_component_id)
Get component logger.
const ROOT_FOLDER_ID
Definition: constants.php:32
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
+ 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,
string  $a_parent_cmd 
)
protected

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

References $ref_id, ilObjUser\_lookupLogin(), ilObject\_lookupObjectId(), ilMailFormCall\CONTEXT_KEY, ilObjectLP\getInstance(), ilMailFormCall\getRedirectTarget(), ILIAS\FileDelivery\http(), ilUtil\redirect(), and ILIAS\Repository\refinery().

Referenced by executeCommand().

226  : void {
227  // see ilObjCourseGUI::sendMailToSelectedUsersObject()
228 
229  $rcps = array();
230  foreach ($a_user_ids as $usr_id) {
231  $rcps[] = ilObjUser::_lookupLogin($usr_id);
232  }
233 
234  $template = array();
235  $sig = null;
236 
237  $ref_id = 0;
238  if ($this->http->wrapper()->query()->has('ref_id')) {
239  $ref_id = $this->http->wrapper()->query()->retrieve(
240  'ref_id',
241  $this->refinery->kindlyTo()->int()
242  );
243  }
244  // repository-object-specific
245  if ($ref_id) {
246  $obj_lp = ilObjectLP::getInstance(
248  );
249  $tmpl_id = $obj_lp->getMailTemplateId();
250 
251  if ($tmpl_id) {
252  $template = array(
253  ilMailFormCall::CONTEXT_KEY => $tmpl_id,
254  'ref_id' => $ref_id,
255  'ts' => time()
256  );
257  } else {
258  $sig = ilLink::_getLink($ref_id);
259  $sig = rawurlencode(base64_encode($sig));
260  }
261  }
262 
265  $a_parent_obj,
266  $a_parent_cmd,
267  array(),
268  array(
269  'type' => 'new',
270  'rcp_to' => implode(',', $rcps),
271  'sig' => $sig
272  ),
273  $template
274  )
275  );
276  }
static http()
Fetches the global http state from ILIAS.
$ref_id
Definition: ltiauth.php:67
static _lookupObjectId(int $ref_id)
static redirect(string $a_script)
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static getInstance(int $obj_id)
static _lookupLogin(int $a_user_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setIconVariant()

ilLPTableBaseGUI::setIconVariant ( int  $variant)

Sets the variant of LP icons that is shown in the table.

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

1219  : void
1220  {
1221  $this->icon_variant = $variant;
1222  }

◆ showTimingsWarning()

ilLPTableBaseGUI::showTimingsWarning ( int  $a_ref_id,
int  $a_user_id 
)
protected
Parameters
int$a_ref_id
int$a_user_id
Returns
bool|mixed

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

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

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

900  {
901  $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
902  if ($timing_cache->isWarningRequired($a_user_id)) {
903  $timings = ilTimingCache::_getTimings($a_ref_id);
904  if (
905  $timings['item']['changeable'] &&
906  ($timings['user'][$a_user_id] ?? false) &&
907  $timings['user'][$a_user_id]['end']
908  ) {
909  $end = $timings['user'][$a_user_id]['end'];
910  } elseif ($timings['item']['suggestion_end']) {
911  $end = $timings['item']['suggestion_end'];
912  } else {
913  $end = true;
914  }
915  return $end;
916  }
917  return false;
918  }
static _getTimings(int $a_ref_id)
static getInstanceByRefId(int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $anonymized

bool ilLPTableBaseGUI::$anonymized = true
protected

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

◆ $filter

array ilLPTableBaseGUI::$filter = []
protected

◆ $http

HttpService ilLPTableBaseGUI::$http
protected

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

◆ $icon_variant

int ilLPTableBaseGUI::$icon_variant = ilLPStatusIcons::ICON_VARIANT_LONG
protected

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

Referenced by getIconVariant().

◆ $ilObjDataCache

ilObjectDataCache ilLPTableBaseGUI::$ilObjDataCache
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilLPTableBaseGUI::$main_tpl
protected

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

◆ $objDefinition

ilObjectDefinition ilLPTableBaseGUI::$objDefinition
protected

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

◆ $refinery

RefineryFactory ilLPTableBaseGUI::$refinery
protected

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

◆ $setting

ilSetting ilLPTableBaseGUI::$setting
protected

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

◆ $tree

ilTree ilLPTableBaseGUI::$tree
protected

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

◆ $user

ilObjUser ilLPTableBaseGUI::$user
private

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

Referenced by ilLPProgressTableGUI\__construct(), and parseTitle().

◆ HIT_LIMIT

const ilLPTableBaseGUI::HIT_LIMIT = 5000

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


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