ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSurveyCodesTableGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
10{
18 public function __construct($a_parent_obj, $a_parent_cmd)
19 {
20 global $DIC;
21
22 parent::__construct($a_parent_obj, $a_parent_cmd);
23
24 $lng = $DIC->language();
25 $ilCtrl = $DIC->ctrl();
26
27 $this->lng = $lng;
28 $this->ctrl = $ilCtrl;
29
30 $this->setFormName('codesform');
31
32 $this->addColumn('', '', '1%');
33 $this->addColumn($this->lng->txt("survey_code"), 'code', '');
34 $this->addColumn($this->lng->txt("email"), 'email', '');
35 $this->addColumn($this->lng->txt("lastname"), 'last_name', '');
36 $this->addColumn($this->lng->txt("firstname"), 'first_name', '');
37 $this->addColumn($this->lng->txt("create_date"), 'date', '');
38 $this->addColumn($this->lng->txt("survey_code_used"), 'used', '');
39 $this->addColumn($this->lng->txt("mail_sent_short"), 'sent', '');
40 $this->addColumn($this->lng->txt("survey_code_url"));
41
42 $this->setRowTemplate("tpl.il_svy_svy_codes_row.html", "Modules/Survey");
43
44 $this->addMultiCommand('editCodes', $this->lng->txt('edit'));
45 $this->addMultiCommand('exportCodes', $this->lng->txt('export'));
46 $this->addMultiCommand('deleteCodesConfirm', $this->lng->txt('delete'));
47
48 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
49
51 $button->setCaption("export_all_survey_codes");
52 $button->setCommand("exportAllCodes");
53 $button->setOmitPreventDoubleSubmission(true);
54 $this->addCommandButtonInstance($button);
55
56 $this->setDefaultOrderField("code");
57 $this->setDefaultOrderDirection("asc");
58
59 $this->setPrefix('chb_code');
60 $this->setSelectAllCheckbox('chb_code');
61 }
62
70 public function fillRow($data)
71 {
73
74 $this->tpl->setVariable('CB_CODE', $data['id']);
75
76 // :TODO: see permalink gui
77 if (strlen($data['href'])) {
78 $this->tpl->setCurrentBlock('url');
79 $this->tpl->setVariable("URL", $lng->txt("survey_code_url_name"));
80 $this->tpl->setVariable("HREF", $data['href']);
81 $this->tpl->parseCurrentBlock();
82 }
83
84 $this->tpl->setVariable("USED", ($data['used']) ? $lng->txt("used") : $lng->txt("not_used"));
85 $this->tpl->setVariable("SENT", ($data['sent']) ? '&#10003;' : '');
86 $this->tpl->setVariable("USED_CLASS", ($data['used']) ? ' smallgreen' : ' smallred');
87 $this->tpl->setVariable("DATE", ilDatePresentation::formatDate(new ilDateTime($data['date'], IL_CAL_UNIX)));
88 $this->tpl->setVariable("CODE", $data['code']);
89 $this->tpl->setVariable("EMAIL", $data['email']);
90 $this->tpl->setVariable("LAST_NAME", $data['last_name']);
91 $this->tpl->setVariable("FIRST_NAME", $data['first_name']);
92 }
93}
An exception for terminatinating execution or to throw for unit testing.
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling
static getInstance()
Factory.
__construct($a_parent_obj, $a_parent_cmd)
Constructor.
Class ilTable2GUI.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
addCommandButtonInstance(ilButtonBase $a_button)
Add Command button instance.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addMultiCommand($a_cmd, $a_text)
Add Command button.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46