ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSurveyAppraiseesTableGUI.php
Go to the documentation of this file.
1<?php
2
23{
24 protected \ILIAS\Survey\Editing\EditingGUIRequest $edit_request;
25 protected bool $raters_mode;
26 protected string $fallback_url;
27
28 public function __construct(
29 object $a_parent_obj,
30 string $a_parent_cmd,
31 bool $a_raters_mode = false,
32 bool $a_may_delete_rater = false,
33 ?string $a_fallback_url = null
34 ) {
35 global $DIC;
36
37 parent::__construct($a_parent_obj, $a_parent_cmd);
38
39 $lng = $DIC->language();
40 $ilCtrl = $DIC->ctrl();
41
42 $this->raters_mode = $a_raters_mode;
43 $this->fallback_url = trim($a_fallback_url ?? "");
44
45 $this->lng = $lng;
46 $this->ctrl = $ilCtrl;
47
48 $this->setFormName('apprform');
49
50 $this->addColumn('', '', '1%');
51 $this->addColumn($this->lng->txt("name"), 'name', '');
52 $this->addColumn($this->lng->txt("login"), 'login', '');
53 $this->addColumn($this->lng->txt("email"), 'email', '');
54
55 $this->edit_request = $DIC->survey()
56 ->internal()
57 ->gui()
58 ->editing()
59 ->request();
60
61 if (!$this->raters_mode) {
62 $this->addColumn($this->lng->txt("survey_360_raters_finished"), "finished");
63 $this->addColumn($this->lng->txt("survey_360_appraisee_close_table"), "closed");
64 $this->addColumn($this->lng->txt("actions"));
65
66 $this->setTitle($this->lng->txt("survey_360_appraisees"));
67 } else {
68 $this->addColumn($this->lng->txt("survey_360_rater_finished"), "finished");
69 $this->addColumn($this->lng->txt("survey_code_url"));
70 $this->addColumn($this->lng->txt("survey_360_rater_mail_sent"), "sent");
71
72 $this->setTitle(
73 $this->lng->txt("survey_360_edit_raters") . " : " .
74 ilUserUtil::getNamePresentation($this->edit_request->getAppraiseeId())
75 );
76 }
77
78 $this->setRowTemplate("tpl.il_svy_svy_appraisees_row.html", "components/ILIAS/Survey");
79
80 $this->setFormAction($this->ctrl->getFormAction($a_parent_obj, $a_parent_cmd));
81
82 $this->setDefaultOrderField("last_name");
83 $this->setDefaultOrderDirection("asc");
84
85 if (!$this->raters_mode) {
86 $this->addMultiCommand('confirmAdminAppraiseesClose', $this->lng->txt('survey_360_appraisee_close_action'));
87 $this->addMultiCommand('confirmDeleteAppraisees', $this->lng->txt('survey_360_remove_appraisees'));
88 $this->setPrefix('appr_id');
89 $this->setSelectAllCheckbox('appr_id');
90 } else {
91 $this->addMultiCommand('mailRaters', $this->lng->txt('mail'));
92 if ($a_may_delete_rater) {
93 $this->addMultiCommand('confirmDeleteRaters', $this->lng->txt('remove'));
94 }
95 $this->setPrefix('rtr_id');
96 $this->setSelectAllCheckbox('rtr_id');
97 }
98 }
99
100 protected function fillRow(array $a_set): void
101 {
103
104 if (!$this->raters_mode) {
105 if ($a_set['closed']) {
106 $this->tpl->setVariable("CLOSED", ilDatePresentation::formatDate(new ilDateTime($a_set['closed'], IL_CAL_UNIX)));
107 } else {
108 $this->tpl->setCurrentBlock("cb");
109 $this->tpl->setVariable('MODE', "appr");
110 $this->tpl->setVariable('ID', $a_set['user_id']);
111 $this->tpl->parseCurrentBlock();
112 $this->tpl->setVariable("CLOSED", "");
113 }
114
115 $this->tpl->setVariable("FINISHED", $a_set['finished']);
116
117 $this->ctrl->setParameter($this->getParentObject(), "appr_id", $a_set["user_id"]);
118 $this->tpl->setVariable("URL", $lng->txt("survey_360_edit_raters"));
119 $this->tpl->setVariable("HREF", $this->ctrl->getLinkTarget($this->getParentObject(), "editRaters"));
120 $this->ctrl->setParameter($this->getParentObject(), "appr_id", "");
121 } else {
122 $this->tpl->setVariable('MODE', "rtr");
123 $this->tpl->setVariable('ID', $a_set['user_id']);
124 $this->tpl->setVariable("FINISHED", $a_set['finished'] ? $lng->txt("yes") : $lng->txt("no"));
125
126 $sent = "";
127 if ($a_set["sent"]) {
128 $sent = ilDatePresentation::formatDate(new ilDateTime($a_set["sent"], IL_CAL_UNIX));
129 }
130 $this->tpl->setVariable("MAIL_SENT", $sent);
131
132 if (($a_set["href"] ?? false) || $this->fallback_url) {
133 if ($a_set["href"] ?? false) {
134 $this->tpl->setVariable("DIRECT_HREF", $a_set["href"]);
135 } else {
136 $this->tpl->setVariable("DIRECT_HREF", $this->fallback_url);
137 }
138 } else {
139 $this->tpl->setVariable("NO_HREF", "");
140 }
141 }
142
143 $this->tpl->setVariable("LOGIN", $a_set['login']);
144 $this->tpl->setVariable("EMAIL", $a_set['email']);
145 $this->tpl->setVariable("NAME", $a_set['name']);
146 }
147}
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, bool $a_raters_mode=false, bool $a_may_delete_rater=false, ?string $a_fallback_url=null)
ILIAS Survey Editing EditingGUIRequest $edit_request
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...
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
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
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26