ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillTemplateReferenceGUI Class Reference

Skill template reference GUI class. More...

+ Inheritance diagram for ilSkillTemplateReferenceGUI:
+ Collaboration diagram for ilSkillTemplateReferenceGUI:

Public Member Functions

 __construct ($a_tref_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 setTabs ($a_tab="")
 output tabs More...
 
 insert ()
 Insert. More...
 
 editProperties ()
 Edit properties. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 getValues ()
 Get current values for from. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateSkillTemplateReference ()
 Update form. More...
 
 cancel ()
 Cancel. More...
 
 listItems ()
 List items. More...
 
 showObjects ()
 Show assigned objects. More...
 
- Public Member Functions inherited from ilBasicSkillTemplateGUI
 __construct ($a_node_id=0, $a_tref_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="")
 Set header for skill. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 edit ()
 Edit skill. More...
 
 showUsage ()
 Show skill usage. More...
 
 showObjects ()
 Show assigned objects. More...
 
- Public Member Functions inherited from ilBasicSkillGUI
 __construct ($a_node_id=0)
 Constructor. More...
 
 getType ()
 Get Node Type. More...
 
 executeCommand ()
 Execute command. More...
 
 showProperties ()
 Show properties. More...
 
 saveItem ()
 Save item. More...
 
 afterSave ()
 After saving. More...
 
 updateItem ()
 Update item. More...
 
 edit ()
 Edit skill. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 editProperties ()
 Edit properties. More...
 
 addLevel ()
 Add new level. More...
 
 editLevel ()
 Edit level. More...
 
 saveLevel ()
 Save level form. More...
 
 updateLevel ()
 Update level form. More...
 
 initLevelForm ($a_mode="edit")
 Init level form. More...
 
 getLevelValues ()
 Get current values for level from. More...
 
 updateLevelOrder ()
 Update level order. More...
 
 confirmLevelDeletion ()
 Confirm level deletion. More...
 
 deleteLevel ()
 Delete levels. More...
 
 setLevelHead ()
 Set header for level. More...
 
 setTabs ($a_tab="levels")
 Set header for skill. More...
 
 editLevelTrigger ()
 Edit level trigger. More...
 
 selectLevelTrigger ()
 Select skill level trigger. More...
 
 saveLevelTrigger ()
 Save level trigger. More...
 
 removeLevelTrigger ()
 Remove trigger. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 showLevelResources ()
 Show level resources. More...
 
 addLevelResource ()
 Add level resource. More...
 
 saveLevelResource ()
 Save level resource. More...
 
 confirmLevelResourcesRemoval ()
 Confirm level resources removal. More...
 
 removeLevelResources ()
 Remove level resource. More...
 
 saveResourceSettings ()
 Save resource settings. More...
 
- Public Member Functions inherited from ilSkillTreeNodeGUI
 __construct ($a_node_id=0)
 constructor More...
 
 isInUse ()
 Is in use? More...
 
 checkPermissionBool ($a_perm)
 Check permission pool. More...
 
 setParentGUI ($a_parentgui)
 Set Parent GUI class. More...
 
 getParentGUI ()
 Get Parent GUI class (ilObjSCORM2004LearningModuleGUI). More...
 
 readNodeObject ($a_node_id)
 Get node object instance. More...
 
 saveAllTitles ()
 Save Titles. More...
 
 deleteNodes ()
 Delete nodes in the hierarchy. More...
 
 cutItems ()
 Copy items to clipboard, then cut them from the current tree. More...
 
 copyItems ()
 Copy items to clipboard. More...
 
 cancelDelete ()
 cancel delete More...
 
 confirmedDelete ()
 confirmed delete More...
 
 setLocator ()
 Set Locator Items. More...
 
 setSkillNodeDescription ()
 Set skill node description. More...
 
 create ()
 Create skill tree node. More...
 
 addStatusInput (ilPropertyFormGUI $a_form)
 Add status input. More...
 
 editProperties ()
 Edit properties form. More...
 
 getPropertyValues ()
 Get property values for edit form. More...
 
 save ()
 Save skill tree node. More...
 
 afterSave ()
 After saving. More...
 
 update ()
 Update skill tree node. More...
 
 afterUpdate ()
 After update. More...
 
 initForm ($a_mode="edit")
 Init form. More...
 
 cancelSave ()
 Cancel saving. More...
 
 redirectToParent ($a_tmp_mode=false)
 Redirect to parent (identified by current obj_id) More...
 
 saveOrder ()
 Save order. More...
 
 insertBasicSkillClip ()
 Insert basic skills from clipboard. More...
 
 insertSkillCategoryClip ()
 Insert skill categories from clipboard. More...
 
 insertTemplateReferenceClip ()
 Insert skill template references from clipboard. More...
 
 insertSkillTemplateClip ()
 Insert skill template from clipboard. More...
 
 insertTemplateCategoryClip ()
 Insert skill template category from clipboard. More...
 
 setTitleIcon ()
 Set title icon. More...
 
 addUsageTab ($a_tabs)
 Add usage tab. More...
 
 showUsage ()
 Show skill usage. More...
 
 addObjectsTab ($a_tabs)
 
 showObjects ()
 Show assigned objects. More...
 
 exportSelectedNodes ()
 Export seleced nodes. More...
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNodeGUI
 $node_object
 
 $in_use = false
 
 $use_checked = false
 
 $access
 
 $ref_id
 
- Protected Attributes inherited from ilBasicSkillTemplateGUI
 $ctrl
 
 $lng
 
 $tabs
 
 $tpl
 
 $help
 
 $toolbar
 
- Protected Attributes inherited from ilBasicSkillGUI
 $ctrl
 
 $tpl
 
 $tabs
 
 $help
 
 $toolbar
 
 $lng
 
 $tree
 
 $tref_id = 0
 
 $base_skill_id
 
- Protected Attributes inherited from ilSkillTreeNodeGUI
 $ctrl
 
 $lng
 
 $locator
 
 $tpl
 
 $user
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReferenceGUI::__construct (   $a_tref_id = 0)

Constructor.

Definition at line 18 of file class.ilSkillTemplateReferenceGUI.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and help().

19  {
20  global $DIC;
21 
22  $this->ctrl = $DIC->ctrl();
23  $this->tpl = $DIC["tpl"];
24  $this->tabs = $DIC->tabs();
25  $this->lng = $DIC->language();
26  $this->help = $DIC["ilHelp"];
27  $ilCtrl = $DIC->ctrl();
28 
29  $ilCtrl->saveParameter($this, "obj_id");
30  $ilCtrl->saveParameter($this, "tref_id");
31 
32  parent::__construct($a_tref_id);
33 
34  $this->tref_id = $a_tref_id;
35  if (is_object($this->node_object)) {
36  $this->base_skill_id = $this->node_object->getSkillTemplateId();
37  }
38  }
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ afterSave()

ilSkillTemplateReferenceGUI::afterSave ( )

After saving.

Definition at line 283 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl.

284  {
285  $ilCtrl = $this->ctrl;
286 
287  $ilCtrl->setParameterByClass(
288  "ilskilltemplatereferencegui",
289  "tref_id",
290  $this->node_object->getId()
291  );
292  $ilCtrl->setParameterByClass(
293  "ilskilltemplatereferencegui",
294  "obj_id",
295  $this->node_object->getSkillTemplateId()
296  );
297  $ilCtrl->redirectByClass("ilskilltemplatereferencegui", "listItems");
298  }

◆ cancel()

ilSkillTemplateReferenceGUI::cancel ( )

Cancel.

Parameters

Definition at line 337 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl.

338  {
339  $ilCtrl = $this->ctrl;
340 
341  $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
342  }

◆ editProperties()

ilSkillTemplateReferenceGUI::editProperties ( )

Edit properties.

Definition at line 161 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$tpl, getValues(), initForm(), and setTabs().

162  {
163  $tpl = $this->tpl;
164 
165  $this->setTabs("properties");
166 
167  $this->initForm();
168  $this->getValues();
169  $tpl->setContent($this->form->getHTML());
170  }
getValues()
Get current values for from.
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateReferenceGUI::executeCommand ( )

Execute command.

Definition at line 51 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl, $ret, ilBasicSkillTemplateGUI\$tabs, and ilBasicSkillTemplateGUI\$tpl.

52  {
53  $ilCtrl = $this->ctrl;
54  $tpl = $this->tpl;
55  $ilTabs = $this->tabs;
56 
57  //$tpl->getStandardTemplate();
58 
59  $next_class = $ilCtrl->getNextClass($this);
60  $cmd = $ilCtrl->getCmd();
61 
62  switch ($next_class) {
63  default:
64  $ret = $this->$cmd();
65  break;
66  }
67  }
$ret
Definition: parser.php:6

◆ getType()

ilSkillTemplateReferenceGUI::getType ( )

Get Node Type.

Definition at line 43 of file class.ilSkillTemplateReferenceGUI.php.

44  {
45  return "sktr";
46  }

◆ getValues()

ilSkillTemplateReferenceGUI::getValues ( )

Get current values for from.

Definition at line 246 of file class.ilSkillTemplateReferenceGUI.php.

Referenced by editProperties().

247  {
248  $values = array();
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);
255  }
+ Here is the caller graph for this function:

◆ initForm()

ilSkillTemplateReferenceGUI::initForm (   $a_mode = "edit")

Init form.

Parameters
int$a_modeEdit Mode

Definition at line 177 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl, ilBasicSkillTemplateGUI\$lng, $si, ilSkillTreeNode\_lookupDescription(), ilSkillTreeNodeGUI\addStatusInput(), ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNode\getTopTemplates(), ilFormPropertyGUI\setInfo(), and ilNonEditableValueGUI\setValue().

Referenced by editProperties(), insert(), and updateSkillTemplateReference().

178  {
179  $lng = $this->lng;
180  $ilCtrl = $this->ctrl;
181 
182  $this->form = new ilPropertyFormGUI();
183 
184  // select skill template
186 
187  // title
188  $ti = new ilTextInputGUI($lng->txt("title"), "title");
189  $ti->setRequired(true);
190  $this->form->addItem($ti);
191 
192  // description
193  if ($a_mode == "edit") {
194  $desc = ilSkillTreeNode::_lookupDescription($this->node_object->getSkillTemplateId());
195  if (!empty($desc)) {
196  $ne = new ilNonEditableValueGUI($lng->txt("description"), "template_description");
197  $ne->setValue($desc);
198  $ne->setInfo($lng->txt("skmg_description_info"));
199  $this->form->addItem($ne);
200  }
201  }
202 
203  // template
204  $options = array(
205  "" => $lng->txt("please_select"),
206  );
207  foreach ($tmplts as $tmplt) {
208  $options[$tmplt["child"]] = $tmplt["title"];
209  }
210  if ($a_mode != "edit") {
211  $si = new ilSelectInputGUI($lng->txt("skmg_skill_template"), "skill_template_id");
212  $si->setOptions($options);
213  $si->setRequired(true);
214  $this->form->addItem($si);
215  } else {
216  $ne = new ilNonEditableValueGUI($lng->txt("skmg_skill_template"), "");
217  $ne->setValue($options[$this->node_object->getSkillTemplateId()]);
218  $this->form->addItem($ne);
219  }
220 
221  // status
222  $this->addStatusInput($this->form);
223 
224  // selectable
225  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "selectable");
226  $cb->setInfo($lng->txt("skmg_selectable_info"));
227  $this->form->addItem($cb);
228 
229  if ($this->checkPermissionBool("write")) {
230  if ($a_mode == "create") {
231  $this->form->addCommandButton("save", $lng->txt("save"));
232  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
233  $this->form->setTitle($lng->txt("skmg_new_sktr"));
234  } else {
235  $this->form->addCommandButton("updateSkillTemplateReference", $lng->txt("save"));
236  $this->form->setTitle($lng->txt("skmg_edit_sktr"));
237  }
238  }
239 
240  $this->form->setFormAction($ilCtrl->getFormAction($this));
241  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
checkPermissionBool($a_perm)
Check permission pool.
setInfo($a_info)
Set Information Text.
static _lookupDescription($a_obj_id)
Lookup Description.
This class represents a non editable value in a property form.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
static getTopTemplates()
Get top skill templates and template categories.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilSkillTemplateReferenceGUI::insert ( )

Insert.

Parameters

Definition at line 146 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl, ilBasicSkillTemplateGUI\$tpl, and initForm().

147  {
148  $ilCtrl = $this->ctrl;
149  $tpl = $this->tpl;
150 
151  $ilCtrl->saveParameter($this, "parent_id");
152  $ilCtrl->saveParameter($this, "target");
153  $this->initForm("create");
154  $tpl->setContent($this->form->getHTML());
155  }
+ Here is the call graph for this function:

◆ listItems()

ilSkillTemplateReferenceGUI::listItems ( )

List items.

Definition at line 347 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$lng, ilBasicSkillTemplateGUI\$tpl, ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\isInUse(), ilSkillCatTableGUI\MODE_SCTP, ilUtil\sendInfo(), and setTabs().

348  {
349  $tpl = $this->tpl;
350  $lng = $this->lng;
351 
352  if ($this->isInUse()) {
353  ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
354  }
355 
356  $this->setTabs("content");
357 
358  $sk_id = $this->node_object->getSkillTemplateId();
359  $obj_type = ilSkillTreeNode::_lookupType($sk_id);
360 
361  if ($obj_type == "sctp") {
362  $table = new ilSkillCatTableGUI(
363  $this,
364  "listItems",
365  (int) $sk_id,
367  $this->node_object->getId()
368  );
369  $tpl->setContent($table->getHTML());
370  } elseif ($obj_type == "sktp") {
371  $table = new ilSkillLevelTableGUI((int) $sk_id, $this, "edit", $this->node_object->getId());
372  $tpl->setContent($table->getHTML());
373  }
374  }
static _lookupType($a_obj_id)
Lookup Type.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ saveItem()

ilSkillTemplateReferenceGUI::saveItem ( )

Save item.

Definition at line 260 of file class.ilSkillTemplateReferenceGUI.php.

References $_GET, $_POST, ilBasicSkillGUI\$tree, ilSkillTreeNodeGUI\checkPermissionBool(), IL_LAST_NODE, and ilSkillTreeNode\putInTree().

261  {
262  if (!$this->checkPermissionBool("write")) {
263  return;
264  }
265 
266  $tree = new ilSkillTree();
267 
268  $sktr = new ilSkillTemplateReference();
269  $sktr->setTitle($_POST["title"]);
270  $sktr->setDescription($_POST["description"]);
271  $sktr->setSkillTemplateId($_POST["skill_template_id"]);
272  $sktr->setSelfEvaluation($_POST["selectable"]);
273  $sktr->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
274  $sktr->setStatus($_POST["status"]);
275  $sktr->create();
276  ilSkillTreeNode::putInTree($sktr, (int) $_GET["obj_id"], IL_LAST_NODE);
277  $this->node_object = $sktr;
278  }
Skill tree.
$_GET["client_id"]
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
checkPermissionBool($a_perm)
Check permission pool.
const IL_LAST_NODE
Definition: class.ilTree.php:4
$_POST["username"]
+ Here is the call graph for this function:

◆ setTabs()

ilSkillTemplateReferenceGUI::setTabs (   $a_tab = "")

output tabs

Definition at line 72 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$ctrl, ilBasicSkillTemplateGUI\$help, ilBasicSkillTemplateGUI\$lng, ilBasicSkillTemplateGUI\$tabs, ilBasicSkillTemplateGUI\$tpl, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), ilSkillTreeNodeGUI\addObjectsTab(), ilSkillTreeNodeGUI\addUsageTab(), and ilSkillTreeNodeGUI\setSkillNodeDescription().

Referenced by editProperties(), listItems(), and showObjects().

73  {
74  $ilTabs = $this->tabs;
75  $ilCtrl = $this->ctrl;
76  $tpl = $this->tpl;
77  $lng = $this->lng;
78  $ilHelp = $this->help;
79 
80  $ilTabs->clearTargets();
81  $ilHelp->setScreenIdComponent("skmg_sktr");
82 
83  if (is_object($this->node_object)) {
84  $sk_id = $this->node_object->getSkillTemplateId();
85  $obj_type = ilSkillTreeNode::_lookupType($sk_id);
86 
87  if ($obj_type == "sctp") {
88  // content
89  $ilTabs->addTab(
90  "content",
91  $lng->txt("content"),
92  $ilCtrl->getLinkTarget($this, 'listItems')
93  );
94  } else {
95  // content
96  $ilTabs->addTab(
97  "content",
98  $lng->txt("skmg_skill_levels"),
99  $ilCtrl->getLinkTarget($this, 'listItems')
100  );
101  }
102 
103  // properties
104  $ilTabs->addTab(
105  "properties",
106  $lng->txt("settings"),
107  $ilCtrl->getLinkTarget($this, 'editProperties')
108  );
109 
110  // usage
111  $this->addUsageTab($ilTabs);
112 
113  // assigned objects
114  if ($obj_type != "sctp") {
115  $this->addObjectsTab($ilTabs);
116  }
117 
118  // back link
119  /*
120  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
121  $this->node_object->skill_tree->getRootId());
122  $ilTabs->setBackTarget($lng->txt("obj_skmg"),
123  $ilCtrl->getLinkTargetByClass("ilskillrootgui", "listSkills"));
124  $ilCtrl->setParameterByClass("ilskillrootgui", "obj_id",
125  $_GET["obj_id"]);*/
126 
127  $tid = ilSkillTemplateReference::_lookupTemplateId($this->node_object->getId());
128  $add = " (" . ilSkillTreeNode::_lookupTitle($tid) . ")";
129 
130  parent::setTitleIcon();
131  $tpl->setTitle(
132  $lng->txt("skmg_sktr") . ": " . $this->node_object->getTitle() . $add
133  );
134  $this->setSkillNodeDescription();
135 
136  $ilTabs->activateTab($a_tab);
137  }
138  }
addUsageTab($a_tabs)
Add usage tab.
setSkillNodeDescription()
Set skill node description.
static _lookupType($a_obj_id)
Lookup Type.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showObjects()

ilSkillTemplateReferenceGUI::showObjects ( )

Show assigned objects.

Definition at line 379 of file class.ilSkillTemplateReferenceGUI.php.

References ilBasicSkillTemplateGUI\$tpl, and setTabs().

380  {
381  $tpl = $this->tpl;
382 
383  $this->setTabs("objects");
384 
385  $usage_info = new ilSkillUsage();
386  $objects = $usage_info->getAssignedObjectsForSkill($this->base_skill_id, $this->tref_id);
387 
388  $tab = new ilSkillAssignedObjectsTableGUI($this, "showObjects", $objects);
389 
390  $tpl->setContent($tab->getHTML());
391  }
TableGUI class for assigned objects of skills.
Skill usage.
+ Here is the call graph for this function:

◆ updateSkillTemplateReference()

ilSkillTemplateReferenceGUI::updateSkillTemplateReference ( )

Update form.

Definition at line 303 of file class.ilSkillTemplateReferenceGUI.php.

References $_POST, ilBasicSkillTemplateGUI\$ctrl, ilBasicSkillTemplateGUI\$lng, ilBasicSkillTemplateGUI\$tpl, ilSkillTreeNodeGUI\checkPermissionBool(), and initForm().

304  {
305  $lng = $this->lng;
306  $ilCtrl = $this->ctrl;
307  $tpl = $this->tpl;
308 
309  if (!$this->checkPermissionBool("write")) {
310  return;
311  }
312 
313  $this->initForm("edit");
314  if ($this->form->checkInput()) {
315  // perform update
316  // $this->node_object->setSkillTemplateId($_POST["skill_template_id"]);
317  $this->node_object->setTitle($_POST["title"]);
318  $this->node_object->setDescription($_POST["description"]);
319  $this->node_object->setSelfEvaluation($_POST["selectable"]);
320  $this->node_object->setStatus($_POST["status"]);
321  $this->node_object->update();
322 
323  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
324  $ilCtrl->redirect($this, "editProperties");
325  }
326 
327  $this->form->setValuesByPost();
328  $tpl->setContent($this->form->getHtml());
329  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: