19declare(strict_types=1);
86 $this->export_factory =
new ExportFactory();
88 $this->
ctrl = $DIC->ctrl();
89 $this->
lng = $DIC->language();
90 $this->
locator = $DIC[
"ilLocator"];
91 $this->tpl =
$DIC[
"tpl"];
92 $this->
user = $DIC->user();
93 $this->ui_fac =
$DIC->ui()->factory();
94 $this->ui_ren =
$DIC->ui()->renderer();
95 $ilAccess =
$DIC->access();
96 $this->tree =
$DIC->repositoryTree();
97 $this->
tabs = $DIC->tabs();
98 $this->admin_gui_request =
$DIC->skills()->internal()->gui()->admin_request();
99 $this->skill_ui_service =
$DIC->skills()->ui();
101 $this->node_object =
null;
102 $this->
access = $ilAccess;
104 $this->requested_ref_id = $this->admin_gui_request->getRefId();
105 $this->requested_node_id = $this->admin_gui_request->getNodeId();
106 $this->requested_backcmd = $this->admin_gui_request->getBackCommand();
107 $this->requested_tmpmode = $this->admin_gui_request->getTemplateMode();
108 $this->requested_node_ids = $this->admin_gui_request->getNodeIds();
109 $this->requested_node_order = $this->admin_gui_request->getOrder();
111 $this->skill_tree_node_manager = $node_manager;
112 $this->tree_access_manager =
$DIC->skills()->internal()->manager()->getTreeAccessManager($this->requested_ref_id);
113 $this->table_manager =
$DIC->skills()->internal()->manager()->getTableManager();
114 $this->usage_manager =
$DIC->skills()->internal()->manager()->getUsageManager();
115 $this->tree_repo =
$DIC->skills()->internal()->repo()->getTreeRepo();
116 $this->skill_tree_id = $this->tree_repo->getTreeIdForNodeId($this->requested_node_id);
118 if ($a_node_id > 0 &&
126 if (!is_object($this->node_object)) {
129 if ($this->use_checked) {
133 $usages = $this->usage_manager->getAllUsagesInfoOfSubtrees($cskill_ids);
134 if (count($usages) > 0) {
135 $this->in_use =
true;
137 $this->in_use =
false;
144 $this->parentgui = $a_parentgui;
165 $ilCtrl->redirect($this,
"showOrganization");
175 $ilCtrl->
setParameter($this,
"backcmd", $this->requested_backcmd);
186 if (empty($this->requested_node_ids)) {
192 foreach ($items as $k => $item) {
197 foreach ($todel as $k) {
202 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
206 $this->skill_tree_node_manager->clipboardCut($items);
208 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_selected_items_have_been_cut"),
true);
210 $this->skill_tree_node_manager->saveChildsOrder(
211 $this->requested_node_id,
213 $this->requested_tmpmode
227 if (empty($this->requested_node_ids)) {
233 foreach ($items as $k => $item) {
238 foreach ($todel as $k) {
242 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_insert_please_choose_one_type_only"),
true);
245 $this->skill_tree_node_manager->clipboardCopy($items);
247 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_selected_items_have_been_copied"),
true);
266 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
271 $this->skill_tree_node_manager->saveChildsOrder(
272 $this->requested_node_id,
274 $this->requested_tmpmode
284 $tpl->
setDescription($this->skill_tree_node_manager->getWrittenPath($this->node_object->getId(), $this->tref_id));
299 $ilCtrl->getLinkTarget($this,
"redirectToParent")
314 $radg->addOption($op);
326 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_skill_in_use"));
341 $values[
"title"] = $this->node_object->getTitle();
342 $values[
"description"] = $this->node_object->getDescription();
343 $values[
"order_nr"] = $this->node_object->getOrderNr();
344 $values[
"self_eval"] = $this->node_object->getSelfEvaluation();
345 $values[
"status"] = (string) $this->node_object->getStatus();
347 $this->
form->setValuesByArray($values);
360 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
365 if ($this->
form->checkInput()) {
367 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
368 $this->skill_tree_node_manager->saveChildsOrder(
369 $this->requested_node_id,
371 in_array($this->getType(), array(
"sktp",
"sctp"))
375 $this->
form->setValuesByPost();
396 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
401 if ($this->
form->checkInput()) {
403 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
406 $this->
form->setValuesByPost();
415 $ilCtrl->
redirect($this,
"editProperties");
418 public function initForm(
string $a_mode =
"edit"): void
427 $ti->setMaxLength(200);
429 $ti->setRequired(
true);
430 $this->
form->addItem($ti);
435 $this->
form->addItem($ta);
438 if ($a_mode ==
"create") {
439 $this->
form->addCommandButton(
"save", $lng->
txt(
"save"));
440 $this->
form->addCommandButton(
"cancelSave", $lng->
txt(
"cancel"));
441 $this->
form->setTitle($lng->
txt(
"skmg_create_" . $this->getType()));
443 $this->
form->addCommandButton(
"update", $lng->
txt(
"save"));
444 $this->
form->setTitle($lng->
txt(
"skmg_edit_" . $this->getType()));
447 $ilCtrl->setParameter($this,
"node_id", $this->requested_node_id);
448 $this->
form->setFormAction($ilCtrl->getFormAction($this));
463 if ($this->requested_tmpmode) {
471 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"node_id", $this->requested_node_id);
473 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listTemplates");
475 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
480 $ilCtrl->setParameterByClass(
"ilskilltemplatecategorygui",
"node_id", $this->requested_node_id);
481 $ilCtrl->redirectByClass(
"ilskilltemplatecategorygui",
"listItems");
485 $ilCtrl->setParameterByClass(
"ilskillcategorygui",
"node_id", $this->requested_node_id);
486 $ilCtrl->redirectByClass(
"ilskillcategorygui",
"listItems");
495 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
499 $this->skill_tree_node_manager->saveChildsOrder(
500 $this->requested_node_id,
501 $this->requested_node_order,
502 $this->requested_tmpmode
504 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
510 $this->skill_tree_node_manager->insertItemsFromClip(
"skll", $this->requested_node_id);
516 $this->skill_tree_node_manager->insertItemsFromClip(
"scat", $this->requested_node_id);
522 $this->skill_tree_node_manager->insertItemsFromClip(
"sktr", $this->requested_node_id);
528 $this->skill_tree_node_manager->insertItemsFromClip(
"sktp", $this->requested_node_id);
534 $this->skill_tree_node_manager->insertItemsFromClip(
"sctp", $this->requested_node_id);
542 $obj_id = (is_object($this->node_object))
543 ? $this->node_object->getId()
567 $ilCtrl->getLinkTarget($this,
"showUsage")
575 $this->setTabs(
"usage");
578 ? $this->base_skill_id
579 : $this->node_object->getId();
580 $usages = $this->usage_manager->getAllUsagesInfoOfSubtree(
$base_skill_id, $this->tref_id);
583 foreach ($usages as $k => $usage) {
584 $usages_ui = $this->skill_ui_service->getUsagesUI($k, $usage);
585 $html .= $usages_ui->render() .
"<br/><br/>";
598 $lng->
txt(
"skmg_assigned_objects"),
599 $ilCtrl->getLinkTarget($this,
"showObjects")
607 $this->setTabs(
"objects");
610 ? $this->base_skill_id
611 : $this->node_object->getId();
612 $objects = $this->usage_manager->getAssignedObjectsForSkill(
$base_skill_id, $this->tref_id);
614 $table = $this->table_manager->getAssignedObjectsTable(
624 public function exportSelectedNodes(): void
628 if (empty($this->requested_node_ids)) {
633 $configs = $this->export_factory->consumer()->exportConfig()->allExportConfigs();
634 $config = $configs->getElementByComponent(
'components/ILIAS/Skill');
635 $config->setSelectedNodes($this->requested_node_ids);
636 $config->setSkillTreeId($this->skill_tree_id);
639 $obj->setRefId($this->requested_ref_id);
640 $obj->setType(
'skee');
642 $obj->setType(
'skmg');
643 $this->export_factory->consumer()->handler()->createStandardExportByObject($this->
user->getId(), $obj, $configs);
644 $ilCtrl->redirectByClass(array(
"ilobjskilltreegui",
"ilexportgui"),
"");
Request wrapper for guis in skill administration.
Class ilCtrl provides processing control methods.
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
@inheritDoc
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
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...
Class ilObject Basic functions for all objects.
This class represents an option in a radio group.
static getInstance(int $a_id=0)
Basic GUI class for skill tree nodes.
Table TableManager $table_manager
readNodeObject(int $a_node_id)
Get node object instance.
SkillTreeAccess $tree_access_manager
array $requested_node_ids
__construct(Node\SkillTreeNodeManager $node_manager, int $a_node_id=0)
Node SkillTreeNodeManager $skill_tree_node_manager
insertSkillTemplateClip()
ilSkillTreeRepository $tree_repo
ilGlobalTemplateInterface $tpl
initForm(string $a_mode="edit")
addUsageTab(ilTabsGUI $a_tabs)
save()
Save skill tree node.
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()
SkillUIService $skill_ui_service
Usage SkillUsageManager $usage_manager
update()
Update skill tree node.
insertTemplateCategoryClip()
setParentGUI(object $a_parentgui)
addStatusInput(ilPropertyFormGUI $a_form)
ExportFactoryInterface $export_factory
array $requested_node_order
cutItems()
Copy items to clipboard, then cut them from the current tree.
DataFactory $data_factory
insertSkillCategoryClip()
copyItems()
Copy items to clipboard.
redirectToParent(bool $a_tmp_mode=false)
Redirect to parent (identified by current node_id)
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.
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.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
setDescription(string $a_descr)
Sets description below title in standard template.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Interface ilSkillTreeRepository.
form( $class_path, string $cmd, string $submit_caption="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...