3 declare(strict_types=1);
37 $this->
ctrl = $DIC->ctrl();
38 $this->tpl = $DIC[
"tpl"];
39 $this->
tabs = $DIC->tabs();
40 $this->
lng = $DIC->language();
41 $this->
help = $DIC[
"ilHelp"];
42 $ilCtrl = $DIC->ctrl();
44 $ilCtrl->saveParameter($this,
"node_id");
45 $ilCtrl->saveParameter($this,
"tref_id");
49 $this->tref_id = $a_tref_id;
50 if (is_object($this->node_object)) {
51 $this->base_skill_id = $this->node_object->getSkillTemplateId();
68 $next_class = $ilCtrl->getNextClass($this);
69 $cmd = $ilCtrl->getCmd();
71 switch ($next_class) {
78 public function setTabs($a_tab =
"levels"): void
86 $ilTabs->clearTargets();
89 if (is_object($this->node_object)) {
90 $sk_id = $this->node_object->getSkillTemplateId();
93 if ($obj_type ==
"sctp") {
98 $ilCtrl->getLinkTarget($this,
'listItems')
104 $lng->
txt(
"skmg_skill_levels"),
105 $ilCtrl->getLinkTarget($this,
'listItems')
113 $ilCtrl->getLinkTarget($this,
'editProperties')
120 if ($obj_type !=
"sctp") {
124 $ilCtrl->setParameterByClass(
127 $this->skill_tree_node_manager->getRootId()
129 $ilTabs->setBackTarget(
131 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills")
133 $ilCtrl->setParameterByClass(
136 $this->requested_node_id
142 parent::setTitleIcon();
144 $lng->
txt(
"skmg_sktr") .
": " . $this->node_object->getTitle() . $add
148 $ilTabs->activateTab($a_tab);
157 $ilCtrl->saveParameter($this,
"parent_id");
158 $ilCtrl->saveParameter($this,
"target");
174 public function initForm(
string $a_mode =
"edit"): void
184 $tmplts = $this->skill_tree_node_manager->getTopTemplates();
188 $ti->setRequired(
true);
189 $this->
form->addItem($ti);
192 if ($a_mode ==
"edit") {
196 $ne->setValue($desc);
197 $ne->setInfo(
$lng->
txt(
"skmg_description_info"));
198 $this->
form->addItem($ne);
204 "" =>
$lng->
txt(
"please_select"),
206 foreach ($tmplts as $tmplt) {
207 $options[$tmplt[
"child"]] = $tmplt[
"title"];
209 if ($a_mode !=
"edit") {
212 $si->setRequired(
true);
213 $this->
form->addItem($si);
216 $ne->setValue($options[$this->node_object->getSkillTemplateId()] ??
"");
217 $this->
form->addItem($ne);
225 $cb->setInfo(
$lng->
txt(
"skmg_selectable_info"));
226 $this->
form->addItem($cb);
228 if ($this->tree_access_manager->hasManageCompetencesPermission()) {
229 if ($a_mode ==
"create") {
230 $this->
form->addCommandButton(
"save",
$lng->
txt(
"save"));
231 $this->
form->addCommandButton(
"cancelSave",
$lng->
txt(
"cancel"));
234 $this->
form->addCommandButton(
"updateSkillTemplateReference",
$lng->
txt(
"save"));
235 $this->
form->setTitle(
$lng->
txt(
"skmg_edit_sktr"));
238 foreach ($this->
form->getItems() as $item) {
239 $item->setDisabled(
true);
243 $this->
form->setFormAction($ilCtrl->getFormAction($this));
249 $values[
"skill_template_id"] = $this->node_object->getSkillTemplateId();
250 $values[
"title"] = $this->node_object->getTitle();
251 $values[
"description"] = $this->node_object->getDescription();
252 $values[
"selectable"] = $this->node_object->getSelfEvaluation();
253 $values[
"status"] = $this->node_object->getStatus();
254 $this->
form->setValuesByArray($values);
259 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
264 $sktr->setTitle($this->
form->getInput(
"title"));
265 $sktr->setDescription($this->
form->getInput(
"description"));
266 $sktr->setSkillTemplateId((
int) $this->
form->getInput(
"skill_template_id"));
267 $sktr->setSelfEvaluation((
bool) $this->
form->getInput(
"selectable"));
268 $sktr->setStatus((
int) $this->
form->getInput(
"status"));
271 $this->node_object = $sktr;
278 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
283 "ilskilltemplatereferencegui",
285 $this->node_object->getId()
287 $ilCtrl->setParameterByClass(
288 "ilskilltemplatereferencegui",
290 $this->node_object->getSkillTemplateId()
292 $ilCtrl->redirectByClass(
"ilskilltemplatereferencegui",
"listItems");
301 if (!$this->tree_access_manager->hasManageCompetencesPermission()) {
306 if ($this->
form->checkInput()) {
308 $this->node_object->setTitle($this->
form->getInput(
"title"));
309 $this->node_object->setDescription($this->
form->getInput(
"description"));
310 $this->node_object->setSelfEvaluation((
bool) $this->
form->getInput(
"selectable"));
311 $this->node_object->setStatus((
int) $this->
form->getInput(
"status"));
312 $this->node_object->update();
314 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
315 $ilCtrl->redirect($this,
"editProperties");
318 $this->
form->setValuesByPost();
328 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"skmg_skill_in_use"));
333 $sk_id = $this->node_object->getSkillTemplateId();
336 if ($obj_type ==
"sctp") {
342 $this->node_object->getId()
345 } elseif ($obj_type ==
"sktp") {
350 $this->node_object->getId(),
352 $this->tree_access_manager->hasManageCompetencesPermission()
364 $objects = $this->usage_manager->getAssignedObjectsForSkill($this->base_skill_id, $this->tref_id);
366 $table = $this->table_manager->getAssignedObjectsTable(
369 $this->base_skill_id,
381 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
static _lookupTemplateId(int $a_obj_id)
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...
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, string $submit_caption="")
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilGlobalTemplateInterface $tpl
__construct(Node\SkillTreeNodeManager $node_manager, int $a_tref_id=0)
Basic skill template GUI class.
addStatusInput(ilPropertyFormGUI $a_form)