42 $this->ui_fac = $DIC->ui()->factory();
43 $this->ui_ren = $DIC->ui()->renderer();
47 $this->
setId(
'myst_lcrt');
51 $this->
setRowTemplate(
'tpl.list_courses_row.html',
"components/ILIAS/MyStaff");
52 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
83 'filters' => $this->
filter,
96 $data = $certificates_fetcher->getData($options);
104 $options[
'limit'] = array(
108 $max_data = $certificates_fetcher->getData($options);
116 $item = new \ilTextInputGUI($DIC->language()->txt(
"title"),
"obj_title");
118 $item->readFromSession();
119 $this->
filter[
'obj_title'] = $item->getValue();
122 $item = new \ilTextInputGUI(
123 $DIC->language()->txt(
"login")
124 .
"/" . $DIC->language()->txt(
"email")
125 .
"/" . $DIC->language()->txt(
"name"),
130 $item->readFromSession();
131 $this->
filter[
'user'] = $item->getValue();
135 $options[0] = $DIC->language()->txt(
'mst_opt_all');
136 foreach ($paths as $org_ref_id =>
$path) {
137 $options[$org_ref_id] =
$path;
139 $item = new \ilSelectInputGUI($DIC->language()->txt(
'obj_orgu'),
'org_unit');
140 $item->setOptions($options);
142 $item->readFromSession();
143 $this->
filter[
'org_unit'] = $item->getValue();
149 if ($this->selectable_columns_cached) {
164 $cols[
'objectTitle'] = array(
165 'txt' => $DIC->language()->txt(
'title'),
168 'sort_field' =>
'objectTitle',
170 $cols[
'issuedOnTimestamp'] = array(
171 'txt' => $DIC->language()->txt(
'mst_cert_issued_on'),
174 'sort_field' =>
'issuedOnTimestamp',
176 if ($arr_searchable_user_columns[
'login'] ??
false) {
177 $cols[
'userLogin'] = array(
178 'txt' => $DIC->language()->txt(
'login'),
181 'sort_field' =>
'userLogin',
184 if ($arr_searchable_user_columns[
'firstname'] ??
false) {
185 $cols[
'userFirstName'] = array(
186 'txt' => $DIC->language()->txt(
'firstname'),
189 'sort_field' =>
'userFirstName',
192 if ($arr_searchable_user_columns[
'lastname'] ??
false) {
193 $cols[
'userLastName'] = array(
194 'txt' => $DIC->language()->txt(
'lastname'),
197 'sort_field' =>
'userLastName',
201 if ($arr_searchable_user_columns[
'email'] ??
false) {
202 $cols[
'userEmail'] = array(
203 'txt' => $DIC->language()->txt(
'email'),
206 'sort_field' =>
'userEmail',
209 if ($arr_searchable_user_columns[
'org_units'] ??
false) {
210 $cols[
'usr_assinged_orgus'] = array(
211 'txt' => $DIC->language()->txt(
'objs_orgu'),
226 $sort = $v[
'sort_field'] ??
"";
233 $this->
addColumn($DIC->language()->txt(
'actions'));
239 if (isset($this->usr_orgu_names[$user_id])) {
240 return $this->usr_orgu_names[
$user_id];
243 return $this->usr_orgu_names[
$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
253 final protected function fillRow(array $a_set): void
257 $set = array_pop($a_set);
259 $propGetter = \Closure::bind(
function ($prop) {
260 return $this->$prop ?? null;
265 case 'usr_assinged_orgus':
266 $this->tpl->setCurrentBlock(
'td');
267 $this->tpl->setVariable(
271 $this->tpl->parseCurrentBlock();
273 case 'issuedOnTimestamp':
274 $date_time = new \ilDateTime($propGetter($k),
IL_CAL_UNIX);
275 $this->tpl->setCurrentBlock(
'td');
276 $this->tpl->setVariable(
'VALUE', $date_time->get(
IL_CAL_DATE));
277 $this->tpl->parseCurrentBlock();
280 if ($propGetter($k) !== null) {
281 $this->tpl->setCurrentBlock(
'td');
282 $this->tpl->setVariable(
284 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
286 $this->tpl->parseCurrentBlock();
288 $this->tpl->setCurrentBlock(
'td');
289 $this->tpl->setVariable(
'VALUE',
' ');
290 $this->tpl->parseCurrentBlock();
296 $button = $this->ui_fac->button()->shy($this->
lng->txt(
"mst_download_certificate"), $set->getDownloadLink());
297 $dropdown = $this->ui_fac->dropdown()->standard([$button])->withLabel($this->
lng->txt(
"actions"));
298 $this->tpl->setVariable(
'ACTIONS', $this->ui_ren->render($dropdown));
299 $this->tpl->parseCurrentBlock();
304 $set = array_pop($a_set);
308 $a_excel->
setCell($a_row, $col, $v);
315 $set = array_pop($a_set);
325 $propGetter = \Closure::bind(
function ($prop) {
326 return $this->$prop ?? null;
327 }, $user_certificate_dto, $user_certificate_dto);
329 $field_values = array();
332 case 'usr_assinged_orgus':
335 case 'issuedOnTimestamp':
336 $field_values[$k] = new \ilDateTime($propGetter($k),
IL_CAL_UNIX);
339 $field_values[$k] = strip_tags($propGetter($k) ??
"");
344 return $field_values;
setExportFormats(array $formats)
Set available export formats.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilMStListCertificatesGUI $parent_obj, $parent_cmd=\ilMStListCertificatesGUI::CMD_INDEX)
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
Class ilMStListCertificates.
setEnableTitle(bool $a_enabletitle)
getTextRepresentationOfUsersOrgUnits(int $user_id)
setDisableFilterHiding(bool $a_val=true)
setFormName(string $a_name="")
getFieldValuesForExport(UserCertificateDto $user_certificate_dto)
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
Class ilMStListCertificatesTableGUI.
setExternalSorting(bool $a_val)
isColumnSelected(string $col)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
fillRowCSV(\ilCSVWriter $a_csv, array $a_set)
setDefaultOrderField(string $a_defaultorderfield)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
array $selectable_columns_cached
fillRowExcel(\ilExcel $a_excel, int &$a_row, array $a_set)
setDefaultOrderDirection(string $a_defaultorderdirection)
ILIAS UI Renderer $ui_ren
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
static _isEnabled($a_key)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setFilterCols(int $a_val)
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)