5 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
27 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
32 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
34 $this->lng->loadLanguageModule(
'skmg');
36 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
39 $ilCtrl->saveParameter($this,
"obj_id");
50 global $rbacsystem,
$ilErr, $ilAccess, $ilTabs;
52 $next_class = $this->ctrl->getNextClass($this);
53 $cmd = $this->ctrl->getCmd();
57 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
59 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
64 case 'ilskillrootgui':
65 include_once(
"./Services/Skill/classes/class.ilSkillRootGUI.php");
67 $skrt_gui->setParentGUI($this);
68 $ret = $this->ctrl->forwardCommand($skrt_gui);
71 case 'ilskillcategorygui':
72 $this->tabs_gui->activateTab(
"skills");
73 include_once(
"./Services/Skill/classes/class.ilSkillCategoryGUI.php");
75 $scat_gui->setParentGUI($this);
76 $this->
showTree(
false, $scat_gui,
"listItems");
77 $ret = $this->ctrl->forwardCommand($scat_gui);
80 case 'ilbasicskillgui':
81 $this->tabs_gui->activateTab(
"skills");
82 include_once(
"./Services/Skill/classes/class.ilBasicSkillGUI.php");
84 $skill_gui->setParentGUI($this);
85 $this->
showTree(
false, $skill_gui,
"edit");
86 $ret = $this->ctrl->forwardCommand($skill_gui);
89 case 'ilskilltemplatecategorygui':
90 $this->tabs_gui->activateTab(
"skill_templates");
91 include_once(
"./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
93 $sctp_gui->setParentGUI($this);
94 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sctp_gui,
"listItems");
95 $ret = $this->ctrl->forwardCommand($sctp_gui);
98 case 'ilbasicskilltemplategui':
99 $this->tabs_gui->activateTab(
"skill_templates");
100 include_once(
"./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
102 $sktp_gui->setParentGUI($this);
103 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sktp_gui,
"edit");
104 $ret = $this->ctrl->forwardCommand($sktp_gui);
107 case 'ilskilltemplatereferencegui':
108 $this->tabs_gui->activateTab(
"skills");
109 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
111 $sktr_gui->setParentGUI($this);
112 $this->
showTree(
false, $sktr_gui,
"listItems");
113 $ret = $this->ctrl->forwardCommand($sktr_gui);
116 case "ilskillprofilegui":
117 $ilTabs->activateTab(
"profiles");
118 include_once(
"./Services/Skill/classes/class.ilSkillProfileGUI.php");
120 $ret = $this->ctrl->forwardCommand($skprof_gui);
123 case 'ilpermissiongui':
124 $this->tabs_gui->activateTab(
'permissions');
125 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
127 $ret = $this->ctrl->forwardCommand($perm_gui);
131 $this->tabs_gui->activateTab(
'export');
132 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
134 $exp_gui->addFormat(
"xml");
136 $ret = $this->ctrl->forwardCommand($exp_gui);
145 if (
$cmd ==
"showTree")
147 $this->
showTree($_GET[
"templates_tree"]);
166 global $rbacsystem, $ilAccess,
$lng;
168 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
170 $this->tabs_gui->addTab(
"skills",
171 $lng->txt(
"skmg_skills"),
172 $this->ctrl->getLinkTarget($this,
"editSkills"));
174 $this->tabs_gui->addTab(
"skill_templates",
175 $lng->txt(
"skmg_skill_templates"),
176 $this->ctrl->getLinkTarget($this,
"editSkillTemplates"));
178 $this->tabs_gui->addTab(
"settings",
179 $lng->txt(
"settings"),
180 $this->ctrl->getLinkTarget($this,
"editSettings"));
182 $this->tabs_gui->addTab(
"profiles",
183 $lng->txt(
"skmg_skill_profiles"),
184 $this->ctrl->getLinkTargetByClass(
"ilskillprofilegui"));
186 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
188 $this->tabs_gui->addTab(
"export",
190 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
195 $this->tabs_gui->addTab(
"test",
197 $this->ctrl->getLinkTarget($this,
"test"));
201 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
203 $this->tabs_gui->addTab(
"permissions",
204 $lng->txt(
"perm_settings"),
205 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"));
216 $ilTabs->activateTab(
"settings");
218 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
220 $enable_skmg = $skmg_set->isActivated();
222 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
224 $form->setFormAction($ilCtrl->getFormAction($this));
225 $form->setTitle($lng->txt(
"skmg_settings"));
231 $cb_prop->setChecked($enable_skmg);
232 $form->addItem($cb_prop);
237 $form->addCommandButton(
"saveSettings", $lng->txt(
"save"));
240 $this->tpl->setContent($form->getHTML());
255 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
257 $skmg_set->activate((
int)
$_POST[
"enable_skmg"]);
261 $ilCtrl->redirect($this,
"editSettings");
271 $ilTabs->activateTab(
"skills");
273 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
274 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
286 if (is_array(
$_POST[
"title"]))
288 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
292 if (is_object($node_obj))
303 $ilCtrl->redirect($this,
"editSkills");
313 if (is_array(
$_POST[
"title"]))
315 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
319 if (is_object($node_obj))
330 $ilCtrl->redirect($this,
"editSkillTemplates");
339 $_GET[
"skexpand"] =
"";
340 $n_id = (
$_GET[
"obj_id"] > 0)
342 : $this->skill_tree->readRootId();
343 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
345 foreach ($stree as
$n)
347 $n_arr[] = $n[
"child"];
358 $_GET[
"skexpand"] =
"";
359 $n_id = (
$_GET[
"obj_id"] > 0)
361 : $this->skill_tree->readRootId();
362 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
364 foreach ($stree as
$n)
366 if (in_array($n[
"child"],
$old) && $n[
"child"] != $n_id)
368 $k = array_search($n[
"child"],
$old);
385 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->
ilias->error_obj->MESSAGE);
388 $ilTabs->clearTargets();
392 $cskill_ids =
array();
393 foreach(
$_POST[
"id"] as $id)
397 if ($mode ==
"templates")
399 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.",$this->
ilias->error_obj->MESSAGE);
406 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
410 $cskill_ids[] =
array(
"skill_id" => $skill_id,
"tref_id" => $tref_id);
414 if ($mode ==
"basic")
416 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.",$this->
ilias->error_obj->MESSAGE);
422 $cskill_ids[] =
array(
"skill_id" => $id,
"tref_id" => $tref_id);
429 if ($mode ==
"basic" || $mode ==
"templates")
431 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
433 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
434 if (count($usages) > 0)
437 foreach ($usages as $k => $usage)
439 include_once(
"./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
443 $tpl->setContent(
$html);
444 $ilCtrl->saveParameter($a_gui,
"tmpmode");
445 $ilToolbar->addButton($lng->txt(
"back"),
446 $ilCtrl->getLinkTarget($a_gui,
"cancelDelete"));
453 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.",$this->
ilias->error_obj->MESSAGE);
459 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
462 $ilCtrl->setParameter($a_gui,
"tmpmode",
$_GET[
"tmpmode"]);
463 $a_form_action = $this->ctrl->getFormAction($a_gui);
464 $confirmation_gui->setFormAction($a_form_action);
465 $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
468 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
469 foreach(
$_POST[
"id"] as $id)
474 $confirmation_gui->addItem(
"id[]", $node_obj->getId(),
479 $confirmation_gui->setCancel($lng->txt(
"cancel"),
"cancelDelete");
480 $confirmation_gui->setConfirm($lng->txt(
"confirm"),
"confirmedDelete");
482 $tpl->setContent($confirmation_gui->getHTML());
490 $this->ctrl->redirect($this,
"editSkills");
501 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
502 foreach (
$_POST[
"id"] as $id)
507 $node_data = $this->skill_tree->getNodeData($id);
512 if($this->skill_tree->isInTree($id))
514 $this->skill_tree->deleteTree($node_data);
539 $this->setTestSubTabs(
"test");
541 $ilTabs->activateTab(
"test");
543 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
545 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
548 $this->form->addCommandButton(
"test", $lng->txt(
"execute"));
550 $this->form->setTitle(
"getCompletionDateForTriggerRefId()");
551 $this->form->setFormAction($ilCtrl->getFormAction($this));
555 $ti->setMaxLength(200);
556 $ti->setInfo(
"Separate multiple IDs by :");
557 $ti->setValue(
$_POST[
"user_id"]);
558 $this->form->addItem($ti);
562 $ti->setMaxLength(200);
563 $ti->setInfo(
"Separate multiple IDs by :");
564 $ti->setValue(
$_POST[
"ref_id"]);
565 $this->form->addItem($ti);
568 if (isset(
$_POST[
"user_id"]))
570 $user_ids = explode(
":",
$_POST[
"user_id"]);
571 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
572 if (count($user_ids) <= 1)
574 $user_ids = $user_ids[0];
576 if (count($ref_ids) == 1)
578 $ref_ids = $ref_ids[0];
580 else if (count($ref_ids) == 0)
585 $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
589 $tpl->setContent($this->form->getHTML().$result);
603 $this->setTestSubTabs(
"cert");
604 $ilTabs->activateTab(
"test");
606 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
608 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
611 $this->form->addCommandButton(
"testCert", $lng->txt(
"execute"));
613 $this->form->setTitle(
"checkUserCertificateForTriggerRefId()");
614 $this->form->setFormAction($ilCtrl->getFormAction($this));
618 $ti->setMaxLength(200);
619 $ti->setInfo(
"Separate multiple IDs by :");
620 $ti->setValue(
$_POST[
"user_id"]);
621 $this->form->addItem($ti);
625 $ti->setMaxLength(200);
626 $ti->setInfo(
"Separate multiple IDs by :");
627 $ti->setValue(
$_POST[
"ref_id"]);
628 $this->form->addItem($ti);
631 if (isset(
$_POST[
"user_id"]))
633 $user_ids = explode(
":",
$_POST[
"user_id"]);
634 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
635 if (count($user_ids) <= 1)
637 $user_ids = $user_ids[0];
639 if (count($ref_ids) == 1)
641 $ref_ids = $ref_ids[0];
643 else if (count($ref_ids) == 0)
648 $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
652 $tpl->setContent($this->form->getHTML().$result);
666 $this->setTestSubTabs(
"all_cert");
667 $ilTabs->activateTab(
"test");
669 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
671 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
674 $this->form->addCommandButton(
"testAllCert", $lng->txt(
"execute"));
676 $this->form->setTitle(
"getTriggerOfAllCertificates()");
677 $this->form->setFormAction($ilCtrl->getFormAction($this));
681 $ti->setMaxLength(200);
682 $ti->setInfo(
"Separate multiple IDs by :");
683 $ti->setValue(
$_POST[
"user_id"]);
684 $this->form->addItem($ti);
687 if (isset(
$_POST[
"user_id"]))
689 $user_ids = explode(
":",
$_POST[
"user_id"]);
690 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
691 if (count($user_ids) <= 1)
693 $user_ids = $user_ids[0];
696 $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
700 $tpl->setContent($this->form->getHTML().$result);
714 $this->setTestSubTabs(
"levels");
715 $ilTabs->activateTab(
"test");
717 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
719 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
722 $this->form->addCommandButton(
"testLevels", $lng->txt(
"execute"));
724 $this->form->setTitle(
"getTriggerOfAllCertificates()");
725 $this->form->setFormAction($ilCtrl->getFormAction($this));
729 $ti->setMaxLength(200);
730 $ti->setValue(
$_POST[
"ref_id"]);
731 $this->form->addItem($ti);
734 if (isset(
$_POST[
"ref_id"]))
736 $result = ilBasicSkill::getSkillLevelsForTrigger(
$_POST[
"ref_id"]);
740 $tpl->setContent($this->form->getHTML().$result);
755 $ilTabs->addSubtab(
"test",
756 "getCompletionDateForTriggerRefId",
757 $ilCtrl->getLinkTarget($this,
"test"));
759 $ilTabs->addSubtab(
"cert",
760 "checkUserCertificateForTriggerRefId",
761 $ilCtrl->getLinkTarget($this,
"testCert"));
763 $ilTabs->addSubtab(
"all_cert",
764 "getTriggerOfAllCertificates",
765 $ilCtrl->getLinkTarget($this,
"testAllCert"));
767 $ilTabs->addSubtab(
"levels",
768 "getSkillLevelsForTrigger",
769 $ilCtrl->getLinkTarget($this,
"testLevels"));
771 $ilTabs->activateSubtab($a_act);
786 $ilTabs->activateTab(
"skill_templates");
787 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
788 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
799 function showTree($a_templates, $a_gui =
"", $a_gui_cmd =
"")
805 if (
$_GET[
"obj_id"] ==
"" ||
$_GET[
"obj_id"] == 1)
810 if (
$_GET[
"obj_id"] > 1)
812 $path = $this->skill_tree->getPathId(
$_GET[
"obj_id"]);
813 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
821 $ilCtrl->setParameter($this,
"templates_tree", $a_templates);
825 include_once(
"./Services/Skill/classes/class.ilSkillTemplateTreeExplorerGUI.php");
830 include_once(
"./Services/Skill/classes/class.ilSkillTreeExplorerGUI.php");
833 if (!$exp->handleCommand())
835 $tpl->setLeftNavContent($exp->getHTML());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Skill category GUI class.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
executeCommand()
Execute command.
showTree($a_templates, $a_gui="", $a_gui_cmd="")
Show Editing Tree.
static _writeTitle($a_obj_id, $a_title)
Write Title.
Skill management settings.
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
editSettings()
Edit news settings.
Explorer class that works on tree objects (Services/Tree)
static _lookupType($a_obj_id)
Lookup Type.
setTestSubtabs($a_act)
Set test subtabs.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
prepareOutput($a_show_subobjects=true)
prepare output
static getInstance($a_id=0)
confirmedDelete()
Delete chapters/scos/pages.
expandAll($a_redirect=true)
Expand all.
editSkillTemplates()
Edit skill templates.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
Skill template reference GUI class.
cancelDelete()
cancel delete
This class represents a text property in a property form.
saveAllTemplateTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
redirection script todo: (a better solution should control the processing via a xml file) ...
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
test()
Test getCompletionDateForTriggerRefId.
testAllCert()
Test getTriggerOfAllCertificates.
TableGUI class for skill usages.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
saveSettings()
Save skill management settings.
testLevels()
Test getSkillLevelsForTrigger.
Skill template category GUI class.
collapseAll($a_redirect=true)
Collapse all.
testCert()
Test checkUserCertificateForTriggerRefId.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Explorer class that works on tree objects (Services/Tree)
saveAllTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
Basic skill template GUI class.
deleteNodes($a_gui)
confirm deletion screen of skill tree nodes
Skill management main GUI class.
Confirmation screen class.