ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjSkillManagementGUI.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2020 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
17 protected $rbacsystem;
18
22 protected $error;
23
27 protected $tabs;
28
29 protected $skill_tree;
30
36 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
37 {
38 global $DIC;
39
40 $this->ctrl = $DIC->ctrl();
41 $this->rbacsystem = $DIC->rbac()->system();
42 $this->error = $DIC["ilErr"];
43 $this->access = $DIC->access();
44 $this->tabs = $DIC->tabs();
45 $this->lng = $DIC->language();
46 $this->settings = $DIC->settings();
47 $this->tpl = $DIC["tpl"];
48 $this->toolbar = $DIC->toolbar();
49 $this->user = $DIC->user();
50 $ilCtrl = $DIC->ctrl();
51
52 $this->tool_context = $DIC->globalScreen()->tool()->context();
53
54 $this->type = 'skmg';
55 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
56
57 $this->lng->loadLanguageModule('skmg');
58
59 $this->skill_tree = new ilSkillTree();
60
61 $ilCtrl->saveParameter($this, "obj_id");
62 }
63
70 public function executeCommand()
71 {
74 $ilTabs = $this->tabs;
75
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd();
78
79 $this->prepareOutput();
80
81
82 if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
83 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
84 }
85
86 switch ($next_class) {
87 case 'ilskillrootgui':
88 $skrt_gui = new ilSkillRootGUI((int) $_GET["obj_id"], $this);
89 $skrt_gui->setParentGUI($this);
90 $ret = $this->ctrl->forwardCommand($skrt_gui);
91 break;
92
93 case 'ilskillcategorygui':
94 $this->tabs_gui->activateTab("skills");
95 $scat_gui = new ilSkillCategoryGUI((int) $_GET["obj_id"]);
96 $scat_gui->setParentGUI($this);
97 $this->showTree(false, $scat_gui, "listItems");
98 $ret = $this->ctrl->forwardCommand($scat_gui);
99 break;
100
101 case 'ilbasicskillgui':
102 $this->tabs_gui->activateTab("skills");
103 $skill_gui = new ilBasicSkillGUI((int) $_GET["obj_id"]);
104 $skill_gui->setParentGUI($this);
105 $this->showTree(false, $skill_gui, "edit");
106 $ret = $this->ctrl->forwardCommand($skill_gui);
107 break;
108
109 case 'ilskilltemplatecategorygui':
110 $this->tabs_gui->activateTab("skill_templates");
111 $sctp_gui = new ilSkillTemplateCategoryGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
112 $sctp_gui->setParentGUI($this);
113 $this->showTree(((int) $_GET["tref_id"] == 0), $sctp_gui, "listItems");
114 $ret = $this->ctrl->forwardCommand($sctp_gui);
115 break;
116
117 case 'ilbasicskilltemplategui':
118 $this->tabs_gui->activateTab("skill_templates");
119 $sktp_gui = new ilBasicSkillTemplateGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
120 $sktp_gui->setParentGUI($this);
121 $this->showTree(((int) $_GET["tref_id"] == 0), $sktp_gui, "edit");
122 $ret = $this->ctrl->forwardCommand($sktp_gui);
123 break;
124
125 case 'ilskilltemplatereferencegui':
126 $this->tabs_gui->activateTab("skills");
127 $sktr_gui = new ilSkillTemplateReferenceGUI((int) $_GET["tref_id"]);
128 $sktr_gui->setParentGUI($this);
129 $this->showTree(false, $sktr_gui, "listItems");
130 $ret = $this->ctrl->forwardCommand($sktr_gui);
131 break;
132
133 case "ilskillprofilegui":
134 $ilTabs->activateTab("profiles");
135 $skprof_gui = new ilSkillProfileGUI();
136 $ret = $this->ctrl->forwardCommand($skprof_gui);
137 break;
138
139 case 'ilpermissiongui':
140 $this->tabs_gui->activateTab('permissions');
141 $perm_gui = new ilPermissionGUI($this);
142 $ret = $this->ctrl->forwardCommand($perm_gui);
143 break;
144
145 case "ilexportgui":
146 $this->tabs_gui->activateTab('export');
147 $exp_gui = new ilExportGUI($this);
148 $exp_gui->addFormat("xml");
149 //$exp_gui->addFormat("html", "", $this, "exportHTML");
150 $ret = $this->ctrl->forwardCommand($exp_gui);
151 break;
152
153 default:
154 if (!$cmd || $cmd == 'view') {
155 $cmd = "editSkills";
156 }
157
158 if ($cmd == "showTree") {
159 $this->showTree($_GET["templates_tree"]);
160 } else {
161 $this->$cmd();
162 }
163 break;
164 }
165 return true;
166 }
167
174 public function getAdminTabs()
175 {
177 $ilAccess = $this->access;
179
180 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
181 $this->tabs_gui->addTab(
182 "skills",
183 $lng->txt("skmg_skills"),
184 $this->ctrl->getLinkTarget($this, "editSkills")
185 );
186
187 $this->tabs_gui->addTab(
188 "skill_templates",
189 $lng->txt("skmg_skill_templates"),
190 $this->ctrl->getLinkTarget($this, "editSkillTemplates")
191 );
192
193 $this->tabs_gui->addTab(
194 "profiles",
195 $lng->txt("skmg_skill_profiles"),
196 $this->ctrl->getLinkTargetByClass("ilskillprofilegui")
197 );
198
199 $this->tabs_gui->addTab(
200 "settings",
201 $lng->txt("settings"),
202 $this->ctrl->getLinkTarget($this, "editSettings")
203 );
204
205 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
206 $this->tabs_gui->addTab(
207 "export",
208 $lng->txt("export"),
209 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
210 );
211 }
212
213 if (DEVMODE == 1) {
214 $this->tabs_gui->addTab(
215 "test",
216 "Test (DEVMODE)",
217 $this->ctrl->getLinkTarget($this, "test")
218 );
219 }
220 }
221
222 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
223 $this->tabs_gui->addTab(
224 "permissions",
225 $lng->txt("perm_settings"),
226 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
227 );
228 }
229 }
230
234 public function editSettings()
235 {
236 $ilCtrl = $this->ctrl;
238 $ilTabs = $this->tabs;
239
240 $ilTabs->activateTab("settings");
241
242 $skmg_set = new ilSkillManagementSettings();
243 $enable_skmg = $skmg_set->isActivated();
244
245 $form = new ilPropertyFormGUI();
246 $form->setFormAction($ilCtrl->getFormAction($this));
247 $form->setTitle($lng->txt("skmg_settings"));
248
249 // Enable skill management
250 $cb_prop = new ilCheckboxInputGUI(
251 $lng->txt("skmg_enable_skmg"),
252 "enable_skmg"
253 );
254 $cb_prop->setValue("1");
255 $cb_prop->setChecked($enable_skmg);
256 $form->addItem($cb_prop);
257
258 // Hide Competence Profile Data before Self-Assessment
259 $cb_prop = new ilCheckboxInputGUI(
260 $lng->txt("skmg_hide_profile_self_eval"),
261 "hide_profile_self_eval"
262 );
263 $cb_prop->setValue("1");
264 $cb_prop->setInfo($lng->txt("skmg_hide_profile_self_eval_info"));
265 $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
266 $form->addItem($cb_prop);
267
268 // Allow local assignment of global profiles
269 $cb_prop = new ilCheckboxInputGUI(
270 $lng->txt("skmg_local_assignment_profiles"),
271 "local_assignment_profiles"
272 );
273 $cb_prop->setValue("1");
274 $cb_prop->setChecked($skmg_set->getLocalAssignmentOfProfiles());
275 $form->addItem($cb_prop);
276
277 // Allow creation of local profiles
278 $cb_prop = new ilCheckboxInputGUI(
279 $lng->txt("skmg_allow_local_profiles"),
280 "allow_local_profiles"
281 );
282 $cb_prop->setValue("1");
283 $cb_prop->setInfo($lng->txt("skmg_allow_local_profiles_info"));
284 $cb_prop->setChecked($skmg_set->getAllowLocalProfiles());
285 $form->addItem($cb_prop);
286
287 // command buttons
288 if ($this->checkPermissionBool("write")) {
289 $form->addCommandButton("saveSettings", $lng->txt("save"));
290 }
291
292 $this->tpl->setContent($form->getHTML());
293 }
294
298 public function saveSettings()
299 {
300 $ilCtrl = $this->ctrl;
302
303 if (!$this->checkPermissionBool("write")) {
304 return;
305 }
306
307 $skmg_set = new ilSkillManagementSettings();
308 $skmg_set->activate((int) $_POST["enable_skmg"]);
309 $skmg_set->setHideProfileBeforeSelfEval((int) $_POST["hide_profile_self_eval"]);
310 $skmg_set->setLocalAssignmentOfProfiles((int) $_POST["local_assignment_profiles"]);
311 $skmg_set->setAllowLocalProfiles((int) $_POST["allow_local_profiles"]);
312
313 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
314
315 $ilCtrl->redirect($this, "editSettings");
316 }
317
321 public function editSkills()
322 {
324 $ilTabs = $this->tabs;
326 $ilCtrl = $this->ctrl;
327
328 $ilTabs->activateTab("skills");
329
330 $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
331 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
332 }
333
334
338 public function saveAllTitles($a_succ_mess = true)
339 {
340 $ilCtrl = $this->ctrl;
342
343 if (is_array($_POST["title"])) {
344 foreach ($_POST["title"] as $id => $title) {
346 if (is_object($node_obj)) {
347 // update title
349 }
350 }
351 if ($a_succ_mess) {
352 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
353 }
354 }
355 $ilCtrl->redirect($this, "editSkills");
356 }
357
361 public function saveAllTemplateTitles($a_succ_mess = true)
362 {
363 $ilCtrl = $this->ctrl;
365
366 if (is_array($_POST["title"])) {
367 foreach ($_POST["title"] as $id => $title) {
369 if (is_object($node_obj)) {
370 // update title
372 }
373 }
374 if ($a_succ_mess) {
375 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
376 }
377 }
378 $ilCtrl->redirect($this, "editSkillTemplates");
379 }
380
381
385 public function expandAll($a_redirect = true)
386 {
387 $_GET["skexpand"] = "";
388 $n_id = ($_GET["obj_id"] > 0)
389 ? $_GET["obj_id"]
390 : $this->skill_tree->readRootId();
391 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
392 $n_arr = array();
393 foreach ($stree as $n) {
394 $n_arr[] = $n["child"];
395 $_SESSION["skexpand"] = $n_arr;
396 }
397 $this->saveAllTitles(false);
398 }
399
403 public function collapseAll($a_redirect = true)
404 {
405 $_GET["skexpand"] = "";
406 $n_id = ($_GET["obj_id"] > 0)
407 ? $_GET["obj_id"]
408 : $this->skill_tree->readRootId();
409 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
410 $old = $_SESSION["skexpand"];
411 foreach ($stree as $n) {
412 if (in_array($n["child"], $old) && $n["child"] != $n_id) {
413 $k = array_search($n["child"], $old);
414 unset($old[$k]);
415 }
416 }
417 $_SESSION["skexpand"] = $old;
418 $this->saveAllTitles(false);
419 }
420
424 public function deleteNodes($a_gui)
425 {
428 $ilCtrl = $this->ctrl;
429 $ilTabs = $this->tabs;
430 $ilToolbar = $this->toolbar;
431
432 if (!isset($_POST["id"])) {
433 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
434 }
435
436 $ilTabs->clearTargets();
437
438 // check usages
439 $mode = "";
440 $cskill_ids = array();
441 foreach ($_POST["id"] as $id) {
442 if (in_array(ilSkillTreeNode::_lookupType($id), array("skll", "scat", "sktr"))) {
443 if ($mode == "templates") {
444 $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
445 }
446 $mode = "basic";
447 $skill_id = $id;
448 $tref_id = 0;
449 if (ilSkillTreeNode::_lookupType($id) == "sktr") {
451 $tref_id = $id;
452 }
453 $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
454 }
455 if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp"))) {
456 if ($mode == "basic") {
457 $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
458 }
459 $mode = "templates";
460
462 $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
463 }
464 }
465 // for cats, skills and template references, get "real" usages
466 // for skill and category templates check usage in references
467 }
468
469 if ($mode == "basic" || $mode == "templates") {
470 $u = new ilSkillUsage();
471 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
472 if (count($usages) > 0) {
473 $html = "";
474 foreach ($usages as $k => $usage) {
475 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
476 $html .= $tab->getHTML() . "<br/><br/>";
477 }
478 $tpl->setContent($html);
479 $ilCtrl->saveParameter($a_gui, "tmpmode");
480 $ilToolbar->addButton(
481 $lng->txt("back"),
482 $ilCtrl->getLinkTarget($a_gui, "cancelDelete")
483 );
484 ilUtil::sendFailure($lng->txt("skmg_cannot_delete_nodes_in_use"));
485 return;
486 }
487 } else {
488 $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
489 }
490
491 // SAVE POST VALUES
492 $_SESSION["saved_post"] = $_POST["id"];
493
494 $confirmation_gui = new ilConfirmationGUI();
495
496 $ilCtrl->setParameter($a_gui, "tmpmode", $_GET["tmpmode"]);
497 $a_form_action = $this->ctrl->getFormAction($a_gui);
498 $confirmation_gui->setFormAction($a_form_action);
499 $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
500
501 // Add items to delete
502 foreach ($_POST["id"] as $id) {
503 if ($id != IL_FIRST_NODE) {
505 $obj_title = (!in_array($node_obj->getType(), ["sktp", "sctp"]))
506 ? $node_obj->getTitle()
507 : $node_obj->getTitle() .
508 " (" .
509 $this->lng->txt("skmg_count_references") . " " .
511 ")";
512
513 $confirmation_gui->addItem(
514 "id[]",
515 $node_obj->getId(),
516 $obj_title,
517 ilUtil::getImagePath("icon_" . $node_obj->getType() . ".svg")
518 );
519 }
520 }
521
522 $confirmation_gui->setCancel($lng->txt("cancel"), "cancelDelete");
523 $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
524
525 $tpl->setContent($confirmation_gui->getHTML());
526 }
527
531 public function cancelDelete()
532 {
533 $this->ctrl->redirect($this, "editSkills");
534 }
535
539 public function confirmedDelete()
540 {
541 $ilCtrl = $this->ctrl;
542
543 // delete all selected objects
544 foreach ($_POST["id"] as $id) {
545 if ($id != IL_FIRST_NODE) {
547 $node_data = $this->skill_tree->getNodeData($id);
548 if (is_object($obj)) {
549 $obj->delete();
550 }
551 if ($this->skill_tree->isInTree($id)) {
552 $this->skill_tree->deleteTree($node_data);
553 }
554 }
555 }
556
557 // feedback
558 ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
559 }
560
561 //
562 //
563 // Test
564 //
565 //
566
573 public function test()
574 {
577 $ilCtrl = $this->ctrl;
578 $ilTabs = $this->tabs;
579
580 $this->setTestSubTabs("test");
581
582 $ilTabs->activateTab("test");
583
584 $this->form = new ilPropertyFormGUI();
585
586 if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
587 $this->form->addCommandButton("test", $lng->txt("execute"));
588 }
589
590 $this->form->setTitle("getCompletionDateForTriggerRefId()");
591 $this->form->setFormAction($ilCtrl->getFormAction($this));
592
593 // user id
594 $ti = new ilTextInputGUI("User ID(s)", "user_id");
595 $ti->setMaxLength(200);
596 $ti->setInfo("Separate multiple IDs by :");
597 $ti->setValue($_POST["user_id"]);
598 $this->form->addItem($ti);
599
600 // ref id
601 $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
602 $ti->setMaxLength(200);
603 $ti->setInfo("Separate multiple IDs by :");
604 $ti->setValue($_POST["ref_id"]);
605 $this->form->addItem($ti);
606
607 $result = "";
608 if (isset($_POST["user_id"])) {
609 $user_ids = explode(":", $_POST["user_id"]);
610 $ref_ids = explode(":", $_POST["ref_id"]);
611 if (count($user_ids) <= 1) {
612 $user_ids = $user_ids[0];
613 }
614 if (count($ref_ids) == 1) {
615 $ref_ids = $ref_ids[0];
616 } elseif (count($ref_ids) == 0) {
617 $ref_ids = null;
618 }
619
620 $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
621 $result = "<br />Result:<br />" . var_export($result, true);
622 }
623
624 $tpl->setContent($this->form->getHTML() . $result);
625 }
626
633 public function testCert()
634 {
637 $ilCtrl = $this->ctrl;
638 $ilTabs = $this->tabs;
639
640 $this->setTestSubTabs("cert");
641 $ilTabs->activateTab("test");
642
643 $this->form = new ilPropertyFormGUI();
644
645 if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
646 $this->form->addCommandButton("testCert", $lng->txt("execute"));
647 }
648
649 $this->form->setTitle("checkUserCertificateForTriggerRefId()");
650 $this->form->setFormAction($ilCtrl->getFormAction($this));
651
652 // user id
653 $ti = new ilTextInputGUI("User ID(s)", "user_id");
654 $ti->setMaxLength(200);
655 $ti->setInfo("Separate multiple IDs by :");
656 $ti->setValue($_POST["user_id"]);
657 $this->form->addItem($ti);
658
659 // ref id
660 $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
661 $ti->setMaxLength(200);
662 $ti->setInfo("Separate multiple IDs by :");
663 $ti->setValue($_POST["ref_id"]);
664 $this->form->addItem($ti);
665
666 $result = "";
667 if (isset($_POST["user_id"])) {
668 $user_ids = explode(":", $_POST["user_id"]);
669 $ref_ids = explode(":", $_POST["ref_id"]);
670 if (count($user_ids) <= 1) {
671 $user_ids = $user_ids[0];
672 }
673 if (count($ref_ids) == 1) {
674 $ref_ids = $ref_ids[0];
675 } elseif (count($ref_ids) == 0) {
676 $ref_ids = null;
677 }
678
679 $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
680 $result = "<br />Result:<br />" . var_export($result, true);
681 }
682
683 $tpl->setContent($this->form->getHTML() . $result);
684 }
685
692 public function testAllCert()
693 {
696 $ilCtrl = $this->ctrl;
697 $ilTabs = $this->tabs;
698
699 $this->setTestSubTabs("all_cert");
700 $ilTabs->activateTab("test");
701
702 $this->form = new ilPropertyFormGUI();
703
704 if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
705 $this->form->addCommandButton("testAllCert", $lng->txt("execute"));
706 }
707
708 $this->form->setTitle("getTriggerOfAllCertificates()");
709 $this->form->setFormAction($ilCtrl->getFormAction($this));
710
711 // user id
712 $ti = new ilTextInputGUI("User ID(s)", "user_id");
713 $ti->setMaxLength(200);
714 $ti->setInfo("Separate multiple IDs by :");
715 $ti->setValue($_POST["user_id"]);
716 $this->form->addItem($ti);
717
718 $result = "";
719 if (isset($_POST["user_id"])) {
720 $user_ids = explode(":", $_POST["user_id"]);
721 $ref_ids = explode(":", $_POST["ref_id"]);
722 if (count($user_ids) <= 1) {
723 $user_ids = $user_ids[0];
724 }
725
726 $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
727 $result = "<br />Result:<br />" . var_export($result, true);
728 }
729
730 $tpl->setContent($this->form->getHTML() . $result);
731 }
732
739 public function testLevels()
740 {
743 $ilCtrl = $this->ctrl;
744 $ilTabs = $this->tabs;
745
746 $this->setTestSubTabs("levels");
747 $ilTabs->activateTab("test");
748
749 $this->form = new ilPropertyFormGUI();
750
751 if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
752 $this->form->addCommandButton("testLevels", $lng->txt("execute"));
753 }
754
755 $this->form->setTitle("getTriggerOfAllCertificates()");
756 $this->form->setFormAction($ilCtrl->getFormAction($this));
757
758 // user id
759 $ti = new ilTextInputGUI("Ref ID", "ref_id");
760 $ti->setMaxLength(200);
761 $ti->setValue($_POST["ref_id"]);
762 $this->form->addItem($ti);
763
764 $result = "";
765 if (isset($_POST["ref_id"])) {
766 $result = ilBasicSkill::getSkillLevelsForTrigger($_POST["ref_id"]);
767 $result = "<br />Result:<br />" . var_export($result, true);
768 }
769
770 $tpl->setContent($this->form->getHTML() . $result);
771 }
772
773
780 public function setTestSubtabs($a_act)
781 {
782 $ilTabs = $this->tabs;
783 $ilCtrl = $this->ctrl;
784
785 $ilTabs->addSubtab(
786 "test",
787 "getCompletionDateForTriggerRefId",
788 $ilCtrl->getLinkTarget($this, "test")
789 );
790
791 $ilTabs->addSubtab(
792 "cert",
793 "checkUserCertificateForTriggerRefId",
794 $ilCtrl->getLinkTarget($this, "testCert")
795 );
796
797 $ilTabs->addSubtab(
798 "all_cert",
799 "getTriggerOfAllCertificates",
800 $ilCtrl->getLinkTarget($this, "testAllCert")
801 );
802
803 $ilTabs->addSubtab(
804 "levels",
805 "getSkillLevelsForTrigger",
806 $ilCtrl->getLinkTarget($this, "testLevels")
807 );
808
809 $ilTabs->activateSubtab($a_act);
810 }
811
812 //
813 // Skill Templates
814 //
815
819 public function editSkillTemplates()
820 {
822 $ilTabs = $this->tabs;
824 $ilCtrl = $this->ctrl;
825
826 $ilTabs->activateTab("skill_templates");
827 $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
828 $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
829 }
830
831 //
832 // Tree
833 //
834
838 public function showTree($a_templates, $a_gui = "", $a_gui_cmd = "")
839 {
842 $ilCtrl = $this->ctrl;
844
845 if ($a_templates) {
846 if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1) {
847 return;
848 }
849
850 if ($_GET["obj_id"] > 1) {
851 $path = $this->skill_tree->getPathId($_GET["obj_id"]);
852 if (ilSkillTreeNode::_lookupType($path[1]) == "sktp") {
853 return;
854 }
855 }
856 }
857
858 $ilCtrl->setParameter($this, "templates_tree", $a_templates);
859
860 if ($a_templates) {
861 $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_TEMPLATE_TREE, true);
862 $exp = new ilSkillTemplateTreeExplorerGUI($this, "showTree");
863 } else {
864 $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_SKILL_TREE, true);
865 $exp = new ilSkillTreeExplorerGUI($this, "showTree");
866 }
867 if (!$exp->handleCommand()) {
868 $tpl->setLeftNavContent($exp->getHTML());
869 }
870 }
871}
$result
user()
Definition: user.php:4
$n
Definition: RandomTest.php:85
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
const IL_FIRST_NODE
Definition: class.ilTree.php:5
Basic skill GUI class.
Basic skill template GUI class.
This class represents a checkbox property in a property form.
Confirmation screen class.
Export User Interface Class.
Skill management main GUI class.
testAllCert()
Test getTriggerOfAllCertificates.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
saveAllTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
confirmedDelete()
Delete chapters/scos/pages.
setTestSubtabs($a_act)
Set test subtabs.
expandAll($a_redirect=true)
Expand all.
saveSettings()
Save skill management settings.
saveAllTemplateTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
testLevels()
Test getSkillLevelsForTrigger.
deleteNodes($a_gui)
confirm deletion screen of skill tree nodes
collapseAll($a_redirect=true)
Collapse all.
showTree($a_templates, $a_gui="", $a_gui_cmd="")
Show Editing Tree.
testCert()
Test checkUserCertificateForTriggerRefId.
editSkillTemplates()
Edit skill templates.
test()
Test getCompletionDateForTriggerRefId.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
Skill category GUI class.
Skill profile GUI class.
Skill root GUI class.
Skill template category GUI class.
Skill template reference GUI class.
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static _lookupTrefIdsForTopTemplateId($a_template_id)
Lookup tref ids for template id.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Explorer class that works on tree objects (Services/Tree)
Explorer class that works on tree objects (Services/Tree)
static _writeTitle($a_obj_id, $a_title)
Write Title.
static _lookupType($a_obj_id)
Lookup Type.
TableGUI class for skill usages.
This class represents a text property in a property form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)
$ret
Definition: parser.php:6
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2