ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.UIModifier.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
22 
25 
31 {
32  public function getSurveySettingsGeneral(
33  \ilObjSurvey $survey
34  ): array {
35  $items = [];
36  $lng = $this->service->gui()->lng();
37 
38  $self_eval = new \ilCheckboxInputGUI($lng->txt("survey_360_self_evaluation"), "self_eval");
39  $self_eval->setInfo($lng->txt("survey_360_self_evaluation_info"));
40  $self_eval->setChecked($survey->get360SelfEvaluation());
41  $items[] = $self_eval;
42 
43  return $items;
44  }
45 
47  \ilObjSurvey $survey,
48  InternalGUIService $ui_service
49  ): array {
50  $items = [];
51  $lng = $ui_service->lng();
52 
53  // remind appraisees
54  $cb = new \ilCheckboxInputGUI($lng->txt("survey_notification_target_group"), "remind_appraisees");
55  $cb->setOptionTitle($lng->txt("survey_360_appraisees"));
56  $cb->setInfo($lng->txt("survey_360_appraisees_remind_info"));
57  $cb->setValue("1");
58  $cb->setChecked(in_array(
59  $survey->getReminderTarget(),
61  true
62  ));
63  $items[] = $cb;
64 
65  // remind raters
66  $cb = new \ilCheckboxInputGUI("", "remind_raters");
67  $cb->setOptionTitle($lng->txt("survey_360_raters"));
68  $cb->setInfo($lng->txt("survey_360_raters_remind_info"));
69  $cb->setValue("1");
70  $cb->setChecked(in_array(
71  $survey->getReminderTarget(),
73  true
74  ));
75  $items[] = $cb;
76 
77  return $items;
78  }
79 
80  public function getSurveySettingsResults(
81  \ilObjSurvey $survey,
82  InternalGUIService $ui_service
83  ): array {
84  $items = [];
85  $lng = $ui_service->lng();
86 
87  $ts_results = new \ilRadioGroupInputGUI($lng->txt("survey_360_results"), "ts_res");
88  $ts_results->setValue((string) $survey->get360Results());
89 
90  $option = new \ilRadioOption($lng->txt("survey_360_results_none"), (string) \ilObjSurvey::RESULTS_360_NONE);
91  $option->setInfo($lng->txt("survey_360_results_none_info"));
92  $ts_results->addOption($option);
93 
94  $option = new \ilRadioOption($lng->txt("survey_360_results_own"), (string) \ilObjSurvey::RESULTS_360_OWN);
95  $option->setInfo($lng->txt("survey_360_results_own_info"));
96  $ts_results->addOption($option);
97 
98  $option = new \ilRadioOption($lng->txt("survey_360_results_all"), (string) \ilObjSurvey::RESULTS_360_ALL);
99  $option->setInfo($lng->txt("survey_360_results_all_info"));
100  $ts_results->addOption($option);
101 
102  $items[] = $ts_results;
103 
104  return $items;
105  }
106 
107  public function setValuesFromForm(
108  \ilObjSurvey $survey,
109  \ilPropertyFormGUI $form
110  ): void {
111  if ($form->getInput("remind_appraisees") && $form->getInput("remind_raters")) {
113  } elseif ($form->getInput("remind_appraisees")) {
115  } elseif ($form->getInput("remind_raters")) {
117  } else {
118  $survey->setReminderTarget(0);
119  }
120 
121  $survey->set360SelfEvaluation((bool) $form->getInput("self_eval"));
122  $survey->set360Results((int) $form->getInput("ts_res"));
123  }
124 }
getSurveySettingsResults(\ilObjSurvey $survey, InternalGUIService $ui_service)
setValuesFromForm(\ilObjSurvey $survey, \ilPropertyFormGUI $form)
$lng
const NOTIFICATION_APPRAISEES
set360Results(int $a_value)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
setReminderTarget(int $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const NOTIFICATION_APPRAISEES_AND_RATERS
set360SelfEvaluation(bool $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const NOTIFICATION_RATERS
getSurveySettingsReminderTargets(\ilObjSurvey $survey, InternalGUIService $ui_service)