ILIAS  release_8 Revision v8.23
ilLPProgressTableGUI 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 ilLPProgressTableGUI:
+ Collaboration diagram for ilLPProgressTableGUI:

Public Member Functions

 __construct (?object $a_parent_obj, string $a_parent_cmd, ?ilObjUser $a_user=null, ?array $obj_ids=null, bool $details=false, ?int $mode=null, bool $personal_only=false, ?int $a_parent_id=null, ?int $a_parent_ref_id=null, ?int $lp_context=null)
 Constructor. More...
 
 numericOrdering (string $a_field)
 
 getItems ()
 
- 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

ilObjUser $tracked_user = null
 
array $obj_ids = null
 
bool $details = false
 
int $mode = 0
 
int $parent_obj_id = 0
 
int $ref_id = 0
 
int $obj_id = 0
 
int $lp_context = 0
 
bool $has_object_subitems = false
 
- 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 TableGUI class for learning progress

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e ilLPProgressTableGUI: ilFormPropertyDispatchGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilLPProgressTableGUI::__construct ( ?object  $a_parent_obj,
string  $a_parent_cmd,
?ilObjUser  $a_user = null,
?array  $obj_ids = null,
bool  $details = false,
?int  $mode = null,
bool  $personal_only = false,
?int  $a_parent_id = null,
?int  $a_parent_ref_id = null,
?int  $lp_context = null 
)

Constructor.

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

References $details, $DIC, ilTableGUI\$lng, $obj_ids, $parent_obj_id, $tracked_user, ilLPTableBaseGUI\$user, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addMultiCommand(), ILIAS\Repository\ctrl(), ilObjectLP\getInstance(), getItems(), ilLPTableBaseGUI\initBaseFilter(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_SCORM, ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTable2GUI\setLimit(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowTemplates(), and ilTable2GUI\setTitle().

53  {
54  global $DIC;
55 
56  $ilCtrl = $DIC['ilCtrl'];
57  $lng = $DIC['lng'];
58 
59  $this->tracked_user = $a_user;
60  $this->obj_ids = $obj_ids;
61  $this->details = $details;
62  $this->mode = (int) $mode;
63  $this->parent_obj_id = (int) $a_parent_id;
64  $this->lp_context = (int) $lp_context;
65 
66  if ($a_parent_id) {
67  $this->obj_id = $this->parent_obj_id;
68  $this->ref_id = (int) $a_parent_ref_id;
69  }
70 
71  $this->setId("lpprgtbl");
72  parent::__construct($a_parent_obj, $a_parent_cmd);
73  $this->setLimit(9999);
74 
75  if (!$this->details) {
76  $this->has_object_subitems = true;
78  if (!$user) {
79  $user = $DIC->user();
80  }
81  $this->addColumn("", "", "1", true);
82  $this->addColumn($this->lng->txt("trac_title"), "title", "26%");
83  $this->addColumn($this->lng->txt("status"), "status", "7%");
84  $this->addColumn(
85  $this->lng->txt('trac_status_changed'),
86  'status_changed',
87  '10%'
88  );
89  $this->addColumn(
90  $this->lng->txt("trac_percentage"),
91  "percentage",
92  "7%"
93  );
94  $this->addColumn($this->lng->txt("trac_mark"), "", "5%");
95  $this->addColumn($this->lng->txt("comment"), "", "10%");
96  $this->addColumn($this->lng->txt("trac_mode"), "", "20%");
97  $this->addColumn($this->lng->txt("path"), "", "20%");
98  $this->addColumn($this->lng->txt("actions"), "", "5%");
99 
100  $this->setTitle(
101  sprintf(
102  $this->lng->txt("trac_learning_progress_of"),
103  $user->getFullName()
104  )
105  );
106  $this->initBaseFilter();
107 
108  $this->setSelectAllCheckbox("item_id");
109  $this->addMultiCommand(
110  "hideSelected",
111  $this->lng->txt("trac_hide_selected")
112  );
113 
114  $this->setShowTemplates(true);
115  } else {
116  $olp = ilObjectLP::getInstance($this->parent_obj_id);
117  $collection = $olp->getCollectionInstance();
118  $this->has_object_subitems = ($collection instanceof ilLPCollectionOfRepositoryObjects);
119 
120  $this->setTitle($this->lng->txt("details")); // #15247
121 
122  $this->addColumn($this->lng->txt("trac_title"), "title", "31%");
123  $this->addColumn($this->lng->txt("status"), "status", "7%");
124 
125  if ($this->mode == ilLPObjSettings::LP_MODE_SCORM) {
126  $this->lng->loadLanguageModule('content');
127  $this->addColumn($this->lng->txt('cont_score'), 'score', '10%');
128  } elseif ($this->has_object_subitems) {
129  $this->addColumn(
130  $this->lng->txt('trac_status_changed'),
131  'status_changed',
132  '10%'
133  );
134  $this->addColumn(
135  $this->lng->txt("trac_percentage"),
136  "percentage",
137  "7%"
138  );
139  $this->addColumn($this->lng->txt("trac_mark"), "", "5%");
140  $this->addColumn($this->lng->txt("comment"), "", "10%");
141  $this->addColumn($this->lng->txt("trac_mode"), "", "20%");
142  $this->addColumn($this->lng->txt("path"), "", "20%");
143  }
144  }
145 
146  $this->setEnableHeader(true);
147  $this->setFormAction(
148  $this->ctrl->getFormActionByClass(get_class($this))
149  );
150  $this->setRowTemplate(
151  "tpl.lp_progress_list_row.html",
152  "Services/Tracking"
153  );
154  $this->setEnableHeader(true);
155  $this->setEnableNumInfo(false);
156  $this->setEnableTitle(true);
157  $this->setDefaultOrderField("title");
158  $this->setDefaultOrderDirection("asc");
159 
160  if ($this->has_object_subitems) {
161  $this->setExportFormats(
162  array(self::EXPORT_CSV, self::EXPORT_EXCEL)
163  );
164  }
165 
166  // area selector gets in the way
167  if ($this->tracked_user) {
168  $this->getItems();
169  }
170  }
setExportFormats(array $formats)
Set available export formats.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setShowTemplates(bool $a_value)
ilLanguage $lng
setId(string $a_val)
global $DIC
Definition: feed.php:28
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true)
Init filter.
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
setEnableNumInfo(bool $a_val)
__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)
addMultiCommand(string $a_cmd, string $a_text)
static getInstance(int $obj_id)
setEnableHeader(bool $a_enableheader)
+ Here is the call graph for this function:

Member Function Documentation

◆ fillHeaderCSV()

ilLPProgressTableGUI::fillHeaderCSV ( ilCSVWriter  $a_csv)
protected

Definition at line 485 of file class.ilLPProgressTableGUI.php.

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

485  : void
486  {
487  $a_csv->addColumn($this->lng->txt("type"));
488  $a_csv->addColumn($this->lng->txt("trac_title"));
489  $a_csv->addColumn($this->lng->txt("status"));
490  $a_csv->addColumn($this->lng->txt("trac_status_changed"));
491  $a_csv->addColumn($this->lng->txt("trac_percentage"));
492  $a_csv->addColumn($this->lng->txt("trac_mark"));
493  $a_csv->addColumn($this->lng->txt("comment"));
494  $a_csv->addColumn($this->lng->txt("trac_mode"));
495  // $a_csv->addColumn($this->lng->txt("path"));
496  $a_csv->addRow();
497  }
addColumn(string $a_col)
+ Here is the call graph for this function:

◆ fillHeaderExcel()

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

Definition at line 432 of file class.ilLPProgressTableGUI.php.

References ILIAS\Repository\lng(), ilExcel\setBold(), and ilExcel\setCell().

432  : void
433  {
434  $a_excel->setCell($a_row, 0, $this->lng->txt("type"));
435  $a_excel->setCell($a_row, 1, $this->lng->txt("trac_title"));
436  $a_excel->setCell($a_row, 2, $this->lng->txt("status"));
437  $a_excel->setCell($a_row, 3, $this->lng->txt("trac_status_changed"));
438  $a_excel->setCell($a_row, 4, $this->lng->txt("trac_percentage"));
439  $a_excel->setCell($a_row, 5, $this->lng->txt("trac_mark"));
440  $a_excel->setCell($a_row, 6, $this->lng->txt("comment"));
441  $a_excel->setCell($a_row, 7, $this->lng->txt("trac_mode"));
442  // $a_excel->setCell($a_row, 7, $this->lng->txt("path"));
443 
444  $a_excel->setBold("A" . $a_row . ":H" . $a_row);
445  }
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()

ilLPProgressTableGUI::fillRow ( array  $a_set)
protected

Definition at line 269 of file class.ilLPProgressTableGUI.php.

References $path, $ref_id, ilObject\_getIcon(), ilLPTableBaseGUI\buildPath(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilUtil\getImagePath(), ilLPStatusIcons\getInstance(), ilObjectLP\getInstance(), ilLPStatusIcons\ICON_VARIANT_LONG, IL_CAL_DATETIME, IL_CAL_UNIX, ILIAS\Repository\lng(), ilLPObjSettings\LP_MODE_SCORM, ilLPStatus\LP_STATUS_COMPLETED_NUM, and ilLPTableBaseGUI\showTimingsWarning().

269  : void
270  {
271  if (!$this->details) {
272  $this->tpl->setCurrentBlock("column_checkbox");
273  $this->tpl->setVariable("OBJ_ID", $a_set["obj_id"]);
274  $this->tpl->parseCurrentBlock();
275  }
276 
277  $this->tpl->setVariable(
278  "ICON_SRC",
279  ilObject::_getIcon(0, "tiny", $a_set["type"])
280  );
281  $this->tpl->setVariable("ICON_ALT", $this->lng->txt("obj_" . $a_set["type"]));
282  $this->tpl->setVariable("TITLE_TEXT", $a_set["title"]);
283 
284  if ($a_set["offline"] ?? false) {
285  $this->tpl->setCurrentBlock("offline");
286  $this->tpl->setVariable("TEXT_STATUS", $this->lng->txt("status"));
287  $this->tpl->setVariable("TEXT_OFFLINE", $this->lng->txt("offline"));
288  $this->tpl->parseCurrentBlock();
289  }
290 
292  $this->tpl->setVariable(
293  "STATUS_ICON",
294  $icons->renderIconForStatus((int) $a_set["status"])
295  );
296 
297  if ($this->mode == ilLPObjSettings::LP_MODE_SCORM) {
298  $this->tpl->setVariable('SCORE_VAL', $a_set["score"]);
299  } elseif ($this->has_object_subitems) {
300  $this->tpl->setCurrentBlock("status_details");
301 
302  $this->tpl->setVariable(
303  'STATUS_CHANGED_VAL',
305  new ilDateTime(
306  $a_set['status_changed'],
308  )
309  )
310  );
311 
312  $olp = ilObjectLP::getInstance($a_set["obj_id"]);
313  $this->tpl->setVariable(
314  "MODE_TEXT",
315  $olp->getModeText($a_set["u_mode"])
316  );
317  $this->tpl->setVariable("MARK_VALUE", $a_set["mark"]);
318  $this->tpl->setVariable("COMMENT_TEXT", $a_set["comment"]);
319 
320  if ($a_set["percentage"] < 0) {
321  $this->tpl->setVariable("PERCENTAGE_VALUE", "");
322  } else {
323  $this->tpl->setVariable(
324  "PERCENTAGE_VALUE",
325  sprintf("%d%%", $a_set["percentage"])
326  );
327  }
328 
329  // path
330  $path = $this->buildPath($a_set["ref_ids"]);
331  if ($path) {
332  $this->tpl->setCurrentBlock("item_path");
333  foreach ($path as $path_item) {
334  $this->tpl->setVariable("PATH_ITEM", $path_item);
335  $this->tpl->parseCurrentBlock();
336  }
337  }
338 
339  $this->tpl->parseCurrentBlock();
340  }
341 
342  // not for objectives/scos
343  if (!$this->mode) {
344  // tlt warning
345  if ($a_set["status"] != ilLPStatus::LP_STATUS_COMPLETED_NUM && $a_set["ref_ids"]) {
346  $ref_id = $a_set["ref_ids"];
347  $ref_id = array_shift($ref_id);
348  $timing = $this->showTimingsWarning(
349  $ref_id,
350  $this->tracked_user->getId()
351  );
352  if ($timing) {
353  if ($timing !== true) {
354  $timing = ": " . ilDatePresentation::formatDate(
355  new ilDate($timing, IL_CAL_UNIX)
356  );
357  } else {
358  $timing = "";
359  }
360  $this->tpl->setCurrentBlock('warning_img');
361  $this->tpl->setVariable(
362  'WARNING_IMG',
364  'time_warn.svg'
365  )
366  );
367  $this->tpl->setVariable(
368  'WARNING_ALT',
369  $this->lng->txt(
370  'trac_time_passed'
371  ) . $timing
372  );
373  $this->tpl->parseCurrentBlock();
374  }
375  }
376 
377  // hide / unhide?!
378  if (!$this->details) {
379  $this->tpl->setCurrentBlock("item_command");
380  $this->ctrl->setParameterByClass(
381  get_class($this),
382  'hide',
383  $a_set["obj_id"]
384  );
385  $this->tpl->setVariable(
386  "HREF_COMMAND",
387  $this->ctrl->getLinkTargetByClass(
388  get_class($this),
389  'hide'
390  )
391  );
392  $this->tpl->setVariable(
393  "TXT_COMMAND",
394  $this->lng->txt('trac_hide')
395  );
396  $this->tpl->parseCurrentBlock();
397 
398  $olp = ilObjectLP::getInstance($a_set["obj_id"]);
399  if ($olp->getCollectionInstance() && $a_set["ref_ids"]) {
400  $ref_id = $a_set["ref_ids"];
401  $ref_id = array_shift($ref_id);
402  $this->ctrl->setParameterByClass(
403  $this->ctrl->getCmdClass(),
404  'details_id',
405  $ref_id
406  );
407  $this->tpl->setVariable(
408  "HREF_COMMAND",
409  $this->ctrl->getLinkTargetByClass(
410  $this->ctrl->getCmdClass(),
411  'details'
412  )
413  );
414  $this->ctrl->setParameterByClass(
415  $this->ctrl->getCmdClass(),
416  'details_id',
417  ''
418  );
419  $this->tpl->setVariable(
420  "TXT_COMMAND",
421  $this->lng->txt('trac_subitems')
422  );
423  $this->tpl->parseCurrentBlock();
424  }
425 
426  $this->tpl->setCurrentBlock("column_action");
427  $this->tpl->parseCurrentBlock();
428  }
429  }
430  }
const LP_STATUS_COMPLETED_NUM
const IL_CAL_DATETIME
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
$path
Definition: ltiservices.php:32
showTimingsWarning(int $a_ref_id, int $a_user_id)
static getInstance(int $obj_id)
+ Here is the call graph for this function:

◆ fillRowCSV()

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

Definition at line 499 of file class.ilLPProgressTableGUI.php.

References ilLearningProgressBaseGUI\_getStatusText(), ilLPObjSettings\_mode2Text(), ilCSVWriter\addColumn(), ilCSVWriter\addRow(), ilDatePresentation\formatDate(), IL_CAL_DATETIME, ilLPTableBaseGUI\isPercentageAvailable(), ILIAS\Repository\lng(), ilDatePresentation\resetToDefaults(), and ilDatePresentation\setUseRelativeDates().

499  : void
500  {
501  $a_csv->addColumn($this->lng->txt("obj_" . $a_set["type"]));
502  $a_csv->addColumn($a_set["title"]);
503  $a_csv->addColumn(
505  );
506 
508  $a_csv->addColumn(
510  new ilDateTime(
511  $a_set['status_changed'],
513  )
514  )
515  );
517 
518  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
519  $a_csv->addColumn('-');
520  } else {
521  $a_csv->addColumn(sprintf("%d%%", $a_set["percentage"]));
522  }
523  $a_csv->addColumn((string) $a_set["mark"]);
524  $a_csv->addColumn((string) $a_set["comment"]);
525  $a_csv->addColumn(ilLPObjSettings::_mode2Text($a_set["u_mode"]));
526 
527  $a_csv->addRow();
528  }
addColumn(string $a_col)
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
static resetToDefaults()
reset to defaults
isPercentageAvailable(int $a_obj_id)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static setUseRelativeDates(bool $a_status)
set use relative dates
static _mode2Text(int $a_mode)
+ Here is the call graph for this function:

◆ fillRowExcel()

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

Definition at line 447 of file class.ilLPProgressTableGUI.php.

References ilLearningProgressBaseGUI\_getStatusText(), ilLPObjSettings\_mode2Text(), IL_CAL_DATETIME, ilLPTableBaseGUI\isPercentageAvailable(), ILIAS\Repository\lng(), and ilExcel\setCell().

451  : void {
452  $a_excel->setCell($a_row, 0, $this->lng->txt("obj_" . $a_set["type"]));
453  $a_excel->setCell($a_row, 1, $a_set["title"]);
454  $a_excel->setCell(
455  $a_row,
456  2,
458  $a_set["status"]
459  )
460  );
461 
462  $a_excel->setCell(
463  $a_row,
464  3,
465  new ilDateTime(
466  $a_set['status_changed'],
468  )
469  );
470 
471  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
472  $a_excel->setCell($a_row, 4, '-');
473  } else {
474  $a_excel->setCell($a_row, 4, $a_set["percentage"] . "%");
475  }
476  $a_excel->setCell($a_row, 5, (string) $a_set["mark"]);
477  $a_excel->setCell($a_row, 6, (string) $a_set["comment"]);
478  $a_excel->setCell(
479  $a_row,
480  7,
481  ilLPObjSettings::_mode2Text($a_set["u_mode"])
482  );
483  }
const IL_CAL_DATETIME
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
isPercentageAvailable(int $a_obj_id)
static _getStatusText(int $a_status, ?ilLanguage $a_lng=null)
Get status alt text.
static _mode2Text(int $a_mode)
+ Here is the call graph for this function:

◆ getItems()

ilLPProgressTableGUI::getItems ( )

Definition at line 177 of file class.ilLPProgressTableGUI.php.

References ilTableGUI\$data, $obj_ids, $parent_obj_id, ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilLPTableBaseGUI\getCurrentFilter(), ilObjectLP\getLPMemberships(), ilTrQuery\getObjectivesStatusForUser(), ilTrQuery\getObjectsStatusForUser(), ilTrQuery\getSCOsStatusForUser(), ilTrQuery\getSubItemsStatusForUser(), ilLearningProgressBaseGUI\isObjectOffline(), ilLPTableBaseGUI\isPercentageAvailable(), ilLearningProgressBaseGUI\LP_CONTEXT_ORG_UNIT, ilLPObjSettings\LP_MODE_COLLECTION_MANUAL, ilLPObjSettings\LP_MODE_COLLECTION_MOBS, ilLPObjSettings\LP_MODE_COLLECTION_TLT, ilLPObjSettings\LP_MODE_OBJECTIVES, ilLPObjSettings\LP_MODE_SCORM, ilLPTableBaseGUI\searchObjects(), and ilTable2GUI\setData().

Referenced by __construct().

177  : void
178  {
179  $data = [];
181  if (!$obj_ids && !$this->details) {
182  switch ($this->lp_context) {
184  $obj_ids = $this->searchObjects(
185  $this->getCurrentFilter(true),
186  ''
187  );
188  break;
189 
190  default:
191  $obj_ids = $this->searchObjects(
192  $this->getCurrentFilter(true),
193  "read"
194  );
195 
196  // check for LP relevance
198  $this->tracked_user->getId(),
199  $obj_ids,
200  null,
201  true
202  ) as $obj_id => $status) {
203  if (!$status) {
204  unset($obj_ids[$obj_id]);
205  }
206  }
207  break;
208  }
209  }
210  if ($obj_ids) {
211  switch ($this->mode) {
214  $this->tracked_user->getId(),
216  $obj_ids
217  );
218  break;
219 
222  $this->tracked_user->getId(),
224  $obj_ids
225  );
226  break;
227 
231  if ($this->tracked_user) {
233  $this->tracked_user->getId(),
235  $obj_ids
236  );
237  }
238  break;
239 
240  default:
242  $this->tracked_user->getId(),
243  $obj_ids
244  );
245  foreach ($data as $idx => $item) {
246  if (!($item["status"] ?? false) && !($this->filter["status"] ?? false) && !$this->details) {
247  unset($data[$idx]);
248  } else {
250  $item["obj_id"],
251  $item["type"]
252  );
253  }
254  }
255  break;
256  }
257 
258  // #15334
259  foreach ($data as $idx => $row) {
260  if (!$this->isPercentageAvailable($row["obj_id"] ?? 0)) {
261  // #17000 - enable proper (numeric) sorting
262  $data[$idx]["percentage"] = -1;
263  }
264  }
265  $this->setData($data);
266  }
267  }
setData(array $a_data)
getCurrentFilter(bool $as_query=false)
static getLPMemberships(int $usr_id, array $obj_ids, ?int $parent_ref_id=null, bool $mapped_ref_ids=false)
Get all objects where given user is member (from LP POV)
static getSubItemsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_item_ids)
Get subitems status.
static getObjectivesStatusForUser(int $a_user_id, int $a_obj_id, array $a_objective_ids)
searchObjects(array $filter, string $permission, ?array $preset_obj_ids=null, bool $a_check_lp_activation=true)
Search objects that match current filters.
static getSCOsStatusForUser(int $a_user_id, int $a_parent_obj_id, array $a_sco_ids)
isPercentageAvailable(int $a_obj_id)
static getObjectsStatusForUser(int $a_user_id, array $obj_refs)
static isObjectOffline(int $a_obj_id, string $a_type='')
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ numericOrdering()

ilLPProgressTableGUI::numericOrdering ( string  $a_field)

Definition at line 172 of file class.ilLPProgressTableGUI.php.

172  : bool
173  {
174  return $a_field == "percentage";
175  }

Field Documentation

◆ $details

bool ilLPProgressTableGUI::$details = false
protected

Definition at line 31 of file class.ilLPProgressTableGUI.php.

Referenced by __construct().

◆ $has_object_subitems

bool ilLPProgressTableGUI::$has_object_subitems = false
protected

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

◆ $lp_context

int ilLPProgressTableGUI::$lp_context = 0
protected

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

◆ $mode

int ilLPProgressTableGUI::$mode = 0
protected

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

◆ $obj_id

int ilLPProgressTableGUI::$obj_id = 0
protected

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

◆ $obj_ids

array ilLPProgressTableGUI::$obj_ids = null
protected

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

Referenced by __construct(), and getItems().

◆ $parent_obj_id

int ilLPProgressTableGUI::$parent_obj_id = 0
protected

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

Referenced by __construct(), and getItems().

◆ $ref_id

int ilLPProgressTableGUI::$ref_id = 0
protected

Definition at line 34 of file class.ilLPProgressTableGUI.php.

Referenced by fillRow().

◆ $tracked_user

ilObjUser ilLPProgressTableGUI::$tracked_user = null
protected

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

Referenced by __construct().


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