ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilLPProgressTableGUI Class Reference

TableGUI class for learning progress. 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, bool $show_type_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

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(), 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  false,
108  true,
109  $obj_ids || $this->details
110  );
111 
112  $this->setSelectAllCheckbox("item_id");
113  $this->addMultiCommand(
114  "hideSelected",
115  $this->lng->txt("trac_hide_selected")
116  );
117  } else {
118  $olp = ilObjectLP::getInstance($this->parent_obj_id);
119  $collection = $olp->getCollectionInstance();
120  $this->has_object_subitems = ($collection instanceof ilLPCollectionOfRepositoryObjects);
121 
122  $this->setTitle($this->lng->txt("details")); // #15247
123 
124  $this->addColumn($this->lng->txt("trac_title"), "title", "31%");
125  $this->addColumn($this->lng->txt("status"), "status", "7%");
126 
127  if ($this->mode == ilLPObjSettings::LP_MODE_SCORM) {
128  $this->lng->loadLanguageModule('content');
129  $this->addColumn($this->lng->txt('cont_score'), 'score', '10%');
130  } elseif ($this->has_object_subitems) {
131  $this->addColumn(
132  $this->lng->txt('trac_status_changed'),
133  'status_changed',
134  '10%'
135  );
136  $this->addColumn(
137  $this->lng->txt("trac_percentage"),
138  "percentage",
139  "7%"
140  );
141  $this->addColumn($this->lng->txt("trac_mark"), "", "5%");
142  $this->addColumn($this->lng->txt("comment"), "", "10%");
143  $this->addColumn($this->lng->txt("trac_mode"), "", "20%");
144  $this->addColumn($this->lng->txt("path"), "", "20%");
145  }
146  }
147 
148  $this->setEnableHeader(true);
149  $this->setFormAction(
150  $this->ctrl->getFormActionByClass(get_class($this))
151  );
152  $this->setRowTemplate(
153  "tpl.lp_progress_list_row.html",
154  "components/ILIAS/Tracking"
155  );
156  $this->setEnableHeader(true);
157  $this->setEnableNumInfo(false);
158  $this->setEnableTitle(true);
159  $this->setDefaultOrderField("title");
160  $this->setDefaultOrderDirection("asc");
161 
162  if ($this->has_object_subitems) {
163  $this->setExportFormats(
164  array(self::EXPORT_CSV, self::EXPORT_EXCEL)
165  );
166  }
167 
168  // area selector gets in the way
169  if ($this->tracked_user) {
170  $this->getItems();
171  }
172  }
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)
ilLanguage $lng
setId(string $a_val)
setDefaultOrderField(string $a_defaultorderfield)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:25
setDefaultOrderDirection(string $a_defaultorderdirection)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
initBaseFilter(bool $a_split_learning_resources=false, bool $a_include_no_status_filter=true, bool $show_type_filter=true)
Init filter.
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 490 of file class.ilLPProgressTableGUI.php.

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

490  : void
491  {
492  $a_csv->addColumn($this->lng->txt("type"));
493  $a_csv->addColumn($this->lng->txt("trac_title"));
494  $a_csv->addColumn($this->lng->txt("status"));
495  $a_csv->addColumn($this->lng->txt("trac_status_changed"));
496  $a_csv->addColumn($this->lng->txt("trac_percentage"));
497  $a_csv->addColumn($this->lng->txt("trac_mark"));
498  $a_csv->addColumn($this->lng->txt("comment"));
499  $a_csv->addColumn($this->lng->txt("trac_mode"));
500  // $a_csv->addColumn($this->lng->txt("path"));
501  $a_csv->addRow();
502  }
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 437 of file class.ilLPProgressTableGUI.php.

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

437  : void
438  {
439  $a_excel->setCell($a_row, 0, $this->lng->txt("type"));
440  $a_excel->setCell($a_row, 1, $this->lng->txt("trac_title"));
441  $a_excel->setCell($a_row, 2, $this->lng->txt("status"));
442  $a_excel->setCell($a_row, 3, $this->lng->txt("trac_status_changed"));
443  $a_excel->setCell($a_row, 4, $this->lng->txt("trac_percentage"));
444  $a_excel->setCell($a_row, 5, $this->lng->txt("trac_mark"));
445  $a_excel->setCell($a_row, 6, $this->lng->txt("comment"));
446  $a_excel->setCell($a_row, 7, $this->lng->txt("trac_mode"));
447  // $a_excel->setCell($a_row, 7, $this->lng->txt("path"));
448 
449  $a_excel->setBold("A" . $a_row . ":H" . $a_row);
450  }
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
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 274 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().

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

504  : void
505  {
506  $a_csv->addColumn($this->lng->txt('obj_' . $a_set["type"]));
507  $a_csv->addColumn($a_set["title"]);
508  $a_csv->addColumn(
510  );
511 
513  $a_csv->addColumn(
515  new ilDateTime(
516  $a_set['status_changed'],
518  )
519  )
520  );
522 
523  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
524  $a_csv->addColumn('-');
525  } else {
526  $a_csv->addColumn(sprintf("%d%%", $a_set["percentage"]));
527  }
528  $a_csv->addColumn((string) $a_set["mark"]);
529  $a_csv->addColumn((string) $a_set["comment"]);
530  $a_csv->addColumn(ilLPObjSettings::_mode2Text($a_set["u_mode"]));
531 
532  $a_csv->addRow();
533  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
addColumn(string $a_col)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
const IL_CAL_DATETIME
static resetToDefaults()
reset to defaults
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:

◆ fillRowExcel()

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

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

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

456  : void {
457  $a_excel->setCell($a_row, 0, $this->lng->txt('obj_' . $a_set["type"]));
458  $a_excel->setCell($a_row, 1, $a_set["title"]);
459  $a_excel->setCell(
460  $a_row,
461  2,
463  $a_set["status"]
464  )
465  );
466 
467  $a_excel->setCell(
468  $a_row,
469  3,
470  new ilDateTime(
471  $a_set['status_changed'],
473  )
474  );
475 
476  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
477  $a_excel->setCell($a_row, 4, '-');
478  } else {
479  $a_excel->setCell($a_row, 4, $a_set["percentage"] . "%");
480  }
481  $a_excel->setCell($a_row, 5, (string) $a_set["mark"]);
482  $a_excel->setCell($a_row, 6, (string) $a_set["comment"]);
483  $a_excel->setCell(
484  $a_row,
485  7,
486  ilLPObjSettings::_mode2Text($a_set["u_mode"])
487  );
488  }
const IL_CAL_DATETIME
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
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 179 of file class.ilLPProgressTableGUI.php.

References ilTableGUI\$data, ilLPTableBaseGUI\$filter, $obj_ids, $parent_obj_id, ILIAS\Repository\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().

179  : void
180  {
181  $data = [];
183  if (!$obj_ids && !$this->details) {
184  $filter = $this->getCurrentFilter(true);
185  // only courses in Achievements > Learning Progress (ILIAS 10 only) #43289
186  $filter['type'] = 'crs';
187  switch ($this->lp_context) {
189  $obj_ids = $this->searchObjects(
190  $filter,
191  ''
192  );
193  break;
194 
195  default:
196  $obj_ids = $this->searchObjects(
197  $filter,
198  "read"
199  );
200 
201  // check for LP relevance
203  $this->tracked_user->getId(),
204  $obj_ids,
205  null,
206  true
207  ) as $obj_id => $status) {
208  if (!$status) {
209  unset($obj_ids[$obj_id]);
210  }
211  }
212  break;
213  }
214  }
215  if ($obj_ids) {
216  switch ($this->mode) {
219  $this->tracked_user->getId(),
221  $obj_ids
222  );
223  break;
224 
227  $this->tracked_user->getId(),
229  $obj_ids
230  );
231  break;
232 
236  if ($this->tracked_user) {
238  $this->tracked_user->getId(),
240  $obj_ids
241  );
242  }
243  break;
244 
245  default:
247  $this->tracked_user->getId(),
248  $obj_ids
249  );
250  foreach ($data as $idx => $item) {
251  if (!($item["status"] ?? false) && !($this->filter["status"] ?? false) && !$this->details) {
252  unset($data[$idx]);
253  } else {
255  $item["obj_id"],
256  $item["type"]
257  );
258  }
259  }
260  break;
261  }
262 
263  // #15334
264  foreach ($data as $idx => $row) {
265  if (!$this->isPercentageAvailable($row["obj_id"] ?? 0)) {
266  // #17000 - enable proper (numeric) sorting
267  $data[$idx]["percentage"] = -1;
268  }
269  }
270  $this->setData($data);
271  }
272  }
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)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
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 174 of file class.ilLPProgressTableGUI.php.

174  : bool
175  {
176  return $a_field == "percentage";
177  }

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: