ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveySkillGUI.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 {
20  function __construct(ilObjSurvey $a_survey)
21  {
22  $this->survey = $a_survey;
23  }
24 
28  function executeCommand()
29  {
30  global $ilCtrl;
31 
32  $cmd = $ilCtrl->getCmd();
33  $next_class = $ilCtrl->getNextClass();
34 
35  switch ($next_class)
36  {
37  case 'ilsurveyskillthresholdsgui':
38  $this->setSubTabs("skill_thresholds");
39  include_once("./Modules/Survey/classes/class.ilSurveySkillThresholdsGUI.php");
40  $gui = new ilSurveySkillThresholdsGUI($this->survey);
41  $ilCtrl->forwardCommand($gui);
42  break;
43 
44  default:
45  if (in_array($cmd, array("listQuestionAssignment",
46  "assignSkillToQuestion", "selectSkillForQuestion",
47  "removeSkillFromQuestion")))
48  {
49  $this->setSubTabs("survey_skill_assign");
50  $this->$cmd();
51  }
52  break;
53  }
54  }
55 
60  {
61  global $tpl;
62 
63  include_once("./Modules/Survey/classes/class.ilSurveySkillAssignmentTableGUI.php");
64  $tab = new ilSurveySkillAssignmentTableGUI($this, "listQuestionAssignment",
65  $this->survey);
66  $tpl->setContent($tab->getHTML());
67  }
68 
73  {
74  global $ilUser, $tpl, $ilCtrl, $lng, $ilTabs;
75 
76  $ilCtrl->saveParameter($this, "q_id");
77 
78 
79  include_once("./Services/Skill/classes/class.ilSkillSelectorGUI.php");
80  $sel = new ilSkillSelectorGUI($this, "assignSkillToQuestion", $this, "selectSkillForQuestion");
81  if (!$sel->handleCommand())
82  {
83  $tpl->setContent($sel->getHTML());
84  }
85 
86 return;
87  /*
88  include_once("./Services/Skill/classes/class.ilSkillTree.php");
89  $skill_tree = new ilSkillTree();
90 
91  require_once ("./Modules/Survey/classes/class.ilSurveySkillExplorer.php");
92  $exp = new ilSurveySkillExplorer($ilCtrl->getLinkTarget($this, "assignSkillToQuestion"));
93  $exp->setTargetGet("obj_id");
94 
95  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, "assignSkillToQuestion"));
96 
97  if ($_GET["skpexpand"] == "")
98  {
99  $expanded = $skill_tree->readRootId();
100  }
101  else
102  {
103  $expanded = $_GET["skpexpand"];
104  }
105 
106  $exp->setExpand($expanded);
107  // build html-output
108  $exp->setOutput(0);
109  $output = $exp->getOutput();
110 
111  // asynchronous output
112  if ($ilCtrl->isAsynch())
113  {
114  echo $output; exit;
115  }
116 
117  $tpl->setContent($output); */
118  }
119 
124  {
125  global $ilCtrl, $lng;
126 
127  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
128  $skill_survey = new ilSurveySkill($this->survey);
129  $skill_id_parts = explode(":", $_GET["selected_skill"]);
130  $skill_survey->addQuestionSkillAssignment((int) $_GET["q_id"],
131  (int) $skill_id_parts[0], (int) $skill_id_parts[1]);
132  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
133 
134  $ilCtrl->redirect($this, "listQuestionAssignment");
135  }
136 
141  {
142  global $ilCtrl, $lng;
143 
144  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
145  $skill_survey = new ilSurveySkill($this->survey);
146  $skill_survey->removeQuestionSkillAssignment((int) $_GET["q_id"]);
147  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
148 
149  $ilCtrl->redirect($this, "listQuestionAssignment");
150  }
151 
157  function setSubTabs($a_activate)
158  {
159  global $ilTabs, $lng, $ilCtrl;
160 
161  $ilTabs->addSubtab("survey_skill_assign",
162  $lng->txt("survey_skill_assign"),
163  $ilCtrl->getLinkTargetByClass("ilsurveyskillgui", "listQuestionAssignment"));
164 
165  $ilTabs->addSubTab("skill_thresholds",
166  $lng->txt("survey_skill_thresholds"),
167  $ilCtrl->getLinkTargetByClass("ilsurveyskillthresholdsgui", "listCompetences"));
168 
169  $ilTabs->activateSubtab($a_activate);
170  }
171 
172 }
173 
174 ?>