119 $this->ctrl = $DIC->ctrl();
120 $this->lng = $DIC->language();
121 $this->
help = $DIC[
"ilHelp"];
122 $this->setting = $DIC[
"ilSetting"];
123 $this->
user = $DIC->user();
124 $this->tpl = $DIC[
"tpl"];
125 $this->tabs = $DIC->tabs();
126 $this->toolbar = $DIC->toolbar();
127 $this->access = $DIC->access();
128 $this->ui_fac = $DIC->ui()->factory();
129 $this->ui_ren = $DIC->ui()->renderer();
130 $this->
ui = $DIC->ui();
131 $this->tree_service = $DIC->repositoryTree();
132 $this->obj_definition = $DIC[
"objDefinition"];
140 $lng->loadLanguageModule(
'skmg');
141 $ilHelp->setScreenIdComponent(
"skill");
143 $ilCtrl->saveParameter($this,
"skill_id");
144 $ilCtrl->saveParameter($this,
"tref_id");
145 $ilCtrl->saveParameter($this,
"profile_id");
146 $ilCtrl->saveParameter($this,
"list_mode");
148 $this->list_mode =
$_GET[
"list_mode"];
151 $this->cont_profiles = array();
155 $this->use_materials = !
$ilSetting->get(
"disable_personal_workspace");
180 $this->profile_id = $a_val;
190 return $this->profile_id;
200 $this->gap_self_eval_levels = $a_val;
220 $this->history_view = $a_val;
256 $this->intro_text = $a_val;
277 $this->hidden_skills[] = $a_skill_id .
":" . $a_tref_id;
290 if (count($this->user_profiles) == 0 && count($this->cont_profiles) == 0) {
293 $current_prof_id = 0;
294 if ((
int)
$_GET[
"profile_id"] > 0) {
295 foreach ($this->user_profiles as $p) {
296 if ($p[
"id"] == (
int)
$_GET[
"profile_id"]) {
297 $current_prof_id = (int) $_GET[
"profile_id"];
302 if ((
int)
$_GET[
"profile_id"] > 0 && $current_prof_id == 0) {
303 foreach ($this->cont_profiles as $p) {
304 if ($p[
"profile_id"] == (
int)
$_GET[
"profile_id"]) {
305 $current_prof_id = (int)
$_GET[
"profile_id"];
310 if ($current_prof_id == 0 && !(is_array($this->obj_skills) && $this->obj_id > 0)) {
311 $current_prof_id = $this->user_profiles[0][
"id"];
313 $ilCtrl->setParameter($this,
"profile_id", $current_prof_id);
341 $this->obj_id = $a_obj_id;
342 $this->obj_skills = $a_skills;
371 $next_class = $ilCtrl->getNextClass($this);
375 $std_cmd =
"listSkills";
377 $cmd = $ilCtrl->getCmd($std_cmd);
382 switch ($next_class) {
400 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
403 $lng->txt(
"skmg_selected_skills"),
404 $ilCtrl->getLinkTarget($this,
"render")
407 if (count($this->user_profiles) > 0) {
408 $ilCtrl->setParameter($this,
"list_mode", self::LIST_PROFILES);
411 $lng->txt(
"skmg_assigned_profiles"),
412 $ilCtrl->getLinkTarget($this,
"render")
416 $ilCtrl->clearParameterByClass(get_class($this),
"list_mode");
420 $ilTabs->activateTab($a_activate);
425 $this->offline_mode = $a_file_path;
433 switch ($this->list_mode) {
434 case self::LIST_PROFILES:
456 $tpl =
new ilTemplate(
"tpl.skill_filter.html",
true,
true,
"Services/Skill");
463 $ilToolbar->addFormButton(
464 $lng->txt(
"skmg_add_skill"),
467 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
470 $filter_toolbar->setFormAction($ilCtrl->getFormAction($this));
471 $this->
getFilter()->addToToolbar($filter_toolbar,
false);
475 foreach ($skills as $s) {
476 $path = $stree->getSkillTreePath($s[
"skill_node_id"]);
479 foreach ($path as $p) {
484 $html .= $this->
getSkillHTML($s[
"skill_node_id"], 0,
true);
490 $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"),
"applyFilter");
491 $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
492 $html =
$tpl->get() . $html;
494 $box = $this->ui_fac->messageBox()->info(
$lng->txt(
"skmg_no_skills_selected_info"));
495 $html = $this->ui_ren->render($box);
498 $main_tpl->setContent($html);
507 $this->ctrl->redirect($this,
"listSkills");
516 $this->ctrl->redirect($this,
"listAssignedProfile");
528 public function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit =
false, $a_tref_id = 0)
533 "personal_skill_html",
534 array(
"personal_skills_gui" => $this,
"top_skill_id" => $a_top_skill_id,
"user_id" => $a_user_id,
535 "edit" => $a_edit,
"tref_id" => $a_tref_id)
537 if (!$uip->replaced()) {
538 $skill_html = $this->
renderSkillHTML($a_top_skill_id, $a_user_id, $a_edit, $a_tref_id);
540 $skill_html = $uip->getHTML($skill_html);
551 public function renderSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit =
false, $a_tref_id = 0)
557 $sub_panels = array();
559 if ($a_user_id == 0) {
565 $tpl =
new ilTemplate(
"tpl.skill_pres.html",
true,
true,
"Services/Skill");
570 $tref_id = $a_tref_id;
571 $skill_id = $a_top_skill_id;
573 $tref_id = $a_top_skill_id;
576 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
578 foreach ($b_skills as $bs) {
579 $bs[
"id"] = $bs[
"skill_id"];
580 $bs[
"tref"] = $bs[
"tref_id"];
582 $path = $stree->getSkillTreePath($bs[
"id"], $bs[
"tref"]);
584 $panel_comps = array();
588 foreach ($path as $p) {
596 $level_data = $skill->getLevelData();
602 foreach ($path as $p) {
604 $title .= $sep . $p[
"title"];
606 $description = $p[
"description"];
608 if ($a_top_skill_id == $p[
"child"]) {
622 if (!$this->skmg_settings->getHideProfileBeforeSelfEval() ||
624 if ($this->
getFilter()->showTargetLevel()) {
630 if ($this->mode ==
"gap" && !$this->history_view) {
631 $panel_comps[] = $this->ui_fac->legacy($this->
getActualGapItem($level_data, $bs[
"tref"]) .
"");
632 $panel_comps[] = $this->ui_fac->legacy($this->
getSelfEvalGapItem($level_data, $bs[
"tref"]) .
"");
636 $se_rendered = ($se_date ==
"")
647 if ($se_date > $level_entry[
"status_date"] && !$se_rendered) {
650 if ($this->
getFilter()->isInRange($level_data, $level_entry)) {
651 $panel_comps[] = $this->ui_fac->legacy($this->
getEvalItem($level_data, $level_entry));
657 if ($this->mode !=
"gap") {
658 if ($this->
getFilter()->showMaterialsRessources() && $this->use_materials) {
662 $panel_comps[] = $this->ui_fac->legacy($mat);
667 if ($this->
getFilter()->showMaterialsRessources()) {
671 $panel_comps[] = $this->ui_fac->legacy($sugg);
674 $sub = $this->ui_fac->panel()->sub((
string) $title, $panel_comps);
677 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"skill_id", $a_top_skill_id);
678 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"tref_id", $bs[
"tref"]);
679 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"basic_skill_id", $bs[
"id"]);
680 if ($this->use_materials) {
681 $actions[] = $this->ui_fac->button()->shy(
682 $lng->txt(
'skmg_assign_materials'),
683 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"assignMaterials")
686 $actions[] = $this->ui_fac->button()->shy(
687 $lng->txt(
'skmg_self_evaluation'),
688 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"selfEvaluation")
690 $sub = $sub->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
693 $sub_panels[] = $sub;
695 $tpl->parseCurrentBlock();
701 $sub_panels = $this->ui_fac->legacy($des . $this->ui_ren->render($sub_panels));
703 $panel = $this->ui_fac->panel()->standard(
711 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"skill_id", $a_top_skill_id);
712 $actions[] = $this->ui_fac->button()->shy(
713 $lng->txt(
'skmg_remove_skill'),
714 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"confirmSkillRemove")
717 $panel =
$panel->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
720 return $this->ui_ren->render(
$panel);
732 if (!$this->ws_tree) {
737 $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
740 if (!$this->offline_mode) {
741 $url = $this->ws_access->getGotoLink($a_wsp_id,
$obj_id);
743 $url = $this->offline_mode .
"file_" .
$obj_id .
"/";
749 $url .= $obj->getOfflineFilename();
754 $url .= $obj->getOfflineFilename();
759 $url .= $obj->getOfflineFilename();
764 $url .= $obj->getOfflineFilename();
769 $url .= $obj->getOfflineFilename();
774 $url .= $obj->getOfflineFilename();
779 $url .= $file->getFilename();
784 return array($caption,
$url);
798 ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
799 $ilCtrl->redirect($this,
"listSkills");
813 if (
$_GET[
"skill_id"] > 0) {
816 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
818 $ilCtrl->redirect($this,
"listSkills");
821 $cgui->setFormAction($ilCtrl->getFormAction($this));
822 $cgui->setHeaderText(
$lng->txt(
"skmg_really_remove_skills"));
823 $cgui->setCancel(
$lng->txt(
"cancel"),
"listSkills");
824 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSkills");
830 $tpl->setContent($cgui->getHTML());
843 if (is_array(
$_POST[
"id"])) {
844 foreach (
$_POST[
"id"] as $n_id) {
849 ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
850 $ilCtrl->redirect($this,
"listSkills");
873 $ilTabs->setBackTarget(
875 $ilCtrl->getLinkTarget($this,
"render")
878 $ilCtrl->saveParameter($this,
"skill_id");
879 $ilCtrl->saveParameter($this,
"basic_skill_id");
880 $ilCtrl->saveParameter($this,
"tref_id");
890 $skill_id = (int) $_GET[
"skill_id"];
892 $tref_id = $_GET[
"skill_id"];
895 $bs = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
898 foreach ($bs as
$b) {
903 $cur_basic_skill_id = ((int)
$_POST[
"basic_skill_id"] > 0)
904 ? (int)
$_POST[
"basic_skill_id"]
905 : (((
int) $_GET[
"basic_skill_id"] > 0)
906 ? (
int) $_GET[
"basic_skill_id"]
909 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
911 if (count($options) > 1) {
913 $si->setOptions($options);
914 $si->setValue($cur_basic_skill_id);
915 $ilToolbar->addInputItem(
$si,
true);
916 $ilToolbar->addFormButton(
921 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
928 (
int) $_GET[
"skill_id"],
929 (
int) $_GET[
"tref_id"],
933 $tpl->setContent($tab->getHTML());
953 if (!
$ilSetting->get(
"disable_personal_workspace")) {
954 $url =
'ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace';
955 $mbox =
$ui->factory()->messageBox()->info(
$lng->txt(
"skmg_ass_materials_from_workspace"))
956 ->withLinks([
$ui->factory()->link()->standard(
957 $lng->txt(
"personal_resources"),
963 $ilCtrl->saveParameter($this,
"skill_id");
964 $ilCtrl->saveParameter($this,
"level_id");
965 $ilCtrl->saveParameter($this,
"tref_id");
966 $ilCtrl->saveParameter($this,
"basic_skill_id");
968 $ilTabs->setBackTarget(
970 $ilCtrl->getLinkTarget($this,
"assignMaterials")
975 $exp->
setTypeWhiteList(array(
"blog",
"wsrt",
"wfld",
"file",
"tstv",
"excv"));
976 $exp->setSelectableTypes(array(
"file",
"tstv",
"excv"));
977 $exp->setSelectMode(
"wsp_id",
true);
978 if ($exp->handleCommand()) {
983 $mtpl =
new ilTemplate(
"tpl.materials_selection.html",
true,
true,
"Services/Skill");
984 $mtpl->setVariable(
"EXP", $exp->getHTML());
992 $tb->setFormAction($ilCtrl->getFormAction($this));
993 $tb->setOpenFormTag(
true);
994 $tb->setCloseFormTag(
false);
995 $mtpl->setVariable(
"TOOLBAR1", $tb->getHTML());
996 $tb->setOpenFormTag(
false);
997 $tb->setCloseFormTag(
true);
998 $mtpl->setVariable(
"TOOLBAR2", $tb->getHTML());
1013 if (is_array(
$_POST[
"wsp_id"])) {
1014 foreach (
$_POST[
"wsp_id"] as $w) {
1017 (int)
$_GET[
"skill_id"],
1018 (
int)
$_GET[
"tref_id"],
1019 (int)
$_GET[
"basic_skill_id"],
1020 (
int)
$_GET[
"level_id"],
1024 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1027 $ilCtrl->saveParameter($this,
"skill_id");
1028 $ilCtrl->saveParameter($this,
"level_id");
1029 $ilCtrl->saveParameter($this,
"tref_id");
1030 $ilCtrl->saveParameter($this,
"basic_skill_id");
1032 $ilCtrl->redirect($this,
"assignMaterials");
1048 (int)
$_GET[
"tref_id"],
1049 (
int)
$_GET[
"level_id"],
1050 (int)
$_GET[
"wsp_id"]
1052 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1053 $ilCtrl->redirect($this,
"assignMaterials");
1076 $ilTabs->setBackTarget(
1078 $ilCtrl->getLinkTarget($this,
"render")
1081 $ilCtrl->saveParameter($this,
"skill_id");
1082 $ilCtrl->saveParameter($this,
"basic_skill_id");
1083 $ilCtrl->saveParameter($this,
"tref_id");
1093 $skill_id = (int) $_GET[
"skill_id"];
1095 $tref_id = $_GET[
"skill_id"];
1098 $bs = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
1102 foreach ($bs as
$b) {
1106 $cur_basic_skill_id = ((int)
$_POST[
"basic_skill_id"] > 0)
1107 ? (int)
$_POST[
"basic_skill_id"]
1108 : (((
int) $_GET[
"basic_skill_id"] > 0)
1109 ? (
int) $_GET[
"basic_skill_id"]
1112 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
1114 if (count($options) > 1) {
1116 $si->setOptions($options);
1117 $si->setValue($cur_basic_skill_id);
1118 $ilToolbar->addInputItem(
$si,
true);
1119 $ilToolbar->addFormButton(
1120 $lng->txt(
"select"),
1124 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1131 (
int) $_GET[
"skill_id"],
1132 (
int) $_GET[
"tref_id"],
1136 $tpl->setContent($tab->getHTML());
1150 (int)
$_GET[
"skill_id"],
1151 (
int)
$_GET[
"tref_id"],
1152 (int)
$_GET[
"basic_skill_id"],
1155 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1162 $ilCtrl->redirect($this,
"render");
1179 $ilTabs->setBackTarget(
1181 $ilCtrl->getLinkTarget($this,
"")
1185 if ($exp->getHasSelectableNodes()) {
1186 if (!$exp->handleCommand()) {
1187 $tpl->setContent($exp->getHTML());
1208 if (count($this->cont_profiles) == 0 && $this->obj_skills == null) {
1216 $tpl->setContent($html);
1221 $link = $this->ui_fac->link()->standard(
1222 $this->lng->txt(
"skmg_open_all_assigned_profiles"),
1223 $this->ctrl->getLinkTargetByClass([
"ilDashboardGUI",
"ilAchievementsGUI",
"ilPersonalSkillsGUI"])
1225 $box = $this->ui_fac->messageBox()->info($this->lng->txt(
"skmg_cont_profiles_info"))->withLinks([$link]);
1227 return $this->ui_ren->render($box);
1242 $cont_options = array();
1243 if (is_array($this->obj_skills) && $this->obj_id > 0) {
1245 foreach ($this->cont_profiles as $p) {
1246 $cont_options[$p[
"profile_id"]] = $p[
"title"];
1248 asort($cont_options);
1249 $options = $options + $cont_options;
1252 foreach ($this->user_profiles as $p) {
1253 $options[$p[
"id"]] = $p[
"title"];
1258 $si->setOptions($options);
1260 $ilToolbar->addInputItem(
$si,
true);
1261 $ilToolbar->addFormButton(
1262 $lng->txt(
"select"),
1265 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1276 $this->gap_mode =
"max_per_type";
1277 $this->gap_mode_type = $a_type;
1278 $this->gap_cat_title = $a_cat_title;
1279 $this->mode =
"gap";
1289 $this->gap_mode =
"max_per_object";
1290 $this->gap_mode_obj_id = $a_obj_id;
1291 $this->gap_cat_title = $a_cat_title;
1292 $this->mode =
"gap";
1304 $this->actual_levels = array();
1305 foreach ($skills as $sk) {
1307 if ($this->gap_mode ==
"max_per_type") {
1308 $max = $bs->getMaxLevelPerType($sk[
"tref_id"], $this->gap_mode_type, $user_id);
1309 $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
1310 } elseif ($this->gap_mode ==
"max_per_object") {
1312 $sub_objects = $this->tree_service->getSubTree(
1318 foreach ($sub_objects as $ref_id) {
1320 $max_tmp = $bs->getMaxLevelPerObject($sk[
"tref_id"],
$obj_id, $user_id);
1321 if ($max_tmp > $max) {
1326 $max = $bs->getMaxLevelPerObject($sk[
"tref_id"], $this->gap_mode_obj_id, $user_id);
1328 $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
1330 $max = $bs->getMaxLevel($sk[
"tref_id"], $user_id);
1331 $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
1352 if ($a_skills == null) {
1361 $intro_html = $pan->getHTML();
1366 if ($a_user_id == 0) {
1369 $user_id = $a_user_id;
1375 $this->profile_levels = $profile->getSkillLevels();
1377 foreach ($this->profile_levels as $l) {
1379 "base_skill_id" => $l[
"base_skill_id"],
1380 "tref_id" => $l[
"tref_id"],
1381 "level_id" => $l[
"level_id"]
1384 } elseif (is_array($a_skills)) {
1385 $skills = $a_skills;
1391 $incl_self_eval =
false;
1393 $incl_self_eval =
true;
1398 $all_chart_html =
"";
1401 $sw_skills = array();
1402 foreach ($skills as $sk) {
1403 if (!in_array($sk[
"base_skill_id"] .
":" . $sk[
"tref_id"], $this->hidden_skills)) {
1408 if (count($sw_skills) >= 3) {
1409 $skill_packages = array();
1411 if (count($sw_skills) < 8) {
1412 $skill_packages[1] = $sw_skills;
1414 $mod = count($sw_skills) % 7;
1415 $pkg_num = floor((count($sw_skills) - 1) / 7) + 1;
1417 foreach ($sw_skills as $k => $s) {
1418 $skill_packages[$cpkg][$k] = $s;
1419 if ($mod < 3 && count($skill_packages) == ($pkg_num - 1) && count($skill_packages[$cpkg]) == 3 + $mod) {
1421 } elseif (count($skill_packages[$cpkg]) == 7) {
1428 foreach ($skill_packages as $pskills) {
1431 $leg_labels = array();
1436 foreach ($pskills as $k => $l) {
1440 $levels = $bs->getLevelData();
1442 foreach ($levels as $lv) {
1444 if ($l[
"level_id"] == $lv[
"id"]) {
1445 $pskills[$k][
"target_cnt"] = $cnt;
1447 if ($this->actual_levels[$l[
"base_skill_id"]][$l[
"tref_id"]] == $lv[
"id"]) {
1448 $pskills[$k][
"actual_cnt"] = $cnt;
1450 if ($incl_self_eval) {
1451 if ($self_vals[$l[
"base_skill_id"]][$l[
"tref_id"]] == $lv[
"id"]) {
1452 $pskills[$k][
"self_cnt"] = $cnt;
1455 $max_cnt = max($max_cnt, $cnt);
1460 $chart->setsize(800, 300);
1461 $chart->setYAxisMax($max_cnt);
1462 $chart->setLegLabels($leg_labels);
1465 $cd = $chart->getDataInstance();
1466 $cd->setLabel(
$lng->txt(
"skmg_target_level"));
1467 $cd->setFill(
true,
"#A0A0A0");
1470 $cd2 = $chart->getDataInstance();
1471 if ($this->gap_cat_title !=
"") {
1472 $cd2->setLabel($this->gap_cat_title);
1473 } elseif ($this->gap_mode ==
"max_per_type") {
1474 $cd2->setLabel(
$lng->txt(
"objs_" . $this->gap_mode_type));
1475 } elseif ($this->gap_mode ==
"max_per_object") {
1479 $cd2->setFill(
true,
"#FF8080");
1480 $cd2->setFill(
true,
"#cc8466");
1483 if ($incl_self_eval) {
1484 $cd3 = $chart->getDataInstance();
1485 $cd3->setLabel(
$lng->txt(
"skmg_self_evaluation"));
1486 $cd3->setFill(
true,
"#6ea03c");
1491 foreach ($pskills as $pl) {
1492 $cd->addPoint($cnt, (
int) $pl[
"target_cnt"]);
1493 $cd2->addPoint($cnt, (
int) $pl[
"actual_cnt"]);
1494 if ($incl_self_eval) {
1495 $cd3->addPoint($cnt, (
int) $pl[
"self_cnt"]);
1502 $chart->addData($cd);
1504 $chart->addData($cd2);
1506 $chart->addData($cd3);
1509 if ($pkg_cnt == 1) {
1511 $chart->setLegend($lg);
1514 $chart_html = $chart->getHTML();
1515 $all_chart_html .= $chart_html;
1520 $pan->setBody($all_chart_html);
1521 $all_chart_html = $pan->getHTML();
1530 $skills = $vtree->getOrderedNodeset($skills,
"base_skill_id",
"tref_id");
1532 foreach ($skills as $s) {
1533 $path = $stree->getSkillTreePath($s[
"base_skill_id"]);
1536 foreach ($path as $p) {
1541 $html .= $this->
getSkillHTML($s[
"base_skill_id"], $user_id,
false, $s[
"tref_id"]);
1546 return $intro_html . $all_chart_html . $html;
1558 $ilCtrl->setParameter($this,
"profile_id",
$_POST[
"profile_id"]);
1559 if ($this->mode ==
"gap") {
1560 $ilCtrl->redirect($this,
"listProfilesForGap");
1562 $ilCtrl->redirect($this,
"listAssignedProfile");
1577 if ($a_user_id == 0) {
1578 $a_user_id =
$ilUser->getId();
1583 foreach ($a_levels as $v) {
1597 $tpl =
new ilTemplate(
"tpl.skill_materials.html",
true,
true,
"Services/Skill");
1598 foreach ($a_levels as $k => $v) {
1605 $tpl->setCurrentBlock(
"material");
1607 $tpl->setVariable(
"HREF_LINK", $mat_data[1]);
1608 $tpl->setVariable(
"TXT_LINK", $mat_data[0]);
1609 $tpl->parseCurrentBlock();
1613 $tpl->setCurrentBlock(
"level");
1614 $tpl->setVariable(
"LEVEL_VAL", $v[
"title"]);
1615 $tpl->parseCurrentBlock();
1618 $tpl->setVariable(
"TXT_MATERIAL",
$lng->txt(
"skmg_materials"));
1634 $profile_levels = $profile->getSkillLevels();
1636 $a_activated_levels = array();
1638 foreach ($a_levels as $k => $v) {
1639 foreach ($profile_levels as $pl) {
1640 if ($pl[
"level_id"] == $v[
"id"] &&
1641 $pl[
"base_skill_id"] == $v[
"skill_id"] &&
1642 $a_tref_id == $pl[
"tref_id"]) {
1643 $a_activated_levels[] = $pl[
"level_id"];
1648 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"Services/Skill");
1649 $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
1651 $tpl->setVariable(
"TYPE",
$lng->txt(
"skmg_target_level"));
1652 $tpl->setVariable(
"TITLE",
"");
1667 $a_activated_levels = array();
1668 foreach ($a_levels as $k => $v) {
1669 if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
1670 $a_activated_levels[] = $v[
"id"];
1674 if ($this->gap_cat_title !=
"") {
1675 $title = $this->gap_cat_title;
1676 } elseif ($this->gap_mode ==
"max_per_type") {
1677 $title =
$lng->txt(
"objs_" . $this->gap_mode_type);
1678 } elseif ($this->gap_mode ==
"max_per_object") {
1682 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"Services/Skill");
1683 $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
1686 $tpl->setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_" .
$type));
1692 if ($title !=
$lng->txt(
"skmg_eval_type_" .
$type)) {
1693 $tpl->setVariable(
"TITLE", $title);
1710 if (count($self_vals) == 0) {
1714 $a_activated_levels = array();
1715 foreach ($a_levels as $k => $v) {
1716 if ($self_vals[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
1717 $a_activated_levels[] = $v[
"id"];
1721 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"Services/Skill");
1722 $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
1725 $tpl->setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_" .
$type));
1745 if (!is_array($a_activated_levels)) {
1746 $a_activated_levels = array($a_activated_levels);
1749 foreach ($a_levels as $level) {
1750 $vals[$level[
"title"]] = (in_array($level[
"id"], $a_activated_levels));
1752 $scale_bar = $this->ui_fac->chart()->scaleBar($vals);
1754 return $this->ui_ren->render($scale_bar);
1768 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"Services/Skill");
1769 $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_level_entry[
"level_id"]));
1773 if ($a_level_entry[
"self_eval"] == 1) {
1777 if ($a_level_entry[
"trigger_obj_type"] ==
"tst") {
1783 if ($a_level_entry[
"trigger_obj_id"] > 0) {
1787 $title = $del_data[
"title"];
1789 $title = ($a_level_entry[
"trigger_title"]) ??
"";
1793 if ($a_level_entry[
"trigger_ref_id"] > 0
1794 && $ilAccess->checkAccess(
"read",
"", $a_level_entry[
"trigger_ref_id"])) {
1795 $title =
"<a href='" .
ilLink::_getLink($a_level_entry[
"trigger_ref_id"]) .
"'>" . $title .
"</a>";
1798 $tpl->setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_" .
$type));
1803 $tpl->setVariable(
"TITLE", $title);
1824 $tpl =
new ilTemplate(
"tpl.skill_description_category.html",
true,
true,
"Services/Skill");
1828 if (!is_null($des) && !empty($des)) {
1829 $tpl->setCurrentBlock(
"description_category");
1830 $tpl->setVariable(
"DESCRIPTION_CATEGORY", $des);
1831 $tpl->parseCurrentBlock();
1847 $tpl =
new ilTemplate(
"tpl.skill_description_basic.html",
true,
true,
"Services/Skill");
1849 if (!is_null($description) && !empty($description)) {
1850 $tpl->setCurrentBlock(
"description_basic");
1851 $tpl->setVariable(
"DESCRIPTION_BASIC", $description);
1852 $tpl->parseCurrentBlock();
1866 $level_data = $skill->getLevelData();
1867 $tpl =
new ilTemplate(
"tpl.skill_desc.html",
true,
true,
"Services/Skill");
1869 $desc_exists =
false;
1870 foreach ($level_data as $l) {
1871 if ($l[
"description"] !=
"") {
1872 $desc_exists =
true;
1877 foreach ($level_data as $l) {
1878 $tpl->setCurrentBlock(
"level");
1879 $tpl->setVariable(
"LEVEL_VAL", $l[
"title"]);
1880 $tpl->setVariable(
"LEVEL_DESC", nl2br($l[
"description"]));
1881 $tpl->parseCurrentBlock();
1898 $tpl =
new ilTemplate(
"tpl.suggested_resources.html",
true,
true,
"Services/Skill");
1901 if ($a_profile_id > 0) {
1903 $current_target_level = 0;
1905 foreach ($a_levels as $k => $v) {
1906 foreach ($this->profile_levels as $pl) {
1907 if ($pl[
"level_id"] == $v[
"id"] &&
1908 $pl[
"base_skill_id"] == $v[
"skill_id"]) {
1910 $current_target_level = $v[
"id"];
1914 if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
1920 if ($this->skmg_settings->getHideProfileBeforeSelfEval() &&
1922 $tpl->setVariable(
"SUGGESTED_MAT_MESS",
$lng->txt(
"skmg_skill_needs_self_eval"));
1929 $res = $skill_res->getResources();
1930 $imp_resources = array();
1931 foreach (
$res as $level) {
1932 foreach ($level as $r) {
1933 if ($r[
"imparting"] ==
true &&
1934 $current_target_level == $r[
"level_id"]) {
1935 $imp_resources[] = $r;
1939 foreach ($imp_resources as $r) {
1940 $ref_id = $r[
"rep_ref_id"];
1943 $tpl->setCurrentBlock(
"resource_item");
1944 $tpl->setVariable(
"TXT_RES", $title);
1946 $tpl->parseCurrentBlock();
1948 if (count($imp_resources) > 0) {
1949 $tpl->touchBlock(
"resources_list");
1950 $tpl->setVariable(
"SUGGESTED_MAT_MESS",
$lng->txt(
"skmg_skill_needs_impr_res"));
1953 $tpl->setVariable(
"SUGGESTED_MAT_MESS",
$lng->txt(
"skmg_skill_needs_impr_no_res"));
1957 $tpl->setVariable(
"SUGGESTED_MAT_MESS",
$lng->txt(
"skmg_skill_no_needs_impr"));
1963 $res = $skill_res->getResources();
1966 foreach (
$res as $level) {
1969 foreach ($level as $r) {
1970 if ($r[
"imparting"]) {
1971 $ref_id = $r[
"rep_ref_id"];
1974 $tpl->setCurrentBlock(
"resource_item");
1975 $tpl->setVariable(
"TXT_RES", $title);
1977 $tpl->parseCurrentBlock();
1980 $cl = $r[
"level_id"];
1984 $tpl->setCurrentBlock(
"resources_list_level");
1985 $tpl->setVariable(
"TXT_LEVEL",
$lng->txt(
"skmg_level"));
1987 $tpl->parseCurrentBlock();
1988 $tpl->touchBlock(
"resources_list");
1992 $tpl->setVariable(
"SUGGESTED_MAT_MESS",
$lng->txt(
"skmg_suggested_resources"));
2012 $tpl =
new ilTemplate(
"tpl.skill_filter.html",
true,
true,
"Services/Skill");
2020 $filter_toolbar->setFormAction($ilCtrl->getFormAction($this));
2021 $this->
getFilter()->addToToolbar($filter_toolbar,
true);
2026 $this->profile_levels = $profile->getSkillLevels();
2028 foreach ($this->profile_levels as $l) {
2030 "base_skill_id" => $l[
"base_skill_id"],
2031 "tref_id" => $l[
"tref_id"],
2032 "level_id" => $l[
"level_id"]
2041 $not_all_self_evaluated =
false;
2042 foreach ($skills as $s) {
2043 if ($this->skmg_settings->getHideProfileBeforeSelfEval() &&
2045 $not_all_self_evaluated =
true;
2049 $html .= $this->
getSkillHTML($s[
"base_skill_id"], 0,
true, $s[
"tref_id"]);
2053 $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"),
"applyFilterAssignedProfiles");
2055 $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
2057 $html =
$tpl->get() . $html;
2060 if ($not_all_self_evaluated) {
2061 $box = $this->ui_fac->messageBox()->info(
$lng->txt(
"skmg_skill_needs_self_eval_box"));
2062 $html = $this->ui_ren->render($box) . $html;
2065 $main_tpl->setContent($html);
getSkillCategoryDescription(int $skill_id, int $tref_id)
Get description for skill category.
getTriggerObjectsFilter()
saveSelfEvaluation()
Save self evaluation.
hideSkill($a_skill_id, $a_tref_id=0)
Hide skill.
setGapAnalysisSelfEvalLevels(array $a_val)
Set self evaluation levels for gap analysis.
setProfileId($a_val)
Set profile id.
setObjectSkillProfiles(ilContainerGlobalProfiles $a_g_profiles, ilContainerLocalProfiles $a_l_profils)
Set object skill profiles.
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
Skill management settings.
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
getMaterialInfo($a_wsp_id, $a_user_id)
Get material file name and goto url.
static getSupportedObjectTypes()
const PANEL_STYLE_PRIMARY
listAssignedProfile()
List profile.
getProfiles()
Get profiles.
getMaterials($a_levels, $a_tref_id=0, $a_user_id=0)
Get materials.
getHistoryView()
Get history view.
Explorer for selecting a personal skill.
getProfileId()
Get profile id.
Access handler for personal workspace.
static setUseRelativeDates($a_status)
set use relative dates
static _lookupTitle($a_id)
lookup object title
addSkill()
Add personal skill.
getSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Get skill presentation HTML.
setTabs($a_activate)
Set tabs.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
Filter for personal skills.
getEvalItem($a_levels, $a_level_entry)
Get eval item.
static saveSelfEvaluation($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level)
Save self evaluation.
static lookupLevelTitle(int $a_id)
renderSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Render skill html.
applyFilter()
Apply filter.
getGapAnalysisHTML($a_user_id=0, $a_skills=null)
Get gap analysis html.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
Assign materials to skill levels table.
static _getAllReferences($a_id)
get all reference ids of object
removeMaterial()
Remove material.
Tree handler for personal workspace.
static hasSelfEvaluated(int $a_user_id, int $a_skill_id, int $a_tref_id)
setTypeWhiteList($a_val)
Set type white list.
static _lookupObjectId($a_ref_id)
lookup object id
static _lookupType($a_obj_id)
Lookup Type.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
assignMaterial()
Assign materials to skill level.
Personal skills GUI class.
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
static getProfilesOfUser($a_user_id)
Get profiles of a user.
getActualGapItem($a_levels, $a_tref_id=0)
selfEvaluation()
Assign materials to skill levels.
getGapAnalysisSelfEvalLevels()
Get self evaluation levels for gap analysis.
getIntroText()
Get intro text.
foreach($_POST as $key=> $value) $res
selectMaterial()
Select material.
static getInstance($a_id=0)
static removeSkill($a_user_id, $a_skill_node_id)
Remove personal skill.
setIntroText($a_val)
Set intro text.
Global competence profiles of a container.
Self evaluation, second simplier implementation.
getActualLevels($skills, $user_id)
Get actual levels.
getProfiles()
Get profiles.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getSuggestedResources($a_profile_id, $a_levels, $a_base_skill, $a_tref_id)
Render suggested resources.
static _lookupDescription($a_obj_id)
Lookup Description.
static _lookupObjId($a_id)
applyFilterAssignedProfiles()
Apply filter for profiles view.
Manages resources for skills.
determineCurrentProfile()
Determine current profile id.
Explorer for selecting a personal workspace item.
getSelfEvalGapItem($a_levels, $a_tref_id=0)
static addPersonalSkill($a_user_id, $a_skill_node_id)
Add personal skill.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
setHistoryView($a_val)
Set history view.
listProfilesForGap()
List profiles.
listSkillsForAdd()
LIst skills for adding.
showProfileSelectorToolbar()
Show profile selector toolbar.
selectProfile()
Select profile.
static _lookupType($a_id, $a_reference=false)
lookup object type
setOfflineMode($a_file_path)
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
getSkillLevelDescription($skill)
Get level description.
Local competence profiles of a container.
static getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
static getInstance()
Get instance.
assignMaterials()
Assign materials to skill levels.
static countAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
getProfileTargetItem($a_profile_id, $a_levels, $a_tref_id=0)
Get profile target item.
setGapAnalysisActualStatusModePerType($a_type, $a_cat_title="")
Set gap analysis actual status mode "per type".
executeCommand()
Execute command.
getBasicSkillDescription(string $description)
Get description for basic skill.
setObjectSkills($a_obj_id, $a_skills=null)
Set object skills.
setTriggerObjectsFilter($trigger_objects_filter)
confirmSkillRemove()
Confirm skill remove.
static getSelfEvaluationDate($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill)
Get self evaluation.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static getInstanceByType($a_type, $a_id)
Get type instance.
static removeMaterial($a_user_id, $a_tref_id, $a_level_id, $a_wsp_id)
Remove material.
Confirmation screen class.
static assignMaterial($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level, $a_wsp_id)
Assign material to skill level.
removeSkills()
Remove skills.
setGapAnalysisActualStatusModePerObject($a_obj_id, $a_cat_title="")
Set gap analysis actual status mode "per object".