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

Protected Member Functions

 fillRow (array $a_set)
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 
- 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)
 
 fillMetaCSV (ilCSVWriter $a_csv)
 
 showTimingsWarning (int $a_ref_id, int $a_user_id)
 
 formatSeconds (int $seconds, bool $a_shorten_zero=false)
 
 anonymizeValue ($a_value, bool $a_force_number=false)
 
 buildValueScale (int $a_max_value, bool $a_anonymize=false, bool $a_format_seconds=false)
 
 getMonthsFilter ($a_short=false)
 
 getMonthsYear ($a_year=null, $a_short=false)
 
 getSelectableUserColumns (int $a_in_course=0, int $a_in_group=0)
 
 addToClipboard ()
 Add selected users to clipboard. More...
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

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

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

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(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowTemplates().

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  "Services/Tracking"
99  );
100  $this->setEnableTitle(true);
101  $this->setDefaultOrderField("title");
102  $this->setDefaultOrderDirection("asc");
103  $this->setShowTemplates(true);
104  $this->setExportFormats(array(self::EXPORT_CSV, self::EXPORT_EXCEL));
105  $this->initFilter();
106  $this->getItems();
107  }
setExportFormats(array $formats)
Set available export formats.
$c
Definition: cli.php:38
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setShowTemplates(bool $a_value)
setPrintMode(bool $a_value=false)
setId(string $a_val)
global $DIC
Definition: feed.php:28
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
__construct(Container $dic, ilPlugin $plugin)
setLimit(int $a_limit=0, int $a_default_limit=0)
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)
static _lookupType(int $id, bool $reference=false)
parseTitle(int $a_obj_id, string $action, int $a_user_id=0)
setEnableHeader(bool $a_enableheader)
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilTrUserObjectsPropsTableGUI::fillHeaderCSV ( ilCSVWriter  $a_csv)
protected

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

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

572  : void
573  {
574  $a_csv->addColumn($this->lng->txt("type"));
575  $a_csv->addColumn($this->lng->txt("title"));
576 
577  $labels = $this->getSelectableColumns();
578  foreach ($this->getSelectedColumns() as $c) {
579  $a_csv->addColumn($labels[$c]["txt"]);
580  }
581 
582  $a_csv->addRow();
583  }
addColumn(string $a_col)
$c
Definition: cli.php:38
+ Here is the call graph for this function:

◆ fillHeaderExcel()

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

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

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

535  : void
536  {
537  $a_excel->setCell($a_row, 0, $this->lng->txt("type"));
538  $a_excel->setCell($a_row, 1, $this->lng->txt("title"));
539 
540  $labels = $this->getSelectableColumns();
541  $cnt = 2;
542  foreach ($this->getSelectedColumns() as $c) {
543  $a_excel->setCell($a_row, $cnt++, $labels[$c]["txt"]);
544  }
545 
546  $a_excel->setBold(
547  "A" . $a_row . ":" . $a_excel->getColumnCoord($cnt - 1) . $a_row
548  );
549  }
$c
Definition: cli.php:38
getColumnCoord(int $a_col)
Get column "name" from number.
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
setBold(string $a_coords)
Set cell(s) to bold.
+ Here is the call graph for this function:

◆ fillRow()

ilTrUserObjectsPropsTableGUI::fillRow ( array  $a_set)
protected

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

References $c, $DIC, $obj_id, $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().

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

◆ fillRowCSV()

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

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

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

585  : void
586  {
587  $a_csv->addColumn($this->lng->txt($a_set["type"]));
588  $a_csv->addColumn($a_set["title"]);
589 
590  foreach ($this->getSelectedColumns() as $c) {
591  if ($c != 'status') {
592  $val = $this->parseValue($c, $a_set[$c], $this->type);
593  } else {
595  (int) $a_set[$c]
596  );
597  }
598  $a_csv->addColumn($val);
599  }
600 
601  $a_csv->addRow();
602  }
addColumn(string $a_col)
$c
Definition: cli.php:38
parseValue(string $id, ?string $value, string $type)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
+ Here is the call graph for this function:

◆ fillRowExcel()

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

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

References $c, ilLearningProgressBaseGUI\_getStatusText(), ilTable2GUI\getSelectedColumns(), ILIAS\Repository\lng(), ilLPTableBaseGUI\parseValue(), and ilExcel\setCell().

555  : void {
556  $a_excel->setCell($a_row, 0, $this->lng->txt($a_set["type"]));
557  $a_excel->setCell($a_row, 1, $a_set["title"]);
558 
559  $cnt = 2;
560  foreach ($this->getSelectedColumns() as $c) {
561  if ($c != 'status') {
562  $val = $this->parseValue($c, $a_set[$c], $this->type);
563  } else {
565  (int) $a_set[$c]
566  );
567  }
568  $a_excel->setCell($a_row, $cnt++, $val);
569  }
570  }
$c
Definition: cli.php:38
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
parseValue(string $id, ?string $value, string $type)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
+ Here is the call graph for this function:

◆ getItems()

ilTrUserObjectsPropsTableGUI::getItems ( )

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

References ilLearningProgressAccess\checkPermission(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\UI\examples\Symbol\Glyph\Filter\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().

167  {
168  $this->determineOffsetAndOrder();
169  $additional_fields = $this->getSelectedColumns();
170 
172  $this->user_id,
173  $this->obj_id,
174  $this->ref_id,
178  ilUtil::stripSlashes($this->getLimit()),
179  $this->filter,
180  $additional_fields,
181  $this->filter["view_mode"] ?? false
182  );
183 
184  if (count($tr_data["set"]) == 0 && $this->getOffset() > 0) {
185  $this->resetOffset();
187  $this->user_id,
188  $this->obj_id,
189  $this->ref_id,
193  ilUtil::stripSlashes($this->getLimit()),
194  $this->filter,
195  $additional_fields,
196  $this->filter["view_mode"] ?? false
197  );
198  }
199 
200  // #13807
201  foreach ($tr_data["set"] as $idx => $row) {
202  if (($row["ref_id"] ?? 0) &&
204  'read_learning_progress',
205  $row['ref_id']
206  )) {
207  foreach (array_keys($row) as $col_id) {
208  if (!in_array(
209  $col_id,
210  array("type",
211  "obj_id",
212  "ref_id",
213  "title",
214  "sort_title"
215  )
216  )) {
217  $tr_data["set"][$idx][$col_id] = null;
218  }
219  }
220  $tr_data["set"][$idx]["privacy_conflict"] = true;
221  }
222  }
223 
224  $this->setMaxCount($tr_data["cnt"]);
225 
226  if ($this->getOrderField() == "title") {
227  // sort alphabetically, move parent object to 1st position
228  $set = array();
229  $parent = false;
230  foreach ($tr_data["set"] as $idx => $row) {
231  if ($row['obj_id'] == $this->obj_id) {
232  $parent = $row;
233  } elseif (isset($row["sort_title"])) {
234  $set[strtolower($row["sort_title"]) . "__" . $idx] = $row;
235  } else {
236  $set[strtolower($row["title"]) . "__" . $idx] = $row;
237  }
238  }
239  unset($tr_data["set"]);
240  if ($this->getOrderDirection() == "asc") {
241  ksort($set);
242  } else {
243  krsort($set);
244  }
245  $set = array_values($set);
246  if ($parent) {
247  array_unshift($set, $parent);
248  }
249 
250  $this->setData($set);
251  } else {
252  $this->setData($tr_data["set"]);
253  }
254  }
setData(array $a_data)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
resetOffset(bool $a_in_determination=false)
static checkPermission(string $a_permission, int $a_ref_id, ?int $a_user_id=null)
wrapper for rbac access checks
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.
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilTrUserObjectsPropsTableGUI::getSelectableColumns ( )

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

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

Referenced by fillHeaderCSV(), and fillHeaderExcel().

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

◆ initFilter()

ilTrUserObjectsPropsTableGUI::initFilter ( )

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

References ilTable2GUI\addFilterItem(), ilRadioGroupInputGUI\addOption(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilObjectLP\getInstance(), and ILIAS\Repository\lng().

Referenced by __construct().

256  : void
257  {
258  // for scorm and objectives this filter does not make sense / is not implemented
259  $olp = ilObjectLP::getInstance($this->obj_id);
260  $collection = $olp->getCollectionInstance();
261  if ($collection instanceof ilLPCollectionOfRepositoryObjects) {
262 
263  // show collection only/all
264  $ti = new ilRadioGroupInputGUI(
265  $this->lng->txt("trac_view_mode"),
266  "view_mode"
267  );
268  $ti->addOption(
269  new ilRadioOption($this->lng->txt("trac_view_mode_all"), "")
270  );
271  $ti->addOption(
272  new ilRadioOption(
273  $this->lng->txt("trac_view_mode_collection"),
274  "coll"
275  )
276  );
277  $this->addFilterItem($ti);
278  $ti->readFromSession();
279  $this->filter["view_mode"] = $ti->getValue();
280  }
281  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
addOption(ilRadioOption $a_option)
This class represents a property in a property form.
static getInstance(int $obj_id)
+ 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.

Referenced by fillRow().

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