ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPersonalSkillsGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
6 
18 {
19  protected $offline_mode;
20  protected $skill_tree;
21  static $skill_tt_cnt = 1;
22 
28  public function __construct()
29  {
30  global $ilCtrl, $lng, $ilHelp, $ilSetting;
31 
32  $lng->loadLanguageModule('skmg');
33 
34  $ilHelp->setScreenIdComponent("skill");
35 
36  $ilCtrl->saveParameter($this, "skill_id");
37  $ilCtrl->saveParameter($this, "tref_id");
38 
39  include_once("./Services/Skill/classes/class.ilSkillTree.php");
40  $this->skill_tree = new ilSkillTree();
41 
42  $this->use_materials = !$ilSetting->get("disable_personal_workspace");
43  }
44 
51  public function executeCommand()
52  {
53  global $ilCtrl, $tpl, $lng;
54 
55  $next_class = $ilCtrl->getNextClass($this);
56  $cmd = $ilCtrl->getCmd("listSkills");
57 
58  $tpl->setTitle($lng->txt("skills"));
59  $tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg_b.png"));
60 
61  switch($next_class)
62  {
63  default:
64  $this->$cmd();
65  break;
66  }
67  return true;
68  }
69 
73  function setTabs($a_activate)
74  {
75  global $ilTabs, $lng, $ilCtrl;
76 
77  // list skills
78  $ilTabs->addTab("list_skills",
79  $lng->txt("skmg_list_skills"),
80  $ilCtrl->getLinkTarget($this, "listSkills"));
81 
82  // assign materials
83 /* $ilTabs->addTab("assign_materials",
84  $lng->txt("skmg_assign_materials"),
85  $ilCtrl->getLinkTarget($this, "assignMaterials"));*/
86 
87  $ilTabs->activateTab($a_activate);
88  }
89 
90  function setOfflineMode($a_file_path)
91  {
92  $this->offline_mode = $a_file_path;
93  }
94 
98  function listSkills()
99  {
100  global $tpl, $ilTabs, $lng, $ilCtrl, $ilToolbar, $ilUser;
101 
102  $this->setTabs("list_skills");
103 
104  include_once("./Services/Skill/classes/class.ilSkillTree.php");
105  $stree = new ilSkillTree();
106 
107  // skill selection / add new personal skill
108  $ilToolbar->addFormButton($lng->txt("skmg_add_skill"),
109  "listSkillsForAdd");
110  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
111 
112  $skills = ilPersonalSkill::getSelectedUserSkills($ilUser->getId());
113  $html = "";
114  foreach ($skills as $s)
115  {
116  $path = $stree->getSkillTreePath($s["skill_node_id"]);
117 
118  // check draft
119  foreach ($path as $p)
120  {
121  if ($p["draft"])
122  {
123  continue(2);
124  }
125  }
126 
127 
128  $html.= $this->getSkillHTML($s["skill_node_id"], 0, true);
129  }
130 
131  // list skills
132 // include_once("./Services/Skill/classes/class.ilPersonalSkillTableGUI.php");
133 // $sktab = new ilPersonalSkillTableGUI($this, "listSkills");
134 
135  $tpl->setContent($html);
136 
137  }
138 
144  function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = false)
145  {
146  global $ilUser, $lng, $ilCtrl, $ilSetting;
147 
148  $this->tooltips = array();
149 
150  if ($a_user_id == 0)
151  {
152  $user = $ilUser;
153  }
154  else
155  {
156  $user = new ilObjUser($a_user_id);
157  }
158 
159  $tpl = new ilTemplate("tpl.skill_pres.html", true, true, "Services/Skill");
160 
161  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
162 
163  include_once("./Services/Skill/classes/class.ilSkillTree.php");
164  $stree = new ilSkillTree();
165 
166  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
167  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
168 
169  // general settings for the action drop down
170  include_once("Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
171  $act_list = new ilAdvancedSelectionListGUI();
172  $act_list->setListTitle($lng->txt("actions"));
173  $act_list->setSelectionHeaderClass("small");
174 // $act_list->setLinksMode("il_ContainerItemCommand2");
175  $act_list->setHeaderIcon(ilAdvancedSelectionListGUI::DOWN_ARROW_DARK);
176  $act_list->setUseImages(false);
177 
178  $b_skills = ilSkillTreeNode::getSkillTreeNodes($a_top_skill_id, true);
179  foreach ($b_skills as $bs)
180  {
181  $path = $stree->getSkillTreePath($bs["id"], $bs["tref"]);
182 
183  // check draft
184  foreach ($path as $p)
185  {
186  if ($p["draft"])
187  {
188  continue(2);
189  }
190  }
191  reset($path);
192 
193  $se_level = ilPersonalSkill::getSelfEvaluation($user->getId(),
194  $a_top_skill_id, $bs["tref"], $bs["id"]);
195 
196  $skill = ilSkillTreeNodeFactory::getInstance($bs["id"]);
197  $level_data = $skill->getLevelData();
198 
199  // check, if current self eval level is in current level data
200  $valid_sel_level = false;
201  if ($se_level > 0)
202  {
203  foreach ($level_data as $k => $v)
204  {
205  if ($v["id"] == $se_level)
206  {
207  $valid_sel_level = true;
208  }
209  }
210  }
211  reset($level_data);
212  $found = false;
213  foreach ($level_data as $k => $v)
214  {
215  // level
216  $tpl->setCurrentBlock("level_td");
217  $tpl->setVariable("VAL_LEVEL", $v["title"]);
218  $tt_id = "skmg_skl_tt_".self::$skill_tt_cnt;
219  self::$skill_tt_cnt++;
220  $tpl->setVariable("TT_ID", $tt_id);
221  if ($v["description"] != "")
222  {
223  ilTooltipGUI::addTooltip($tt_id, $v["description"]);
224  }
225  $tpl->parseCurrentBlock();
226 
227  // self evaluation
228  $tpl->setCurrentBlock("self_eval_td");
229  if ($valid_sel_level && !$found)
230  {
231  $tpl->setVariable("VAL_SELF_EVAL", "x");
232  $tpl->setVariable("CLASS_SELF_EVAL", "ilSkillSelf");
233  }
234  else
235  {
236  $tpl->setVariable("VAL_SELF_EVAL", " ");
237  }
238  $tpl->parseCurrentBlock();
239  if ($v["id"] == $se_level)
240  {
241  $found = true;
242  }
243 
244  // assigned materials
245  if ($this->use_materials)
246  {
247 
248  $mat_cnt = ilPersonalSkill::countAssignedMaterial($user->getId(),
249  $bs["tref"], $v["id"]);
250  if ($mat_cnt == 0)
251  {
252  $tpl->setCurrentBlock("material_td");
253  $tpl->setVariable("VAL_MATERIAL", " ");
254  $tpl->parseCurrentBlock();
255  }
256  else
257  {
258  // links to material files
259  $tpl->setCurrentBlock("material_links");
260 
261  $mat_tt = array();
262  $cnt = 1;
263  foreach(ilPersonalSkill::getAssignedMaterial($user->getId(),
264  $bs["tref"], $v["id"]) as $item)
265  {
266  $mat_data = $this->getMaterialInfo($item["wsp_id"]);
267  $tpl->setVariable("URL_MATERIAL", $mat_data[1]);
268  $tpl->setVariable("TXT_MATERIAL", $cnt);
269 
270  // tooltip
271  $mat_tt_id = "skmg_skl_tt_mat_".self::$skill_tt_cnt;
272  self::$skill_tt_cnt++;
273  $tpl->setVariable("TOOLTIP_MATERIAL_ID", $mat_tt_id);
274 
275  if(!$this->offline_mode)
276  {
277  ilTooltipGUI::addTooltip($mat_tt_id, $mat_data[0]);
278  }
279  else
280  {
281  $this->tooltips[] = ilTooltipGUI::getTooltip($mat_tt_id, $mat_data[0]);
282  }
283 
284  $tpl->parseCurrentBlock();
285  $cnt++;
286  }
287 
288  $tpl->setCurrentBlock("material_td");
289  $tpl->setVariable("CLASS_MAT", "ilSkillMat");
290  $tpl->parseCurrentBlock();
291  }
292  }
293  }
294 
295  $title = $sep = "";
296  $found = false;
297  foreach ($path as $p)
298  {
299  if ($found)
300  {
301  $title.= $sep.$p["title"];
302  $sep = " > ";
303  }
304  if ($a_top_skill_id == $p["child"])
305  {
306  $found = true;
307  }
308  }
309 
310  $tpl->setCurrentBlock("skill");
311  $tpl->setVariable("BSKILL_TITLE", $title);
312  $tpl->setVariable("TXT_LEVEL", $lng->txt("skmg_level"));
313  $tpl->setVariable("TXT_SELF_EVAL", $lng->txt("skmg_self_evaluation"));
314  if ($this->use_materials)
315  {
316  $tpl->setVariable("TXT_MATERIAL", $lng->txt("skmg_material"));
317  }
318 
319  if ($a_edit)
320  {
321  $act_list->flush();
322  $act_list->setId("act_".$a_top_skill_id."_".$bs["id"]);
323  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
324  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "tref_id", $bs["tref"]);
325  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "basic_skill_id", $bs["id"]);
326  if ($this->use_materials)
327  {
328  $act_list->addItem($lng->txt('skmg_assign_materials'), "",
329  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
330  }
331  $act_list->addItem($lng->txt('skmg_self_evaluation'), "",
332  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "selfEvaluation"));
333  $tpl->setVariable("ACTIONS2", $act_list->getHTML());
334  }
335 
336 
337  $tpl->parseCurrentBlock();
338  }
339 
340  $tpl->setVariable("SKILL_TITLE", ilSkillTreeNode::_lookupTitle($a_top_skill_id));
341 
342  if ($a_edit)
343  {
344  $act_list->flush();
345  $act_list->setId("act_".$a_top_skill_id);
346  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
347 // $act_list->addItem($lng->txt('skmg_assign_materials'), "",
348 // $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials"));
349  $act_list->addItem($lng->txt('skmg_remove_skill'), "",
350  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "confirmSkillRemove"));
351  $tpl->setVariable("ACTIONS1", $act_list->getHTML());
352  }
353 
354  return $tpl->get();
355  }
356 
357  function getTooltipsJs()
358  {
359  return $this->tooltips;
360  }
361 
368  function getMaterialInfo($a_wsp_id)
369  {
370  global $ilUser;
371 
372  if(!$this->ws_tree)
373  {
374  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
375  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
376  $this->ws_tree = new ilWorkspaceTree($ilUser->getId());
377  $this->ws_access = new ilWorkspaceAccessHandler($caption);
378  }
379 
380  $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
381  $caption = ilObject::_lookupTitle($obj_id);
382 
383  if(!$this->offline_mode)
384  {
385  $url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
386  }
387  else
388  {
389  $url = $this->offline_mode."file_".$obj_id."/";
390 
391  // all possible material types for now
392  switch(ilObject::_lookupType($obj_id))
393  {
394  case "tstv":
395  include_once "Modules/Test/classes/class.ilObjTestVerification.php";
396  $obj = new ilObjTestVerification($obj_id, false);
397  $url .= $obj->getOfflineFilename();
398  break;
399 
400  case "excv":
401  include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
402  $obj = new ilObjExerciseVerification($obj_id, false);
403  $url .= $obj->getOfflineFilename();
404  break;
405 
406  case "file":
407  $file = new ilObjFile($obj_id, false);
408  $url .= $file->getFilename();
409  break;
410  }
411  }
412 
413  return array($caption, $url);
414  }
415 
419  function addSkill()
420  {
421  global $ilUser, $ilCtrl, $lng;
422 
423  ilPersonalSkill::addPersonalSkill($ilUser->getId(), (int) $_GET["obj_id"]);
424 
425  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
426  $ilCtrl->redirect($this, "listSkills");
427  }
428 
429 
430 
435  {
436  global $ilCtrl, $tpl, $lng;
437 
438  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
439  if ($_GET["skill_id"] > 0)
440  {
441  $_POST["id"][] = $_GET["skill_id"];
442  }
443  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
444  {
445  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
446  $ilCtrl->redirect($this, "listSkills");
447  }
448  else
449  {
450  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
451  $cgui = new ilConfirmationGUI();
452  $cgui->setFormAction($ilCtrl->getFormAction($this));
453  $cgui->setHeaderText($lng->txt("skmg_really_remove_skills"));
454  $cgui->setCancel($lng->txt("cancel"), "listSkills");
455  $cgui->setConfirm($lng->txt("delete"), "removeSkills");
456 
457  foreach ($_POST["id"] as $i)
458  {
459  $cgui->addItem("id[]", $i, ilSkillTreeNode::_lookupTitle($i));
460  }
461 
462  $tpl->setContent($cgui->getHTML());
463  }
464  }
465 
469  function removeSkills()
470  {
471  global $ilUser, $lng, $ilCtrl;
472 
473  if (is_array($_POST["id"]))
474  {
475  foreach ($_POST["id"] as $n_id)
476  {
477  ilPersonalSkill::removeSkill($ilUser->getId(), $n_id);
478  }
479  }
480 
481  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
482  $ilCtrl->redirect($this, "listSkills");
483  }
484 
485 
486  //
487  // Materials assignments
488  //
489 
496  function assignMaterials()
497  {
498  global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
499 
500  $ilTabs->setBackTarget($lng->txt("back"),
501  $ilCtrl->getLinkTarget($this, "listSkills"));
502 
503  $ilCtrl->saveParameter($this, "skill_id");
504  $ilCtrl->saveParameter($this, "basic_skill_id");
505  $ilCtrl->saveParameter($this, "tref_id");
506 
507  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
508  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
509  $tpl->setTitleIcon(ilUtil::getImagePath("icon_".
510  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
511  "_b.png"));
512 
513  // basic skill selection
514 // here basic skill id??
515  $bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
516  $options = array();
517  foreach ($bs as $b)
518  {
519  $options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
520  }
521 
522  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
523  ? (int) $_POST["basic_skill_id"]
524  : (((int) $_GET["basic_skill_id"] > 0)
525  ? (int) $_GET["basic_skill_id"]
526  : key($options));
527 
528  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
529 
530  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
531  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
532  $si->setOptions($options);
533  $si->setValue($cur_basic_skill_id);
534  $ilToolbar->addInputItem($si, true);
535  $ilToolbar->addFormButton($lng->txt("select"),
536  "assignMaterials");
537 
538  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
539 
540  // table
541  include_once("./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
542  $tab = new ilSkillAssignMaterialsTableGUI($this, "assignMaterials",
543  (int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
544 
545  $tpl->setContent($tab->getHTML());
546 
547  }
548 
549 
556  function assignMaterial()
557  {
558  global $tpl, $ilUser, $ilCtrl, $ilTabs, $lng, $ilSetting;
559 
560  if(!$ilSetting->get("disable_personal_workspace"))
561  {
562  ilUtil::sendInfo($lng->txt("skmg_ass_materials_from_workspace")." ยป <a href='ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace'>".$lng->txt("personal_workspace")."</a>");
563  }
564 
565  $ilCtrl->saveParameter($this, "skill_id");
566  $ilCtrl->saveParameter($this, "level_id");
567  $ilCtrl->saveParameter($this, "tref_id");
568  $ilCtrl->saveParameter($this, "basic_skill_id");
569 
570  $ilTabs->setBackTarget($lng->txt("back"),
571  $ilCtrl->getLinkTarget($this, "assignMaterials"));
572 
573  // get ws tree
574  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
575  $tree = new ilWorkspaceTree($ilUser->getId());
576 
577  // get access handler
578  include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
579  $acc_handler = new ilWorkspaceAccessHandler($tree);
580 
581  // get es explorer
582  include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorer.php");
584  'skill_wspexpand', $tree, $acc_handler);
585  $exp->setTargetGet('wsp_id');
586  $exp->setFiltered(false);
587  $exp->removeAllFormItemTypes();
588  $exp->addFormItemForType("file");
589  $exp->addFormItemForType("tstv");
590  $exp->addFormItemForType("excv");
591 
592  if($_GET['skill_wspexpand'] == '')
593  {
594  // not really used as session is already set [see above]
595  $expanded = $tree->readRootId();
596  }
597  else
598  {
599  $expanded = $_GET['skill_wspexpand'];
600  }
601  $exp->setCheckedItems(array((int)$_POST['wsp_id']));
602  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, 'assignMaterial'));
603  $exp->setPostVar('wsp_id[]');
604  $exp->setExpand($expanded);
605  $exp->setOutput(0);
606 
607  // fill template
608  $mtpl = new ilTemplate("tpl.materials_selection.html", true, true, "Services/Skill");
609  $mtpl->setVariable("EXP", $exp->getOutput());
610 
611  // toolbars
612  $tb = new ilToolbarGUI();
613  $tb->addFormButton($lng->txt("select"),
614  "selectMaterial");
615  $tb->setFormAction($ilCtrl->getFormAction($this));
616  $tb->setOpenFormTag(true);
617  $tb->setCloseFormTag(false);
618  $mtpl->setVariable("TOOLBAR1", $tb->getHTML());
619  $tb->setOpenFormTag(false);
620  $tb->setCloseFormTag(true);
621  $mtpl->setVariable("TOOLBAR2", $tb->getHTML());
622 
623  $tpl->setContent($mtpl->get());
624  }
625 
629  function selectMaterial()
630  {
631  global $ilUser, $ilCtrl, $lng;
632 
633  include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
634  if (is_array($_POST["wsp_id"]))
635  {
636  foreach ($_POST["wsp_id"] as $w)
637  {
638  ilPersonalSkill::assignMaterial($ilUser->getId(), (int) $_GET["skill_id"],
639  (int) $_GET["tref_id"],
640  (int) $_GET["basic_skill_id"], (int) $_GET["level_id"], (int) $w);
641  }
642  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
643  }
644 
645  $ilCtrl->saveParameter($this, "skill_id");
646  $ilCtrl->saveParameter($this, "level_id");
647  $ilCtrl->saveParameter($this, "tref_id");
648  $ilCtrl->saveParameter($this, "basic_skill_id");
649 
650  $ilCtrl->redirect($this, "assignMaterials");
651  }
652 
653 
657  function removeMaterial()
658  {
659  global $ilUser, $lng, $ilCtrl;
660 
661  ilPersonalSkill::removeMaterial($ilUser->getId(), (int) $_GET["tref_id"],
662  (int) $_GET["level_id"],
663  (int) $_GET["wsp_id"]);
664  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
665  $ilCtrl->redirect($this, "assignMaterials");
666  }
667 
668 
669  //
670  // Self evaluation
671  //
672 
679  function selfEvaluation()
680  {
681  global $ilTabs, $lng, $ilCtrl, $tpl, $ilToolbar;
682 
683  $ilTabs->setBackTarget($lng->txt("back"),
684  $ilCtrl->getLinkTarget($this, "listSkills"));
685 
686  $ilCtrl->saveParameter($this, "skill_id");
687  $ilCtrl->saveParameter($this, "basic_skill_id");
688  $ilCtrl->saveParameter($this, "tref_id");
689 
690  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
691  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
692  $tpl->setTitleIcon(ilUtil::getImagePath("icon_".
693  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]).
694  "_b.png"));
695 
696  // basic skill selection
697 // here basic skill id??
698  $bs = ilSkillTreeNode::getSkillTreeNodes((int) $_GET["skill_id"], true);
699  $options = array();
700  foreach ($bs as $b)
701  {
702  $options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
703  }
704 
705  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
706  ? (int) $_POST["basic_skill_id"]
707  : (((int) $_GET["basic_skill_id"] > 0)
708  ? (int) $_GET["basic_skill_id"]
709  : key($options));
710 
711  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
712 
713  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
714  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
715  $si->setOptions($options);
716  $si->setValue($cur_basic_skill_id);
717  $ilToolbar->addInputItem($si, true);
718  $ilToolbar->addFormButton($lng->txt("select"),
719  "selfEvaluation");
720 
721  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
722 
723  // table
724  include_once("./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
725  $tab = new ilSelfEvaluationSimpleTableGUI($this, "selfEvaluation",
726  (int) $_GET["skill_id"], (int) $_GET["tref_id"], $cur_basic_skill_id);
727 
728  $tpl->setContent($tab->getHTML());
729 
730  }
731 
736  {
737  global $ilUser, $lng, $ilCtrl;
738 
739  ilPersonalSkill::saveSelfEvaluation($ilUser->getId(), (int) $_GET["skill_id"],
740  (int) $_GET["tref_id"], (int) $_GET["basic_skill_id"], (int) $_POST["se"]);
741  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
742 
743 /* $ilCtrl->saveParameter($this, "skill_id");
744  $ilCtrl->saveParameter($this, "level_id");
745  $ilCtrl->saveParameter($this, "tref_id");
746  $ilCtrl->saveParameter($this, "basic_skill_id");*/
747 
748  $ilCtrl->redirect($this, "listSkills");
749 
750  }
751 
758  function listSkillsForAdd()
759  {
760  global $ilUser, $tpl, $ilCtrl, $lng, $ilTabs;
761 
762  ilUtil::sendInfo($lng->txt("skmg_select_skill"));
763 
764  $ilTabs->setBackTarget($lng->txt("back"),
765  $ilCtrl->getLinkTarget($this, ""));
766 
767  include_once("./Services/Skill/classes/class.ilSkillTree.php");
768  $skill_tree = new ilSkillTree();
769 
770  require_once ("./Services/Skill/classes/class.ilPersonalSkillExplorer.php");
771  $exp = new ilPersonalSkillExplorer($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
772  $exp->setTargetGet("obj_id");
773 
774  $exp->setExpandTarget($ilCtrl->getLinkTarget($this, "listSkillsForAdd"));
775 
776  if ($_GET["skpexpand"] == "")
777  {
778  $expanded = $skill_tree->readRootId();
779  }
780  else
781  {
782  $expanded = $_GET["skpexpand"];
783  }
784 
785  if ($_GET["obj_id"] > 0)
786  {
787  $path = $this->skill_tree->getPathId($_GET["obj_id"]);
788  $exp->setForceOpenPath($path);
789  $exp->highlightNode($_GET["obj_id"]);
790  }
791  else
792  {
793  $exp->highlightNode($this->skill_tree->readRootId());
794  }
795  $exp->setExpand($expanded);
796  // build html-output
797  $exp->setOutput(0);
798  $output = $exp->getOutput();
799 
800  // asynchronous output
801  if ($ilCtrl->isAsynch())
802  {
803  echo $output; exit;
804  }
805 
806  $tpl->setContent($output);
807 
808  }
809 
810 
811 }
812 ?>