ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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", "components/ILIAS/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
58 $this->addCommandButton(
59 "exportAllCodes",
60 $this->lng->txt("export_all_survey_codes")
61 );
62
63 $this->setDefaultOrderField("code");
64 $this->setDefaultOrderDirection("asc");
65
66 $this->setPrefix('chb_code');
67 $this->setSelectAllCheckbox('chb_code');
68 }
69
70 protected function fillRow(array $a_set): void
71 {
73
74 $this->tpl->setVariable('CB_CODE', $a_set['id']);
75
76 // :TODO: see permalink gui
77 if (($a_set['href'] ?? '') !== '') {
78 $this->tpl->setCurrentBlock('url');
79 $this->tpl->setVariable("URL", $lng->txt("survey_code_url_name"));
80 $this->tpl->setVariable("HREF", $a_set['href']);
81 $this->tpl->parseCurrentBlock();
82 }
83
84 $this->tpl->setVariable("USED", ($a_set['used']) ? $lng->txt("used") : $lng->txt("not_used"));
85 $this->tpl->setVariable("SENT", ($a_set['sent']) ? '&#10003;' : '');
86 $this->tpl->setVariable("USED_CLASS", ($a_set['used']) ? ' smallgreen' : ' smallred');
87 $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($a_set['date'], IL_CAL_UNIX)));
88 $this->tpl->setVariable("CODE", $a_set['code']);
89 $this->tpl->setVariable("EMAIL", $a_set['email']);
90 $this->tpl->setVariable("LAST_NAME", $a_set['last_name']);
91 $this->tpl->setVariable("FIRST_NAME", $a_set['first_name']);
92 }
93}
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,)
@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...
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
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)
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
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26