ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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  {
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  {
82  $tpl = $this->tpl;
83 
84  include_once("./Modules/Survey/classes/class.ilSurveySkillTableGUI.php");
85  $tab = new ilSurveySkillTableGUI($this, "listCompetences", $this->survey);
86  $tpl->setContent($tab->getHTML());
87  }
88 
89 
93  public function listSkillThresholds()
94  {
95  $tpl = $this->tpl;
96  $ilToolbar = $this->toolbar;
97  $lng = $this->lng;
99  $ilTabs = $this->tabs;
100 
101  $ilTabs->clearTargets();
102  $ilTabs->setBackTarget(
103  $lng->txt("svy_back"),
104  $ilCtrl->getLinkTarget($this, "listCompetences")
105  );
106 
107  include_once("./Modules/Survey/classes/class.ilSurveySkillThresholdsTableGUI.php");
109  $this,
110  "listSkillThresholds",
111  $this->survey,
112  (int) $_GET["sk_id"],
113  (int) $_GET["tref_id"]
114  );
115  $tpl->setContent($tab->getHTML());
116  }
117 
124  public function selectSkill()
125  {
127 
128  $o = explode(":", $_POST["skill"]);
129  $ilCtrl->setParameter($this, "sk_id", (int) $o[0]);
130  $ilCtrl->setParameter($this, "tref_id", (int) $o[1]);
131  $ilCtrl->redirect($this, "listSkillThresholds");
132  }
133 
140  public function saveThresholds()
141  {
143  $lng = $this->lng;
144 
145  include_once("./Modules/Survey/classes/class.ilSurveySkillThresholds.php");
146  $thres = new ilSurveySkillThresholds($this->survey);
147 
148  if (is_array($_POST["threshold"])) {
149  foreach ($_POST["threshold"] as $l => $t) {
150  $thres->writeThreshold(
151  (int) $_GET["sk_id"],
152  (int) $_GET["tref_id"],
153  (int) $l,
154  (int) $t
155  );
156  }
157  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), 1);
158  }
159 
160  $ilCtrl->redirect($this, "listSkillThresholds");
161  }
162 }
TableGUI class for skill list in survey.
global $DIC
Definition: saml.php:7
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Skill tresholds for 360 surveys.
__construct(ilObjSurvey $a_survey)
Constructor.
TableGUI class for competence thresholds.
global $l
Definition: afr.php:30
Survey skill thresholds GUI class.
$_POST["username"]