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

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilLPTableBaseGUI
const HIT_LIMIT = 5000
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

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

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

483  : void
484  {
485  $a_csv->addColumn($this->lng->txt("type"));
486  $a_csv->addColumn($this->lng->txt("trac_title"));
487  $a_csv->addColumn($this->lng->txt("status"));
488  $a_csv->addColumn($this->lng->txt("trac_status_changed"));
489  $a_csv->addColumn($this->lng->txt("trac_percentage"));
490  $a_csv->addColumn($this->lng->txt("trac_mark"));
491  $a_csv->addColumn($this->lng->txt("comment"));
492  $a_csv->addColumn($this->lng->txt("trac_mode"));
493  // $a_csv->addColumn($this->lng->txt("path"));
494  $a_csv->addRow();
495  }
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 430 of file class.ilLPProgressTableGUI.php.

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

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

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

497  : void
498  {
499  $a_csv->addColumn($this->lng->txt('obj_' . $a_set["type"]));
500  $a_csv->addColumn($a_set["title"]);
501  $a_csv->addColumn(
503  );
504 
506  $a_csv->addColumn(
508  new ilDateTime(
509  $a_set['status_changed'],
511  )
512  )
513  );
515 
516  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
517  $a_csv->addColumn('-');
518  } else {
519  $a_csv->addColumn(sprintf("%d%%", $a_set["percentage"]));
520  }
521  $a_csv->addColumn((string) $a_set["mark"]);
522  $a_csv->addColumn((string) $a_set["comment"]);
523  $a_csv->addColumn(ilLPObjSettings::_mode2Text($a_set["u_mode"]));
524 
525  $a_csv->addRow();
526  }
static array static setUseRelativeDates(bool $a_status)
set use relative dates
addColumn(string $a_col)
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 formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
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 445 of file class.ilLPProgressTableGUI.php.

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

449  : void {
450  $a_excel->setCell($a_row, 0, $this->lng->txt('obj_' . $a_set["type"]));
451  $a_excel->setCell($a_row, 1, $a_set["title"]);
452  $a_excel->setCell(
453  $a_row,
454  2,
456  $a_set["status"]
457  )
458  );
459 
460  $a_excel->setCell(
461  $a_row,
462  3,
463  new ilDateTime(
464  $a_set['status_changed'],
466  )
467  );
468 
469  if (!$this->isPercentageAvailable($a_set['obj_id'])) {
470  $a_excel->setCell($a_row, 4, '-');
471  } else {
472  $a_excel->setCell($a_row, 4, $a_set["percentage"] . "%");
473  }
474  $a_excel->setCell($a_row, 5, (string) $a_set["mark"]);
475  $a_excel->setCell($a_row, 6, (string) $a_set["comment"]);
476  $a_excel->setCell(
477  $a_row,
478  7,
479  ilLPObjSettings::_mode2Text($a_set["u_mode"])
480  );
481  }
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 175 of file class.ilLPProgressTableGUI.php.

References ilTableGUI\$data, $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, null, ilLPTableBaseGUI\searchObjects(), and ilTable2GUI\setData().

Referenced by __construct().

175  : void
176  {
177  $data = [];
179  if (!$obj_ids && !$this->details) {
180  switch ($this->lp_context) {
182  $obj_ids = $this->searchObjects(
183  $this->getCurrentFilter(true),
184  ''
185  );
186  break;
187 
188  default:
189  $obj_ids = $this->searchObjects(
190  $this->getCurrentFilter(true),
191  "read"
192  );
193 
194  // check for LP relevance
196  $this->tracked_user->getId(),
197  $obj_ids,
198  null,
199  true
200  ) as $obj_id => $status) {
201  if (!$status) {
202  unset($obj_ids[$obj_id]);
203  }
204  }
205  break;
206  }
207  }
208  if ($obj_ids) {
209  switch ($this->mode) {
212  $this->tracked_user->getId(),
214  $obj_ids
215  );
216  break;
217 
220  $this->tracked_user->getId(),
222  $obj_ids
223  );
224  break;
225 
229  if ($this->tracked_user) {
231  $this->tracked_user->getId(),
233  $obj_ids
234  );
235  }
236  break;
237 
238  default:
240  $this->tracked_user->getId(),
241  $obj_ids
242  );
243  foreach ($data as $idx => $item) {
244  if (!($item["status"] ?? false) && !($this->filter["status"] ?? false) && !$this->details) {
245  unset($data[$idx]);
246  } else {
248  $item["obj_id"],
249  $item["type"]
250  );
251  }
252  }
253  break;
254  }
255 
256  // #15334
257  foreach ($data as $idx => $row) {
258  if (!$this->isPercentageAvailable($row["obj_id"] ?? 0)) {
259  // #17000 - enable proper (numeric) sorting
260  $data[$idx]["percentage"] = -1;
261  }
262  }
263  $this->setData($data);
264  }
265  }
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)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 170 of file class.ilLPProgressTableGUI.php.

170  : bool
171  {
172  return $a_field == "percentage";
173  }

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: