ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTrUserObjectsPropsTableGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTrUserObjectsPropsTableGUI:
+ Collaboration diagram for ilTrUserObjectsPropsTableGUI:

Public Member Functions

 __construct (?object $a_parent_obj, string $a_parent_cmd, int $a_user_id, int $a_obj_id, int $a_ref_id, bool $a_print_view=false)
 Constructor. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 getItems ()
 
 initFilter ()
 
- Public Member Functions inherited from ilLPTableBaseGUI
 __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)
 

Protected Member Functions

 fillRow (array $a_set)
 Standard Version of Fill Row. 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...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 
- Protected Member Functions inherited from ilLPTableBaseGUI
 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

string $type
 
int $ref_id
 
int $obj_id
 
int $user_id
 
ilAccessHandler $access
 
ilRbacSystem $rbacsystem
 
- Protected Attributes inherited from ilLPTableBaseGUI
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
 

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='')
 
- Data Fields inherited from ilLPTableBaseGUI
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
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Build table list for objects of given user

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$ @ilCtrl_Calls ilTrUserObjectsPropsTableGUI: ilFormPropertyDispatchGUI

Definition at line 25 of file class.ilTrUserObjectsPropsTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTrUserObjectsPropsTableGUI::__construct ( ?object  $a_parent_obj,
string  $a_parent_cmd,
int  $a_user_id,
int  $a_obj_id,
int  $a_ref_id,
bool  $a_print_view = false 
)

Constructor.

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

45 {
46 global $DIC;
47
48 $this->setId("truop");
49 $this->user_id = $a_user_id;
50 $this->obj_id = $a_obj_id;
51 $this->type = ilObject::_lookupType($this->obj_id);
52 $this->ref_id = $a_ref_id;
53
54 parent::__construct($a_parent_obj, $a_parent_cmd);
55 $this->setLimit(9999);
56
57 $this->parseTitle($this->obj_id, "details", $this->user_id);
58
59 if ($a_print_view) {
60 $this->setPrintMode(true);
61 }
62
63 $this->addColumn($this->lng->txt("title"), "title");
64
65 foreach ($this->getSelectedColumns() as $c) {
66 $l = $c;
67 if (in_array(
68 $l,
69 array("last_access",
70 "first_access",
71 "read_count",
72 "spent_seconds",
73 "mark",
74 "status",
75 "percentage"
76 )
77 )) {
78 $l = "trac_" . $l;
79 }
80 if ($l == "u_comment") {
81 $l = "trac_comment";
82 }
83 $this->addColumn($this->lng->txt($l), $c);
84 }
85
86 if (!$this->getPrintMode()) {
87 $this->addColumn($this->lng->txt("actions"), "");
88 }
89
90 $this->setExternalSorting(true);
91 $this->setExternalSegmentation(true);
92 $this->setEnableHeader(true);
93 $this->setFormAction(
94 $this->ctrl->getFormActionByClass(get_class($this))
95 );
96 $this->setRowTemplate(
97 "tpl.user_objects_props_row.html",
98 "components/ILIAS/Tracking"
99 );
100 $this->setEnableTitle(true);
101 $this->setDefaultOrderField("title");
102 $this->setDefaultOrderDirection("asc");
103 $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
104 $this->initFilter();
105 $this->getItems();
106 }
parseTitle(int $a_obj_id, string $action, int $a_user_id=0)
static _lookupType(int $id, bool $reference=false)
setLimit(int $a_limit=0, int $a_default_limit=0)
set max.
setExportFormats(array $formats)
Set available export formats.
setExternalSegmentation(bool $a_val)
setEnableTitle(bool $a_enabletitle)
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setPrintMode(bool $a_value=false)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
setDefaultOrderDirection(string $a_defaultorderdirection)
$c
Definition: deliver.php:25
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $c, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilObject\_lookupType(), ilTable2GUI\addColumn(), ILIAS\Repository\ctrl(), getItems(), ilTable2GUI\getPrintMode(), ilTable2GUI\getSelectedColumns(), initFilter(), ILIAS\Repository\lng(), ilLPTableBaseGUI\parseTitle(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExportFormats(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setLimit(), ilTable2GUI\setPrintMode(), and ilTable2GUI\setRowTemplate().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilTrUserObjectsPropsTableGUI::fillHeaderCSV ( ilCSVWriter  $a_csv)
protected

CSV Version of Fill Header.

Likely to be overwritten by derived class.

Parameters
ilCSVWriter$a_csvcurrent file

Reimplemented from ilTable2GUI.

Definition at line 569 of file class.ilTrUserObjectsPropsTableGUI.php.

569 : void
570 {
571 $a_csv->addColumn($this->lng->txt("type"));
572 $a_csv->addColumn($this->lng->txt("title"));
573
574 $labels = $this->getSelectableColumns();
575 foreach ($this->getSelectedColumns() as $c) {
576 $a_csv->addColumn($labels[$c]["txt"]);
577 }
578
579 $a_csv->addRow();
580 }
addColumn(string $a_col)

References $c, ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ fillHeaderExcel()

ilTrUserObjectsPropsTableGUI::fillHeaderExcel ( ilExcel  $a_excel,
int &  $a_row 
)
protected

Excel Version of Fill Header.

Likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter

Reimplemented from ilTable2GUI.

Definition at line 532 of file class.ilTrUserObjectsPropsTableGUI.php.

532 : void
533 {
534 $a_excel->setCell($a_row, 0, $this->lng->txt("type"));
535 $a_excel->setCell($a_row, 1, $this->lng->txt("title"));
536
537 $labels = $this->getSelectableColumns();
538 $cnt = 2;
539 foreach ($this->getSelectedColumns() as $c) {
540 $a_excel->setCell($a_row, $cnt++, $labels[$c]["txt"]);
541 }
542
543 $a_excel->setBold(
544 "A" . $a_row . ":" . $a_excel->getColumnCoord($cnt - 1) . $a_row
545 );
546 }
setBold(string $a_coords)
Set cell(s) to bold.
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
getColumnCoord(int $a_col)
Get column "name" from number.

References $c, ilExcel\getColumnCoord(), getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ILIAS\Repository\lng(), ilExcel\setBold(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ fillRow()

ilTrUserObjectsPropsTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

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

281 : void
282 {
283 global $DIC;
285
286 if (!$this->isPercentageAvailable($a_set["obj_id"])) {
287 $a_set["percentage"] = null;
288 }
289
290 foreach ($this->getSelectedColumns() as $c) {
291 if (!(bool) ($a_set["privacy_conflict"] ?? null)) {
292 $val = (trim(($a_set[$c] ?? '')) == "")
293 ? " "
294 : $a_set[$c];
295
296 if (($a_set[$c] ?? '') != "" || $c == "status") {
297 switch ($c) {
298 case "first_access":
300 new ilDateTime(
301 $a_set[$c],
303 )
304 );
305 break;
306
307 case "last_access":
309 new ilDateTime($a_set[$c], IL_CAL_UNIX)
310 );
311 break;
312
313 case "status":
314 $val = $icons->renderIconForStatus($a_set[$c] ?? ilLPStatusIcons::ICON_VARIANT_LONG);
315
316 if (($a_set["ref_id"] ?? 0) &&
317 $a_set["type"] != "lobj" &&
318 $a_set["type"] != "sco" &&
319 $a_set["type"] != "st" &&
320 $a_set["type"] != "mob") {
321 $timing = $this->showTimingsWarning(
322 $a_set["ref_id"],
323 $this->user_id
324 );
325 if ($timing) {
326 if ($timing !== true) {
327 $timing = ": " . ilDatePresentation::formatDate(
328 new ilDate(
329 $timing,
331 )
332 );
333 } else {
334 $timing = "";
335 }
336 $this->tpl->setCurrentBlock('warning_img');
337 $this->tpl->setVariable(
338 'WARNING_IMG',
340 'media/time_warn.svg'
341 )
342 );
343 $this->tpl->setVariable(
344 'WARNING_ALT',
345 $this->lng->txt(
346 'trac_time_passed'
347 ) . $timing
348 );
349 $this->tpl->parseCurrentBlock();
350 }
351 }
352 break;
353
354 case "spent_seconds":
356 $a_set["type"]
357 )) {
358 $val = "-";
359 } else {
361 $a_set[$c],
362 ($a_set[$c] < 3600 ? true : false)
363 ); // #14858
364 }
365 break;
366
367 case "percentage":
368 $val = $a_set[$c] . "%";
369 break;
370 }
371 }
372 if ($c == "mark" &&
373 !ilObjectLP::supportsMark($this->type)) {
374 $val = "-";
375 }
376 if ($c == "spent_seconds" &&
377 !ilObjectLP::supportsSpentSeconds($this->type)) {
378 $val = "-";
379 }
380 if ($c == "percentage" &&
381 !$this->isPercentageAvailable($a_set["obj_id"])) {
382 $val = "-";
383 }
384 } else {
385 $val = "&nbsp;";
386 }
387
388 $this->tpl->setCurrentBlock("user_field");
389 $this->tpl->setVariable("VAL_UF", $val);
390 $this->tpl->parseCurrentBlock();
391 }
392
393 if ($a_set["privacy_conflict"] ?? null) {
394 $this->tpl->setCurrentBlock("permission_bl");
395 $this->tpl->setVariable(
396 "TXT_NO_PERMISSION",
397 $this->lng->txt("status_no_permission")
398 );
399 $this->tpl->parseCurrentBlock();
400 }
401
402 if ($a_set["title"] == "") {
403 $a_set["title"] = "--" . $this->lng->txt("none") . "--";
404 }
405
406 $this->tpl->setVariable(
407 "ICON",
408 ilObject::_getIcon(0, "tiny", $a_set["type"])
409 );
410 $this->tpl->setVariable("ICON_ALT", $this->lng->txt($a_set["type"]));
411
412 if (in_array(
413 $a_set['type'],
414 array('fold', 'grp')
415 ) && $a_set['obj_id'] != $this->obj_id) {
416 if ($a_set['type'] == 'fold') {
417 $object_gui = 'ilobjfoldergui';
418 } else {
419 $object_gui = 'ilobjgroupgui';
420 }
421 $this->tpl->setCurrentBlock('title_linked');
422
423 $base_class = '';
424 if ($this->http->wrapper()->query()->has('baseClass')) {
425 $base_class = $this->http->wrapper()->query()->retrieve(
426 'baseClass',
427 $this->refinery->kindlyTo()->string()
428 );
429 }
430 // link structure gets too complicated
431 if ($base_class != "ilDashboardGUI" && $base_class != "ilAdministrationGUI") {
432 $old = $this->ctrl->getParameterArrayByClass(
433 'illplistofobjectsgui'
434 );
435 $this->ctrl->setParameterByClass(
436 'illplistofobjectsgui',
437 'ref_id',
438 $a_set["ref_id"]
439 );
440 $this->ctrl->setParameterByClass(
441 'illplistofobjectsgui',
442 'details_id',
443 $a_set["ref_id"]
444 );
445 $this->ctrl->setParameterByClass(
446 'illplistofobjectsgui',
447 'user_id',
448 $this->user_id
449 );
450 $url = $this->ctrl->getLinkTargetByClass(
451 array('ilrepositorygui',
452 $object_gui,
453 'illearningprogressgui',
454 'illplistofobjectsgui'
455 ),
456 'userdetails'
457 );
458 $this->ctrl->setParameterByClass(
459 'illplistofobjectsgui',
460 'ref_id',
461 $old["ref_id"] ?? null
462 );
463 $this->ctrl->setParameterByClass(
464 'illplistofobjectsgui',
465 'details_id',
466 $old["details_id"]
467 );
468 $this->ctrl->setParameterByClass(
469 'illplistofobjectsgui',
470 'user_id',
471 $old["user_id"]
472 );
473 } else {
474 $url = "#";
475 }
476
477 $this->tpl->setVariable("URL_TITLE", $url);
478 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
479 $this->tpl->parseCurrentBlock();
480 } else {
481 $this->tpl->setCurrentBlock('title_plain');
482 $this->tpl->setVariable("VAL_TITLE", $a_set["title"]);
483 $this->tpl->parseCurrentBlock();
484 }
485
486 // #16453 / #17163
487 if (($a_set['ref_id'] ?? 0)) {
488 $path = new ilPathGUI();
489 $path = $path->getPath($this->ref_id, $a_set['ref_id']);
490 if ($path) {
491 $this->tpl->setVariable(
492 'COLL_PATH',
493 $this->lng->txt('path') . ': ' . $path
494 );
495 }
496 }
497
498 // #13807 / #17069
499 if (($a_set["ref_id"] ?? 0) &&
501 'edit_learning_progress',
502 $a_set['ref_id']
503 )) {
504 if (!in_array(
505 $a_set["type"],
506 array("sco", "lobj")
507 ) && !$this->getPrintMode()) {
508 $this->tpl->setCurrentBlock("item_command");
509 $this->ctrl->setParameterByClass(
510 "illplistofobjectsgui",
511 "userdetails_id",
512 $a_set["ref_id"]
513 );
514 $this->tpl->setVariable(
515 "HREF_COMMAND",
516 $this->ctrl->getLinkTargetByClass(
517 "illplistofobjectsgui",
518 'edituser'
519 )
520 );
521 $this->tpl->setVariable("TXT_COMMAND", $this->lng->txt('edit'));
522 $this->ctrl->setParameterByClass(
523 "illplistofobjectsgui",
524 "userdetails_id",
525 ""
526 );
527 $this->tpl->parseCurrentBlock();
528 }
529 }
530 }
const IL_CAL_UNIX
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
@classDescription Date and time handling
Class for single dates.
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
showTimingsWarning(int $a_ref_id, int $a_user_id)
isPercentageAvailable(int $a_obj_id)
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
static supportsSpentSeconds(string $obj_type)
static supportsMark(string $obj_type)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$path
Definition: ltiservices.php:30
static http()
Fetches the global http state from ILIAS.
$url
Definition: shib_logout.php:68

References $c, $DIC, $path, $url, ilObject\_getIcon(), ilLearningProgressAccess\checkPermission(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilLPStatusIcons\getInstance(), ilTable2GUI\getPrintMode(), ilTable2GUI\getSelectedColumns(), ILIAS\FileDelivery\http(), ilLPStatusIcons\ICON_VARIANT_LONG, IL_CAL_DATETIME, IL_CAL_UNIX, ilLPTableBaseGUI\isPercentageAvailable(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ilDatePresentation\secondsToString(), ilLPTableBaseGUI\showTimingsWarning(), ilObjectLP\supportsMark(), and ilObjectLP\supportsSpentSeconds().

+ Here is the call graph for this function:

◆ fillRowCSV()

ilTrUserObjectsPropsTableGUI::fillRowCSV ( ilCSVWriter  $a_csv,
array  $a_set 
)
protected

CSV Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
ilCSVWriter$a_csvcurrent file
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 582 of file class.ilTrUserObjectsPropsTableGUI.php.

582 : void
583 {
584 $a_csv->addColumn($this->lng->txt($a_set["type"]));
585 $a_csv->addColumn($a_set["title"]);
586
587 foreach ($this->getSelectedColumns() as $c) {
588 if ($c != 'status') {
589 $val = $this->parseValue($c, $a_set[$c], $this->type);
590 } else {
592 (int) $a_set[$c]
593 );
594 }
595 $a_csv->addColumn($val);
596 }
597
598 $a_csv->addRow();
599 }
parseValue(string $id, ?string $value, string $type)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.

References $c, ilLearningProgressBaseGUI\_getStatusText(), ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ fillRowExcel()

ilTrUserObjectsPropsTableGUI::fillRowExcel ( ilExcel  $a_excel,
int &  $a_row,
array  $a_set 
)
protected

Excel Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
ilExcel$a_excelexcel wrapper
int$a_rowrow counter
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 548 of file class.ilTrUserObjectsPropsTableGUI.php.

552 : void {
553 $a_excel->setCell($a_row, 0, $this->lng->txt($a_set["type"]));
554 $a_excel->setCell($a_row, 1, $a_set["title"]);
555
556 $cnt = 2;
557 foreach ($this->getSelectedColumns() as $c) {
558 if ($c != 'status') {
559 $val = $this->parseValue($c, $a_set[$c], $this->type);
560 } else {
562 (int) $a_set[$c]
563 );
564 }
565 $a_excel->setCell($a_row, $cnt++, $val);
566 }
567 }

References $c, ilLearningProgressBaseGUI\_getStatusText(), ilLPTableBaseGUI\parseValue(), and ilExcel\setCell().

+ Here is the call graph for this function:

◆ getItems()

ilTrUserObjectsPropsTableGUI::getItems ( )

Definition at line 165 of file class.ilTrUserObjectsPropsTableGUI.php.

166 {
168 $additional_fields = $this->getSelectedColumns();
169
171 $this->user_id,
172 $this->obj_id,
173 $this->ref_id,
178 $this->filter,
179 $additional_fields,
180 $this->filter["view_mode"] ?? false
181 );
182
183 if (count($tr_data["set"]) == 0 && $this->getOffset() > 0) {
184 $this->resetOffset();
186 $this->user_id,
187 $this->obj_id,
188 $this->ref_id,
193 $this->filter,
194 $additional_fields,
195 $this->filter["view_mode"] ?? false
196 );
197 }
198
199 // #13807
200 foreach ($tr_data["set"] as $idx => $row) {
201 if (($row["ref_id"] ?? 0) &&
203 'read_learning_progress',
204 $row['ref_id']
205 )) {
206 foreach (array_keys($row) as $col_id) {
207 if (!in_array(
208 $col_id,
209 array("type",
210 "obj_id",
211 "ref_id",
212 "title",
213 "sort_title"
214 )
215 )) {
216 $tr_data["set"][$idx][$col_id] = null;
217 }
218 }
219 $tr_data["set"][$idx]["privacy_conflict"] = true;
220 }
221 }
222
223 $this->setMaxCount($tr_data["cnt"]);
224
225 if ($this->getOrderField() == "title") {
226 // sort alphabetically, move parent object to 1st position
227 $set = array();
228 $parent = false;
229 foreach ($tr_data["set"] as $idx => $row) {
230 if ($row['obj_id'] == $this->obj_id) {
231 $parent = $row;
232 } elseif (isset($row["sort_title"])) {
233 $set[strtolower($row["sort_title"]) . "__" . $idx] = $row;
234 } else {
235 $set[strtolower($row["title"]) . "__" . $idx] = $row;
236 }
237 }
238 unset($tr_data["set"]);
239 if ($this->getOrderDirection() == "asc") {
240 ksort($set);
241 } else {
242 krsort($set);
243 }
244 $set = array_values($set);
245 if ($parent) {
246 array_unshift($set, $parent);
247 }
248
249 $this->setData($set);
250 } else {
251 $this->setData($tr_data["set"]);
252 }
253 }
determineOffsetAndOrder(bool $a_omit_offset=false)
resetOffset(bool $a_in_determination=false)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
static getObjectsDataForUser(int $a_user_id, int $a_parent_obj_id, int $a_parent_ref_id, string $a_order_field="", string $a_order_dir="", int $a_offset=0, int $a_limit=9999, ?array $a_filters=null, ?array $a_additional_fields=null, bool $use_collection=true)
Get all object-based tracking data for user and parent object.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)

References ilLearningProgressAccess\checkPermission(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\Repository\filter(), ilTable2GUI\getLimit(), ilTrQuery\getObjectsDataForUser(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\getSelectedColumns(), ilTable2GUI\resetOffset(), ilTable2GUI\setData(), ilTableGUI\setMaxCount(), and ilUtil\stripSlashes().

Referenced by __construct().

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

◆ getSelectableColumns()

ilTrUserObjectsPropsTableGUI::getSelectableColumns ( )

Get selectable columns.

Returns
array key: column id, val: true/false -> default on/off

Reimplemented from ilTable2GUI.

Definition at line 108 of file class.ilTrUserObjectsPropsTableGUI.php.

108 : array
109 {
110 // default fields
111 $cols = array();
112
113 $tracking = new ilObjUserTracking();
114 if ($tracking->hasExtendedData(
116 )) {
117 $cols["first_access"] = array(
118 "txt" => $this->lng->txt("trac_first_access"),
119 "default" => true
120 );
121 $cols["last_access"] = array(
122 "txt" => $this->lng->txt("trac_last_access"),
123 "default" => true
124 );
125 }
126 if ($tracking->hasExtendedData(
128 )) {
129 $cols["read_count"] = array(
130 "txt" => $this->lng->txt("trac_read_count"),
131 "default" => true
132 );
133 }
134 if ($tracking->hasExtendedData(
136 )) {
137 $cols["spent_seconds"] = array(
138 "txt" => $this->lng->txt("trac_spent_seconds"),
139 "default" => true
140 );
141 }
142
143 // #15334 - parent object does not matter, sub-objects may have percentage
144 $cols["percentage"] = array(
145 "txt" => $this->lng->txt("trac_percentage"),
146 "default" => true
147 );
148
149 $cols["status"] = array(
150 "txt" => $this->lng->txt("trac_status"),
151 "default" => true
152 );
153 $cols["mark"] = array(
154 "txt" => $this->lng->txt("trac_mark"),
155 "default" => true
156 );
157 $cols["u_comment"] = array(
158 "txt" => $this->lng->txt("trac_comment"),
159 "default" => false
160 );
161
162 return $cols;
163 }

References ilObjUserTracking\EXTENDED_DATA_LAST_ACCESS, ilObjUserTracking\EXTENDED_DATA_READ_COUNT, ilObjUserTracking\EXTENDED_DATA_SPENT_SECONDS, and ILIAS\Repository\lng().

Referenced by fillHeaderExcel().

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

◆ initFilter()

ilTrUserObjectsPropsTableGUI::initFilter ( )

Reimplemented from ilTable2GUI.

Definition at line 255 of file class.ilTrUserObjectsPropsTableGUI.php.

255 : void
256 {
257 // for scorm and objectives this filter does not make sense / is not implemented
258 $olp = ilObjectLP::getInstance($this->obj_id);
259 $collection = $olp->getCollectionInstance();
260 if ($collection instanceof ilLPCollectionOfRepositoryObjects) {
261 // show collection only/all
262 $ti = new ilRadioGroupInputGUI(
263 $this->lng->txt("trac_view_mode"),
264 "view_mode"
265 );
266 $ti->addOption(
267 new ilRadioOption($this->lng->txt("trac_view_mode_all"), "")
268 );
269 $ti->addOption(
270 new ilRadioOption(
271 $this->lng->txt("trac_view_mode_collection"),
272 "coll"
273 )
274 );
275 $this->addFilterItem($ti);
276 $ti->readFromSession();
277 $this->filter["view_mode"] = $ti->getValue();
278 }
279 }
static getInstance(int $obj_id)
This class represents a property in a property form.
This class represents an option in a radio group.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)

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

Referenced by __construct().

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

Field Documentation

◆ $access

ilAccessHandler ilTrUserObjectsPropsTableGUI::$access
protected

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

◆ $obj_id

int ilTrUserObjectsPropsTableGUI::$obj_id
protected

Definition at line 29 of file class.ilTrUserObjectsPropsTableGUI.php.

◆ $rbacsystem

ilRbacSystem ilTrUserObjectsPropsTableGUI::$rbacsystem
protected

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

◆ $ref_id

int ilTrUserObjectsPropsTableGUI::$ref_id
protected

Definition at line 28 of file class.ilTrUserObjectsPropsTableGUI.php.

◆ $type

string ilTrUserObjectsPropsTableGUI::$type
protected

Definition at line 27 of file class.ilTrUserObjectsPropsTableGUI.php.

◆ $user_id

int ilTrUserObjectsPropsTableGUI::$user_id
protected

Definition at line 30 of file class.ilTrUserObjectsPropsTableGUI.php.


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