35 $this->
ctrl = $DIC->ctrl();
36 $this->tpl = $DIC[
"tpl"];
37 $this->
tabs = $DIC->tabs();
38 $this->
lng = $DIC->language();
39 $this->
help = $DIC[
"ilHelp"];
40 $ilCtrl = $DIC->ctrl();
42 $ilCtrl->saveParameter($this,
"node_id");
43 $ilCtrl->saveParameter($this,
"tref_id");
47 $this->tref_id = $a_tref_id;
48 if (is_object($this->node_object)) {
49 $this->base_skill_id = $this->node_object->getSkillTemplateId();
66 $next_class = $ilCtrl->getNextClass($this);
67 $cmd = $ilCtrl->getCmd();
69 switch ($next_class) {
76 public function setTabs($a_tab =
"levels"): void
84 $ilTabs->clearTargets();
87 if (is_object($this->node_object)) {
88 $sk_id = $this->node_object->getSkillTemplateId();
91 if ($obj_type ==
"sctp") {
96 $ilCtrl->getLinkTarget($this,
'listItems')
102 $lng->
txt(
"skmg_skill_levels"),
103 $ilCtrl->getLinkTarget($this,
'listItems')
111 $ilCtrl->getLinkTarget($this,
'editProperties')
118 if ($obj_type !=
"sctp") {
122 $ilCtrl->setParameterByClass(
125 $this->skill_tree_node_manager->getRootId()
127 $ilTabs->setBackTarget(
129 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills")
131 $ilCtrl->setParameterByClass(
134 $this->requested_node_id
140 parent::setTitleIcon();
142 $lng->
txt(
"skmg_sktr") .
": " . $this->node_object->getTitle() . $add
146 $ilTabs->activateTab($a_tab);
155 $ilCtrl->saveParameter($this,
"parent_id");
156 $ilCtrl->saveParameter($this,
"target");
172 public function initForm(
string $a_mode =
"edit"): void
182 $tmplts = $this->skill_tree_node_manager->getTopTemplates();
186 $ti->setRequired(
true);
187 $this->
form->addItem($ti);
190 if ($a_mode ==
"edit") {
195 $ne->setInfo(
$lng->
txt(
"skmg_description_info"));
196 $this->
form->addItem($ne);
202 "" =>
$lng->
txt(
"please_select"),
204 foreach ($tmplts as $tmplt) {
205 $options[$tmplt[
"child"]] = $tmplt[
"title"];
207 if ($a_mode !=
"edit") {
209 $si->setOptions($options);
210 $si->setRequired(
true);
211 $this->
form->addItem($si);
214 $ne->
setValue($options[$this->node_object->getSkillTemplateId()] ??
"");
215 $this->
form->addItem($ne);
224 $this->
form->addItem($cb);
226 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
227 if ($a_mode ==
"create") {
228 $this->
form->addCommandButton(
"save",
$lng->
txt(
"save"));
229 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
232 $this->
form->addCommandButton(
"updateSkillTemplateReference",
$lng->
txt(
"save"));
233 $this->
form->setTitle(
$lng->
txt(
"skmg_edit_sktr"));
236 foreach ($this->
form->getItems() as $item) {
237 $item->setDisabled(
true);
241 $this->
form->setFormAction($ilCtrl->getFormAction($this));
247 $values[
"skill_template_id"] = $this->node_object->getSkillTemplateId();
248 $values[
"title"] = $this->node_object->getTitle();
249 $values[
"description"] = $this->node_object->getDescription();
250 $values[
"selectable"] = $this->node_object->getSelfEvaluation();
251 $values[
"status"] = $this->node_object->getStatus();
252 $this->
form->setValuesByArray($values);
257 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
262 $sktr->setTitle($this->
form->getInput(
"title"));
263 $sktr->setDescription($this->
form->getInput(
"description"));
264 $sktr->setSkillTemplateId($this->
form->getInput(
"skill_template_id"));
265 $sktr->setSelfEvaluation((
bool) $this->
form->getInput(
"selectable"));
266 $sktr->setStatus($this->
form->getInput(
"status"));
269 $this->node_object = $sktr;
276 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
281 "ilskilltemplatereferencegui",
283 $this->node_object->getId()
285 $ilCtrl->setParameterByClass(
286 "ilskilltemplatereferencegui",
288 $this->node_object->getSkillTemplateId()
290 $ilCtrl->redirectByClass(
"ilskilltemplatereferencegui",
"listItems");
299 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
304 if ($this->
form->checkInput()) {
306 $this->node_object->setTitle($this->
form->getInput(
"title"));
307 $this->node_object->setDescription($this->
form->getInput(
"description"));
308 $this->node_object->setSelfEvaluation((
bool) $this->
form->getInput(
"selectable"));
309 $this->node_object->setStatus($this->
form->getInput(
"status"));
310 $this->node_object->update();
312 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
313 $ilCtrl->redirect($this,
"editProperties");
316 $this->
form->setValuesByPost();
326 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_skill_in_use"));
331 $sk_id = $this->node_object->getSkillTemplateId();
334 if ($obj_type ==
"sctp") {
340 $this->node_object->getId()
343 } elseif ($obj_type ==
"sktp") {
348 $this->node_object->getId(),
350 $this->tree_access_manager->hasManageCompetencesPermission()
363 $objects = $usage_info->getAssignedObjectsForSkill($this->base_skill_id, $this->tref_id);
375 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
static _lookupTemplateId(int $a_obj_id)
__construct(Tree\SkillTreeNodeManager $node_manager, int $a_tref_id=0)
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...
setSkillNodeDescription()
addUsageTab(ilTabsGUI $a_tabs)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
setParameterByClass(string $a_class, string $a_parameter, $a_value)
initForm(string $a_mode="edit")
static _lookupType(int $a_obj_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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupDescription(int $a_obj_id)
setContent(string $a_html)
Sets content for standard template.
setScreenIdComponent(string $a_comp)
addObjectsTab(ilTabsGUI $a_tabs)
Skill template reference GUI class.
redirectToParent(bool $a_tmp_mode=false)
updateSkillTemplateReference()
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
form( $class_path, string $cmd)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
ilGlobalTemplateInterface $tpl
Basic skill template GUI class.
addStatusInput(ilPropertyFormGUI $a_form)