ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjSkillManagementGUI.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
5include_once("./Services/Object/classes/class.ilObjectGUI.php");
6
19{
23 protected $rbacsystem;
24
28 protected $error;
29
33 protected $tabs;
34
35 protected $skill_tree;
36
42 public function __construct($a_data, $a_id, $a_call_by_reference = true, $a_prepare_output = true)
43 {
44 global $DIC;
45
46 $this->ctrl = $DIC->ctrl();
47 $this->rbacsystem = $DIC->rbac()->system();
48 $this->error = $DIC["ilErr"];
49 $this->access = $DIC->access();
50 $this->tabs = $DIC->tabs();
51 $this->lng = $DIC->language();
52 $this->settings = $DIC->settings();
53 $this->tpl = $DIC["tpl"];
54 $this->toolbar = $DIC->toolbar();
55 $this->user = $DIC->user();
56 $ilCtrl = $DIC->ctrl();
57
58 $this->type = 'skmg';
59 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
60
61 $this->lng->loadLanguageModule('skmg');
62
63 include_once("./Services/Skill/classes/class.ilSkillTree.php");
64 $this->skill_tree = new ilSkillTree();
65
66 $ilCtrl->saveParameter($this, "obj_id");
67 }
68
75 public function executeCommand()
76 {
79 $ilAccess = $this->access;
80 $ilTabs = $this->tabs;
81
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
84
85 $this->prepareOutput();
86
87 if (!$ilAccess->checkAccess('read', '', $this->object->getRefId())) {
88 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
89 }
90
91 switch ($next_class) {
92 case 'ilskillrootgui':
93 include_once("./Services/Skill/classes/class.ilSkillRootGUI.php");
94 $skrt_gui = new ilSkillRootGUI((int) $_GET["obj_id"], $this);
95 $skrt_gui->setParentGUI($this);
96 $ret = $this->ctrl->forwardCommand($skrt_gui);
97 break;
98
99 case 'ilskillcategorygui':
100 $this->tabs_gui->activateTab("skills");
101 include_once("./Services/Skill/classes/class.ilSkillCategoryGUI.php");
102 $scat_gui = new ilSkillCategoryGUI((int) $_GET["obj_id"]);
103 $scat_gui->setParentGUI($this);
104 $this->showTree(false, $scat_gui, "listItems");
105 $ret = $this->ctrl->forwardCommand($scat_gui);
106 break;
107
108 case 'ilbasicskillgui':
109 $this->tabs_gui->activateTab("skills");
110 include_once("./Services/Skill/classes/class.ilBasicSkillGUI.php");
111 $skill_gui = new ilBasicSkillGUI((int) $_GET["obj_id"]);
112 $skill_gui->setParentGUI($this);
113 $this->showTree(false, $skill_gui, "edit");
114 $ret = $this->ctrl->forwardCommand($skill_gui);
115 break;
116
117 case 'ilskilltemplatecategorygui':
118 $this->tabs_gui->activateTab("skill_templates");
119 include_once("./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
120 $sctp_gui = new ilSkillTemplateCategoryGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
121 $sctp_gui->setParentGUI($this);
122 $this->showTree(((int) $_GET["tref_id"] == 0), $sctp_gui, "listItems");
123 $ret = $this->ctrl->forwardCommand($sctp_gui);
124 break;
125
126 case 'ilbasicskilltemplategui':
127 $this->tabs_gui->activateTab("skill_templates");
128 include_once("./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
129 $sktp_gui = new ilBasicSkillTemplateGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
130 $sktp_gui->setParentGUI($this);
131 $this->showTree(((int) $_GET["tref_id"] == 0), $sktp_gui, "edit");
132 $ret = $this->ctrl->forwardCommand($sktp_gui);
133 break;
134
135 case 'ilskilltemplatereferencegui':
136 $this->tabs_gui->activateTab("skills");
137 include_once("./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
138 $sktr_gui = new ilSkillTemplateReferenceGUI((int) $_GET["tref_id"]);
139 $sktr_gui->setParentGUI($this);
140 $this->showTree(false, $sktr_gui, "listItems");
141 $ret = $this->ctrl->forwardCommand($sktr_gui);
142 break;
143
144 case "ilskillprofilegui":
145 $ilTabs->activateTab("profiles");
146 include_once("./Services/Skill/classes/class.ilSkillProfileGUI.php");
147 $skprof_gui = new ilSkillProfileGUI();
148 $ret = $this->ctrl->forwardCommand($skprof_gui);
149 break;
150
151 case 'ilpermissiongui':
152 $this->tabs_gui->activateTab('permissions');
153 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
154 $perm_gui = new ilPermissionGUI($this);
155 $ret = $this->ctrl->forwardCommand($perm_gui);
156 break;
157
158 case "ilexportgui":
159 $this->tabs_gui->activateTab('export');
160 include_once("./Services/Export/classes/class.ilExportGUI.php");
161 $exp_gui = new ilExportGUI($this);
162 $exp_gui->addFormat("xml");
163 //$exp_gui->addFormat("html", "", $this, "exportHTML");
164 $ret = $this->ctrl->forwardCommand($exp_gui);
165 break;
166
167 default:
168 if (!$cmd || $cmd == 'view') {
169 $cmd = "editSkills";
170 }
171
172 if ($cmd == "showTree") {
173 $this->showTree($_GET["templates_tree"]);
174 } else {
175 $this->$cmd();
176 }
177 break;
178 }
179 return true;
180 }
181
188 public function getAdminTabs()
189 {
191 $ilAccess = $this->access;
193
194 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
195 $this->tabs_gui->addTab(
196 "skills",
197 $lng->txt("skmg_skills"),
198 $this->ctrl->getLinkTarget($this, "editSkills")
199 );
200
201 $this->tabs_gui->addTab(
202 "skill_templates",
203 $lng->txt("skmg_skill_templates"),
204 $this->ctrl->getLinkTarget($this, "editSkillTemplates")
205 );
206
207 $this->tabs_gui->addTab(
208 "settings",
209 $lng->txt("settings"),
210 $this->ctrl->getLinkTarget($this, "editSettings")
211 );
212
213 $this->tabs_gui->addTab(
214 "profiles",
215 $lng->txt("skmg_skill_profiles"),
216 $this->ctrl->getLinkTargetByClass("ilskillprofilegui")
217 );
218
219 if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
220 $this->tabs_gui->addTab(
221 "export",
222 $lng->txt("export"),
223 $this->ctrl->getLinkTargetByClass("ilexportgui", "")
224 );
225 }
226
227 if (DEVMODE == 1) {
228 $this->tabs_gui->addTab(
229 "test",
230 "Test (DEVMODE)",
231 $this->ctrl->getLinkTarget($this, "test")
232 );
233 }
234 }
235
236 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
237 $this->tabs_gui->addTab(
238 "permissions",
239 $lng->txt("perm_settings"),
240 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
241 );
242 }
243 }
244
248 public function editSettings()
249 {
253 $ilTabs = $this->tabs;
254
255 $ilTabs->activateTab("settings");
256
257 include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
258 $skmg_set = new ilSkillManagementSettings();
259 $enable_skmg = $skmg_set->isActivated();
260
261 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
262 $form = new ilPropertyFormGUI();
263 $form->setFormAction($ilCtrl->getFormAction($this));
264 $form->setTitle($lng->txt("skmg_settings"));
265
266 // Enable skill management
267 $cb_prop = new ilCheckboxInputGUI(
268 $lng->txt("skmg_enable_skmg"),
269 "enable_skmg"
270 );
271 $cb_prop->setValue("1");
272 $cb_prop->setChecked($enable_skmg);
273 $form->addItem($cb_prop);
274
275 // Hide Competence Profile Data before Self-Assessment
276 $cb_prop = new ilCheckboxInputGUI(
277 $lng->txt("skmg_hide_profile_self_eval"),
278 "hide_profile_self_eval"
279 );
280 $cb_prop->setValue("1");
281 $cb_prop->setInfo($lng->txt("skmg_hide_profile_self_eval_info"));
282 $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
283 $form->addItem($cb_prop);
284
285 // command buttons
286 if ($this->checkPermissionBool("write")) {
287 $form->addCommandButton("saveSettings", $lng->txt("save"));
288 }
289
290 $this->tpl->setContent($form->getHTML());
291 }
292
296 public function saveSettings()
297 {
300
301 if (!$this->checkPermissionBool("write")) {
302 return;
303 }
304
305 include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
306 $skmg_set = new ilSkillManagementSettings();
307 $skmg_set->activate((int) $_POST["enable_skmg"]);
308 $skmg_set->setHideProfileBeforeSelfEval((int) $_POST["hide_profile_self_eval"]);
309
310 ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
311
312 $ilCtrl->redirect($this, "editSettings");
313 }
314
318 public function editSkills()
319 {
321 $ilTabs = $this->tabs;
324
325 $ilTabs->activateTab("skills");
326
327 $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
328 $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
329 }
330
331
335 public function saveAllTitles($a_succ_mess = true)
336 {
339
340 if (is_array($_POST["title"])) {
341 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
342 foreach ($_POST["title"] as $id => $title) {
344 if (is_object($node_obj)) {
345 // update title
347 }
348 }
349 if ($a_succ_mess) {
350 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
351 }
352 }
353 $ilCtrl->redirect($this, "editSkills");
354 }
355
359 public function saveAllTemplateTitles($a_succ_mess = true)
360 {
363
364 if (is_array($_POST["title"])) {
365 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
366 foreach ($_POST["title"] as $id => $title) {
368 if (is_object($node_obj)) {
369 // update title
371 }
372 }
373 if ($a_succ_mess) {
374 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
375 }
376 }
377 $ilCtrl->redirect($this, "editSkillTemplates");
378 }
379
380
384 public function expandAll($a_redirect = true)
385 {
386 $_GET["skexpand"] = "";
387 $n_id = ($_GET["obj_id"] > 0)
388 ? $_GET["obj_id"]
389 : $this->skill_tree->readRootId();
390 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
391 $n_arr = array();
392 foreach ($stree as $n) {
393 $n_arr[] = $n["child"];
394 $_SESSION["skexpand"] = $n_arr;
395 }
396 $this->saveAllTitles(false);
397 }
398
402 public function collapseAll($a_redirect = true)
403 {
404 $_GET["skexpand"] = "";
405 $n_id = ($_GET["obj_id"] > 0)
406 ? $_GET["obj_id"]
407 : $this->skill_tree->readRootId();
408 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
409 $old = $_SESSION["skexpand"];
410 foreach ($stree as $n) {
411 if (in_array($n["child"], $old) && $n["child"] != $n_id) {
412 $k = array_search($n["child"], $old);
413 unset($old[$k]);
414 }
415 }
416 $_SESSION["skexpand"] = $old;
417 $this->saveAllTitles(false);
418 }
419
423 public function deleteNodes($a_gui)
424 {
428 $ilTabs = $this->tabs;
429 $ilToolbar = $this->toolbar;
430
431 if (!isset($_POST["id"])) {
432 $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
433 }
434
435 $ilTabs->clearTargets();
436
437 // check usages
438 $mode = "";
439 $cskill_ids = array();
440 foreach ($_POST["id"] as $id) {
441 if (in_array(ilSkillTreeNode::_lookupType($id), array("skll", "scat", "sktr"))) {
442 if ($mode == "templates") {
443 $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
444 }
445 $mode = "basic";
446 $skill_id = $id;
447 $tref_id = 0;
448 if (ilSkillTreeNode::_lookupType($id) == "sktr") {
449 include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
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 include_once("./Services/Skill/classes/class.ilSkillUsage.php");
471 $u = new ilSkillUsage();
472 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
473 if (count($usages) > 0) {
474 $html = "";
475 foreach ($usages as $k => $usage) {
476 include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
477 $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
478 $html.= $tab->getHTML() . "<br/><br/>";
479 }
480 $tpl->setContent($html);
481 $ilCtrl->saveParameter($a_gui, "tmpmode");
482 $ilToolbar->addButton(
483 $lng->txt("back"),
484 $ilCtrl->getLinkTarget($a_gui, "cancelDelete")
485 );
486 ilUtil::sendFailure($lng->txt("skmg_cannot_delete_nodes_in_use"));
487 return;
488 }
489 } else {
490 $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
491 }
492
493 // SAVE POST VALUES
494 $_SESSION["saved_post"] = $_POST["id"];
495
496 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
497 $confirmation_gui = new ilConfirmationGUI();
498
499 $ilCtrl->setParameter($a_gui, "tmpmode", $_GET["tmpmode"]);
500 $a_form_action = $this->ctrl->getFormAction($a_gui);
501 $confirmation_gui->setFormAction($a_form_action);
502 $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
503
504 // Add items to delete
505 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
506 foreach ($_POST["id"] as $id) {
507 if ($id != IL_FIRST_NODE) {
509 $confirmation_gui->addItem(
510 "id[]",
511 $node_obj->getId(),
512 $node_obj->getTitle(),
513 ilUtil::getImagePath("icon_" . $node_obj->getType() . ".svg")
514 );
515 }
516 }
517
518 $confirmation_gui->setCancel($lng->txt("cancel"), "cancelDelete");
519 $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
520
521 $tpl->setContent($confirmation_gui->getHTML());
522 }
523
527 public function cancelDelete()
528 {
529 $this->ctrl->redirect($this, "editSkills");
530 }
531
535 public function confirmedDelete()
536 {
538
539 // delete all selected objects
540 include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
541 foreach ($_POST["id"] as $id) {
542 if ($id != IL_FIRST_NODE) {
544 $node_data = $this->skill_tree->getNodeData($id);
545 if (is_object($obj)) {
546 $obj->delete();
547 }
548 if ($this->skill_tree->isInTree($id)) {
549 $this->skill_tree->deleteTree($node_data);
550 }
551 }
552 }
553
554 // feedback
555 ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
556 }
557
558 //
559 //
560 // Test
561 //
562 //
563
570 public function test()
571 {
575 $ilTabs = $this->tabs;
576
577 $this->setTestSubTabs("test");
578
579 $ilTabs->activateTab("test");
580
581 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
582
583 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
584 $this->form = new ilPropertyFormGUI();
585
586 $this->form->addCommandButton("test", $lng->txt("execute"));
587
588 $this->form->setTitle("getCompletionDateForTriggerRefId()");
589 $this->form->setFormAction($ilCtrl->getFormAction($this));
590
591 // user id
592 $ti = new ilTextInputGUI("User ID(s)", "user_id");
593 $ti->setMaxLength(200);
594 $ti->setInfo("Separate multiple IDs by :");
595 $ti->setValue($_POST["user_id"]);
596 $this->form->addItem($ti);
597
598 // ref id
599 $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
600 $ti->setMaxLength(200);
601 $ti->setInfo("Separate multiple IDs by :");
602 $ti->setValue($_POST["ref_id"]);
603 $this->form->addItem($ti);
604
605 $result = "";
606 if (isset($_POST["user_id"])) {
607 $user_ids = explode(":", $_POST["user_id"]);
608 $ref_ids = explode(":", $_POST["ref_id"]);
609 if (count($user_ids) <= 1) {
610 $user_ids = $user_ids[0];
611 }
612 if (count($ref_ids) == 1) {
613 $ref_ids = $ref_ids[0];
614 } elseif (count($ref_ids) == 0) {
615 $ref_ids = null;
616 }
617
618 $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
619 $result = "<br />Result:<br />" . var_export($result, true);
620 }
621
622 $tpl->setContent($this->form->getHTML() . $result);
623 }
624
631 public function testCert()
632 {
636 $ilTabs = $this->tabs;
637
638 $this->setTestSubTabs("cert");
639 $ilTabs->activateTab("test");
640
641 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
642
643 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
644 $this->form = new ilPropertyFormGUI();
645
646 $this->form->addCommandButton("testCert", $lng->txt("execute"));
647
648 $this->form->setTitle("checkUserCertificateForTriggerRefId()");
649 $this->form->setFormAction($ilCtrl->getFormAction($this));
650
651 // user id
652 $ti = new ilTextInputGUI("User ID(s)", "user_id");
653 $ti->setMaxLength(200);
654 $ti->setInfo("Separate multiple IDs by :");
655 $ti->setValue($_POST["user_id"]);
656 $this->form->addItem($ti);
657
658 // ref id
659 $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
660 $ti->setMaxLength(200);
661 $ti->setInfo("Separate multiple IDs by :");
662 $ti->setValue($_POST["ref_id"]);
663 $this->form->addItem($ti);
664
665 $result = "";
666 if (isset($_POST["user_id"])) {
667 $user_ids = explode(":", $_POST["user_id"]);
668 $ref_ids = explode(":", $_POST["ref_id"]);
669 if (count($user_ids) <= 1) {
670 $user_ids = $user_ids[0];
671 }
672 if (count($ref_ids) == 1) {
673 $ref_ids = $ref_ids[0];
674 } elseif (count($ref_ids) == 0) {
675 $ref_ids = null;
676 }
677
678 $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
679 $result = "<br />Result:<br />" . var_export($result, true);
680 }
681
682 $tpl->setContent($this->form->getHTML() . $result);
683 }
684
691 public function testAllCert()
692 {
696 $ilTabs = $this->tabs;
697
698 $this->setTestSubTabs("all_cert");
699 $ilTabs->activateTab("test");
700
701 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
702
703 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
704 $this->form = new ilPropertyFormGUI();
705
706 $this->form->addCommandButton("testAllCert", $lng->txt("execute"));
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 {
744 $ilTabs = $this->tabs;
745
746 $this->setTestSubTabs("levels");
747 $ilTabs->activateTab("test");
748
749 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
750
751 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
752 $this->form = new ilPropertyFormGUI();
753
754 $this->form->addCommandButton("testLevels", $lng->txt("execute"));
755
756 $this->form->setTitle("getTriggerOfAllCertificates()");
757 $this->form->setFormAction($ilCtrl->getFormAction($this));
758
759 // user id
760 $ti = new ilTextInputGUI("Ref ID", "ref_id");
761 $ti->setMaxLength(200);
762 $ti->setValue($_POST["ref_id"]);
763 $this->form->addItem($ti);
764
765 $result = "";
766 if (isset($_POST["ref_id"])) {
767 $result = ilBasicSkill::getSkillLevelsForTrigger($_POST["ref_id"]);
768 $result = "<br />Result:<br />" . var_export($result, true);
769 }
770
771 $tpl->setContent($this->form->getHTML() . $result);
772 }
773
774
781 public function setTestSubtabs($a_act)
782 {
783 $ilTabs = $this->tabs;
785
786 $ilTabs->addSubtab(
787 "test",
788 "getCompletionDateForTriggerRefId",
789 $ilCtrl->getLinkTarget($this, "test")
790 );
791
792 $ilTabs->addSubtab(
793 "cert",
794 "checkUserCertificateForTriggerRefId",
795 $ilCtrl->getLinkTarget($this, "testCert")
796 );
797
798 $ilTabs->addSubtab(
799 "all_cert",
800 "getTriggerOfAllCertificates",
801 $ilCtrl->getLinkTarget($this, "testAllCert")
802 );
803
804 $ilTabs->addSubtab(
805 "levels",
806 "getSkillLevelsForTrigger",
807 $ilCtrl->getLinkTarget($this, "testLevels")
808 );
809
810 $ilTabs->activateSubtab($a_act);
811 }
812
813 //
814 // Skill Templates
815 //
816
820 public function editSkillTemplates()
821 {
823 $ilTabs = $this->tabs;
826
827 $ilTabs->activateTab("skill_templates");
828 $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
829 $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
830 }
831
832 //
833 // Tree
834 //
835
839 public function showTree($a_templates, $a_gui = "", $a_gui_cmd = "")
840 {
845
846 if ($a_templates) {
847 if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1) {
848 return;
849 }
850
851 if ($_GET["obj_id"] > 1) {
852 $path = $this->skill_tree->getPathId($_GET["obj_id"]);
853 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
854 if (ilSkillTreeNode::_lookupType($path[1]) == "sktp") {
855 return;
856 }
857 }
858 }
859
860 $ilCtrl->setParameter($this, "templates_tree", $a_templates);
861
862 if ($a_templates) {
863 include_once("./Services/Skill/classes/class.ilSkillTemplateTreeExplorerGUI.php");
864 $exp = new ilSkillTemplateTreeExplorerGUI($this, "showTree");
865 } else {
866 include_once("./Services/Skill/classes/class.ilSkillTreeExplorerGUI.php");
867 $exp = new ilSkillTreeExplorerGUI($this, "showTree", $a_templates);
868 }
869 if (!$exp->handleCommand()) {
870 $tpl->setLeftNavContent($exp->getHTML());
871 }
872 }
873}
$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 _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 sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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)
$html
Definition: example_001.php:87
if(!array_key_exists('StateId', $_REQUEST)) $id
global $ilCtrl
Definition: ilias.php:18
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
if(isset($_POST['submit'])) $form
$old
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2
$ilUser
Definition: imgupload.php:18