ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 int 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 1145 of file class.ilLPTableBaseGUI.php.

1145 : void
1146 {
1147 $users = $this->initUidFromPost();
1148 $clip = ilUserClipboard::getInstance($this->user->getId());
1149 $clip->add($users);
1150 $clip->save();
1151 $this->lng->loadLanguageModule('user');
1152 $this->main_tpl->setOnScreenMessage(
1153 'success',
1154 $this->lng->txt(
1155 'clipboard_user_added'
1156 ),
1157 true
1158 );
1159 }
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 449 of file class.ilLPTableBaseGUI.php.

449 : array
450 {
451 if (!count($ref_ids)) {
452 return [];
453 }
454 $result = [];
455 foreach ($ref_ids as $ref_id) {
456 $path = "...";
457 $counter = 0;
458 $path_full = $this->tree->getPathFull($ref_id);
459 foreach ($path_full as $data) {
460 if (++$counter < (count($path_full) - 1)) {
461 continue;
462 }
463 $path .= " &raquo; ";
464 if ($ref_id != $data['ref_id']) {
465 $path .= $data['title'];
466 } else {
467 $path .= ('<a target="_top" href="' .
468 ilLink::_getLink(
469 $data['ref_id'],
470 $data['type']
471 ) . '">' .
472 $data['title'] . '</a>');
473 }
474 }
475
476 $result[$ref_id] = $path;
477 }
478 return $result;
479 }
$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 934 of file class.ilLPTableBaseGUI.php.

938 : array {
939 $step = 0;
940 if ($a_max_value) {
941 $step = $a_max_value / 10;
942 $base = ceil(log($step, 10));
943 $fac = ceil($step / pow(10, ($base - 1)));
944 $step = pow(10, $base - 1) * $fac;
945 }
946 if ($step <= 1) {
947 $step = 1;
948 }
949 $ticks = range(0, $a_max_value + $step, $step);
950
951 $value_ticks = array(0 => 0);
952 foreach ($ticks as $tick) {
953 $value = $tvalue = $tick;
954 if ($a_anonymize) {
955 $value = $this->anonymizeValue($value, true);
956 $tvalue = $this->anonymizeValue($tvalue);
957 }
958 if ($a_format_seconds) {
959 $tvalue = $this->formatSeconds($value);
960 }
961 $value_ticks[$value] = $tvalue;
962 }
963
964 return $value_ticks;
965 }
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 $this->ctrl->redirect($this->parent_obj, $this->parent_cmd);
194 } else {
195 // e.g. repository selector
196 return parent::executeCommand();
197 }
198 return true;
199 }
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 865 of file class.ilLPTableBaseGUI.php.

865 : void
866 {
867 foreach ($this->getExportMeta() as $caption => $value) {
868 $a_csv->addColumn(strip_tags($caption));
869 $a_csv->addColumn(strip_tags($value));
870 $a_csv->addRow();
871 }
872 $a_csv->addRow();
873 }
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 855 of file class.ilLPTableBaseGUI.php.

855 : void
856 {
857 foreach ($this->getExportMeta() as $caption => $value) {
858 $a_excel->setCell($a_row, 0, $caption);
859 $a_excel->setCell($a_row, 1, $value);
860 $a_row++;
861 }
862 $a_row++;
863 }
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 204 of file class.ilLPTableBaseGUI.php.

204 : array
205 {
206 $ref_ids = array_keys(ilObject::_getAllReferences($a_obj_id));
207 sort($ref_ids, SORT_NUMERIC);
208 return $ref_ids;
209 }
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 901 of file class.ilLPTableBaseGUI.php.

904 : string {
905 $seconds = ($seconds > 0) ? $seconds : 0;
906 if ($a_shorten_zero && !$seconds) {
907 return "-";
908 }
909
910 $hours = floor($seconds / 3600);
911 $rest = $seconds % 3600;
912
913 $minutes = floor($rest / 60);
914 $rest = $rest % 60;
915
916 if ($rest) {
917 $minutes++;
918 }
919
920 return sprintf("%dh%02dm", $hours, $minutes);
921 }

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

638 : array
639 {
640 $result = array();
641 foreach ($this->filter as $id => $value) {
642 $item = $this->getFilterItemByPostVar($id);
643 switch ($id) {
644 case "title":
645 case "gender":
646 case "city":
647 case "language":
648 case "login":
649 case "firstname":
650 case "lastname":
651 case "mark":
652 case "u_comment":
653 case "institution":
654 case "department":
655 case "street":
656 case "zipcode":
657 case "email":
658 case "matriculation":
659 case "country":
660 case "query":
661 case "type":
662 case "area":
663 if ($value) {
664 $result[$id] = $value;
665 }
666 break;
667
668 case "status":
669 if (!is_null($value) && $value !== "") {
670 $result[$id] = $value;
671 }
672 break;
673
674 case "user_total":
675 case "read_count":
676 case "percentage":
677 case "hide":
678 case "spent_seconds":
679 if (is_array($value) && implode("", $value)) {
680 $result[$id] = $value;
681 }
682 break;
683
684 case "registration":
685 case "create_date":
686 case "first_access":
687 case "last_access":
688 case 'status_changed':
689 if ($value) {
690 if ($value["from"]) {
691 $result[$id]["from"] = $value["from"]->get(
693 );
694 }
695 if ($value["to"]) {
696 $result[$id]["to"] = $value["to"]->get(
698 );
699 }
700 }
701 break;
702
703 case "birthday":
704 if ($value) {
705 if ($value["from"]) {
706 $result[$id]["from"] = $value["from"]->get(
708 );
709 $result[$id]["from"] = substr(
710 $result[$id]["from"],
711 0,
712 -8
713 ) . "00:00:00";
714 }
715 if ($value["to"]) {
716 $result[$id]["to"] = $value["to"]->get(
718 );
719 $result[$id]["to"] = substr(
720 $result[$id]["to"],
721 0,
722 -8
723 ) . "23:59:59";
724 }
725 }
726 break;
727 }
728 }
729 return $result;
730 }
const IL_CAL_DATETIME
filter(string $filter_id, array $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 801 of file class.ilLPTableBaseGUI.php.

801 : array
802 {
803 global $DIC;
804
805 $ilClientIniFile = $DIC['ilClientIniFile'];
806
807 /* see spec
808 Name of installation
809 Name of the course
810 Permalink to course
811 Owner of course object
812 Date of report generation
813 Reporting period
814 Name of person who generated the report.
815 */
816
818
819 $data = array();
820 $data[$this->lng->txt(
821 "trac_name_of_installation"
822 )] = $ilClientIniFile->readVariable('client', 'name');
823
824 if ($this->obj_id) {
825 $data[$this->lng->txt(
826 "trac_object_name"
827 )] = $this->ilObjDataCache->lookupTitle((int) $this->obj_id);
828 if ($this->ref_id) {
829 $data[$this->lng->txt("trac_object_link")] = ilLink::_getLink(
830 $this->ref_id,
831 ilObject::_lookupType($this->obj_id)
832 );
833 }
834 $data[$this->lng->txt(
835 "trac_object_owner"
837 ilObject::_lookupOwner($this->obj_id)
838 );
839 }
840
841 $data[$this->lng->txt(
842 "trac_report_date"
844 new ilDateTime(
845 time(),
847 )
848 );
849 $data[$this->lng->txt("trac_report_owner")] = $this->user->getFullName(
850 );
851
852 return $data;
853 }
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 1164 of file class.ilLPTableBaseGUI.php.

1164 : int
1165 {
1166 return $this->icon_variant;
1167 }

◆ getMonthsFilter()

ilLPTableBaseGUI::getMonthsFilter (   $a_short = false)
protected

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

967 : array
968 {
969 $options = array();
970 for ($loop = 0; $loop < 10; $loop++) {
971 $year = date("Y") - $loop;
972 $options[$year] = $year;
973 for ($loop2 = 12; $loop2 > 0; $loop2--) {
974 $month = str_pad($loop2, 2, "0", STR_PAD_LEFT);
975 if ($year . $month <= date("Ym")) {
976 if (!$a_short) {
977 $caption = $year . " / " . $this->lng->txt(
978 "month_" . $month . "_long"
979 );
980 } else {
981 $caption = $year . "/" . $month;
982 }
983 $options[$year . "-" . $month] = $caption;
984 }
985 }
986 }
987 return $options;
988 }

References ILIAS\UI\Implementation\Component\Input\Field\$options, 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:

◆ getMonthsYear()

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

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

990 : array
991 {
992 if (!$a_year) {
993 $a_year = date("Y");
994 }
995
996 $all = array();
997 for ($loop = 1; $loop < 13; $loop++) {
998 $month = str_pad($loop, 2, "0", STR_PAD_LEFT);
999 if ($a_year . "-" . $month <= date("Y-m")) {
1000 if (!$a_short) {
1001 $caption = $this->lng->txt("month_" . $month . "_long");
1002 } else {
1003 $caption = $this->lng->txt("month_" . $month . "_short");
1004 }
1005 $all[$a_year . "-" . $month] = $caption;
1006 }
1007 }
1008 return $all;
1009 }

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

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

1014 : array {
1015 $cols = $privacy_fields = array();
1016
1017 if ($a_in_course === 1) {
1018 $ufs = $this->profile->getVisibleFields(Context::Course, null, [AvailableSections::Interests]);
1019 } elseif ($a_in_group === 1) {
1020 $ufs = $this->profile->getVisibleFields(Context::Group, null, [AvailableSections::Interests]);
1021 } else {
1022 $ufs = $this->profile->getFields();
1023 }
1024
1025 // default fields
1026 $cols["login"] = array(
1027 "txt" => $this->lng->txt("login"),
1028 "default" => true
1029 );
1030
1031 if (!$this->anonymized) {
1032 $cols["firstname"] = array(
1033 "txt" => $this->lng->txt("firstname"),
1034 "default" => true
1035 );
1036 $cols["lastname"] = array(
1037 "txt" => $this->lng->txt("lastname"),
1038 "default" => true
1039 );
1040 }
1041
1042 // show only if extended data was activated in lp settings
1043 $tracking = new ilObjUserTracking();
1044 if ($tracking->hasExtendedData(
1046 )) {
1047 $cols["first_access"] = array(
1048 "txt" => $this->lng->txt("trac_first_access"),
1049 "default" => true
1050 );
1051 $cols["last_access"] = array(
1052 "txt" => $this->lng->txt("trac_last_access"),
1053 "default" => true
1054 );
1055 }
1056 if ($tracking->hasExtendedData(
1058 )) {
1059 $cols["read_count"] = array(
1060 "txt" => $this->lng->txt("trac_read_count"),
1061 "default" => true
1062 );
1063 }
1064 if ($tracking->hasExtendedData(
1066 ) &&
1067 ilObjectLP::supportsSpentSeconds($this->type)) {
1068 $cols["spent_seconds"] = array(
1069 "txt" => $this->lng->txt("trac_spent_seconds"),
1070 "default" => true
1071 );
1072 }
1073
1074 if ($this->isPercentageAvailable($this->obj_id)) {
1075 $cols["percentage"] = array(
1076 "txt" => $this->lng->txt("trac_percentage"),
1077 "default" => true
1078 );
1079 }
1080
1081 // do not show status if learning progress is deactivated
1082 $olp = ilObjectLP::getInstance($this->obj_id);
1083 if ($olp->isActive()) {
1084 $cols["status"] = array(
1085 "txt" => $this->lng->txt("trac_status"),
1086 "default" => true
1087 );
1088
1089 $cols['status_changed'] = array(
1090 'txt' => $this->lng->txt('trac_status_changed'),
1091 'default' => false
1092 );
1093 }
1094
1095 if (ilObjectLP::supportsMark($this->type)) {
1096 $cols["mark"] = array(
1097 "txt" => $this->lng->txt("trac_mark"),
1098 "default" => true
1099 );
1100 }
1101
1102 $cols["u_comment"] = array(
1103 "txt" => $this->lng->txt("trac_comment"),
1104 "default" => false
1105 );
1106
1107 $cols["create_date"] = array(
1108 "txt" => $this->lng->txt("create_date"),
1109 "default" => false
1110 );
1111 $cols["language"] = array(
1112 "txt" => $this->lng->txt("language"),
1113 "default" => false
1114 );
1115
1116 // add user data only if object is [part of] course
1117 if (!$this->anonymized &&
1118 ($a_in_course || $a_in_group)) {
1119 // only show if export permission is granted
1120 if (ilPrivacySettings::getInstance()->checkExportAccess(
1121 $a_in_group === 0 ? $a_in_course : $a_in_group
1122 )) {
1123 // other user profile fields
1124 foreach ($ufs as $fd) {
1125 if ($fd->isCustom()) {
1126 continue;
1127 }
1128 $f = $fd->getIdentifier();
1129 if (!isset($cols[$f]) && $f !== "username" && !$fd->hiddenInLists()) {
1130 $cols[$f] = array(
1131 "txt" => $fd->getLabel($this->lng),
1132 "default" => false
1133 );
1134 $privacy_fields[] = $f;
1135 }
1136 }
1137 }
1138 }
1139 return array($cols, $privacy_fields);
1140 }
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 378 of file class.ilLPTableBaseGUI.php.

381 {
382 $this->setDisableFilterHiding(true);
383
384 // object type selection
385 $si = new ilSelectInputGUI($this->lng->txt("obj_type"), "type");
386 $si->setOptions($this->getPossibleTypes($a_split_learning_resources));
387 $this->addFilterItem($si);
388 $si->readFromSession();
389 if (!$si->getValue()) {
390 $si->setValue("crs");
391 }
392 $this->filter["type"] = $si->getValue();
393
394 // hidden items
395 $msi = new ilMultiSelectInputGUI(
396 $this->lng->txt("trac_filter_hidden"),
397 "hide"
398 );
399 $this->addFilterItem($msi);
400 $msi->readFromSession();
401 $this->filter["hide"] = $msi->getValue();
402 if ($this->filter["hide"]) {
403 // create options from current value
404 $types = $this->getCurrentFilter(true);
405 $options = [];
406 foreach ($this->filter["hide"] as $obj_id) {
407 $options[$obj_id] = $this->ilObjDataCache->lookupTitle(
408 (int) $obj_id
409 );
410 }
411 $msi->setOptions($options);
412 }
413
414 // title/description
415 $ti = new ilTextInputGUI(
416 $this->lng->txt("trac_title_description"),
417 "query"
418 );
419 $ti->setMaxLength(64);
420 $ti->setSize(20);
421 $this->addFilterItem($ti);
422 $ti->readFromSession();
423 $this->filter["query"] = $ti->getValue();
424
425 // repository area selection
427 $this->lng->txt("trac_filter_area"),
428 "area"
429 );
430 $rs->setSelectText($this->lng->txt("trac_select_area"));
431 $this->addFilterItem($rs);
432 $rs->readFromSession();
433 $this->filter["area"] = $rs->getValue();
434
435 // hide "not started yet"
436 if ($a_include_no_status_filter) {
437 $cb = new ilCheckboxInputGUI(
438 $this->lng->txt("trac_filter_has_status"),
439 "status"
440 );
441 $this->addFilterItem($cb);
442 $cb->readFromSession();
443 $this->filter["status"] = $cb->getChecked();
444 }
445 }
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\UI\Implementation\Component\Input\Field\$options, 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 354 of file class.ilLPTableBaseGUI.php.

354 : array
355 {
357 $this->lng->txt('trac_filter_area'),
358 'effective_from',
359 false,
360 ($this->isForwardingToFormDispatcher()) ? $this : null
361 );
362 $white_list = [];
363 foreach ($this->objDefinition->getAllRepositoryTypes() as $type) {
364 if ($this->objDefinition->isContainer($type)) {
365 $white_list[] = $type;
366 }
367 }
368 $repo->getExplorerGUI()->setTypeWhiteList($white_list);
369 $this->addFilterItem($repo);
370 $repo->readFromSession();
371 $filter['area'] = (int) $repo->getValue();
372 return $filter;
373 }

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

349 : bool
350 {
351 return false;
352 }

◆ isPercentageAvailable()

ilLPTableBaseGUI::isPercentageAvailable ( int  $a_obj_id)
protected

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

732 : bool
733 {
734 if ($a_obj_id === 0) {
735 return false;
736 }
737 $olp = ilObjectLP::getInstance($a_obj_id);
738 $mode = $olp->getCurrentMode();
739 if (in_array(
740 $mode,
741 [
755 ]
756 )) {
757 return true;
758 }
759 return false;
760 }
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 762 of file class.ilLPTableBaseGUI.php.

766 {
767 global $DIC;
768
769 $user = "";
770 if ($a_user_id) {
771 if ($a_user_id != $this->user->getId()) {
772 $a_user = ilObjectFactory::getInstanceByObjId($a_user_id);
773 } else {
774 $a_user = $this->user;
775 }
776 $user .= ", " . $a_user->getFullName(
777 ); // " [".$a_user->getLogin()."]";
778 }
779
780 if ($a_obj_id != ROOT_FOLDER_ID) {
781 $this->setTitle(
782 $this->lng->txt(
783 $action
784 ) . ": " . $this->ilObjDataCache->lookupTitle($a_obj_id) . $user
785 );
786
787 $olp = ilObjectLP::getInstance($a_obj_id);
788 $this->setDescription(
789 $this->lng->txt('trac_mode') . ": " . $olp->getModeText(
790 $olp->getCurrentMode()
791 )
792 );
793 } else {
794 $this->setTitle($this->lng->txt($action));
795 }
796 }
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 544 of file class.ilLPTableBaseGUI.php.

548 : string {
549 // get rid of aggregation
550 $pos = strrpos($id, "_");
551 if ($pos !== false) {
552 $function = strtoupper(substr($id, $pos + 1));
553 if (in_array(
554 $function,
555 array("MIN", "MAX", "SUM", "AVG", "COUNT")
556 )) {
557 $id = substr($id, 0, $pos);
558 }
559 }
560
561 if ((trim((string) $value) == "") && $id != "status") {
562 if ($id == "title" &&
563 get_class($this) != "ilTrObjectUsersPropsTableGUI" &&
564 get_class($this) != "ilTrMatrixTableGUI") {
565 return "--" . $this->lng->txt("none") . "--";
566 }
567 return " ";
568 }
569
570 switch ($id) {
571 case "first_access":
572 case "create_date":
573 case 'status_changed':
575 new ilDateTime($value, IL_CAL_DATETIME)
576 );
577 break;
578
579 case "last_access":
581 new ilDateTime($value, IL_CAL_UNIX)
582 );
583 break;
584
585 case "birthday":
587 new ilDate($value, IL_CAL_DATE)
588 );
589 break;
590
591 case "spent_seconds":
593 $value = "-";
594 } else {
596 (int) $value,
597 ((int) $value < 3600 ? true : false)
598 ); // #14858
599 }
600 break;
601
602 case "percentage":
603 if (false /* $this->isPercentageAvailable() */) {
604 $value = "-";
605 } else {
606 $value = $value . "%";
607 }
608 break;
609
610 case "mark":
611 if (!ilObjectLP::supportsMark($type)) {
612 $value = "-";
613 }
614 break;
615
616 case "gender":
617 $value = $this->lng->txt("gender_" . $value);
618 break;
619
620 case "status":
622 $value = $icons->renderIconForStatus((int) $value);
623 break;
624
625 case "language":
626 $this->lng->loadLanguageModule("meta");
627 $value = $this->lng->txt("meta_l_" . $value);
628 break;
629
630 case "sel_country":
631 $value = $this->lng->txt("meta_c_" . $value);
632 break;
633 }
634
635 return $value ?? '';
636 }
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 331 of file class.ilLPTableBaseGUI.php.

331 : bool
332 {
333 if (is_array($this->filter["hide"]) && in_array(
334 $a_data["obj_id"],
335 $this->filter["hide"]
336 )) {
337 return false;
338 }
339 $olp = ilObjectLP::getInstance($a_data["obj_id"]);
340 if (get_class(
341 $olp
342 ) != "ilObjectLP" && // #13654 - LP could be unsupported
343 !$olp->isActive()) {
344 return false;
345 }
346 return true;
347 }

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

277 : array {
278 $query_parser = new ilQueryParser($filter["query"] ?? '');
279 $query_parser->setMinWordLength(0);
280 $query_parser->setCombination(ilQueryParser::QP_COMBINATION_AND);
281 $query_parser->parse();
282 if (!$query_parser->validate()) {
283 ilLoggerFactory::getLogger('trac')->notice(
284 $query_parser->getMessage()
285 );
286 // echo $query_parser->getMessage();
287 return [];
288 }
289
290 if ($filter["type"] == "lres") {
291 $filter["type"] = array('lm', 'sahs', 'htlm');
292 } else {
293 $filter["type"] = array($filter["type"]);
294 }
295
296 $object_search = new ilLikeObjectSearch($query_parser);
297 $object_search->setFilter($filter["type"]);
298 if ($preset_obj_ids) {
299 $object_search->setIdFilter($preset_obj_ids);
300 }
301 $res = $object_search->performSearch();
302
303 if ($permission) {
304 $res->setRequiredPermission($permission);
305 }
306
307 $res->setMaxHits(self::HIT_LIMIT);
308
309 if ($a_check_lp_activation) {
310 $res->addObserver($this, "searchFilterListener");
311 }
312
313 if (!$this->filter["area"]) {
314 $res->filter(ROOT_FOLDER_ID, true);
315 } else {
316 $res->filter($this->filter["area"], true);
317 }
318
319 $objects = array();
320 foreach ($res->getResults() as $obj_data) {
321 $objects[$obj_data['obj_id']][] = $obj_data['ref_id'];
322 }
323 return $objects ?: array();
324 }
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 213 of file class.ilLPTableBaseGUI.php.

217 : void {
218 // see ilObjCourseGUI::sendMailToSelectedUsersObject()
219
220 $rcps = array();
221 foreach ($a_user_ids as $usr_id) {
222 $rcps[] = ilObjUser::_lookupLogin($usr_id);
223 }
224
225 $template = array();
226 $sig = null;
227
228 $ref_id = 0;
229 if ($this->http->wrapper()->query()->has('ref_id')) {
230 $ref_id = $this->http->wrapper()->query()->retrieve(
231 'ref_id',
232 $this->refinery->kindlyTo()->int()
233 );
234 }
235 // repository-object-specific
236 if ($ref_id) {
237 $obj_lp = ilObjectLP::getInstance(
239 );
240 $tmpl_id = $obj_lp->getMailTemplateId();
241
242 if ($tmpl_id) {
243 $template = array(
244 ilMailFormCall::CONTEXT_KEY => $tmpl_id,
245 'ref_id' => $ref_id,
246 'ts' => time()
247 );
248 } else {
249 $sig = ilLink::_getLink($ref_id);
250 $sig = rawurlencode(base64_encode($sig));
251 }
252 }
253
256 $a_parent_obj,
257 $a_parent_cmd,
258 array(),
259 array(
260 'type' => 'new',
261 'rcp_to' => implode(',', $rcps),
262 'sig' => $sig
263 ),
264 $template
265 )
266 );
267 }
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 1172 of file class.ilLPTableBaseGUI.php.

1172 : void
1173 {
1174 $this->icon_variant = $variant;
1175 }

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

881 {
882 $timing_cache = ilTimingCache::getInstanceByRefId($a_ref_id);
883 if ($timing_cache->isWarningRequired($a_user_id)) {
884 $timings = ilTimingCache::_getTimings($a_ref_id);
885 if (
886 $timings['item']['changeable'] &&
887 ($timings['user'][$a_user_id] ?? false) &&
888 $timings['user'][$a_user_id]['end']
889 ) {
890 $end = $timings['user'][$a_user_id]['end'];
891 } elseif ($timings['item']['suggestion_end']) {
892 $end = $timings['item']['suggestion_end'];
893 } else {
894 $end = true;
895 }
896 return $end;
897 }
898 return false;
899 }
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 int ilLPTableBaseGUI::HIT_LIMIT = 5000

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


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