5 include_once(
"./Services/Skill/classes/class.ilPersonalSkill.php");
32 $lng->loadLanguageModule(
'skmg');
34 $ilHelp->setScreenIdComponent(
"skill");
36 $ilCtrl->saveParameter($this,
"skill_id");
37 $ilCtrl->saveParameter($this,
"tref_id");
39 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
42 $this->use_materials = !$ilSetting->get(
"disable_personal_workspace");
55 $next_class = $ilCtrl->getNextClass($this);
56 $cmd = $ilCtrl->getCmd(
"listSkills");
58 $tpl->setTitle($lng->txt(
"skills"));
78 $ilTabs->addTab(
"list_skills",
79 $lng->txt(
"skmg_list_skills"),
80 $ilCtrl->getLinkTarget($this,
"listSkills"));
87 $ilTabs->activateTab($a_activate);
92 $this->offline_mode = $a_file_path;
104 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
108 $ilToolbar->addFormButton($lng->txt(
"skmg_add_skill"),
110 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
114 foreach ($skills as $s)
116 $path = $stree->getSkillTreePath($s[
"skill_node_id"]);
119 foreach (
$path as $p)
128 $html.= $this->
getSkillHTML($s[
"skill_node_id"], 0,
true);
135 $tpl->setContent($html);
144 function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit =
false)
148 $this->tooltips = array();
159 $tpl =
new ilTemplate(
"tpl.skill_pres.html",
true,
true,
"Services/Skill");
161 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
163 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
166 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
167 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
170 include_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
172 $act_list->setListTitle($lng->txt(
"actions"));
173 $act_list->setSelectionHeaderClass(
"small");
176 $act_list->setUseImages(
false);
179 foreach ($b_skills as $bs)
181 $path = $stree->getSkillTreePath($bs[
"id"], $bs[
"tref"]);
184 foreach (
$path as $p)
194 $a_top_skill_id, $bs[
"tref"], $bs[
"id"]);
197 $level_data = $skill->getLevelData();
200 $valid_sel_level =
false;
203 foreach ($level_data as $k => $v)
205 if ($v[
"id"] == $se_level)
207 $valid_sel_level =
true;
213 foreach ($level_data as $k => $v)
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"] !=
"")
225 $tpl->parseCurrentBlock();
228 $tpl->setCurrentBlock(
"self_eval_td");
229 if ($valid_sel_level && !$found)
231 $tpl->setVariable(
"VAL_SELF_EVAL",
"x");
232 $tpl->setVariable(
"CLASS_SELF_EVAL",
"ilSkillSelf");
236 $tpl->setVariable(
"VAL_SELF_EVAL",
" ");
238 $tpl->parseCurrentBlock();
239 if ($v[
"id"] == $se_level)
245 if ($this->use_materials)
249 $bs[
"tref"], $v[
"id"]);
252 $tpl->setCurrentBlock(
"material_td");
253 $tpl->setVariable(
"VAL_MATERIAL",
" ");
254 $tpl->parseCurrentBlock();
259 $tpl->setCurrentBlock(
"material_links");
264 $bs[
"tref"], $v[
"id"]) as $item)
267 $tpl->setVariable(
"URL_MATERIAL", $mat_data[1]);
268 $tpl->setVariable(
"TXT_MATERIAL", $cnt);
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);
275 if(!$this->offline_mode)
281 $this->tooltips[] = ilTooltipGUI::getTooltip($mat_tt_id, $mat_data[0]);
284 $tpl->parseCurrentBlock();
288 $tpl->setCurrentBlock(
"material_td");
289 $tpl->setVariable(
"CLASS_MAT",
"ilSkillMat");
290 $tpl->parseCurrentBlock();
297 foreach (
$path as $p)
301 $title.= $sep.$p[
"title"];
304 if ($a_top_skill_id == $p[
"child"])
310 $tpl->setCurrentBlock(
"skill");
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)
316 $tpl->setVariable(
"TXT_MATERIAL", $lng->txt(
"skmg_material"));
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)
328 $act_list->addItem($lng->txt(
'skmg_assign_materials'),
"",
329 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"assignMaterials"));
331 $act_list->addItem($lng->txt(
'skmg_self_evaluation'),
"",
332 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"selfEvaluation"));
333 $tpl->setVariable(
"ACTIONS2", $act_list->getHTML());
337 $tpl->parseCurrentBlock();
345 $act_list->setId(
"act_".$a_top_skill_id);
346 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"skill_id", $a_top_skill_id);
349 $act_list->addItem($lng->txt(
'skmg_remove_skill'),
"",
350 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"confirmSkillRemove"));
351 $tpl->setVariable(
"ACTIONS1", $act_list->getHTML());
359 return $this->tooltips;
374 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
375 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
380 $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
383 if(!$this->offline_mode)
385 $url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
389 $url = $this->offline_mode.
"file_".$obj_id.
"/";
395 include_once
"Modules/Test/classes/class.ilObjTestVerification.php";
397 $url .= $obj->getOfflineFilename();
401 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
403 $url .= $obj->getOfflineFilename();
408 $url .=
$file->getFilename();
413 return array($caption, $url);
426 $ilCtrl->redirect($this,
"listSkills");
438 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
439 if (
$_GET[
"skill_id"] > 0)
443 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
446 $ilCtrl->redirect($this,
"listSkills");
450 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
457 foreach (
$_POST[
"id"] as $i)
462 $tpl->setContent($cgui->getHTML());
473 if (is_array(
$_POST[
"id"]))
475 foreach (
$_POST[
"id"] as $n_id)
482 $ilCtrl->redirect($this,
"listSkills");
500 $ilTabs->setBackTarget($lng->txt(
"back"),
501 $ilCtrl->getLinkTarget($this,
"listSkills"));
503 $ilCtrl->saveParameter($this,
"skill_id");
504 $ilCtrl->saveParameter($this,
"basic_skill_id");
505 $ilCtrl->saveParameter($this,
"tref_id");
507 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
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"]
528 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
530 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
532 $si->setOptions($options);
533 $si->setValue($cur_basic_skill_id);
534 $ilToolbar->addInputItem(
$si,
true);
535 $ilToolbar->addFormButton($lng->txt(
"select"),
538 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
541 include_once(
"./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
543 (
int) $_GET[
"skill_id"], (
int) $_GET[
"tref_id"], $cur_basic_skill_id);
545 $tpl->setContent(
$tab->getHTML());
560 if(!$ilSetting->get(
"disable_personal_workspace"))
562 ilUtil::sendInfo($lng->txt(
"skmg_ass_materials_from_workspace").
" ยป <a href='ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace'>".$lng->txt(
"personal_workspace").
"</a>");
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");
570 $ilTabs->setBackTarget($lng->txt(
"back"),
571 $ilCtrl->getLinkTarget($this,
"assignMaterials"));
574 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
578 include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php");
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");
592 if(
$_GET[
'skill_wspexpand'] ==
'')
595 $expanded = $tree->readRootId();
599 $expanded =
$_GET[
'skill_wspexpand'];
601 $exp->setCheckedItems(array((
int)
$_POST[
'wsp_id']));
602 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'assignMaterial'));
603 $exp->setPostVar(
'wsp_id[]');
604 $exp->setExpand($expanded);
608 $mtpl =
new ilTemplate(
"tpl.materials_selection.html",
true,
true,
"Services/Skill");
609 $mtpl->setVariable(
"EXP", $exp->getOutput());
613 $tb->addFormButton($lng->txt(
"select"),
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());
623 $tpl->setContent($mtpl->get());
633 include_once(
"./Services/Skill/classes/class.ilPersonalSkill.php");
634 if (is_array(
$_POST[
"wsp_id"]))
636 foreach (
$_POST[
"wsp_id"] as $w)
639 (
int)
$_GET[
"tref_id"],
640 (int)
$_GET[
"basic_skill_id"], (
int)
$_GET[
"level_id"], (int) $w);
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");
650 $ilCtrl->redirect($this,
"assignMaterials");
662 (
int)
$_GET[
"level_id"],
663 (int)
$_GET[
"wsp_id"]);
665 $ilCtrl->redirect($this,
"assignMaterials");
683 $ilTabs->setBackTarget($lng->txt(
"back"),
684 $ilCtrl->getLinkTarget($this,
"listSkills"));
686 $ilCtrl->saveParameter($this,
"skill_id");
687 $ilCtrl->saveParameter($this,
"basic_skill_id");
688 $ilCtrl->saveParameter($this,
"tref_id");
690 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
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"]
711 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
713 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
715 $si->setOptions($options);
716 $si->setValue($cur_basic_skill_id);
717 $ilToolbar->addInputItem(
$si,
true);
718 $ilToolbar->addFormButton($lng->txt(
"select"),
721 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
724 include_once(
"./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
726 (
int) $_GET[
"skill_id"], (
int) $_GET[
"tref_id"], $cur_basic_skill_id);
728 $tpl->setContent(
$tab->getHTML());
748 $ilCtrl->redirect($this,
"listSkills");
764 $ilTabs->setBackTarget($lng->txt(
"back"),
765 $ilCtrl->getLinkTarget($this,
""));
767 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
770 require_once (
"./Services/Skill/classes/class.ilPersonalSkillExplorer.php");
774 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
"listSkillsForAdd"));
776 if (
$_GET[
"skpexpand"] ==
"")
782 $expanded =
$_GET[
"skpexpand"];
785 if (
$_GET[
"obj_id"] > 0)
787 $path = $this->skill_tree->getPathId(
$_GET[
"obj_id"]);
788 $exp->setForceOpenPath(
$path);
789 $exp->highlightNode(
$_GET[
"obj_id"]);
793 $exp->highlightNode($this->skill_tree->readRootId());
795 $exp->setExpand($expanded);
798 $output = $exp->getOutput();
801 if ($ilCtrl->isAsynch())
806 $tpl->setContent($output);