ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ()
 
 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
 
Profile $profile
 
- Protected Attributes inherited from ilTable2GUI
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_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 33 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 50 of file class.ilLPTableBaseGUI.php.

54 {
55 global $DIC;
56 $this->main_tpl = $DIC->ui()->mainTemplate();
57
58 $this->objDefinition = $DIC['objDefinition'];
59 $this->ilObjDataCache = $DIC['ilObjDataCache'];
60 $this->tree = $DIC->repositoryTree();
61 $this->user = $DIC->user();
62 $this->setting = $DIC->settings();
63 $this->http = $DIC->http();
64 $this->refinery = $DIC->refinery();
65 $this->profile = $DIC['user']->getProfile();
66
67 $this->anonymized = !ilObjUserTracking::_enabledUserRelatedData();
68 if (!$this->anonymized && isset($this->obj_id) && $this->obj_id > 0) {
69 $olp = ilObjectLP::getInstance($this->obj_id);
70 $this->anonymized = $olp->isAnonymized();
71 }
72
73 /*
74 * BT 35453: parent constructor needs to be called after $this->anonymized
75 * is set, in order for getSelectableUserColumns to also properly return
76 * user defined fields (e.g. firstname, lastname, and other user data).
77 */
78 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
79
80 // country names
81 $this->lng->loadLanguageModule("meta");
82 }
static getInstance(int $obj_id)
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilObjUserTracking\_enabledUserRelatedData(), ilObjectLP\getInstance(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), 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 1158 of file class.ilLPTableBaseGUI.php.

1158 : void
1159 {
1160 $users = $this->initUidFromPost();
1161 $clip = ilUserClipboard::getInstance($this->user->getId());
1162 $clip->add($users);
1163 $clip->save();
1164 $this->lng->loadLanguageModule('user');
1165 $this->main_tpl->setOnScreenMessage(
1166 'success',
1167 $this->lng->txt(
1168 'clipboard_user_added'
1169 ),
1170 true
1171 );
1172 }
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 463 of file class.ilLPTableBaseGUI.php.

463 : array
464 {
465 if (!count($ref_ids)) {
466 return [];
467 }
468 $result = [];
469 foreach ($ref_ids as $ref_id) {
470 $path = "...";
471 $counter = 0;
472 $path_full = $this->tree->getPathFull($ref_id);
473 foreach ($path_full as $data) {
474 if (++$counter < (count($path_full) - 1)) {
475 continue;
476 }
477 $path .= " &raquo; ";
478 if ($ref_id != $data['ref_id']) {
479 $path .= $data['title'];
480 } else {
481 $path .= ('<a target="_top" href="' .
482 ilLink::_getLink(
483 $data['ref_id'],
484 $data['type']
485 ) . '">' .
486 $data['title'] . '</a>');
487 }
488 }
489
490 $result[$ref_id] = $path;
491 }
492 return $result;
493 }
$ref_id
Definition: ltiauth.php:66
$path
Definition: ltiservices.php:30
$counter

References $counter, $data, $path, and $ref_id.

Referenced by ilLPProgressTableGUI\fillRow().

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

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

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

+ Here is the caller graph for this function:

◆ executeCommand()

ilLPTableBaseGUI::executeCommand ( )

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

110 : bool
111 {
113 if (!$this->ctrl->getNextClass($this)) {
114 $to_hide = false;
115
116 switch ($this->ctrl->getCmd()) {
117 case "applyFilter":
118 $this->resetOffset();
119 $this->writeFilterToSession();
120 $this->storeProperty("offset", "0");
121 break;
122
123 case "resetFilter":
124 $this->resetOffset();
125 $this->resetFilter();
126 $this->storeProperty("offset", "0");
127 break;
128
129 case "hideSelected":
130 $to_hide = $this->initItemIdFromPost();
131 break;
132
133 case "hide":
134 $hide = 0;
135 if ($this->http->wrapper()->query()->has('hide')) {
136 $hide = $this->http->wrapper()->query()->retrieve(
137 'hide',
138 $this->refinery->kindlyTo()->int()
139 );
140 }
141 $to_hide = [$hide];
142 break;
143
144 case "mailselectedusers":
145 if (!$this->initUidFromPost()) {
146 $this->main_tpl->setOnScreenMessage(
147 'failure',
148 $this->lng->txt(
149 "no_checkbox"
150 ),
151 true
152 );
153 } else {
154 $this->sendMail(
155 $this->initUidFromPost(),
156 $this->parent_obj,
157 $this->parent_cmd
158 );
159 }
160 break;
161
162 case 'addToClipboard':
163 if (!$this->initUidFromPost()) {
164 $this->main_tpl->setOnScreenMessage(
165 'failure',
166 $this->lng->txt(
167 'no_checkbox'
168 ),
169 true
170 );
171 } else {
172 $this->addToClipboard();
173 }
174 break;
175
176 // page selector
177 default:
179 $this->storeNavParameter();
180 $this->storeProperty("offset", (string) $this->getOffset());
181 break;
182 }
183
184 if ($to_hide) {
185 $obj = $this->getFilterItemByPostVar("hide");
186 $value = array_unique(
187 array_merge((array) $obj->getValue(), $to_hide)
188 );
189 $obj->setValue($value);
190 $obj->writeToSession();
191 }
192
193 if ($this->requested_tmpl_create !== "") {
194 $this->ctrl->setParameter(
195 $this->parent_obj,
196 "tbltplcrt",
197 $this->requested_tmpl_create
198 );
199 }
200 if ($this->requested_tmpl_delete !== "") {
201 $this->ctrl->setParameter(
202 $this->parent_obj,
203 "tbltpldel",
204 $this->requested_tmpl_delete
205 );
206 }
207 $this->ctrl->redirect($this->parent_obj, $this->parent_cmd);
208 } else {
209 // e.g. repository selector
210 return parent::executeCommand();
211 }
212 return true;
213 }
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 880 of file class.ilLPTableBaseGUI.php.

880 : void
881 {
882 foreach ($this->getExportMeta() as $caption => $value) {
883 $a_csv->addColumn(strip_tags($caption));
884 $a_csv->addColumn(strip_tags($value));
885 $a_csv->addRow();
886 }
887 $a_csv->addRow();
888 }
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 870 of file class.ilLPTableBaseGUI.php.

870 : void
871 {
872 foreach ($this->getExportMeta() as $caption => $value) {
873 $a_excel->setCell($a_row, 0, $caption);
874 $a_excel->setCell($a_row, 1, $value);
875 $a_row++;
876 }
877 $a_row++;
878 }
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
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 218 of file class.ilLPTableBaseGUI.php.

218 : array
219 {
220 $ref_ids = array_keys(ilObject::_getAllReferences($a_obj_id));
221 sort($ref_ids, SORT_NUMERIC);
222 return $ref_ids;
223 }
static _getAllReferences(int $id)
get all reference ids for object ID

References ilObject\_getAllReferences(), and ILIAS\UI\examples\Symbol\Glyph\Sort\sort().

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

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

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

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

References $id, ILIAS\Repository\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 816 of file class.ilLPTableBaseGUI.php.

816 : array
817 {
818 global $DIC;
819
820 $ilClientIniFile = $DIC['ilClientIniFile'];
821
822 /* see spec
823 Name of installation
824 Name of the course
825 Permalink to course
826 Owner of course object
827 Date of report generation
828 Reporting period
829 Name of person who generated the report.
830 */
831
833
834 $data = array();
835 $data[$this->lng->txt(
836 "trac_name_of_installation"
837 )] = $ilClientIniFile->readVariable('client', 'name');
838
839 if ($this->obj_id) {
840 $data[$this->lng->txt(
841 "trac_object_name"
842 )] = $this->ilObjDataCache->lookupTitle((int) $this->obj_id);
843 if ($this->ref_id) {
844 $data[$this->lng->txt("trac_object_link")] = ilLink::_getLink(
845 $this->ref_id,
846 ilObject::_lookupType($this->obj_id)
847 );
848 }
849 $data[$this->lng->txt(
850 "trac_object_owner"
852 ilObject::_lookupOwner($this->obj_id)
853 );
854 }
855
856 $data[$this->lng->txt(
857 "trac_report_date"
859 new ilDateTime(
860 time(),
862 )
863 );
864 $data[$this->lng->txt("trac_report_owner")] = $this->user->getFullName(
865 );
866
867 return $data;
868 }
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, ?ilObjUser $user=null,)
@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, 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 1177 of file class.ilLPTableBaseGUI.php.

1177 : int
1178 {
1179 return $this->icon_variant;
1180 }

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

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

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

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

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

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

499 : array {
500 global $DIC;
501
502 $component_repository = $DIC['component.repository'];
503
504 $options = array();
505
506 if ($a_split_learning_resources) {
507 $options['lm'] = $this->lng->txt('objs_lm');
508 $options['sahs'] = $this->lng->txt('objs_sahs');
509 $options['htlm'] = $this->lng->txt('objs_htlm');
510 } else {
511 $options['lres'] = $this->lng->txt('obj_lrss');
512 }
513
514 $options['crs'] = $this->lng->txt('objs_crs');
515 $options['grp'] = $this->lng->txt('objs_grp');
516 $options['exc'] = $this->lng->txt('objs_exc');
517 $options['file'] = $this->lng->txt('objs_file');
518 $options['mcst'] = $this->lng->txt('objs_mcst');
519 $options['svy'] = $this->lng->txt('objs_svy');
520 $options['tst'] = $this->lng->txt('objs_tst');
521 $options['prg'] = $this->lng->txt('objs_prg');
522 $options['iass'] = $this->lng->txt('objs_iass');
523 $options['copa'] = $this->lng->txt('objs_copa');
524 $options['frm'] = $this->lng->txt('objs_frm');
525 $options['cmix'] = $this->lng->txt('objs_cmix');
526 $options['lti'] = $this->lng->txt('objs_lti');
527 $options['lso'] = $this->lng->txt('objs_lso');
528 $options['dcl'] = $this->lng->txt('objs_dcl');
529
530 if ($a_allow_undefined_lp) {
531 $options['root'] = $this->lng->txt('obj_reps');
532 $options['cat'] = $this->lng->txt('objs_cat');
533 $options["webr"] = $this->lng->txt("objs_webr");
534 $options["wiki"] = $this->lng->txt("objs_wiki");
535 $options["blog"] = $this->lng->txt("objs_blog");
536 $options["prtf"] = $this->lng->txt("objs_prtf");
537 $options["prtt"] = $this->lng->txt("objs_prtt");
538 }
539
540 // repository plugins (currently only active)
541 $plugins = $component_repository->getPluginSlotById(
542 "robj"
543 )->getActivePlugins();
544 foreach ($plugins as $pl) {
545 $pl_id = $pl->getId();
547 $options[$pl_id] = ilObjectPlugin::lookupTxtById(
548 $pl_id,
549 "objs_" . $pl_id
550 );
551 }
552 }
553
554 asort($options);
555 return $options;
556 }
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 1026 of file class.ilLPTableBaseGUI.php.

1029 : array {
1030 $cols = $privacy_fields = array();
1031
1032 $this->profile->skipGroup(AvailableSections::Interests);
1033 if ($a_in_course === 1) {
1034 $ufs = $this->profile->getVisibleFields(Context::Course);
1035 } elseif ($a_in_group === 1) {
1036 $ufs = $this->profile->getVisibleFields(Context::Group);
1037 } else {
1038 $ufs = $this->profile->getFields();
1039 }
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 $fd) {
1141 $f = $fd->getIdentifier();
1142 if (!isset($cols[$f]) && $f !== "username" && !$fd->hiddenInLists()) {
1143 $cols[$f] = array(
1144 "txt" => $fd->getLabel($this->lng),
1145 "default" => false
1146 );
1147 $privacy_fields[] = $f;
1148 }
1149 }
1150 }
1151 }
1152 return array($cols, $privacy_fields);
1153 }
isPercentageAvailable(int $a_obj_id)
static supportsSpentSeconds(string $obj_type)
static supportsMark(string $obj_type)

References ILIAS\Repository\profile().

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

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

◆ initBaseFilter()

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

Init filter.

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

395 {
396 $this->setDisableFilterHiding(true);
397
398 // object type selection
399 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
400 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
401 $this->addFilterItem($si);
402 $si->readFromSession();
403 if (!$si->getValue()) {
404 $si->setValue("crs");
405 }
406 $this->filter["type"] = $si->getValue();
407
408 // hidden items
409 $msi = new ilMultiSelectInputGUI(
410 $this->lng->txt("trac_filter_hidden"),
411 "hide"
412 );
413 $this->addFilterItem($msi);
414 $msi->readFromSession();
415 $this->filter["hide"] = $msi->getValue();
416 if ($this->filter["hide"]) {
417 // create options from current value
418 $types = $this->getCurrentFilter(true);
419 $options = [];
420 foreach ($this->filter["hide"] as $obj_id) {
421 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
422 (int) $obj_id
423 );
424 }
425 $msi->setOptions($options);
426 }
427
428 // title/description
429 $ti = new ilTextInputGUI(
430 $this->lng->txt("trac_title_description"),
431 "query"
432 );
433 $ti->setMaxLength(64);
434 $ti->setSize(20);
435 $this->addFilterItem($ti);
436 $ti->readFromSession();
437 $this->filter["query"] = $ti->getValue();
438
439 // repository area selection
441 $this->lng->txt("trac_filter_area"),
442 "area"
443 );
444 $rs->setSelectText($this->lng->txt("trac_select_area"));
445 $this->addFilterItem($rs);
446 $rs->readFromSession();
447 $this->filter["area"] = $rs->getValue();
448
449 // hide "not started yet"
450 if ($a_include_no_status_filter) {
451 $cb = new ilCheckboxInputGUI(
452 $this->lng->txt("trac_filter_has_status"),
453 "status"
454 );
455 $this->addFilterItem($cb);
456 $cb->readFromSession();
457 $this->filter["status"] = $cb->getChecked();
458 }
459 }
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 class represents a multi selection list property in a property form.
This class represents a repository selector in a property form.
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setDisableFilterHiding(bool $a_val=true)
This class represents a text property in a property form.

References ILIAS\Repository\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 84 of file class.ilLPTableBaseGUI.php.

84 : array
85 {
86 if ($this->http->wrapper()->post()->has('item_id')) {
87 return $this->http->wrapper()->post()->retrieve(
88 'item_id',
89 $this->refinery->kindlyTo()->listOf(
90 $this->refinery->kindlyTo()->int()
91 )
92 );
93 }
94 return [];
95 }

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

368 : array
369 {
371 $this->lng->txt('trac_filter_area'),
372 'effective_from',
373 false,
374 ($this->isForwardingToFormDispatcher()) ? $this : null
375 );
376 $white_list = [];
377 foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
378 if ($this->objDefinition->isContainer($type)) {
379 $white_list[] = $type;
380 }
381 }
382 $repo->getExplorerGUI()->setTypeWhiteList($white_list);
383 $this->addFilterItem($repo);
384 $repo->readFromSession();
385 $filter['area'] = (int) $repo->getValue();
386 return $filter;
387 }

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

97 : array
98 {
99 if ($this->http->wrapper()->post()->has('uid')) {
100 return $this->http->wrapper()->post()->retrieve(
101 'uid',
102 $this->refinery->kindlyTo()->listOf(
103 $this->refinery->kindlyTo()->int()
104 )
105 );
106 }
107 return [];
108 }

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

363 : bool
364 {
365 return false;
366 }

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable ( int  $a_obj_id)
protected

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

747 : bool
748 {
749 if ($a_obj_id === 0) {
750 return false;
751 }
752 $olp = ilObjectLP::getInstance($a_obj_id);
753 $mode = $olp->getCurrentMode();
754 if (in_array(
755 $mode,
756 [
770 ]
771 )) {
772 return true;
773 }
774 return false;
775 }
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_COLLECTION, 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 777 of file class.ilLPTableBaseGUI.php.

781 {
782 global $DIC;
783
784 $user = "";
785 if ($a_user_id) {
786 if ($a_user_id != $this->user->getId()) {
787 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
788 } else {
789 $a_user = $this->user;
790 }
791 $user .= ", " . $a_user->getFullName(
792 ); // " [".$a_user->getLogin()."]";
793 }
794
795 if ($a_obj_id != ROOT_FOLDER_ID) {
796 $this->setTitle(
797 $this->lng->txt(
798 $action
799 ) . ": " . $this->ilObjDataCache->lookupTitle($a_obj_id) . $user
800 );
801
802 $olp = ilObjectLP::getInstance($a_obj_id);
803 $this->setDescription(
804 $this->lng->txt('trac_mode') . ": " . $olp->getModeText(
805 $olp->getCurrentMode()
806 )
807 );
808 } else {
809 $this->setTitle($this->lng->txt($action));
810 }
811 }
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 558 of file class.ilLPTableBaseGUI.php.

562 : string {
563 // get rid of aggregation
564 $pos = strrpos($id, "_");
565 if ($pos !== false) {
566 $function = strtoupper(substr($id, $pos + 1));
567 if (in_array(
568 $function,
569 array("MIN", "MAX", "SUM", "AVG", "COUNT")
570 )) {
571 $id = substr($id, 0, $pos);
572 }
573 }
574
575 if ((trim((string) $value) == "") && $id != "status") {
576 if ($id == "title" &&
577 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
578 get_class($this) != "ilTrMatrixTableGUI") {
579 return "--" . $this->lng->txt("none") . "--";
580 }
581 return " ";
582 }
583
584 switch ($id) {
585 case "first_access":
586 case "create_date":
587 case 'status_changed':
589 new ilDateTime($value, IL_CAL_DATETIME)
590 );
591 break;
592
593 case "last_access":
595 new ilDateTime($value, IL_CAL_UNIX)
596 );
597 break;
598
599 case "birthday":
601 new ilDate($value, IL_CAL_DATE)
602 );
603 break;
604
605 case "spent_seconds":
607 $value = "-";
608 } else {
610 (int) $value,
611 ((int) $value < 3600 ? true : false)
612 ); // #14858
613 }
614 break;
615
616 case "percentage":
617 if (false /* $this->isPercentageAvailable() */) {
618 $value = "-";
619 } else {
620 $value = $value . "%";
621 }
622 break;
623
624 case "mark":
625 if (!ilObjectLP::supportsMark($type)) {
626 $value = "-";
627 }
628 break;
629
630 case "gender":
631 $value = $this->lng->txt("gender_" . $value);
632 break;
633
634 case "status":
636 $value = $icons->renderIconForStatus((int) $value);
637 break;
638
639 case "language":
640 $this->lng->loadLanguageModule("meta");
641 $value = $this->lng->txt("meta_l_" . $value);
642 break;
643
644 case "sel_country":
645 $value = $this->lng->txt("meta_c_" . $value);
646 break;
647 }
648
649 return $value ?? '';
650 }
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 345 of file class.ilLPTableBaseGUI.php.

345 : bool
346 {
347 if (is_array($this->filter["hide"]) && in_array(
348 $a_data["obj_id"],
349 $this->filter["hide"]
350 )) {
351 return false;
352 }
353 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
354 if (get_class(
355 $olp
356 ) != "ilObjectLP" && // #13654 - LP could be unsupported
357 !$olp->isActive()) {
358 return false;
359 }
360 return true;
361 }

References ILIAS\Repository\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 286 of file class.ilLPTableBaseGUI.php.

291 : array {
292 $query_parser = new ilQueryParser($filter["query"] ?? '');
293 $query_parser->setMinWordLength(0);
294 $query_parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
295 $query_parser->parse();
296 if (!$query_parser->validate()) {
297 ilLoggerFactory::getLogger('trac')->notice(
298 $query_parser->getMessage()
299 );
300 // echo $query_parser->getMessage();
301 return [];
302 }
303
304 if ($filter["type"] == "lres") {
305 $filter["type"] = array('lm', 'sahs', 'htlm');
306 } else {
307 $filter["type"] = array($filter["type"]);
308 }
309
310 $object_search = new ilLikeObjectSearch($query_parser);
311 $object_search->setFilter($filter["type"]);
312 if ($preset_obj_ids) {
313 $object_search->setIdFilter($preset_obj_ids);
314 }
315 $res = $object_search->performSearch();
316
317 if ($permission) {
318 $res->setRequiredPermission($permission);
319 }
320
321 $res->setMaxHits(self::HIT_LIMIT);
322
323 if ($a_check_lp_activation) {
324 $res->addObserver($this, "searchFilterListener");
325 }
326
327 if (!$this->filter["area"]) {
328 $res->filter(ROOT_FOLDER_ID, true);
329 } else {
330 $res->filter($this->filter["area"], true);
331 }
332
333 $objects = array();
334 foreach ($res->getResults() as $obj_data) {
335 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
336 }
337 return $objects ?: array();
338 }
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 227 of file class.ilLPTableBaseGUI.php.

231 : void {
232 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
233
234 $rcps = array();
235 foreach ($a_user_ids as $usr_id) {
236 $rcps[] = ilObjUser::_lookupLogin($usr_id);
237 }
238
239 $template = array();
240 $sig = null;
241
242 $ref_id = 0;
243 if ($this->http->wrapper()->query()->has('ref_id')) {
244 $ref_id = $this->http->wrapper()->query()->retrieve(
245 'ref_id',
246 $this->refinery->kindlyTo()->int()
247 );
248 }
249 // repository-object-specific
250 if ($ref_id) {
251 $obj_lp = ilObjectLP::getInstance(
253 );
254 $tmpl_id = $obj_lp->getMailTemplateId();
255
256 if ($tmpl_id) {
257 $template = array(
258 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
259 'ref_id' => $ref_id,
260 'ts' => time()
261 );
262 } else {
263 $sig = ilLink::_getLink($ref_id);
264 $sig = rawurlencode(base64_encode($sig));
265 }
266 }
267
270 $a_parent_obj,
271 $a_parent_cmd,
272 array(),
273 array(
274 'type' => 'new',
275 'rcp_to' => implode(',', $rcps),
276 'sig' => $sig
277 ),
278 $template
279 )
280 );
281 }
static getRedirectTarget( $gui, string $cmd, array $gui_params=[], array $mail_params=[], array $context_params=[])
final const string CONTEXT_KEY
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 1185 of file class.ilLPTableBaseGUI.php.

1185 : void
1186 {
1187 $this->icon_variant = $variant;
1188 }

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

896 {
897 $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
898 if ($timing_cache->isWarningRequired($a_user_id)) {
899 $timings = ilTimingCache::_getTimings($a_ref_id);
900 if (
901 $timings['item']['changeable'] &&
902 ($timings['user'][$a_user_id] ?? false) &&
903 $timings['user'][$a_user_id]['end']
904 ) {
905 $end = $timings['user'][$a_user_id]['end'];
906 } elseif ($timings['item']['suggestion_end']) {
907 $end = $timings['item']['suggestion_end'];
908 } else {
909 $end = true;
910 }
911 return $end;
912 }
913 return false;
914 }
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 40 of file class.ilLPTableBaseGUI.php.

◆ $filter

array ilLPTableBaseGUI::$filter = []
protected

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

Referenced by ilTrSummaryTableGUI\getItems().

◆ $http

HttpService ilLPTableBaseGUI::$http
protected

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

◆ $icon_variant

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

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

◆ $ilObjDataCache

ilObjectDataCache ilLPTableBaseGUI::$ilObjDataCache
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ilLPTableBaseGUI::$main_tpl
protected

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

◆ $objDefinition

ilObjectDefinition ilLPTableBaseGUI::$objDefinition
protected

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

◆ $profile

Profile ilLPTableBaseGUI::$profile
protected

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

◆ $refinery

RefineryFactory ilLPTableBaseGUI::$refinery
protected

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

◆ $setting

ilSetting ilLPTableBaseGUI::$setting
protected

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

◆ $tree

ilTree ilLPTableBaseGUI::$tree
protected

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

◆ $user

ilObjUser ilLPTableBaseGUI::$user
private

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

Referenced by ilLPProgressTableGUI\__construct().

◆ HIT_LIMIT

const ilLPTableBaseGUI::HIT_LIMIT = 5000

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


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