ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveySkillDeterminationGUI.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("listSkillChanges");
33 
34  //$ilCtrl->saveParameter($this, array("sk_id", "tref_id"));
35 
36  if (in_array($cmd, array("listSkillChanges", "writeSkills")))
37  {
38  $this->$cmd();
39  }
40  }
41 
45  function listSkillChanges()
46  {
47  global $tpl, $ilToolbar, $lng, $ilCtrl;
48 
49  include_once("./Modules/Survey/classes/class.ilSurveySkillChangesTableGUI.php");
50 
51 // $ilToolbar->addButton($lng->txt("survey_write_skills"),
52 // $ilCtrl->getLinkTarget($this, "writeSkills"));
53 
54  $apps = $this->survey->getAppraiseesData();
55  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
56  foreach ($apps as $app)
57  {
58  $changes_table = new ilSurveySkillChangesTableGUI($this, "listSkillChanges",
59  $this->survey, $app);
60 
61  $ctpl->setCurrentBlock("appraisee");
62  $ctpl->setVariable("LASTNAME", $app["lastname"]);
63  $ctpl->setVariable("FIRSTNAME", $app["firstname"]);
64 
65  $ctpl->setVariable("CHANGES_TABLE", $changes_table->getHTML());
66 
67  $ctpl->parseCurrentBlock();
68  }
69 
70  $tpl->setContent($ctpl->get());
71  }
72 
79  function writeSkills()
80  {
81  global $lng, $ilCtrl;
82 return;
83  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
84  $sskill = new ilSurveySkill($this->survey);
85  $apps = $this->survey->getAppraiseesData();
86  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
87  foreach ($apps as $app)
88  {
89  $new_levels = $sskill->determineSkillLevelsForAppraisee($app["user_id"]);
90  foreach ($new_levels as $nl)
91  {
92  if ($nl["new_level_id"] > 0)
93  {
94  ilBasicSkill::writeUserSkillLevelStatus($nl["new_level_id"],
95  $app["user_id"], $this->survey->getRefId(), $nl["tref_id"], ilBasicSkill::ACHIEVED);
96  }
97  }
98  }
99  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
100  $ilCtrl->redirect($this, "listSkillChanges");
101  }
102 
103 }
104 
105 ?>