ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 
- 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...
 
- 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...
 
 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

Skill template reference GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilSkillTemplateReferenceGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReferenceGUI::__construct (   $a_tref_id = 0)

Constructor.

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

References $DIC, and $ilCtrl.

23  {
24  global $DIC;
25 
26  $this->ctrl = $DIC->ctrl();
27  $this->tpl = $DIC["tpl"];
28  $this->tabs = $DIC->tabs();
29  $this->lng = $DIC->language();
30  $this->help = $DIC["ilHelp"];
31  $ilCtrl = $DIC->ctrl();
32 
33  $ilCtrl->saveParameter($this, "obj_id");
34  $ilCtrl->saveParameter($this, "tref_id");
35 
36  parent::__construct($a_tref_id);
37 
38  $this->tref_id = $a_tref_id;
39  if (is_object($this->node_object)) {
40  $this->base_skill_id = $this->node_object->getSkillTemplateId();
41  }
42  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ afterSave()

ilSkillTemplateReferenceGUI::afterSave ( )

After saving.

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

References ilBasicSkillTemplateGUI\$ctrl, and $ilCtrl.

285  {
287 
288  $ilCtrl->setParameterByClass(
289  "ilskilltemplatereferencegui",
290  "tref_id",
291  $this->node_object->getId()
292  );
293  $ilCtrl->setParameterByClass(
294  "ilskilltemplatereferencegui",
295  "obj_id",
296  $this->node_object->getSkillTemplateId()
297  );
298  $ilCtrl->redirectByClass("ilskilltemplatereferencegui", "listItems");
299  }
global $ilCtrl
Definition: ilias.php:18

◆ cancel()

ilSkillTemplateReferenceGUI::cancel ( )

Cancel.

Parameters

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

References ilBasicSkillTemplateGUI\$ctrl, and $ilCtrl.

339  {
341 
342  $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
343  }
global $ilCtrl
Definition: ilias.php:18

◆ editProperties()

ilSkillTemplateReferenceGUI::editProperties ( )

Edit properties.

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

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

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

◆ executeCommand()

ilSkillTemplateReferenceGUI::executeCommand ( )

Execute command.

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

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

56  {
58  $tpl = $this->tpl;
59  $ilTabs = $this->tabs;
60 
61  //$tpl->getStandardTemplate();
62 
63  $next_class = $ilCtrl->getNextClass($this);
64  $cmd = $ilCtrl->getCmd();
65 
66  switch ($next_class) {
67  default:
68  $ret = $this->$cmd();
69  break;
70  }
71  }
global $ilCtrl
Definition: ilias.php:18
$ret
Definition: parser.php:6

◆ getType()

ilSkillTemplateReferenceGUI::getType ( )

Get Node Type.

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

48  {
49  return "sktr";
50  }

◆ getValues()

ilSkillTemplateReferenceGUI::getValues ( )

Get current values for from.

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

References array.

Referenced by editProperties().

251  {
252  $values = array();
253  $values["skill_template_id"] = $this->node_object->getSkillTemplateId();
254  $values["title"] = $this->node_object->getTitle();
255  $values["selectable"] = $this->node_object->getSelfEvaluation();
256  $values["status"] = $this->node_object->getStatus();
257  $values["order_nr"] = $this->node_object->getOrderNr();
258  $this->form->setValuesByArray($values);
259  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

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

References $_GET, ilBasicSkillTemplateGUI\$ctrl, $ilCtrl, ilBasicSkillTemplateGUI\$lng, $options, $si, ilBasicSkillGUI\$tree, ilSkillTreeNodeGUI\addStatusInput(), array, ilSkillTreeNodeGUI\checkPermissionBool(), ilSkillTreeNode\getTopTemplates(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilNonEditableValueGUI\setValue().

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

177  {
178  $lng = $this->lng;
180 
181  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
182  $this->form = new ilPropertyFormGUI();
183 
184  // select skill template
185  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
187 
188  // title
189  $ti = new ilTextInputGUI($lng->txt("title"), "title");
190  $ti->setRequired(true);
191  $this->form->addItem($ti);
192 
193  // order nr
194  $ni = new ilNumberInputGUI($lng->txt("skmg_order_nr"), "order_nr");
195  $ni->setInfo($lng->txt("skmg_order_nr_info"));
196  $ni->setMaxLength(6);
197  $ni->setSize(6);
198  $ni->setRequired(true);
199  if ($a_mode == "create") {
200  include_once("./Services/Skill/classes/class.ilSkillTree.php");
201  $tree = new ilSkillTree();
202  $max = $tree->getMaxOrderNr((int) $_GET["obj_id"]);
203  $ni->setValue($max + 10);
204  }
205  $this->form->addItem($ni);
206 
207  // template
208  $options = array(
209  "" => $lng->txt("please_select"),
210  );
211  foreach ($tmplts as $tmplt) {
212  $options[$tmplt["child"]] = $tmplt["title"];
213  }
214  if ($a_mode != "edit") {
215  $si = new ilSelectInputGUI($lng->txt("skmg_skill_template"), "skill_template_id");
216  $si->setOptions($options);
217  $si->setRequired(true);
218  $this->form->addItem($si);
219  } else {
220  $ne = new ilNonEditableValueGUI($lng->txt("skmg_skill_template"), "");
221  $ne->setValue($options[$this->node_object->getSkillTemplateId()]);
222  $this->form->addItem($ne);
223  }
224 
225  // status
226  $this->addStatusInput($this->form);
227 
228  // selectable
229  $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "selectable");
230  $cb->setInfo($lng->txt("skmg_selectable_info"));
231  $this->form->addItem($cb);
232 
233  if ($this->checkPermissionBool("write")) {
234  if ($a_mode == "create") {
235  $this->form->addCommandButton("save", $lng->txt("save"));
236  $this->form->addCommandButton("cancel", $lng->txt("cancel"));
237  $this->form->setTitle($lng->txt("skmg_new_sktr"));
238  } else {
239  $this->form->addCommandButton("updateSkillTemplateReference", $lng->txt("save"));
240  $this->form->setTitle($lng->txt("skmg_edit_sktr"));
241  }
242  }
243 
244  $this->form->setFormAction($ilCtrl->getFormAction($this));
245  }
This class represents a selection list property in a property form.
This class represents a property form user interface.
Skill tree.
$_GET["client_id"]
This class represents a checkbox property in a property form.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
setInfo($a_info)
Set Information Text.
This class represents a number property in a property form.
This class represents a text property in a property form.
Create styles array
The data for the language used.
This class represents a non editable value in a property form.
setRequired($a_required)
Set Required.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
static getTopTemplates()
Get top skill templates and template categories.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilSkillTemplateReferenceGUI::insert ( )

Insert.

Parameters

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

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

146  {
148  $tpl = $this->tpl;
149 
150  $ilCtrl->saveParameter($this, "parent_id");
151  $ilCtrl->saveParameter($this, "target");
152  $this->initForm("create");
153  $tpl->setContent($this->form->getHTML());
154  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ listItems()

ilSkillTemplateReferenceGUI::listItems ( )

List items.

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

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

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

◆ saveItem()

ilSkillTemplateReferenceGUI::saveItem ( )

Save item.

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

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

265  {
266  if (!$this->checkPermissionBool("write")) {
267  return;
268  }
269 
270  $sktr = new ilSkillTemplateReference();
271  $sktr->setTitle($_POST["title"]);
272  $sktr->setSkillTemplateId($_POST["skill_template_id"]);
273  $sktr->setSelfEvaluation($_POST["selectable"]);
274  $sktr->setOrderNr($_POST["order_nr"]);
275  $sktr->setStatus($_POST["status"]);
276  $sktr->create();
277  ilSkillTreeNode::putInTree($sktr, (int) $_GET["obj_id"], IL_LAST_NODE);
278  $this->node_object = $sktr;
279  }
$_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 76 of file class.ilSkillTemplateReferenceGUI.php.

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

Referenced by editProperties(), and listItems().

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

◆ updateSkillTemplateReference()

ilSkillTemplateReferenceGUI::updateSkillTemplateReference ( )

Update form.

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

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

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

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