ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSurveySkillThresholdsGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
14{
18 protected $ctrl;
19
23 protected $tpl;
24
28 protected $toolbar;
29
33 protected $lng;
34
38 protected $tabs;
39
45 public function __construct(ilObjSurvey $a_survey)
46 {
47 global $DIC;
48
49 $this->ctrl = $DIC->ctrl();
50 $this->tpl = $DIC["tpl"];
51 $this->toolbar = $DIC->toolbar();
52 $this->lng = $DIC->language();
53 $this->tabs = $DIC->tabs();
54 $this->survey = $a_survey;
55 }
56
60 public function executeCommand()
61 {
62 $ilCtrl = $this->ctrl;
63
64 $cmd = $ilCtrl->getCmd();
65
66 $ilCtrl->saveParameter($this, array("sk_id", "tref_id"));
67
68 if (in_array($cmd, array("listCompetences", "listSkillThresholds", "selectSkill",
69 "saveThresholds"))) {
70 $this->$cmd();
71 }
72 }
73
80 public function listCompetences()
81 {
83
84 $tab = new ilSurveySkillTableGUI($this, "listCompetences", $this->survey);
85 $tpl->setContent($tab->getHTML());
86 }
87
88
92 public function listSkillThresholds()
93 {
95 $ilToolbar = $this->toolbar;
97 $ilCtrl = $this->ctrl;
98 $ilTabs = $this->tabs;
99
100 $ilTabs->clearTargets();
101 $ilTabs->setBackTarget(
102 $lng->txt("svy_back"),
103 $ilCtrl->getLinkTarget($this, "listCompetences")
104 );
105
107 $this,
108 "listSkillThresholds",
109 $this->survey,
110 (int) $_GET["sk_id"],
111 (int) $_GET["tref_id"]
112 );
113 $tpl->setContent($tab->getHTML());
114 }
115
122 public function selectSkill()
123 {
124 $ilCtrl = $this->ctrl;
125
126 $o = explode(":", $_POST["skill"]);
127 $ilCtrl->setParameter($this, "sk_id", (int) $o[0]);
128 $ilCtrl->setParameter($this, "tref_id", (int) $o[1]);
129 $ilCtrl->redirect($this, "listSkillThresholds");
130 }
131
138 public function saveThresholds()
139 {
140 $ilCtrl = $this->ctrl;
142
143 $thres = new ilSurveySkillThresholds($this->survey);
144
145 if (is_array($_POST["threshold"])) {
146 foreach ($_POST["threshold"] as $l => $t) {
147 $thres->writeThreshold(
148 (int) $_GET["sk_id"],
149 (int) $_GET["tref_id"],
150 (int) $l,
151 (int) $t
152 );
153 }
154 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), 1);
155 }
156
157 $ilCtrl->redirect($this, "listSkillThresholds");
158 }
159}
$_GET["client_id"]
$_POST["username"]
An exception for terminatinating execution or to throw for unit testing.
Class ilObjSurvey.
TableGUI class for skill list in survey.
Survey skill thresholds GUI class.
__construct(ilObjSurvey $a_survey)
Constructor.
TableGUI class for competence thresholds.
Skill tresholds for 360 surveys.
global $DIC
Definition: goto.php:24