5 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
42 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
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();
53 $this->tpl = $DIC[
"tpl"];
54 $this->toolbar = $DIC->toolbar();
55 $this->
user = $DIC->user();
58 $this->tool_context = $DIC->globalScreen()->tool()->context();
63 $this->lng->loadLanguageModule(
'skmg');
65 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
68 $ilCtrl->saveParameter($this,
"obj_id");
83 $next_class = $this->ctrl->getNextClass($this);
84 $cmd = $this->ctrl->getCmd();
89 if (!
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
90 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
93 switch ($next_class) {
94 case 'ilskillrootgui':
95 include_once(
"./Services/Skill/classes/class.ilSkillRootGUI.php");
97 $skrt_gui->setParentGUI($this);
98 $ret = $this->ctrl->forwardCommand($skrt_gui);
101 case 'ilskillcategorygui':
102 $this->tabs_gui->activateTab(
"skills");
103 include_once(
"./Services/Skill/classes/class.ilSkillCategoryGUI.php");
105 $scat_gui->setParentGUI($this);
106 $this->
showTree(
false, $scat_gui,
"listItems");
107 $ret = $this->ctrl->forwardCommand($scat_gui);
110 case 'ilbasicskillgui':
111 $this->tabs_gui->activateTab(
"skills");
112 include_once(
"./Services/Skill/classes/class.ilBasicSkillGUI.php");
114 $skill_gui->setParentGUI($this);
115 $this->
showTree(
false, $skill_gui,
"edit");
116 $ret = $this->ctrl->forwardCommand($skill_gui);
119 case 'ilskilltemplatecategorygui':
120 $this->tabs_gui->activateTab(
"skill_templates");
121 include_once(
"./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
123 $sctp_gui->setParentGUI($this);
124 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sctp_gui,
"listItems");
125 $ret = $this->ctrl->forwardCommand($sctp_gui);
128 case 'ilbasicskilltemplategui':
129 $this->tabs_gui->activateTab(
"skill_templates");
130 include_once(
"./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
132 $sktp_gui->setParentGUI($this);
133 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sktp_gui,
"edit");
134 $ret = $this->ctrl->forwardCommand($sktp_gui);
137 case 'ilskilltemplatereferencegui':
138 $this->tabs_gui->activateTab(
"skills");
139 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
141 $sktr_gui->setParentGUI($this);
142 $this->
showTree(
false, $sktr_gui,
"listItems");
143 $ret = $this->ctrl->forwardCommand($sktr_gui);
146 case "ilskillprofilegui":
147 $ilTabs->activateTab(
"profiles");
148 include_once(
"./Services/Skill/classes/class.ilSkillProfileGUI.php");
150 $ret = $this->ctrl->forwardCommand($skprof_gui);
153 case 'ilpermissiongui':
154 $this->tabs_gui->activateTab(
'permissions');
155 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
157 $ret = $this->ctrl->forwardCommand($perm_gui);
161 $this->tabs_gui->activateTab(
'export');
162 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
164 $exp_gui->addFormat(
"xml");
166 $ret = $this->ctrl->forwardCommand($exp_gui);
170 if (!$cmd || $cmd ==
'view') {
174 if ($cmd ==
"showTree") {
175 $this->
showTree($_GET[
"templates_tree"]);
196 if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
197 $this->tabs_gui->addTab(
199 $lng->txt(
"skmg_skills"),
200 $this->ctrl->getLinkTarget($this,
"editSkills")
203 $this->tabs_gui->addTab(
205 $lng->txt(
"skmg_skill_templates"),
206 $this->ctrl->getLinkTarget($this,
"editSkillTemplates")
209 $this->tabs_gui->addTab(
211 $lng->txt(
"settings"),
212 $this->ctrl->getLinkTarget($this,
"editSettings")
215 $this->tabs_gui->addTab(
217 $lng->txt(
"skmg_skill_profiles"),
218 $this->ctrl->getLinkTargetByClass(
"ilskillprofilegui")
221 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
222 $this->tabs_gui->addTab(
225 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
230 $this->tabs_gui->addTab(
233 $this->ctrl->getLinkTarget($this,
"test")
238 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
239 $this->tabs_gui->addTab(
241 $lng->txt(
"perm_settings"),
242 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
257 $ilTabs->activateTab(
"settings");
259 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
261 $enable_skmg = $skmg_set->isActivated();
263 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
265 $form->setFormAction(
$ilCtrl->getFormAction($this));
266 $form->setTitle(
$lng->txt(
"skmg_settings"));
270 $lng->txt(
"skmg_enable_skmg"),
274 $cb_prop->setChecked($enable_skmg);
275 $form->addItem($cb_prop);
279 $lng->txt(
"skmg_hide_profile_self_eval"),
280 "hide_profile_self_eval" 283 $cb_prop->setInfo(
$lng->txt(
"skmg_hide_profile_self_eval_info"));
284 $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
285 $form->addItem($cb_prop);
289 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
292 $this->tpl->setContent($form->getHTML());
307 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
309 $skmg_set->activate((
int)
$_POST[
"enable_skmg"]);
310 $skmg_set->setHideProfileBeforeSelfEval((
int) $_POST[
"hide_profile_self_eval"]);
312 ilUtil::sendSuccess($this->lng->txt(
"settings_saved"),
true);
314 $ilCtrl->redirect($this,
"editSettings");
327 $ilTabs->activateTab(
"skills");
329 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
330 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
342 if (is_array(
$_POST[
"title"])) {
343 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
344 foreach (
$_POST[
"title"] as $id => $title) {
346 if (is_object($node_obj)) {
352 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
355 $ilCtrl->redirect($this,
"editSkills");
366 if (is_array(
$_POST[
"title"])) {
367 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
368 foreach (
$_POST[
"title"] as $id => $title) {
370 if (is_object($node_obj)) {
376 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
379 $ilCtrl->redirect($this,
"editSkillTemplates");
388 $_GET[
"skexpand"] =
"";
389 $n_id = (
$_GET[
"obj_id"] > 0)
391 : $this->skill_tree->readRootId();
392 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
394 foreach ($stree as
$n) {
395 $n_arr[] = $n[
"child"];
406 $_GET[
"skexpand"] =
"";
407 $n_id = (
$_GET[
"obj_id"] > 0)
409 : $this->skill_tree->readRootId();
410 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
412 foreach ($stree as
$n) {
413 if (in_array($n[
"child"], $old) && $n[
"child"] != $n_id) {
414 $k = array_search($n[
"child"], $old);
433 if (!isset(
$_POST[
"id"])) {
434 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->
ilias->error_obj->MESSAGE);
437 $ilTabs->clearTargets();
441 $cskill_ids = array();
442 foreach (
$_POST[
"id"] as $id) {
444 if ($mode ==
"templates") {
445 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
451 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
455 $cskill_ids[] = array(
"skill_id" => $skill_id,
"tref_id" => $tref_id);
458 if ($mode ==
"basic") {
459 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
464 $cskill_ids[] = array(
"skill_id" => $id,
"tref_id" => $tref_id);
471 if ($mode ==
"basic" || $mode ==
"templates") {
472 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
474 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
475 if (count($usages) > 0) {
477 foreach ($usages as $k => $usage) {
478 include_once(
"./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
480 $html .=
$tab->getHTML() .
"<br/><br/>";
482 $tpl->setContent($html);
483 $ilCtrl->saveParameter($a_gui,
"tmpmode");
484 $ilToolbar->addButton(
486 $ilCtrl->getLinkTarget($a_gui,
"cancelDelete")
492 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
498 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
501 $ilCtrl->setParameter($a_gui,
"tmpmode",
$_GET[
"tmpmode"]);
502 $a_form_action = $this->ctrl->getFormAction($a_gui);
503 $confirmation_gui->setFormAction($a_form_action);
504 $confirmation_gui->setHeaderText($this->lng->txt(
"info_delete_sure"));
507 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
508 foreach (
$_POST[
"id"] as $id) {
511 $confirmation_gui->addItem(
514 $node_obj->getTitle(),
520 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"cancelDelete");
521 $confirmation_gui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
523 $tpl->setContent($confirmation_gui->getHTML());
531 $this->ctrl->redirect($this,
"editSkills");
542 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
543 foreach (
$_POST[
"id"] as $id) {
546 $node_data = $this->skill_tree->getNodeData($id);
547 if (is_object($obj)) {
550 if ($this->skill_tree->isInTree($id)) {
551 $this->skill_tree->deleteTree($node_data);
579 $this->setTestSubTabs(
"test");
581 $ilTabs->activateTab(
"test");
583 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
585 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
588 if ($this->rbacsystem->checkAccess(
'write',
$_GET[
'ref_id'])) {
589 $this->form->addCommandButton(
"test",
$lng->txt(
"execute"));
592 $this->form->setTitle(
"getCompletionDateForTriggerRefId()");
593 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
597 $ti->setMaxLength(200);
598 $ti->setInfo(
"Separate multiple IDs by :");
599 $ti->setValue(
$_POST[
"user_id"]);
600 $this->form->addItem($ti);
604 $ti->setMaxLength(200);
605 $ti->setInfo(
"Separate multiple IDs by :");
606 $ti->setValue(
$_POST[
"ref_id"]);
607 $this->form->addItem($ti);
610 if (isset(
$_POST[
"user_id"])) {
611 $user_ids = explode(
":",
$_POST[
"user_id"]);
612 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
613 if (count($user_ids) <= 1) {
614 $user_ids = $user_ids[0];
616 if (count($ref_ids) == 1) {
617 $ref_ids = $ref_ids[0];
618 } elseif (count($ref_ids) == 0) {
622 $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
626 $tpl->setContent($this->form->getHTML() .
$result);
642 $this->setTestSubTabs(
"cert");
643 $ilTabs->activateTab(
"test");
645 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
647 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
650 if ($this->rbacsystem->checkAccess(
'write',
$_GET[
'ref_id'])) {
651 $this->form->addCommandButton(
"testCert",
$lng->txt(
"execute"));
654 $this->form->setTitle(
"checkUserCertificateForTriggerRefId()");
655 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
659 $ti->setMaxLength(200);
660 $ti->setInfo(
"Separate multiple IDs by :");
661 $ti->setValue(
$_POST[
"user_id"]);
662 $this->form->addItem($ti);
666 $ti->setMaxLength(200);
667 $ti->setInfo(
"Separate multiple IDs by :");
668 $ti->setValue(
$_POST[
"ref_id"]);
669 $this->form->addItem($ti);
672 if (isset(
$_POST[
"user_id"])) {
673 $user_ids = explode(
":",
$_POST[
"user_id"]);
674 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
675 if (count($user_ids) <= 1) {
676 $user_ids = $user_ids[0];
678 if (count($ref_ids) == 1) {
679 $ref_ids = $ref_ids[0];
680 } elseif (count($ref_ids) == 0) {
684 $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
688 $tpl->setContent($this->form->getHTML() .
$result);
704 $this->setTestSubTabs(
"all_cert");
705 $ilTabs->activateTab(
"test");
707 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
709 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
712 if ($this->rbacsystem->checkAccess(
'write',
$_GET[
'ref_id'])) {
713 $this->form->addCommandButton(
"testAllCert",
$lng->txt(
"execute"));
716 $this->form->setTitle(
"getTriggerOfAllCertificates()");
717 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
721 $ti->setMaxLength(200);
722 $ti->setInfo(
"Separate multiple IDs by :");
723 $ti->setValue(
$_POST[
"user_id"]);
724 $this->form->addItem($ti);
727 if (isset(
$_POST[
"user_id"])) {
728 $user_ids = explode(
":",
$_POST[
"user_id"]);
729 $ref_ids = explode(
":",
$_POST[
"ref_id"]);
730 if (count($user_ids) <= 1) {
731 $user_ids = $user_ids[0];
734 $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
738 $tpl->setContent($this->form->getHTML() .
$result);
754 $this->setTestSubTabs(
"levels");
755 $ilTabs->activateTab(
"test");
757 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
759 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
762 if ($this->rbacsystem->checkAccess(
'write',
$_GET[
'ref_id'])) {
763 $this->form->addCommandButton(
"testLevels",
$lng->txt(
"execute"));
766 $this->form->setTitle(
"getTriggerOfAllCertificates()");
767 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
771 $ti->setMaxLength(200);
772 $ti->setValue(
$_POST[
"ref_id"]);
773 $this->form->addItem($ti);
776 if (isset(
$_POST[
"ref_id"])) {
777 $result = ilBasicSkill::getSkillLevelsForTrigger(
$_POST[
"ref_id"]);
781 $tpl->setContent($this->form->getHTML() .
$result);
798 "getCompletionDateForTriggerRefId",
799 $ilCtrl->getLinkTarget($this,
"test")
804 "checkUserCertificateForTriggerRefId",
805 $ilCtrl->getLinkTarget($this,
"testCert")
810 "getTriggerOfAllCertificates",
811 $ilCtrl->getLinkTarget($this,
"testAllCert")
816 "getSkillLevelsForTrigger",
817 $ilCtrl->getLinkTarget($this,
"testLevels")
820 $ilTabs->activateSubtab($a_act);
837 $ilTabs->activateTab(
"skill_templates");
838 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
839 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
849 public function showTree($a_templates, $a_gui =
"", $a_gui_cmd =
"")
857 if (
$_GET[
"obj_id"] ==
"" ||
$_GET[
"obj_id"] == 1) {
861 if (
$_GET[
"obj_id"] > 1) {
862 $path = $this->skill_tree->getPathId(
$_GET[
"obj_id"]);
863 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
870 $ilCtrl->setParameter($this,
"templates_tree", $a_templates);
879 if (!$exp->handleCommand()) {
880 $tpl->setLeftNavContent($exp->getHTML());
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
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.
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.
__construct(Container $dic, ilPlugin $plugin)
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.