ILIAS  release_8 Revision v8.24
class.ilSurveyCodesTableGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 public function __construct(
25 object $a_parent_obj,
26 string $a_parent_cmd
27 ) {
28 global $DIC;
29
30 parent::__construct($a_parent_obj, $a_parent_cmd);
31
32 $lng = $DIC->language();
33 $ilCtrl = $DIC->ctrl();
34
35 $this->lng = $lng;
36 $this->ctrl = $ilCtrl;
37
38 $this->setFormName('codesform');
39
40 $this->addColumn('', '', '1%');
41 $this->addColumn($this->lng->txt("survey_code"), 'code', '');
42 $this->addColumn($this->lng->txt("email"), 'email', '');
43 $this->addColumn($this->lng->txt("lastname"), 'last_name', '');
44 $this->addColumn($this->lng->txt("firstname"), 'first_name', '');
45 $this->addColumn($this->lng->txt("create_date"), 'date', '');
46 $this->addColumn($this->lng->txt("survey_code_used"), 'used', '');
47 $this->addColumn($this->lng->txt("mail_sent_short"), 'sent', '');
48 $this->addColumn($this->lng->txt("survey_code_url"));
49
50 $this->setRowTemplate("tpl.il_svy_svy_codes_row.html", "Modules/Survey");
51
52 $this->addMultiCommand('editCodes', $this->lng->txt('edit'));
53 $this->addMultiCommand('exportCodes', $this->lng->txt('export'));
54 $this->addMultiCommand('deleteCodesConfirm', $this->lng->txt('delete'));
55
56 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
57
59 $button->setCaption("export_all_survey_codes");
60 $button->setCommand("exportAllCodes");
61 $button->setOmitPreventDoubleSubmission(true);
62 $this->addCommandButtonInstance($button);
63
64 $this->setDefaultOrderField("code");
65 $this->setDefaultOrderDirection("asc");
66
67 $this->setPrefix('chb_code');
68 $this->setSelectAllCheckbox('chb_code');
69 }
70
71 protected function fillRow(array $a_set): void
72 {
74
75 $this->tpl->setVariable('CB_CODE', $a_set['id']);
76
77 // :TODO: see permalink gui
78 if (($a_set['href'] ?? '') !== '') {
79 $this->tpl->setCurrentBlock('url');
80 $this->tpl->setVariable("URL", $lng->txt("survey_code_url_name"));
81 $this->tpl->setVariable("HREF", $a_set['href']);
82 $this->tpl->parseCurrentBlock();
83 }
84
85 $this->tpl->setVariable("USED", ($a_set['used']) ? $lng->txt("used") : $lng->txt("not_used"));
86 $this->tpl->setVariable("SENT", ($a_set['sent']) ? '&#10003;' : '');
87 $this->tpl->setVariable("USED_CLASS", ($a_set['used']) ? ' smallgreen' : ' smallred');
88 $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)));
89 $this->tpl->setVariable("CODE", $a_set['code']);
90 $this->tpl->setVariable("EMAIL", $a_set['email']);
91 $this->tpl->setVariable("LAST_NAME", $a_set['last_name']);
92 $this->tpl->setVariable("FIRST_NAME", $a_set['first_name']);
93 }
94}
const IL_CAL_UNIX
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
@classDescription Date and time handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(object $a_parent_obj, string $a_parent_cmd)
fillRow(array $a_set)
Standard Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormName(string $a_name="")
addMultiCommand(string $a_cmd, string $a_text)
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...
setFormAction(string $a_form_action, bool $a_multipart=false)
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)
addCommandButtonInstance(ilButtonBase $a_button)
setDefaultOrderField(string $a_defaultorderfield)
setSelectAllCheckbox(string $a_select_all_checkbox, bool $a_select_all_on_top=false)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
ilLanguage $lng
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc