70 $this->
ctrl = $DIC->ctrl();
71 $this->
lng = $DIC->language();
72 $this->
locator = $DIC[
"ilLocator"];
73 $this->tpl =
$DIC[
"tpl"];
74 $this->
user = $DIC->user();
75 $ilAccess =
$DIC->access();
76 $this->tree =
$DIC->repositoryTree();
77 $this->
tabs = $DIC->tabs();
78 $this->admin_gui_request =
$DIC->skills()->internal()->gui()->admin_request();
80 $this->node_object =
null;
83 $this->requested_ref_id = $this->admin_gui_request->getRefId();
84 $this->requested_node_id = $this->admin_gui_request->getNodeId();
85 $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
86 $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
87 $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
88 $this->requested_node_order = $this->admin_gui_request->getOrder();
90 $this->skill_tree_node_manager = $node_manager;
91 $this->tree_access_manager =
$DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
92 $this->tree_repo =
$DIC->skills()->internal()->repo()->getTreeRepo();
93 $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
103 if (!is_object($this->node_object)) {
106 if ($this->use_checked) {
111 $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
112 if (count($usages) > 0) {
113 $this->in_use =
true;
115 $this->in_use =
false;
122 $this->parentgui = $a_parentgui;
143 $ilCtrl->redirect($this,
"showOrganization");
153 $ilCtrl->
setParameter($this,
"backcmd", $this->requested_backcmd);
164 if (empty($this->requested_node_ids)) {
170 foreach ($items as $k => $item) {
175 foreach ($todel as $k) {
180 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
184 $this->skill_tree_node_manager->clipboardCut($items);
186 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_selected_items_have_been_cut"),
true);
188 $this->skill_tree_node_manager->saveChildsOrder(
189 $this->requested_node_id,
191 $this->requested_tmpmode
205 if (empty($this->requested_node_ids)) {
211 foreach ($items as $k => $item) {
216 foreach ($todel as $k) {
220 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
223 $this->skill_tree_node_manager->clipboardCopy($items);
225 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_selected_items_have_been_copied"),
true);
244 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
249 $this->skill_tree_node_manager->saveChildsOrder(
250 $this->requested_node_id,
252 $this->requested_tmpmode
262 $tpl->
setDescription($this->skill_tree_node_manager->getWrittenPath($this->node_object->getId(), $this->tref_id));
277 $ilCtrl->getLinkTarget($this,
"redirectToParent")
292 $radg->addOption($op);
304 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_skill_in_use"));
319 $values[
"title"] = $this->node_object->getTitle();
320 $values[
"description"] = $this->node_object->getDescription();
321 $values[
"order_nr"] = $this->node_object->getOrderNr();
322 $values[
"self_eval"] = $this->node_object->getSelfEvaluation();
323 $values[
"status"] = (string) $this->node_object->getStatus();
325 $this->
form->setValuesByArray($values);
338 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
343 if ($this->
form->checkInput()) {
345 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
346 $this->skill_tree_node_manager->saveChildsOrder(
347 $this->requested_node_id,
349 in_array($this->getType(), array(
"sktp",
"sctp"))
353 $this->
form->setValuesByPost();
374 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
379 if ($this->
form->checkInput()) {
381 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
384 $this->
form->setValuesByPost();
393 $ilCtrl->
redirect($this,
"editProperties");
396 public function initForm(
string $a_mode =
"edit"): void
405 $ti->setMaxLength(200);
407 $ti->setRequired(
true);
408 $this->
form->addItem($ti);
413 $this->
form->addItem($ta);
416 if ($a_mode ==
"create") {
417 $this->
form->addCommandButton(
"save", $lng->
txt(
"save"));
418 $this->
form->addCommandButton(
"cancelSave", $lng->
txt(
"cancel"));
419 $this->
form->setTitle($lng->
txt(
"skmg_create_" . $this->getType()));
421 $this->
form->addCommandButton(
"update", $lng->
txt(
"save"));
422 $this->
form->setTitle($lng->
txt(
"skmg_edit_" . $this->getType()));
425 $ilCtrl->setParameter($this,
"node_id", $this->requested_node_id);
426 $this->
form->setFormAction($ilCtrl->getFormAction($this));
441 if ($this->requested_tmpmode) {
449 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"node_id", $this->requested_node_id);
451 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
453 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
458 $ilCtrl->setParameterByClass(
"ilskilltemplatecategorygui",
"node_id", $this->requested_node_id);
459 $ilCtrl->redirectByClass(
"ilskilltemplatecategorygui",
"listItems");
463 $ilCtrl->setParameterByClass(
"ilskillcategorygui",
"node_id", $this->requested_node_id);
464 $ilCtrl->redirectByClass(
"ilskillcategorygui",
"listItems");
473 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
477 $this->skill_tree_node_manager->saveChildsOrder(
478 $this->requested_node_id,
479 $this->requested_node_order,
480 $this->requested_tmpmode
482 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
488 $this->skill_tree_node_manager->insertItemsFromClip(
"skll", $this->requested_node_id);
494 $this->skill_tree_node_manager->insertItemsFromClip(
"scat", $this->requested_node_id);
500 $this->skill_tree_node_manager->insertItemsFromClip(
"sktr", $this->requested_node_id);
506 $this->skill_tree_node_manager->insertItemsFromClip(
"sktp", $this->requested_node_id);
512 $this->skill_tree_node_manager->insertItemsFromClip(
"sctp", $this->requested_node_id);
520 $obj_id = (is_object($this->node_object))
521 ? $this->node_object->getId()
545 $ilCtrl->getLinkTarget($this,
"showUsage")
553 $this->setTabs(
"usage");
557 ? $this->base_skill_id
558 : $this->node_object->getId();
559 $usages = $usage_info->getAllUsagesInfoOfSubtree(
$base_skill_id, $this->tref_id);
562 foreach ($usages as $k => $usage) {
564 $html .= $tab->getHTML() .
"<br/><br/>";
577 $lng->
txt(
"skmg_assigned_objects"),
578 $ilCtrl->getLinkTarget($this,
"showObjects")
586 $this->setTabs(
"objects");
589 ? $this->base_skill_id
590 : $this->node_object->getId();
592 $objects = $usage_info->getAssignedObjectsForSkill(
$base_skill_id, $this->tref_id);
603 if (empty($this->requested_node_ids)) {
608 $conf = $exp->getConfig(
"Services/Skill");
609 $conf->setSelectedNodes($this->requested_node_ids);
610 $conf->setSkillTreeId($this->skill_tree_id);
613 $ilCtrl->redirectByClass(array(
"ilobjskilltreegui",
"ilexportgui"),
"");
Request wrapper for guis in skill administration.
Class ilCtrl provides processing control methods.
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(int $a_id=0)
Basic GUI class for skill tree nodes.
readNodeObject(int $a_node_id)
Get node object instance.
SkillTreeAccess $tree_access_manager
array $requested_node_ids
insertSkillTemplateClip()
ilSkillTreeRepository $tree_repo
ilGlobalTemplateInterface $tpl
initForm(string $a_mode="edit")
addUsageTab(ilTabsGUI $a_tabs)
save()
Save skill tree node.
Tree SkillTreeNodeManager $skill_tree_node_manager
addObjectsTab(ilTabsGUI $a_tabs)
string $requested_backcmd
confirmedDelete()
confirmed delete
deleteNodes()
Delete nodes in the hierarchy.
getPropertyValues()
Get property values for edit form.
SkillAdminGUIRequest $admin_gui_request
setSkillNodeDescription()
create()
Create skill tree node.
insertTemplateReferenceClip()
update()
Update skill tree node.
insertTemplateCategoryClip()
setParentGUI(object $a_parentgui)
addStatusInput(ilPropertyFormGUI $a_form)
array $requested_node_order
cutItems()
Copy items to clipboard, then cut them from the current tree.
insertSkillCategoryClip()
copyItems()
Copy items to clipboard.
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
__construct(Tree\SkillTreeNodeManager $node_manager, int $a_node_id=0)
static uniqueTypesCheck(array $a_items)
Check for unique types.
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
static getStatusInfo(int $a_status)
static getAllStatus()
Get all status as array, key is value, value is lang text.
static _lookupType(int $a_obj_id)
static _lookupStatus(int $a_obj_id)
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
TableGUI class for skill usages.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
setBackTarget(string $a_title, string $a_target, string $a_frame="")
This class represents a text area property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setDescription(string $a_descr)
Sets description below title in standard template.
setContent(string $a_html)
Sets content for standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
Interface ilSkillTreeRepository.
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...