Skip to content

Commit c49fb42

Browse files
committed
update: Bring detailed result toolbar to KS
1 parent dc121e7 commit c49fb42

File tree

4 files changed

+205
-170
lines changed

4 files changed

+205
-170
lines changed

components/ILIAS/Survey/Evaluation/class.ilSurveyEvaluationGUI.php

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class ilSurveyEvaluationGUI
4949
protected ilObjUser $user;
5050
protected ilRbacSystem $rbacsystem;
5151
protected ilTree $tree;
52-
protected ilToolbarGUI $toolbar;
5352
protected ilObjSurvey $object;
5453
protected ilLanguage $lng;
5554
protected ilGlobalTemplateInterface $tpl;
@@ -69,7 +68,6 @@ public function __construct(
6968
$this->user = $DIC->user();
7069
$this->rbacsystem = $DIC->rbac()->system();
7170
$this->tree = $DIC->repositoryTree();
72-
$this->toolbar = $DIC->toolbar();
7371
$this->ui = $DIC->ui();
7472
$lng = $DIC->language();
7573
$tpl = $DIC["tpl"];
@@ -646,7 +644,7 @@ protected function buildExportButtonAndModal(
646644
): void {
647645
$lng = $this->lng;
648646
$ctrl = $this->ctrl;
649-
$toolbar = $this->toolbar;
647+
$toolbar = $this->gui->toolbar();
650648
$ui_fac = $this->gui->ui()->factory();
651649

652650
$ctrl->setParameter($this, "export_cmd", $export_cmd);
@@ -705,7 +703,7 @@ protected function validateAndSubmitExportForm(): void
705703
$lng = $this->lng;
706704
$ctrl = $this->ctrl;
707705
$tabs = $this->tabs;
708-
$toolbar = $this->toolbar;
706+
$toolbar = $this->gui->toolbar();
709707
$request = $this->request;
710708
$ui_request = $this->gui->http()->request();
711709

@@ -767,7 +765,6 @@ protected function openEvaluation(): void
767765
public function evaluation(
768766
int $details = 0
769767
): void {
770-
$ilToolbar = $this->toolbar;
771768
$tree = $this->tree;
772769
$ui = $this->ui;
773770

@@ -814,27 +811,27 @@ public function evaluation(
814811
// setup toolbar
815812

816813
$appr_id = $this->evaluation_manager->getCurrentAppraisee();
817-
$ilToolbar->setFormAction($this->ctrl->getFormAction($this));
818814
$results = array();
819815

820816
$eval_tpl = new ilTemplate("tpl.il_svy_svy_evaluation.html", true, true, "components/ILIAS/Survey");
821817

822818

823819
if ($details) {
824-
$this->ui_modifier->setResultsDetailToolbar(
820+
$toolbar_components = $this->ui_modifier->setResultsDetailToolbar(
825821
$this->object,
826-
$ilToolbar,
827822
$this->user->getId(),
828823
$eval_tpl
829824
);
830825
} else {
831-
$this->ui_modifier->setResultsOverviewToolbar(
826+
$toolbar_components = $this->ui_modifier->setResultsOverviewToolbar(
832827
$this->object,
833-
$ilToolbar,
834828
$this->user->getId(),
835829
$eval_tpl
836830
);
837831
}
832+
foreach ($toolbar_components as $component) {
833+
$this->gui->toolbar()->addComponent($component);
834+
}
838835

839836
if (!$this->object->get360Mode() || $appr_id) {
840837
if ($details) {
@@ -905,7 +902,6 @@ public function evaluation(
905902
}
906903
}
907904

908-
//$eval_tpl->setVariable('MODAL', $modal);
909905
if (!$details) {
910906
$table_gui = new ilSurveyResultsCumulatedTableGUI($this, 'evaluation', $results);
911907
$eval_tpl->setVariable('CUMULATED', $table_gui->getHTML());
@@ -1139,23 +1135,21 @@ public function exportEvaluationUser(): void
11391135
*/
11401136
public function evaluationuser(): void
11411137
{
1142-
$ilToolbar = $this->toolbar;
1143-
11441138
if (!$this->hasResultsAccess() &&
11451139
$this->object->getMode() !== ilObjSurvey::MODE_SELF_EVAL) {
11461140
$this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
11471141
$this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
11481142
}
11491143

1150-
$this->ui_modifier->setResultsParticipantToolbar(
1144+
$toolbar_components = $this->ui_modifier->setResultsParticipantToolbar(
11511145
$this->object,
1152-
$ilToolbar,
11531146
$this->user->getId()
11541147
);
1148+
foreach ($toolbar_components as $component) {
1149+
$this->gui->toolbar()->addComponent($component);
1150+
}
11551151

1156-
$ilToolbar->setFormAction($this->ctrl->getFormAction($this, "evaluationuser"));
11571152

1158-
$modal = "";
11591153
$appr_id = null;
11601154
$data = [];
11611155

@@ -1166,7 +1160,8 @@ public function evaluationuser(): void
11661160
if (!$this->object->get360Mode() || $appr_id) {
11671161
$this->buildExportButtonAndModal("exportEvaluationUser");
11681162

1169-
$ilToolbar->addSeparator();
1163+
1164+
$this->gui->toolbar()->addSeparator();
11701165

11711166
$pv = $this->print->resultsDetails($this->object->getRefId());
11721167
$modal_elements = $pv->getModalElements(
@@ -1175,8 +1170,9 @@ public function evaluationuser(): void
11751170
"printResultsPerUserSelection"
11761171
)
11771172
);
1178-
$ilToolbar->addComponent($modal_elements->button);
1179-
$ilToolbar->addComponent($modal_elements->modal);
1173+
1174+
$this->gui->toolbar()->addComponent($modal_elements->button);
1175+
$this->gui->toolbar()->addComponent($modal_elements->modal);
11801176

11811177
$data = $this->evaluation_manager->getUserSpecificResults();
11821178
}
@@ -1190,7 +1186,6 @@ public function competenceEval(): void
11901186
{
11911187
$lng = $this->lng;
11921188
$ilCtrl = $this->ctrl;
1193-
$ilToolbar = $this->toolbar;
11941189
$tpl = $this->tpl;
11951190
$ilTabs = $this->tabs;
11961191

@@ -1199,7 +1194,6 @@ public function competenceEval(): void
11991194
$ilTabs->activateSubTab("svy_eval_competences");
12001195
$ilTabs->activateTab("svy_results");
12011196

1202-
$ilToolbar->setFormAction($this->ctrl->getFormAction($this, "competenceEval"));
12031197

12041198
$appr_id = $this->getAppraiseeId();
12051199

@@ -1208,11 +1202,13 @@ public function competenceEval(): void
12081202
return;
12091203
}
12101204

1211-
$this->ui_modifier->setResultsCompetenceToolbar(
1205+
$toolbar_components = $this->ui_modifier->setResultsCompetenceToolbar(
12121206
$this->object,
1213-
$ilToolbar,
12141207
$this->user->getId()
12151208
);
1209+
foreach ($toolbar_components as $component) {
1210+
$this->gui->toolbar()->addComponent($component);
1211+
}
12161212

12171213
// evaluation modes
12181214
$eval_modes = array();
@@ -1261,12 +1257,21 @@ public function competenceEval(): void
12611257

12621258
$ilCtrl->saveParameter($this, "comp_eval_mode");
12631259

1264-
$mode_sel = new ilSelectInputGUI($lng->txt("svy_analysis"), "comp_eval_mode");
1265-
$mode_sel->setOptions($eval_modes);
1266-
$mode_sel->setValue($comp_eval_mode);
1267-
$ilToolbar->addInputItem($mode_sel, true);
1260+
$dropdown_items = [];
1261+
foreach ($eval_modes as $mode_key => $mode_label) {
1262+
$ilCtrl->setParameter($this, "comp_eval_mode", $mode_key);
1263+
$dropdown_items[] = $this->ui->factory()->button()->shy(
1264+
$mode_label,
1265+
$ilCtrl->getLinkTarget($this, "competenceEval")
1266+
);
1267+
}
1268+
$ilCtrl->setParameter($this, "comp_eval_mode", $comp_eval_mode);
1269+
1270+
$this->gui->toolbar()->addComponent(
1271+
$this->ui->factory()->dropdown()->standard($dropdown_items)
1272+
->withLabel($eval_modes[$comp_eval_mode] ?? $lng->txt("svy_analysis"))
1273+
);
12681274

1269-
$ilToolbar->addFormButton($lng->txt("select"), "competenceEval");
12701275

12711276
$pskills_gui = new ilPersonalSkillsGUI();
12721277
$rater = $this->evaluation_manager->getCurrentRater(

components/ILIAS/Survey/Mode/IndividualFeedback/class.UIModifier.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,32 +114,30 @@ public function setValuesFromForm(
114114
$survey->set360Results((int) $form->getInput("ts_res"));
115115
}
116116

117-
118117
public function setResultsDetailToolbar(
119118
\ilObjSurvey $survey,
120-
\ilToolbarGUI $toolbar,
121119
int $user_id,
122120
\ilTemplate $eval_tpl
123-
): void {
121+
): array {
124122
$this->addApprSelectionToToolbar(
125123
$survey,
126-
$toolbar,
124+
$this->gui->toolbar(),
127125
$user_id
128126
);
129127

130-
$this->addExportAndPrintButton(
128+
return $this->getExportAndPrintComponents(
131129
$survey,
132-
$toolbar,
133130
true,
134131
$eval_tpl
135132
);
136133
}
137134

138135
public function setResultsCompetenceToolbar(
139136
\ilObjSurvey $survey,
140-
\ilToolbarGUI $toolbar,
141137
int $user_id
142-
): void {
138+
): array {
139+
$toolbar = $this->gui->toolbar();
140+
143141
$this->addApprSelectionToToolbar(
144142
$survey,
145143
$toolbar,
@@ -151,6 +149,8 @@ public function setResultsCompetenceToolbar(
151149
$toolbar,
152150
$user_id
153151
);
152+
153+
return [];
154154
}
155155

156156
/**

0 commit comments

Comments
 (0)