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();
59 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
61 $this->lng->loadLanguageModule(
'skmg');
63 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
66 $ilCtrl->saveParameter($this,
"obj_id");
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
87 if (!$ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
88 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
91 switch ($next_class) {
92 case 'ilskillrootgui':
93 include_once(
"./Services/Skill/classes/class.ilSkillRootGUI.php");
95 $skrt_gui->setParentGUI($this);
96 $ret = $this->ctrl->forwardCommand($skrt_gui);
99 case 'ilskillcategorygui':
100 $this->tabs_gui->activateTab(
"skills");
101 include_once(
"./Services/Skill/classes/class.ilSkillCategoryGUI.php");
103 $scat_gui->setParentGUI($this);
104 $this->
showTree(
false, $scat_gui,
"listItems");
105 $ret = $this->ctrl->forwardCommand($scat_gui);
108 case 'ilbasicskillgui':
109 $this->tabs_gui->activateTab(
"skills");
110 include_once(
"./Services/Skill/classes/class.ilBasicSkillGUI.php");
112 $skill_gui->setParentGUI($this);
113 $this->
showTree(
false, $skill_gui,
"edit");
114 $ret = $this->ctrl->forwardCommand($skill_gui);
117 case 'ilskilltemplatecategorygui':
118 $this->tabs_gui->activateTab(
"skill_templates");
119 include_once(
"./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
121 $sctp_gui->setParentGUI($this);
122 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sctp_gui,
"listItems");
123 $ret = $this->ctrl->forwardCommand($sctp_gui);
126 case 'ilbasicskilltemplategui':
127 $this->tabs_gui->activateTab(
"skill_templates");
128 include_once(
"./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
130 $sktp_gui->setParentGUI($this);
131 $this->
showTree(((
int) $_GET[
"tref_id"] == 0), $sktp_gui,
"edit");
132 $ret = $this->ctrl->forwardCommand($sktp_gui);
135 case 'ilskilltemplatereferencegui':
136 $this->tabs_gui->activateTab(
"skills");
137 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
139 $sktr_gui->setParentGUI($this);
140 $this->
showTree(
false, $sktr_gui,
"listItems");
141 $ret = $this->ctrl->forwardCommand($sktr_gui);
144 case "ilskillprofilegui":
145 $ilTabs->activateTab(
"profiles");
146 include_once(
"./Services/Skill/classes/class.ilSkillProfileGUI.php");
148 $ret = $this->ctrl->forwardCommand($skprof_gui);
151 case 'ilpermissiongui':
152 $this->tabs_gui->activateTab(
'permissions');
153 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
155 $ret = $this->ctrl->forwardCommand($perm_gui);
159 $this->tabs_gui->activateTab(
'export');
160 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
162 $exp_gui->addFormat(
"xml");
164 $ret = $this->ctrl->forwardCommand($exp_gui);
168 if (!$cmd || $cmd ==
'view') {
172 if ($cmd ==
"showTree") {
173 $this->
showTree($_GET[
"templates_tree"]);
194 if (
$rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
195 $this->tabs_gui->addTab(
197 $lng->txt(
"skmg_skills"),
198 $this->ctrl->getLinkTarget($this,
"editSkills")
201 $this->tabs_gui->addTab(
203 $lng->txt(
"skmg_skill_templates"),
204 $this->ctrl->getLinkTarget($this,
"editSkillTemplates")
207 $this->tabs_gui->addTab(
209 $lng->txt(
"settings"),
210 $this->ctrl->getLinkTarget($this,
"editSettings")
213 $this->tabs_gui->addTab(
215 $lng->txt(
"skmg_skill_profiles"),
216 $this->ctrl->getLinkTargetByClass(
"ilskillprofilegui")
219 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
220 $this->tabs_gui->addTab(
223 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
"")
228 $this->tabs_gui->addTab(
231 $this->ctrl->getLinkTarget($this,
"test")
236 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
237 $this->tabs_gui->addTab(
239 $lng->txt(
"perm_settings"),
240 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
255 $ilTabs->activateTab(
"settings");
257 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
259 $enable_skmg = $skmg_set->isActivated();
261 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
264 $form->setTitle(
$lng->txt(
"skmg_settings"));
268 $lng->txt(
"skmg_enable_skmg"),
272 $cb_prop->setChecked($enable_skmg);
273 $form->addItem($cb_prop);
277 $lng->txt(
"skmg_hide_profile_self_eval"),
278 "hide_profile_self_eval" 281 $cb_prop->setInfo(
$lng->txt(
"skmg_hide_profile_self_eval_info"));
282 $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
283 $form->addItem($cb_prop);
287 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
290 $this->tpl->setContent(
$form->getHTML());
305 include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
307 $skmg_set->activate((
int)
$_POST[
"enable_skmg"]);
308 $skmg_set->setHideProfileBeforeSelfEval((
int) $_POST[
"hide_profile_self_eval"]);
312 $ilCtrl->redirect($this,
"editSettings");
325 $ilTabs->activateTab(
"skills");
327 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
328 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
340 if (is_array(
$_POST[
"title"])) {
341 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
344 if (is_object($node_obj)) {
353 $ilCtrl->redirect($this,
"editSkills");
364 if (is_array(
$_POST[
"title"])) {
365 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
368 if (is_object($node_obj)) {
377 $ilCtrl->redirect($this,
"editSkillTemplates");
386 $_GET[
"skexpand"] =
"";
387 $n_id = (
$_GET[
"obj_id"] > 0)
389 : $this->skill_tree->readRootId();
390 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
392 foreach ($stree as
$n) {
393 $n_arr[] = $n[
"child"];
404 $_GET[
"skexpand"] =
"";
405 $n_id = (
$_GET[
"obj_id"] > 0)
407 : $this->skill_tree->readRootId();
408 $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
410 foreach ($stree as
$n) {
411 if (in_array($n[
"child"],
$old) && $n[
"child"] != $n_id) {
412 $k = array_search($n[
"child"],
$old);
431 if (!isset(
$_POST[
"id"])) {
432 $this->
ilias->raiseError($this->lng->txt(
"no_checkbox"), $this->
ilias->error_obj->MESSAGE);
435 $ilTabs->clearTargets();
439 $cskill_ids =
array();
442 if ($mode ==
"templates") {
443 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
449 include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
453 $cskill_ids[] =
array(
"skill_id" => $skill_id,
"tref_id" => $tref_id);
456 if ($mode ==
"basic") {
457 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
462 $cskill_ids[] =
array(
"skill_id" => $id,
"tref_id" => $tref_id);
469 if ($mode ==
"basic" || $mode ==
"templates") {
470 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
472 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
473 if (count($usages) > 0) {
475 foreach ($usages as $k => $usage) {
476 include_once(
"./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
481 $ilCtrl->saveParameter($a_gui,
"tmpmode");
482 $ilToolbar->addButton(
484 $ilCtrl->getLinkTarget($a_gui,
"cancelDelete")
490 $this->
ilias->raiseError(
"Skill Deletion - type mismatch.", $this->
ilias->error_obj->MESSAGE);
496 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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"));
505 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
506 foreach (
$_POST[
"id"] as $id) {
509 $confirmation_gui->addItem(
512 $node_obj->getTitle(),
518 $confirmation_gui->setCancel(
$lng->txt(
"cancel"),
"cancelDelete");
519 $confirmation_gui->setConfirm(
$lng->txt(
"confirm"),
"confirmedDelete");
521 $tpl->setContent($confirmation_gui->getHTML());
529 $this->ctrl->redirect($this,
"editSkills");
540 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
544 $node_data = $this->skill_tree->getNodeData($id);
545 if (is_object($obj)) {
548 if ($this->skill_tree->isInTree($id)) {
549 $this->skill_tree->deleteTree($node_data);
577 $this->setTestSubTabs(
"test");
579 $ilTabs->activateTab(
"test");
581 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
583 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
586 $this->form->addCommandButton(
"test",
$lng->txt(
"execute"));
588 $this->form->setTitle(
"getCompletionDateForTriggerRefId()");
589 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
593 $ti->setMaxLength(200);
594 $ti->setInfo(
"Separate multiple IDs by :");
595 $ti->setValue(
$_POST[
"user_id"]);
596 $this->form->addItem($ti);
600 $ti->setMaxLength(200);
601 $ti->setInfo(
"Separate multiple IDs by :");
602 $ti->setValue(
$_POST[
"ref_id"]);
603 $this->form->addItem($ti);
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];
612 if (count($ref_ids) == 1) {
613 $ref_ids = $ref_ids[0];
614 } elseif (count($ref_ids) == 0) {
618 $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
622 $tpl->setContent($this->form->getHTML() .
$result);
638 $this->setTestSubTabs(
"cert");
639 $ilTabs->activateTab(
"test");
641 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
643 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
646 $this->form->addCommandButton(
"testCert",
$lng->txt(
"execute"));
648 $this->form->setTitle(
"checkUserCertificateForTriggerRefId()");
649 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
653 $ti->setMaxLength(200);
654 $ti->setInfo(
"Separate multiple IDs by :");
655 $ti->setValue(
$_POST[
"user_id"]);
656 $this->form->addItem($ti);
660 $ti->setMaxLength(200);
661 $ti->setInfo(
"Separate multiple IDs by :");
662 $ti->setValue(
$_POST[
"ref_id"]);
663 $this->form->addItem($ti);
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];
672 if (count($ref_ids) == 1) {
673 $ref_ids = $ref_ids[0];
674 } elseif (count($ref_ids) == 0) {
678 $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
682 $tpl->setContent($this->form->getHTML() .
$result);
698 $this->setTestSubTabs(
"all_cert");
699 $ilTabs->activateTab(
"test");
701 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
703 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
706 $this->form->addCommandButton(
"testAllCert",
$lng->txt(
"execute"));
708 $this->form->setTitle(
"getTriggerOfAllCertificates()");
709 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
713 $ti->setMaxLength(200);
714 $ti->setInfo(
"Separate multiple IDs by :");
715 $ti->setValue(
$_POST[
"user_id"]);
716 $this->form->addItem($ti);
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];
726 $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
730 $tpl->setContent($this->form->getHTML() .
$result);
746 $this->setTestSubTabs(
"levels");
747 $ilTabs->activateTab(
"test");
749 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
751 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
754 $this->form->addCommandButton(
"testLevels",
$lng->txt(
"execute"));
756 $this->form->setTitle(
"getTriggerOfAllCertificates()");
757 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
761 $ti->setMaxLength(200);
762 $ti->setValue(
$_POST[
"ref_id"]);
763 $this->form->addItem($ti);
766 if (isset(
$_POST[
"ref_id"])) {
767 $result = ilBasicSkill::getSkillLevelsForTrigger(
$_POST[
"ref_id"]);
771 $tpl->setContent($this->form->getHTML() .
$result);
788 "getCompletionDateForTriggerRefId",
789 $ilCtrl->getLinkTarget($this,
"test")
794 "checkUserCertificateForTriggerRefId",
795 $ilCtrl->getLinkTarget($this,
"testCert")
800 "getTriggerOfAllCertificates",
801 $ilCtrl->getLinkTarget($this,
"testAllCert")
806 "getSkillLevelsForTrigger",
807 $ilCtrl->getLinkTarget($this,
"testLevels")
810 $ilTabs->activateSubtab($a_act);
827 $ilTabs->activateTab(
"skill_templates");
828 $ilCtrl->setParameterByClass(
"ilobjskillmanagementgui",
"obj_id", $this->skill_tree->getRootId());
829 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
839 public function showTree($a_templates, $a_gui =
"", $a_gui_cmd =
"")
847 if (
$_GET[
"obj_id"] ==
"" ||
$_GET[
"obj_id"] == 1) {
851 if (
$_GET[
"obj_id"] > 1) {
852 $path = $this->skill_tree->getPathId(
$_GET[
"obj_id"]);
853 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
860 $ilCtrl->setParameter($this,
"templates_tree", $a_templates);
863 include_once(
"./Services/Skill/classes/class.ilSkillTemplateTreeExplorerGUI.php");
866 include_once(
"./Services/Skill/classes/class.ilSkillTreeExplorerGUI.php");
869 if (!$exp->handleCommand()) {
870 $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.
if(!array_key_exists('StateId', $_REQUEST)) $id
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)
if(isset($_POST['submit'])) $form
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.