3 declare(strict_types=1);
81 $this->
ctrl = $DIC->ctrl();
82 $this->
lng = $DIC->language();
83 $this->
locator = $DIC[
"ilLocator"];
84 $this->tpl = $DIC[
"tpl"];
85 $this->
user = $DIC->user();
86 $this->ui_fac = $DIC->ui()->factory();
87 $this->ui_ren = $DIC->ui()->renderer();
88 $ilAccess = $DIC->access();
89 $this->tree = $DIC->repositoryTree();
90 $this->
tabs = $DIC->tabs();
91 $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
92 $this->skill_ui_service = $DIC->skills()->ui();
94 $this->node_object = null;
97 $this->requested_ref_id = $this->admin_gui_request->getRefId();
98 $this->requested_node_id = $this->admin_gui_request->getNodeId();
99 $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
100 $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
101 $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
102 $this->requested_node_order = $this->admin_gui_request->getOrder();
104 $this->skill_tree_node_manager = $node_manager;
105 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
106 $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
107 $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
108 $this->tree_repo = $DIC->skills()->internal()->repo()->getTreeRepo();
109 $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
111 if ($a_node_id > 0 &&
119 if (!is_object($this->node_object)) {
122 if ($this->use_checked) {
126 $usages = $this->usage_manager->getAllUsagesInfoOfSubtrees($cskill_ids);
127 if (count($usages) > 0) {
128 $this->in_use =
true;
130 $this->in_use =
false;
137 $this->parentgui = $a_parentgui;
158 $ilCtrl->redirect($this,
"showOrganization");
168 $ilCtrl->
setParameter($this,
"backcmd", $this->requested_backcmd);
179 if (empty($this->requested_node_ids)) {
185 foreach ($items as $k => $item) {
190 foreach ($todel as $k) {
195 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
199 $this->skill_tree_node_manager->clipboardCut($items);
201 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_selected_items_have_been_cut"),
true);
203 $this->skill_tree_node_manager->saveChildsOrder(
204 $this->requested_node_id,
206 $this->requested_tmpmode
220 if (empty($this->requested_node_ids)) {
226 foreach ($items as $k => $item) {
231 foreach ($todel as $k) {
235 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
238 $this->skill_tree_node_manager->clipboardCopy($items);
240 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_selected_items_have_been_copied"),
true);
259 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
264 $this->skill_tree_node_manager->saveChildsOrder(
265 $this->requested_node_id,
267 $this->requested_tmpmode
292 $ilCtrl->getLinkTarget($this,
"redirectToParent")
307 $radg->addOption($op);
319 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"skmg_skill_in_use"));
334 $values[
"title"] = $this->node_object->getTitle();
335 $values[
"description"] = $this->node_object->getDescription();
336 $values[
"order_nr"] = $this->node_object->getOrderNr();
337 $values[
"self_eval"] = $this->node_object->getSelfEvaluation();
338 $values[
"status"] = (string) $this->node_object->getStatus();
340 $this->
form->setValuesByArray($values);
353 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
358 if ($this->
form->checkInput()) {
360 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
361 $this->skill_tree_node_manager->saveChildsOrder(
362 $this->requested_node_id,
364 in_array($this->getType(), array(
"sktp",
"sctp"))
368 $this->
form->setValuesByPost();
389 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
394 if ($this->
form->checkInput()) {
396 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
399 $this->
form->setValuesByPost();
408 $ilCtrl->
redirect($this,
"editProperties");
411 public function initForm(
string $a_mode =
"edit"): void
420 $ti->setMaxLength(200);
422 $ti->setRequired(
true);
423 $this->
form->addItem($ti);
428 $this->
form->addItem($ta);
431 if ($a_mode ==
"create") {
432 $this->
form->addCommandButton(
"save", $lng->
txt(
"save"));
433 $this->
form->addCommandButton(
"cancelSave", $lng->
txt(
"cancel"));
434 $this->
form->setTitle($lng->
txt(
"skmg_create_" . $this->getType()));
436 $this->
form->addCommandButton(
"update", $lng->
txt(
"save"));
437 $this->
form->setTitle($lng->
txt(
"skmg_edit_" . $this->getType()));
440 $ilCtrl->setParameter($this,
"node_id", $this->requested_node_id);
441 $this->
form->setFormAction($ilCtrl->getFormAction($this));
456 if ($this->requested_tmpmode) {
464 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"node_id", $this->requested_node_id);
466 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
468 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
473 $ilCtrl->setParameterByClass(
"ilskilltemplatecategorygui",
"node_id", $this->requested_node_id);
474 $ilCtrl->redirectByClass(
"ilskilltemplatecategorygui",
"listItems");
478 $ilCtrl->setParameterByClass(
"ilskillcategorygui",
"node_id", $this->requested_node_id);
479 $ilCtrl->redirectByClass(
"ilskillcategorygui",
"listItems");
488 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
492 $this->skill_tree_node_manager->saveChildsOrder(
493 $this->requested_node_id,
494 $this->requested_node_order,
495 $this->requested_tmpmode
497 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
503 $this->skill_tree_node_manager->insertItemsFromClip(
"skll", $this->requested_node_id);
509 $this->skill_tree_node_manager->insertItemsFromClip(
"scat", $this->requested_node_id);
515 $this->skill_tree_node_manager->insertItemsFromClip(
"sktr", $this->requested_node_id);
521 $this->skill_tree_node_manager->insertItemsFromClip(
"sktp", $this->requested_node_id);
527 $this->skill_tree_node_manager->insertItemsFromClip(
"sctp", $this->requested_node_id);
535 $obj_id = (is_object($this->node_object))
536 ? $this->node_object->getId()
559 $lng->
txt(
"skmg_usage"),
560 $ilCtrl->getLinkTarget($this,
"showUsage")
568 $this->setTabs(
"usage");
570 $base_skill_id = ($this->base_skill_id > 0)
571 ? $this->base_skill_id
572 : $this->node_object->getId();
573 $usages = $this->usage_manager->getAllUsagesInfoOfSubtree($base_skill_id, $this->tref_id);
576 foreach ($usages as $k => $usage) {
577 $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
578 $html .= $usages_ui->render() .
"<br/><br/>";
591 $lng->
txt(
"skmg_assigned_objects"),
592 $ilCtrl->getLinkTarget($this,
"showObjects")
600 $this->setTabs(
"objects");
602 $base_skill_id = ($this->base_skill_id > 0)
603 ? $this->base_skill_id
604 : $this->node_object->getId();
605 $objects = $this->usage_manager->getAssignedObjectsForSkill($base_skill_id, $this->tref_id);
607 $table = $this->table_manager->getAssignedObjectsTable(
614 $tpl->
setContent($this->ui_ren->render($table));
621 if (empty($this->requested_node_ids)) {
626 $conf = $exp->getConfig(
"Services/Skill");
627 $conf->setSelectedNodes($this->requested_node_ids);
628 $conf->setSkillTreeId($this->skill_tree_id);
631 $ilCtrl->redirectByClass(array(
"ilobjskilltreegui",
"ilexportgui"),
"");
static getAllCSkillIdsForNodeIds(array $a_node_ids)
Get all possible common skill IDs for node IDs.
cutItems()
Copy items to clipboard, then cut them from the current tree.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insertTemplateReferenceClip()
array $requested_node_order
static _lookupStatus(int $a_obj_id)
SkillUIService $skill_ui_service
initForm(string $a_mode="edit")
static getAllStatus()
Get all status as array, key is value, value is lang text.
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...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
setSkillNodeDescription()
addUsageTab(ilTabsGUI $a_tabs)
readNodeObject(int $a_node_id)
Get node object instance.
Request wrapper for guis in skill administration.
Table TableManager $table_manager
Usage SkillUsageManager $usage_manager
update()
Update skill tree node.
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
static _lookupType(int $a_obj_id)
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
deleteNodes()
Delete nodes in the hierarchy.
ilSkillTreeRepository $tree_repo
static getInstance(int $a_id=0)
array $requested_node_ids
getPropertyValues()
Get property values for edit form.
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...
copyItems()
Copy items to clipboard.
setParentGUI(object $a_parentgui)
create()
Create skill tree node.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
Basic GUI class for skill tree nodes.
confirmedDelete()
confirmed delete
addObjectsTab(ilTabsGUI $a_tabs)
string $requested_backcmd
setBackTarget(string $a_title, string $a_target, string $a_frame="")
ilGlobalTemplateInterface $tpl
static getIconPath(int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
Node SkillTreeNodeManager $skill_tree_node_manager
SkillAdminGUIRequest $admin_gui_request
save()
Save skill tree node.
__construct(Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
form( $class_path, string $cmd, string $submit_caption="")
insertSkillCategoryClip()
setDescription(string $a_descr)
Sets description below title in standard template.
This class represents a text area property in a property form.
insertSkillTemplateClip()
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...
SkillTreeAccess $tree_access_manager
static uniqueTypesCheck(array $a_items)
Check for unique types.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getStatusInfo(int $a_status)
addStatusInput(ilPropertyFormGUI $a_form)
addTab(string $a_id, string $a_text, string $a_link, string $a_frame="")
Add a Tab.
insertTemplateCategoryClip()