ILIAS  release_8 Revision v8.24
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 @access 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)
 Set table data. More...
 
 getData ()
 
 dataExists ()
 
 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...
 
 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 ()
 get the name of the parent form More...
 
 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)
 set max. More...
 
- 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)
 Add meta information to excel export. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 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 = "" 
)
Parameters
object | null$a_parent_objupper GUI class, which calls ilTable2GUI

Reimplemented from ilTable2GUI.

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

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 }
static getInstance(int $obj_id)
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ addToClipboard()

ilLPTableBaseGUI::addToClipboard ( )
protected

Add selected users to clipboard.

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

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

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

Referenced by executeCommand().

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

◆ anonymizeValue()

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

◆ buildPath()

ilLPTableBaseGUI::buildPath ( array  $ref_ids)
protected

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

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="' .
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 }
$ref_id
Definition: ltiauth.php:67
$path
Definition: ltiservices.php:32

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

Referenced by ilLPProgressTableGUI\fillRow().

+ Here is the call graph for this function:
+ 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 952 of file class.ilLPTableBaseGUI.php.

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

References $base.

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

+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

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

105 : bool
106 {
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:
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)
determineOffsetAndOrder(bool $a_omit_offset=false)
resetOffset(bool $a_in_determination=false)
storeProperty(string $type, string $value)

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

+ Here is the call graph for this function:

◆ fillMetaCSV()

ilLPTableBaseGUI::fillMetaCSV ( ilCSVWriter  $a_csv)
protected

Add meta information to csv export.

Likely to be overwritten by derived class.

Parameters
ilCSVWriter$a_csvcurrent file

Reimplemented from ilTable2GUI.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

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

883 : void
884 {
885 foreach ($this->getExportMeta() as $caption => $value) {
886 $a_csv->addColumn(strip_tags($caption));
887 $a_csv->addColumn(strip_tags($value));
888 $a_csv->addRow();
889 }
890 $a_csv->addRow();
891 }
addColumn(string $a_col)
getExportMeta()
Build export meta data.

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

+ Here is the call graph for this function:

◆ fillMetaExcel()

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

Add meta information to excel export.

Likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter

Reimplemented from ilTable2GUI.

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsTableGUI, and ilLPObjectStatisticsTypesTableGUI.

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

873 : void
874 {
875 foreach ($this->getExportMeta() as $caption => $value) {
876 $a_excel->setCell($a_row, 0, $caption);
877 $a_excel->setCell($a_row, 1, $value);
878 $a_row++;
879 }
880 $a_row++;
881 }
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.

References ilExcel\setCell().

+ Here is the call graph for this function:

◆ findReferencesForObjId()

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

Reimplemented in ilLPObjectStatisticsTableGUI.

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

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

References ilObject\_getAllReferences().

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

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

922 : string {
923 $seconds = ($seconds > 0) ? $seconds : 0;
924 if ($a_shorten_zero && !$seconds) {
925 return "-";
926 }
927
928 $hours = floor($seconds / 3600);
929 $rest = $seconds % 3600;
930
931 $minutes = floor($rest / 60);
932 $rest = $rest % 60;
933
934 if ($rest) {
935 $minutes++;
936 }
937
938 return sprintf("%dh%02dm", $hours, $minutes);
939 }
$rest
Definition: goto.php:49

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

+ Here is the caller graph for this function:

◆ getCurrentFilter()

ilLPTableBaseGUI::getCurrentFilter ( bool  $as_query = false)

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

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

References $id, ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), and IL_CAL_DATETIME.

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

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

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

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

+ Here is the call graph for this function:

◆ getIconVariant()

ilLPTableBaseGUI::getIconVariant ( )

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

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

1210 : int
1211 {
1212 return $this->icon_variant;
1213 }

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

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

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

References ILIAS\Repository\lng().

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

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

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

References ILIAS\Repository\lng().

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

+ 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.

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
535 if ($a_allow_undefined_lp) {
536 $options['root'] = $this->lng->txt('obj_reps');
537 $options['cat'] = $this->lng->txt('objs_cat');
538 $options["webr"] = $this->lng->txt("objs_webr");
539 $options["wiki"] = $this->lng->txt("objs_wiki");
540 $options["blog"] = $this->lng->txt("objs_blog");
541 $options["prtf"] = $this->lng->txt("objs_prtf");
542 $options["prtt"] = $this->lng->txt("objs_prtt");
543 }
544
545 // repository plugins (currently only active)
546 $plugins = $component_repository->getPluginSlotById(
547 "robj"
548 )->getActivePlugins();
549 foreach ($plugins as $pl) {
550 $pl_id = $pl->getId();
552 $options[$pl_id] = ilObjectPlugin::lookupTxtById(
553 $pl_id,
554 "objs_" . $pl_id
555 );
556 }
557 }
558
559 asort($options);
560 return $options;
561 }
static lookupTxtById(string $plugin_id, string $lang_var)
static isTypePluginWithLP(string $a_type, bool $a_active_status=true)

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

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

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

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

+ 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.

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 }
This class represents a checkbox property in a property form.
getPossibleTypes(bool $a_split_learning_resources=false, bool $a_include_digilib=false, bool $a_allow_undefined_lp=false)
getCurrentFilter(bool $as_query=false)
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...
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)
This class represents a text property in a property form.
$type

References $type, ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), and ILIAS\Repository\lng().

Referenced by ilLPProgressTableGUI\__construct().

+ 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.

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 }

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

Referenced by executeCommand().

+ 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.

363 : array
364 {
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 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $type, ILIAS\Repository\int(), and ILIAS\Repository\lng().

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

+ 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.

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 }

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

Referenced by executeCommand().

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

◆ isForwardingToFormDispatcher()

ilLPTableBaseGUI::isForwardingToFormDispatcher ( )
protected

Reimplemented in ilLPObjectStatisticsDailyTableGUI, ilLPObjectStatisticsLPTableGUI, and ilLPObjectStatisticsTableGUI.

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

358 : bool
359 {
360 return false;
361 }

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable ( int  $a_obj_id)
protected

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

752 : bool
753 {
754 if ($a_obj_id === 0) {
755 return false;
756 }
757 $olp = ilObjectLP::getInstance($a_obj_id);
758 $mode = $olp->getCurrentMode();
759 if (in_array(
760 $mode,
773 )
774 )) {
775 return true;
776 }
777 return false;
778 }
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED

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(), ilLPProgressTableGUI\getItems(), ilTrSummaryTableGUI\getItems(), ilTrSummaryTableGUI\getSelectableColumns(), and ilTrSummaryTableGUI\initFilter().

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

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

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

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

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

◆ parseValue()

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

Reimplemented in ilTrSummaryTableGUI.

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

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

References $id.

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

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

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

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 }

References ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), and ilObjectLP\getInstance().

+ 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.

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 }
static getLogger(string $a_component_id)
Get component logger.
$res
Definition: ltiservices.php:69

References ilLoggerFactory\getLogger().

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

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

◆ sendMail()

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

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

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 {
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 getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
static _lookupLogin(int $a_user_id)
static _lookupObjectId(int $ref_id)
static redirect(string $a_script)

References ilObjUser\_lookupLogin().

Referenced by executeCommand().

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

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

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

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

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

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

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

Field Documentation

◆ $anonymized

bool ilLPTableBaseGUI::$anonymized = true
protected

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

◆ $filter

array ilLPTableBaseGUI::$filter = []
protected

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

Referenced by ilTrSummaryTableGUI\getItems().

◆ $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.

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

◆ 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: