ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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$

@ilCtrl_isCalledBy ilSkillTemplateReferenceGUI: ilObjSkillManagementGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReferenceGUI::__construct (   $a_tref_id = 0)

Constructor.

Reimplemented from ilBasicSkillGUI.

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

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 $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $DIC, and $ilCtrl.

Member Function Documentation

◆ afterSave()

ilSkillTemplateReferenceGUI::afterSave ( )

After saving.

Reimplemented from ilBasicSkillTemplateGUI.

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

272 {
274
275 $ilCtrl->setParameterByClass(
276 "ilskilltemplatereferencegui",
277 "tref_id",
278 $this->node_object->getId()
279 );
280 $ilCtrl->setParameterByClass(
281 "ilskilltemplatereferencegui",
282 "obj_id",
283 $this->node_object->getSkillTemplateId()
284 );
285 $ilCtrl->redirectByClass("ilskilltemplatereferencegui", "listItems");
286 }

References ilBasicSkillTemplateGUI\$ctrl, and $ilCtrl.

◆ cancel()

ilSkillTemplateReferenceGUI::cancel ( )

Cancel.

Parameters

return

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

325 {
327
328 $ilCtrl->redirectByClass("ilobjskillmanagementgui", "editSkills");
329 }

References ilBasicSkillTemplateGUI\$ctrl, and $ilCtrl.

◆ editProperties()

ilSkillTemplateReferenceGUI::editProperties ( )

Edit properties.

Reimplemented from ilBasicSkillGUI.

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

161 {
163
164 $this->setTabs("properties");
165
166 $this->initForm();
167 $this->getValues();
168 $tpl->setContent($this->form->getHTML());
169 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillTemplateReferenceGUI::executeCommand ( )

Execute command.

Reimplemented from ilBasicSkillGUI.

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

56 {
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 }
$ret
Definition: parser.php:6

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

◆ getType()

ilSkillTemplateReferenceGUI::getType ( )

Get Node Type.

Reimplemented from ilBasicSkillTemplateGUI.

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 236 of file class.ilSkillTemplateReferenceGUI.php.

237 {
238 $values = array();
239 $values["skill_template_id"] = $this->node_object->getSkillTemplateId();
240 $values["title"] = $this->node_object->getTitle();
241 $values["selectable"] = $this->node_object->getSelfEvaluation();
242 $values["status"] = $this->node_object->getStatus();
243 $this->form->setValuesByArray($values);
244 }
$values

References $values.

Referenced by editProperties().

+ Here is the caller graph for this function:

◆ initForm()

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

Init form.

Parameters
int$a_modeEdit Mode

Reimplemented from ilBasicSkillTemplateGUI.

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

177 {
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 // template
194 $options = array(
195 "" => $lng->txt("please_select"),
196 );
197 foreach ($tmplts as $tmplt) {
198 $options[$tmplt["child"]] = $tmplt["title"];
199 }
200 if ($a_mode != "edit") {
201 $si = new ilSelectInputGUI($lng->txt("skmg_skill_template"), "skill_template_id");
202 $si->setOptions($options);
203 $si->setRequired(true);
204 $this->form->addItem($si);
205 } else {
206 $ne = new ilNonEditableValueGUI($lng->txt("skmg_skill_template"), "");
207 $ne->setValue($options[$this->node_object->getSkillTemplateId()]);
208 $this->form->addItem($ne);
209 }
210
211 // status
212 $this->addStatusInput($this->form);
213
214 // selectable
215 $cb = new ilCheckboxInputGUI($lng->txt("skmg_selectable"), "selectable");
216 $cb->setInfo($lng->txt("skmg_selectable_info"));
217 $this->form->addItem($cb);
218
219 if ($this->checkPermissionBool("write")) {
220 if ($a_mode == "create") {
221 $this->form->addCommandButton("save", $lng->txt("save"));
222 $this->form->addCommandButton("cancel", $lng->txt("cancel"));
223 $this->form->setTitle($lng->txt("skmg_new_sktr"));
224 } else {
225 $this->form->addCommandButton("updateSkillTemplateReference", $lng->txt("save"));
226 $this->form->setTitle($lng->txt("skmg_edit_sktr"));
227 }
228 }
229
230 $this->form->setFormAction($ilCtrl->getFormAction($this));
231 }
This class represents a checkbox property in a property form.
This class represents a non editable value in a property form.
This class represents a property form user interface.
This class represents a selection list property in a property form.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
checkPermissionBool($a_perm)
Check permission pool.
static getTopTemplates()
Get top skill templates and template categories.
This class represents a text property in a property form.

References ilBasicSkillTemplateGUI\$ctrl, $ilCtrl, ilBasicSkillTemplateGUI\$lng, PHPMailer\PHPMailer\$options, $si, ilSkillTreeNodeGUI\addStatusInput(), ilSkillTreeNodeGUI\checkPermissionBool(), and ilSkillTreeNode\getTopTemplates().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ insert()

ilSkillTemplateReferenceGUI::insert ( )

Insert.

Parameters

return

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

146 {
149
150 $ilCtrl->saveParameter($this, "parent_id");
151 $ilCtrl->saveParameter($this, "target");
152 $this->initForm("create");
153 $tpl->setContent($this->form->getHTML());
154 }

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

+ Here is the call graph for this function:

◆ listItems()

ilSkillTemplateReferenceGUI::listItems ( )

List items.

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

335 {
338
339 if ($this->isInUse()) {
340 ilUtil::sendInfo($lng->txt("skmg_skill_in_use"));
341 }
342
343 $this->setTabs("content");
344
345 $sk_id = $this->node_object->getSkillTemplateId();
346 $obj_type = ilSkillTreeNode::_lookupType($sk_id);
347
348 if ($obj_type == "sctp") {
349 include_once("./Services/Skill/classes/class.ilSkillCatTableGUI.php");
351 $this,
352 "listItems",
353 (int) $sk_id,
355 $this->node_object->getId()
356 );
357 $tpl->setContent($table->getHTML());
358 } elseif ($obj_type == "sktp") {
359 include_once("./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
360 $table = new ilSkillLevelTableGUI((int) $sk_id, $this, "edit", $this->node_object->getId());
361 $tpl->setContent($table->getHTML());
362 }
363 }
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

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

+ Here is the call graph for this function:

◆ saveItem()

ilSkillTemplateReferenceGUI::saveItem ( )

Save item.

Reimplemented from ilBasicSkillTemplateGUI.

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

250 {
251 if (!$this->checkPermissionBool("write")) {
252 return;
253 }
254
255 $tree = new ilSkillTree();
256
257 $sktr = new ilSkillTemplateReference();
258 $sktr->setTitle($_POST["title"]);
259 $sktr->setSkillTemplateId($_POST["skill_template_id"]);
260 $sktr->setSelfEvaluation($_POST["selectable"]);
261 $sktr->setOrderNr($tree->getMaxOrderNr((int) $_GET["obj_id"]) + 10);
262 $sktr->setStatus($_POST["status"]);
263 $sktr->create();
264 ilSkillTreeNode::putInTree($sktr, (int) $_GET["obj_id"], IL_LAST_NODE);
265 $this->node_object = $sktr;
266 }
$_GET["client_id"]
$_POST["username"]
const IL_LAST_NODE
Definition: class.ilTree.php:4
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.

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

+ Here is the call graph for this function:

◆ setTabs()

ilSkillTemplateReferenceGUI::setTabs (   $a_tab = "")

output tabs

Reimplemented from ilBasicSkillTemplateGUI.

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

77 {
78 $ilTabs = $this->tabs;
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 );
134
135 $ilTabs->activateTab($a_tab);
136 }
137 }
static _lookupTemplateId($a_obj_id)
Lookup template ID.
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateSkillTemplateReference()

ilSkillTemplateReferenceGUI::updateSkillTemplateReference ( )

Update form.

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

292 {
296
297 if (!$this->checkPermissionBool("write")) {
298 return;
299 }
300
301 $this->initForm("edit");
302 if ($this->form->checkInput()) {
303 // perform update
304 // $this->node_object->setSkillTemplateId($_POST["skill_template_id"]);
305 $this->node_object->setTitle($_POST["title"]);
306 $this->node_object->setSelfEvaluation($_POST["selectable"]);
307 $this->node_object->setStatus($_POST["status"]);
308 $this->node_object->update();
309
310 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
311 $ilCtrl->redirect($this, "editProperties");
312 }
313
314 $this->form->setValuesByPost();
315 $tpl->setContent($this->form->getHtml());
316 }

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

+ Here is the call graph for this function:

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