ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCourseParticipantsTableGUI Class Reference
+ Inheritance diagram for ilCourseParticipantsTableGUI:
+ Collaboration diagram for ilCourseParticipantsTableGUI:

Public Member Functions

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

Protected Member Functions

 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 lookupUserName (int $user_id)
 
- Protected Member Functions inherited from ilParticipantTableGUI
 getRepositoryObject ()
 
 getParticipants ()
 
 initSettings ()
 
 showActionLinks ($a_set)
 
- 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

bool $show_learning_progress = false
 
bool $show_timings = false
 
bool $show_lp_status_sync = false
 
ilAccessHandler $access
 
ilRbacReview $rbacReview
 
ilObjUser $user
 
Profile $profile
 
array $cached_user_names = []
 
- Protected Attributes inherited from ilParticipantTableGUI
ilParticipants $participants = null
 
array $current_filter = []
 
ilObject $rep_object
 
- 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
 

Private Attributes

ilCertificateUserForObjectPreloader $preLoader = null
 
ilPrivacySettings $privacy
 

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 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
 
- Static Protected Attributes inherited from ilParticipantTableGUI
static bool $export_allowed = false
 
static bool $confirmation_required = true
 
static array $accepted_ids = null
 
static array $all_columns = null
 
static bool $has_odf_definitions = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCourseParticipantsTableGUI::__construct ( object  $a_parent_obj,
ilObject  $rep_object,
bool  $a_show_learning_progress = false,
bool  $a_show_timings = false,
bool  $a_show_lp_status_sync = false,
?ilCertificateUserForObjectPreloader  $preloader = null 
)

Definition at line 43 of file class.ilCourseParticipantsTableGUI.php.

50 {
51 global $DIC;
52
53 $this->show_learning_progress = $a_show_learning_progress;
54
55 if (null === $preloader) {
59 );
60 }
61 $this->preLoader = $preloader;
62 $this->show_timings = $a_show_timings;
63 $this->show_lp_status_sync = $a_show_lp_status_sync;
64 $this->rep_object = $rep_object;
65
67 $this->show_lp_status_sync = false;
68 }
69 $this->privacy = ilPrivacySettings::getInstance();
70 $this->access = $DIC->access();
71 $this->participants = ilParticipants::getInstanceByObjId($this->getRepositoryObject()->getId());
72 $this->rbacReview = $DIC->rbac()->review();
73 $this->user = $DIC->user();
74 $this->profile = $DIC['user']->getProfile();
75
76 $this->setId('crs_' . $this->getRepositoryObject()->getId());
77 parent::__construct($a_parent_obj, 'participants');
78
79 $this->lng->loadLanguageModule('crs');
80 $this->lng->loadLanguageModule('trac');
81 $this->lng->loadLanguageModule('rbac');
82 $this->lng->loadLanguageModule('mmbr');
83 $this->lng->loadLanguageModule('cert');
84 $this->lng->loadLanguageModule('certificate');
85
86 $this->initSettings();
87
88 $this->setFormName('participants');
89
90 $this->addColumn('', 'f', '1', true);
91 $this->addColumn($this->lng->txt('name'), 'name', '20%');
92
93 $all_cols = $this->getSelectableColumns();
94 foreach ($this->getSelectedColumns() as $col) {
95 $this->addColumn($all_cols[$col]['txt'], $col);
96 }
97
98 if ($this->show_learning_progress) {
99 $this->addColumn($this->lng->txt('learning_progress'), 'progress');
100 }
101
102 if ($this->privacy->enabledCourseAccessTimes()) {
103 $this->addColumn($this->lng->txt('last_access'), 'access_ut', '16em');
104 }
105
106 $this->addColumn($this->lng->txt('crs_member_passed'), 'passed');
107 if ($this->show_lp_status_sync) {
108 $this->addColumn($this->lng->txt('crs_member_passed_status_changed'), 'passed_timestamp');
109 }
110
111 $this->setSelectAllCheckbox('participants', true);
112 $this->addColumn($this->lng->txt('crs_mem_contact'), 'contact');
113 $this->addColumn($this->lng->txt('crs_blocked'), 'blocked');
114 $this->addColumn($this->lng->txt('crs_notification_list_title'), 'notification');
115
116 $this->addColumn($this->lng->txt('actions'), 'optional', '', false, 'ilMembershipRowActionsHeader');
117
118 $this->setRowTemplate("tpl.show_participants_row.html", "components/ILIAS/Course");
119
120 $this->setDefaultOrderField('roles');
121 $this->enable('sort');
122 $this->enable('header');
123 $this->enable('numinfo');
124 $this->enable('select_all');
125
126 $this->setEnableNumInfo(true);
127 $this->setExternalSegmentation(false);
128 $this->setTopCommands(true);
129 $this->setEnableHeader(true);
130 $this->setEnableTitle(true);
131 $this->initFilter();
132
133 $this->setShowRowsSelector(true);
134
135 $preloader->preLoadDownloadableCertificates($this->getRepositoryObject()->getId());
136 $this->addMultiCommand('editParticipants', $this->lng->txt('edit'));
137 $this->addMultiCommand('confirmDeleteParticipants', $this->lng->txt('remove'));
138 $this->addMultiCommand('sendMailToSelectedUsers', $this->lng->txt('mmbr_btn_mail_selected_users'));
139 $this->lng->loadLanguageModule('user');
140 $this->addMultiCommand('addToClipboard', $this->lng->txt('clipboard_add_btn'));
141
142 $this->addCommandButton('updateParticipantsStatus', $this->lng->txt('save'));
143 }
getSelectableColumns()
Get selectable columns.
static getInstanceByObjId(int $a_obj_id)
Get instance by obj type.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setEnableNumInfo(bool $a_val)
setExternalSegmentation(bool $a_val)
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setTopCommands(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setId(string $a_val)
enable(string $a_module_name)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ilParticipantTableGUI\$rep_object, ILIAS\GlobalScreen\Provider\__construct(), ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), ilTable2GUI\addColumn(), ilTable2GUI\addCommandButton(), ilTable2GUI\addMultiCommand(), ilTableGUI\enable(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilParticipants\getInstanceByObjId(), ilParticipantTableGUI\getRepositoryObject(), ilParticipantTableGUI\getSelectableColumns(), ilTable2GUI\getSelectedColumns(), ilParticipantTableGUI\initFilter(), ilParticipantTableGUI\initSettings(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), ilTable2GUI\setTopCommands(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ fillRow()

ilCourseParticipantsTableGUI::fillRow ( array  $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array<string,mixed>$a_set data array

Reimplemented from ilTable2GUI.

Definition at line 145 of file class.ilCourseParticipantsTableGUI.php.

145 : void
146 {
147 $this->tpl->setVariable('VAL_ID', $a_set['usr_id']);
148 $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']);
149 $this->tpl->setVariable('SELECT_PARTICIPANT', $this->lng->txt("select") . ' ' . $a_set['lastname'] . ', ' . $a_set['firstname']);
150
151 if (
152 !$this->access->checkAccessOfUser($a_set['usr_id'], 'read', '', $this->getRepositoryObject()->getRefId()) &&
153 is_array($info = $this->access->getInfo())
154 ) {
155 $this->tpl->setCurrentBlock('access_warning');
156 $this->tpl->setVariable('PARENT_ACCESS', $info[0]['text']);
157 $this->tpl->parseCurrentBlock();
158 }
159
160 if (!$a_set['active']) {
161 $this->tpl->setCurrentBlock('access_warning');
162 $this->tpl->setVariable('PARENT_ACCESS', $this->lng->txt('usr_account_inactive'));
163 $this->tpl->parseCurrentBlock();
164 }
165
166 foreach ($this->getSelectedColumns() as $field) {
167 switch ($field) {
168 case 'gender':
169 $a_set['gender'] = ($a_set['gender'] ?? '') ? $this->lng->txt('gender_' . $a_set['gender']) : '';
170 $this->tpl->setCurrentBlock('custom_fields');
171 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
172 $this->tpl->parseCurrentBlock();
173 break;
174
175 case 'birthday':
176 $a_set['birthday'] = ($a_set['birthday'] ?? false) ? ilDatePresentation::formatDate(new ilDate(
177 $a_set['birthday'],
179 )) : $this->lng->txt('no_date');
180 $this->tpl->setCurrentBlock('custom_fields');
181 $this->tpl->setVariable('VAL_CUST', $a_set[$field]);
182 $this->tpl->parseCurrentBlock();
183 break;
184
185 case 'consultation_hour':
186 $this->tpl->setCurrentBlock('custom_fields');
187 $dts = array();
188 foreach ((array) ($a_set['consultation_hours'] ?? []) as $ch) {
190 new ilDateTime($ch['dt'], IL_CAL_UNIX),
191 new ilDateTime($ch['dtend'], IL_CAL_UNIX)
192 );
193 if ($ch['explanation']) {
194 $tmp .= ' ' . $ch['explanation'];
195 }
196 $dts[] = $tmp;
197 }
198 $dt_string = implode('<br />', $dts);
199 $this->tpl->setVariable('VAL_CUST', $dt_string);
200 $this->tpl->parseCurrentBlock();
201 break;
202
203 case 'prtf':
204 $tmp = array();
205 if (is_array($a_set['prtf'])) {
206 foreach ($a_set['prtf'] as $prtf_url => $prtf_txt) {
207 $tmp[] = '<a href="' . $prtf_url . '">' . $prtf_txt . '</a>';
208 }
209 }
210 $this->tpl->setCurrentBlock('custom_fields');
211 $this->tpl->setVariable('VAL_CUST', implode('<br />', $tmp));
212 $this->tpl->parseCurrentBlock();
213 break;
214
215 case 'odf_last_update':
216 $this->tpl->setCurrentBlock('custom_fields');
217 $this->tpl->setVariable('VAL_CUST', (string) ($a_set['odf_info_txt'] ?? ''));
218 $this->tpl->parseCurrentBlock();
219 break;
220
221 case 'roles':
222 $this->tpl->setCurrentBlock('custom_fields');
223 $this->tpl->setVariable('VAL_CUST', (string) ($a_set['roles_label'] ?? ''));
224 $this->tpl->parseCurrentBlock();
225 break;
226
227 case 'org_units':
228 $this->tpl->setCurrentBlock('custom_fields');
229 $this->tpl->setVariable(
230 'VAL_CUST',
231 ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits((int) $a_set['usr_id'])
232 );
233 $this->tpl->parseCurrentBlock();
234 break;
235
236 default:
237 $this->tpl->setCurrentBlock('custom_fields');
238 $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : '');
239 $this->tpl->parseCurrentBlock();
240 break;
241 }
242 }
243
244 if ($this->privacy->enabledCourseAccessTimes()) {
245 $this->tpl->setVariable('VAL_ACCESS', $a_set['access_time']);
246 }
247 if ($this->show_learning_progress) {
248 $this->tpl->setCurrentBlock('lp');
250 $icon_rendered = $icons->renderIconForStatus($icons->lookupNumStatus($a_set['progress']));
251
252 $this->tpl->setVariable('LP_STATUS_ALT', $this->lng->txt($a_set['progress']));
253 $this->tpl->setVariable('LP_STATUS_ICON', $icon_rendered);
254
255 $this->tpl->parseCurrentBlock();
256 }
257
258 $this->tpl->setVariable('VAL_POSTNAME', 'participants');
259
260 if ($this->access->checkAccess("grade", "", $this->rep_object->getRefId())) {
261 $this->tpl->setCurrentBlock('grade');
262 $this->tpl->setVariable('VAL_PASSED_ID', $a_set['usr_id']);
263 $this->tpl->setVariable('VAL_PASSED_CHECKED', ($a_set['passed'] ? 'checked="checked"' : ''));
264 $this->tpl->setVariable('PASSED_TITLE', $this->lng->txt('crs_member_passed'));
265 $this->tpl->parseCurrentBlock();
266 } else {
267 $this->tpl->setVariable('VAL_PASSED_TXT', ($a_set['passed']
268 ? $this->lng->txt("yes")
269 : $this->lng->txt("no")));
270 }
271
272 if (
273 $this->getParticipants()->isAdmin($a_set['usr_id']) ||
274 $this->getParticipants()->isTutor($a_set['usr_id'])
275 ) {
276 // cognos-blu-patch: begin
277 $this->tpl->setCurrentBlock('with_contact');
278 $this->tpl->setVariable('VAL_CONTACT_ID', $a_set['usr_id']);
279 $this->tpl->setVariable('VAL_CONTACT_CHECKED', $a_set['contact'] ? 'checked="checked"' : '');
280 $this->tpl->setVariable('CONTACT_TITLE', $this->lng->txt('crs_mem_contact'));
281 $this->tpl->parseCurrentBlock();
282 // cognos-blu-patch: end
283
284 $this->tpl->setCurrentBlock('with_notification');
285 $this->tpl->setVariable('VAL_NOTIFICATION_ID', $a_set['usr_id']);
286 $this->tpl->setVariable('VAL_NOTIFICATION_CHECKED', ($a_set['notification'] ? 'checked="checked"' : ''));
287 $this->tpl->setVariable('NOTIFICATION_TITLE', $this->lng->txt('crs_notification_list_title'));
288 $this->tpl->parseCurrentBlock();
289 }
290
291 // blocked only for real members
292 if (
293 !$this->getParticipants()->isAdmin($a_set['usr_id']) &&
294 !$this->getParticipants()->isTutor($a_set['usr_id'])
295 ) {
296 $this->tpl->setCurrentBlock('with_blocked');
297 $this->tpl->setVariable('VAL_BLOCKED_ID', $a_set['usr_id']);
298 $this->tpl->setVariable('VAL_BLOCKED_CHECKED', ($a_set['blocked'] ? 'checked="checked"' : ''));
299 $this->tpl->setVariable('BLOCKED_TITLE', $this->lng->txt('crs_blocked'));
300 $this->tpl->parseCurrentBlock();
301 }
302
303 if ($this->show_lp_status_sync) {
304 $this->tpl->setVariable('PASSED_INFO', $a_set["passed_info"]);
305 }
306
307 $this->showActionLinks($a_set);
308
309 $isPreloaded = $this->preLoader->isPreloaded($this->getRepositoryObject()->getId(), $a_set['usr_id']);
310 if ($isPreloaded) {
311 $this->tpl->setCurrentBlock('link');
312 $this->tpl->setVariable('LINK_NAME', $this->ctrl->getLinkTarget($this->parent_obj, 'deliverCertificate'));
313 $this->tpl->setVariable('LINK_TXT', $this->lng->txt('download_certificate'));
314 $this->tpl->parseCurrentBlock();
315 }
316 $this->ctrl->clearParameters($this->parent_obj);
317
318 if ($this->show_timings) {
319 $this->ctrl->setParameterByClass('ilcoursecontentgui', 'member_id', $a_set['usr_id']);
320 $this->tpl->setCurrentBlock('link');
321 $this->tpl->setVariable(
322 'LINK_NAME',
323 $this->ctrl->getLinkTargetByClass('ilcoursecontentgui', 'showUserTimings')
324 );
325 $this->tpl->setVariable('LINK_TXT', $this->lng->txt('timings_timings'));
326 $this->tpl->parseCurrentBlock();
327 }
328 }
const IL_CAL_DATE
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
@classDescription Date and time handling
Class for single dates.
static getInstance(int $variant=ilLPStatusIcons::ICON_VARIANT_DEFAULT, ?\ILIAS\UI\Renderer $renderer=null, ?\ILIAS\UI\Factory $factory=null)
$info
Definition: entry_point.php:21

References $info, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilDatePresentation\formatDate(), ilDatePresentation\formatPeriod(), ilTable2GUI\getId(), ilLPStatusIcons\getInstance(), ilParticipantTableGUI\getParticipants(), ilParticipantTableGUI\getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilLPStatusIcons\ICON_VARIANT_LONG, IL_CAL_DATE, IL_CAL_UNIX, ILIAS\Repository\lng(), and ilParticipantTableGUI\showActionLinks().

+ Here is the call graph for this function:

◆ lookupUserName()

ilCourseParticipantsTableGUI::lookupUserName ( int  $user_id)
protected
Returns
array{user_id: int, firstname: string, lastname: string, login: string, title: string}

Definition at line 550 of file class.ilCourseParticipantsTableGUI.php.

550 : array
551 {
552 if (isset($this->cached_user_names[$user_id])) {
553 return $this->cached_user_names[$user_id];
554 }
555 return $this->cached_user_names[$user_id] = ilObjUser::_lookupName($user_id);
556 }
static _lookupName(int $a_user_id)

References $user_id, and ilObjUser\_lookupName().

Referenced by parse().

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

◆ parse()

ilCourseParticipantsTableGUI::parse ( )

Definition at line 330 of file class.ilCourseParticipantsTableGUI.php.

330 : void
331 {
332 $this->determineOffsetAndOrder(true);
333
334 $additional_fields = $this->getSelectedColumns();
335 unset($additional_fields["firstname"]);
336 unset($additional_fields["lastname"]);
337 unset($additional_fields["last_login"]);
338 unset($additional_fields["access_until"]);
339 unset($additional_fields['consultation_hour']);
340 unset($additional_fields['prtf']);
341 unset($additional_fields['roles']);
342 unset($additional_fields['org_units']);
343
344 $part = $this->participants->getParticipants();
345
346 $part = $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
347 'manage_members',
348 'manage_members',
349 $this->getRepositoryObject()->getRefId(),
350 $part
351 );
352
353 if ($part === []) {
354 $this->setData(array());
355 return;
356 }
357
358 $udf_ids = $usr_data_fields = $odf_ids = array();
359 foreach ($additional_fields as $field) {
360 if (substr($field, 0, 3) == 'udf') {
361 $udf_ids[] = substr($field, 4);
362 continue;
363 }
364 if (substr($field, 0, 3) == 'odf') {
365 $odf_ids[] = substr($field, 4);
366 continue;
367 }
368
369 $usr_data_fields[] = $field;
370 }
371
373 '',
374 '',
375 0,
376 9999,
377 $this->current_filter['login'],
378 '',
379 null,
380 false,
381 false,
382 0,
383 0,
384 null,
385 $usr_data_fields,
386 $part
387 );
388 // filter by array
389 $usr_ids = array();
390 $local_roles = $this->getParentObject()->getLocalRoles();
391 foreach ((array) $usr_data['set'] as $user) {
392 if ($this->current_filter['roles'] ?? false) {
393 if (!$this->rbacReview->isAssigned($user['usr_id'], $this->current_filter['roles'])) {
394 continue;
395 }
396 }
397 if ($this->current_filter['org_units'] ?? false) {
398 $org_unit = $this->current_filter['org_units'];
399
400 $assigned = ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($user['usr_id']);
401 if (!in_array($org_unit, $assigned)) {
402 continue;
403 }
404 }
405
406 $usr_ids[] = $user['usr_id'];
407 }
408
409 // merge course data
410 $course_user_data = $this->getParentObject()->readMemberData(
411 $usr_ids,
412 $this->getSelectedColumns(),
413 true
414 );
415 $a_user_data = array();
416 foreach ((array) $usr_data['set'] as $ud) {
417 $user_id = (int) $ud['usr_id'];
418
419 if (!in_array($user_id, $usr_ids)) {
420 continue;
421 }
422 // #15434
423 if (!$this->checkAcceptance($user_id)) {
424 $ud = [
425 'active' => $ud['active'],
426 'firstname' => $ud['firstname'],
427 'lastname' => $ud['lastname'],
428 'login' => $ud['login']
429 ];
430 }
431
432 $a_user_data[$user_id] = array_merge($ud, $course_user_data[$user_id]);
433
434 $roles = array();
435 foreach ($local_roles as $role_id => $role_name) {
436 // @todo fix performance
437 if ($this->rbacReview->isAssigned($user_id, $role_id)) {
438 $roles[] = $role_name;
439 }
440 }
441
442 $a_user_data[$user_id]['name'] = ($a_user_data[$user_id]['lastname'] . ', ' . $a_user_data[$user_id]['firstname']);
443 $a_user_data[$user_id]['roles_label'] = implode('<br />', $roles);
444 $a_user_data[$user_id]['roles'] = $this->participants->setRoleOrderPosition($user_id);
445
446 if ($this->show_lp_status_sync) {
447 // #9912 / #13208
448 $passed_info = "";
449 $passed_timestamp = '';
450 if ($a_user_data[$user_id]["passed_info"]) {
451 $pinfo = $a_user_data[$user_id]["passed_info"];
452 if ($pinfo["user_id"]) {
453 if ($pinfo["user_id"] < 0) {
454 $passed_info = $this->lng->txt("crs_passed_status_system");
455 } elseif ($pinfo["user_id"] > 0) {
456 $name = $this->lookupUserName((int) $pinfo["user_id"]);
457 $passed_info = $this->lng->txt("crs_passed_status_manual_by") . ": " . $name["login"];
458 }
459 }
460 if ($pinfo["timestamp"]) {
461 $passed_info .= "<br />" . ilDatePresentation::formatDate($pinfo["timestamp"]);
462 $passed_timestamp = $pinfo["timestamp"];
463 }
464 }
465 $a_user_data[$user_id]["passed_info"] = $passed_info;
466 $a_user_data[$user_id]["passed_timestamp"] = $passed_timestamp;
467 }
468 }
469
470 // Custom user data fields
471 if ($udf_ids !== []) {
472 $a_user_data = array_reduce(
473 $this->profile->getDataForMultiple($usr_ids),
474 function (array $c, ProfileData $v): array {
475 if (!$this->checkAcceptance($v->getId())) {
476 return $c;
477 }
478
479 foreach ($udf_ids as $field_id) {
480 $c[$v->getId()]['udf_' . $field_id] = $v->getAdditionalFieldByIdentifier($field_id);
481 }
482 },
483 $a_user_data
484 );
485 }
486 // Object specific user data fields
487 if ($odf_ids !== []) {
489 foreach ($data as $usr_id => $fields) {
490 $usr_id = (int) $usr_id;
491 // #7264: as we get data for all course members filter against user data
492 if (!$this->checkAcceptance($usr_id) || !in_array($usr_id, $usr_ids)) {
493 continue;
494 }
495
496 foreach ($fields as $field_id => $value) {
497 $a_user_data[$usr_id]['odf_' . $field_id] = $value;
498 }
499 }
500
501 // add last edit date
502 foreach (ilObjectCustomUserFieldHistory::lookupEntriesByObjectId($this->getRepositoryObject()->getId()) as $usr_id => $edit_info) {
503 if (!isset($a_user_data[$usr_id])) {
504 continue;
505 }
506
507 if ($usr_id == $edit_info['update_user']) {
508 $a_user_data[$usr_id]['odf_last_update'] = '';
509 $a_user_data[$usr_id]['odf_info_txt'] = $this->lng->txt('cdf_edited_by_self');
510 if (ilPrivacySettings::getInstance()->enabledAccessTimesByType($this->getRepositoryObject()->getType())) {
511 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
512 $a_user_data[$usr_id]['odf_info_txt'] .= (', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
513 }
514 } else {
515 $a_user_data[$usr_id]['odf_last_update'] = $edit_info['update_user'];
516 $a_user_data[$usr_id]['odf_last_update'] .= ('_' . $edit_info['editing_time']->get(IL_CAL_UNIX));
517
518 $name = $this->lookupUserName((int) $edit_info['update_user']);
519 $a_user_data[$usr_id]['odf_info_txt'] = ($name['firstname'] . ' ' . $name['lastname'] . ', ' . ilDatePresentation::formatDate($edit_info['editing_time']));
520 }
521 }
522 }
523
524 // consultation hours
525 if ($this->isColumnSelected('consultation_hour')) {
527 $this->getRepositoryObject()->getId(),
528 $this->user->getId()
529 ) as $buser => $booking) {
530 if (isset($a_user_data[$buser])) {
531 $a_user_data[$buser]['consultation_hour'] = $booking[0]['dt'];
532 $a_user_data[$buser]['consultation_hour_end'] = $booking[0]['dtend'];
533 $a_user_data[$buser]['consultation_hours'] = $booking;
534 }
535 }
536 }
537
538 // always sort by name first
539 $a_user_data = ilArrayUtil::sortArray(
540 $a_user_data,
541 'name',
542 $this->getOrderDirection()
543 );
544 $this->setData($a_user_data);
545 }
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static lookupManagedBookingsForObject(int $a_obj_id, int $a_usr_id)
Lookup bookings for own and managed consultation hours of an object.
static _getValuesByObjId(int $a_obj_id)
isColumnSelected(string $col)
determineOffsetAndOrder(bool $a_omit_offset=false)
setData(array $a_data)
Set table data.
static getUserListData(string $a_order_field, string $a_order_dir, int $a_offset, int $a_limit, string $a_string_filter="", string $a_activation_filter="", ?ilDateTime $a_last_login_filter=null, bool $a_limited_access_filter=false, bool $a_no_courses_filter=false, int $a_course_group_filter=0, int $a_role_filter=0, ?array $a_user_folder_filter=null, ?array $a_additional_fields=null, ?array $a_user_filter=null, string $a_first_letter="", string $a_authentication_filter="")
Get data for user administration list.
$c
Definition: deliver.php:25

References $c, ilTableGUI\$data, $user, $user_id, ilObjOrgUnitTree\_getInstance(), ilCourseUserData\_getValuesByObjId(), ILIAS\Repository\access(), ilParticipantTableGUI\checkAcceptance(), ilTable2GUI\determineOffsetAndOrder(), ilDatePresentation\formatDate(), ilTable2GUI\getId(), ilPrivacySettings\getInstance(), ilTableGUI\getOrderDirection(), ilTable2GUI\getParentObject(), ilParticipantTableGUI\getRepositoryObject(), ilTable2GUI\getSelectedColumns(), ilUserQuery\getUserListData(), IL_CAL_UNIX, ILIAS\Repository\int(), ilTable2GUI\isColumnSelected(), ILIAS\Repository\lng(), ilObjectCustomUserFieldHistory\lookupEntriesByObjectId(), ilBookingEntry\lookupManagedBookingsForObject(), lookupUserName(), ILIAS\Repository\profile(), ilTable2GUI\setData(), ilArrayUtil\sortArray(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilCourseParticipantsTableGUI::$access
protected

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

◆ $cached_user_names

array ilCourseParticipantsTableGUI::$cached_user_names = []
protected

Definition at line 41 of file class.ilCourseParticipantsTableGUI.php.

◆ $preLoader

ilCertificateUserForObjectPreloader ilCourseParticipantsTableGUI::$preLoader = null
private

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

◆ $privacy

ilPrivacySettings ilCourseParticipantsTableGUI::$privacy
private

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

◆ $profile

Profile ilCourseParticipantsTableGUI::$profile
protected

Definition at line 40 of file class.ilCourseParticipantsTableGUI.php.

◆ $rbacReview

ilRbacReview ilCourseParticipantsTableGUI::$rbacReview
protected

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

◆ $show_learning_progress

bool ilCourseParticipantsTableGUI::$show_learning_progress = false
protected

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

◆ $show_lp_status_sync

bool ilCourseParticipantsTableGUI::$show_lp_status_sync = false
protected

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

◆ $show_timings

bool ilCourseParticipantsTableGUI::$show_timings = false
protected

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

◆ $user

ilObjUser ilCourseParticipantsTableGUI::$user
protected

Definition at line 39 of file class.ilCourseParticipantsTableGUI.php.

Referenced by parse().


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