ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSelfEvaluationSimpleTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
17 
21  function __construct($a_parent_obj, $a_parent_cmd, $a_top_skill_id, $a_tref_id,
22  $a_basic_skill_id)
23  {
24  global $ilCtrl, $lng, $ilAccess, $lng, $ilUser;
25 
26  $this->top_skill_id = $a_top_skill_id;
27  $this->tref_id = (int) $a_tref_id;
28  $this->basic_skill_id = $a_basic_skill_id;
29 
30  $this->cur_level_id = ilPersonalSkill::getSelfEvaluation($ilUser->getId(),
31  $this->top_skill_id, $this->tref_id, $this->basic_skill_id);
32 
33  // build title
34  include_once("./Services/Skill/classes/class.ilSkillTree.php");
35  $stree = new ilSkillTree();
36  $path = $stree->getPathFull($this->basic_skill_id);
37  $title = $sep = "";
38  foreach ($path as $p)
39  {
40  if ($p["type"] != "skrt")
41  {
42  $title.= $sep.$p["title"];
43  $sep = " > ";
44  }
45  }
46 
47  parent::__construct($a_parent_obj, $a_parent_cmd);
48  $this->setData($this->getLevels());
49  $this->setTitle($title);
50  $this->setLimit(9999);
51 
52  $this->addColumn("", "", "", true);
53  $this->addColumn($this->lng->txt("skmg_skill_level"));
54  $this->addColumn($this->lng->txt("description"));
55 
56  $this->setEnableHeader(true);
57  $this->setRowTemplate("tpl.simple_self_eval.html", "Services/Skill");
58  $this->disable("footer");
59  $this->setEnableTitle(true);
60 
61  $this->addCommandButton("saveSelfEvaluation",
62  $lng->txt("save"));
63  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
64  }
65 
72  function getLevels()
73  {
74  global $lng;
75 
76  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
77  $this->skill = ilSkillTreeNodeFactory::getInstance($this->basic_skill_id);
78  $levels[] = array("id" => 0, "description" => $lng->txt("skmg_no_skills"));
79  foreach ($this->skill->getLevelData() as $k => $v)
80  {
81  $levels[] = $v;
82  }
83 
84  return $levels;
85  }
86 
90  protected function fillRow($a_set)
91  {
92  global $lng, $ilCtrl, $ilUser;
93 
94  include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
95 
96  if ($this->cur_level_id == $a_set["id"])
97  {
98  $this->tpl->setVariable("CHECKED", "checked='checked'");
99  }
100 
101  $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
102  $this->tpl->setVariable("SKILL_ID", $this->basic_skill_id);
103  $this->tpl->setVariable("TXT_SKILL", $a_set["title"]);
104  $this->tpl->setVariable("TXT_SKILL_DESC", $a_set["description"]);
105  }
106 
107 }
108 ?>