ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilObjSkillManagementGUI Class Reference

Skill management main GUI class. More...

+ Inheritance diagram for ilObjSkillManagementGUI:
+ Collaboration diagram for ilObjSkillManagementGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 editSettings ()
 Edit news settings. More...
 
 saveSettings ()
 Save skill management settings. More...
 
 editSkills ()
 Edit skills. More...
 
 saveAllTitles ($a_succ_mess=true)
 Save all titles of chapters/scos/pages. More...
 
 saveAllTemplateTitles ($a_succ_mess=true)
 Save all titles of chapters/scos/pages. More...
 
 expandAll ($a_redirect=true)
 Expand all. More...
 
 collapseAll ($a_redirect=true)
 Collapse all. More...
 
 deleteNodes ($a_gui)
 confirm deletion screen of skill tree nodes More...
 
 cancelDelete ()
 cancel delete More...
 
 confirmedDelete ()
 Delete chapters/scos/pages. More...
 
 test ()
 Test getCompletionDateForTriggerRefId. More...
 
 testCert ()
 Test checkUserCertificateForTriggerRefId. More...
 
 testAllCert ()
 Test getTriggerOfAllCertificates. More...
 
 testLevels ()
 Test getSkillLevelsForTrigger. More...
 
 setTestSubtabs ($a_act)
 Set test subtabs. More...
 
 editSkillTemplates ()
 Edit skill templates. More...
 
 showTree ($a_templates, $a_gui="", $a_gui_cmd="")
 Show Editing Tree. More...
 
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public. More...
 
executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 

Protected Attributes

 $skill_tree
 
- Protected Attributes inherited from ilObjectGUI
 $tmp_import_dir
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $ilias
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 
 prepareOutput ()
 prepare output More...
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste More...
 
 getTabs (&$tabs_gui)
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings ($column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSkillManagementGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

public

Definition at line 27 of file class.ilObjSkillManagementGUI.php.

References $ilCtrl.

28  {
29  global $ilCtrl;
30 
31  $this->type = 'skmg';
32  parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
33 
34  $this->lng->loadLanguageModule('skmg');
35 
36  include_once("./Services/Skill/classes/class.ilSkillTree.php");
37  $this->skill_tree = new ilSkillTree();
38 
39  $ilCtrl->saveParameter($this, "obj_id");
40  }
Skill tree.
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ cancelDelete()

ilObjSkillManagementGUI::cancelDelete ( )

cancel delete

Definition at line 472 of file class.ilObjSkillManagementGUI.php.

473  {
474  $this->ctrl->redirect($this, "editSkills");
475  }

◆ collapseAll()

ilObjSkillManagementGUI::collapseAll (   $a_redirect = true)

Collapse all.

Definition at line 340 of file class.ilObjSkillManagementGUI.php.

References $_GET, $_SESSION, $n, and saveAllTitles().

341  {
342  $_GET["skexpand"] = "";
343  $n_id = ($_GET["obj_id"] > 0)
344  ? $_GET["obj_id"]
345  : $this->skill_tree->readRootId();
346  $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
347  $old = $_SESSION["skexpand"];
348  foreach ($stree as $n)
349  {
350  if (in_array($n["child"], $old) && $n["child"] != $n_id)
351  {
352  $k = array_search($n["child"], $old);
353  unset($old[$k]);
354  }
355  }
356  $_SESSION["skexpand"] = $old;
357  $this->saveAllTitles(false);
358  }
$_SESSION["AccountId"]
$_GET["client_id"]
$n
Definition: RandomTest.php:80
saveAllTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
+ Here is the call graph for this function:

◆ confirmedDelete()

ilObjSkillManagementGUI::confirmedDelete ( )

Delete chapters/scos/pages.

Definition at line 480 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilSkillTreeNodeFactory\getInstance(), IL_FIRST_NODE, and ilUtil\sendInfo().

481  {
482  global $ilCtrl;
483 
484  // delete all selected objects
485  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
486  foreach ($_POST["id"] as $id)
487  {
488  if ($id != IL_FIRST_NODE)
489  {
491  $node_data = $this->skill_tree->getNodeData($id);
492  if (is_object($obj))
493  {
494  $obj->delete();
495  }
496  if($this->skill_tree->isInTree($id))
497  {
498  $this->skill_tree->deleteTree($node_data);
499  }
500  }
501  }
502 
503  // feedback
504  ilUtil::sendInfo($this->lng->txt("info_deleted"),true);
505  }
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const IL_FIRST_NODE
Definition: class.ilTree.php:5
+ Here is the call graph for this function:

◆ deleteNodes()

ilObjSkillManagementGUI::deleteNodes (   $a_gui)

confirm deletion screen of skill tree nodes

Definition at line 363 of file class.ilObjSkillManagementGUI.php.

References $_GET, $_POST, $_SESSION, $html, $ilCtrl, ilObjectGUI\$lng, $tab, ilObjectGUI\$tpl, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTemplateReference\_lookupTrefIdsForTemplateId(), ilSkillTreeNode\_lookupType(), ilUtil\getImagePath(), ilSkillTreeNodeFactory\getInstance(), IL_FIRST_NODE, and ilUtil\sendFailure().

364  {
365  global $lng, $tpl, $ilCtrl, $ilTabs, $ilToolbar;
366 
367  if(!isset($_POST["id"]))
368  {
369  $this->ilias->raiseError($this->lng->txt("no_checkbox"),$this->ilias->error_obj->MESSAGE);
370  }
371 
372  $ilTabs->clearTargets();
373 
374  // check usages
375  $mode = "";
376  $cskill_ids = array();
377  foreach($_POST["id"] as $id)
378  {
379  if (in_array(ilSkillTreeNode::_lookupType($id), array("skll", "scat", "sktr")))
380  {
381  if ($mode == "templates")
382  {
383  $this->ilias->raiseError("Skill Deletion - type mismatch.",$this->ilias->error_obj->MESSAGE);
384  }
385  $mode = "basic";
386  $skill_id = $id;
387  $tref_id = 0;
388  if (ilSkillTreeNode::_lookupType($id) == "sktr")
389  {
390  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
392  $tref_id = $id;
393  }
394  $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
395  }
396  if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp")))
397  {
398  if ($mode == "basic")
399  {
400  $this->ilias->raiseError("Skill Deletion - type mismatch.",$this->ilias->error_obj->MESSAGE);
401  }
402  $mode = "templates";
403 
405  {
406  $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
407  }
408  }
409  // for cats, skills and template references, get "real" usages
410  // for skill and category templates check usage in references
411  }
412 
413  if ($mode == "basic" || $mode == "templates")
414  {
415  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
416  $u = new ilSkillUsage();
417  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
418  if (count($usages) > 0)
419  {
420  $html = "";
421  foreach ($usages as $k => $usage)
422  {
423  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
424  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
425  $html.= $tab->getHTML()."<br/><br/>";
426  }
427  $tpl->setContent($html);
428  $ilCtrl->saveParameter($a_gui, "tmpmode");
429  $ilToolbar->addButton($lng->txt("back"),
430  $ilCtrl->getLinkTarget($a_gui, "cancelDelete"));
431  ilUtil::sendFailure($lng->txt("skmg_cannot_delete_nodes_in_use"));
432  return;
433  }
434  }
435  else
436  {
437  $this->ilias->raiseError("Skill Deletion - type mismatch.",$this->ilias->error_obj->MESSAGE);
438  }
439 
440  // SAVE POST VALUES
441  $_SESSION["saved_post"] = $_POST["id"];
442 
443  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
444  $confirmation_gui = new ilConfirmationGUI();
445 
446  $ilCtrl->setParameter($a_gui, "tmpmode", $_GET["tmpmode"]);
447  $a_form_action = $this->ctrl->getFormAction($a_gui);
448  $confirmation_gui->setFormAction($a_form_action);
449  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
450 
451  // Add items to delete
452  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
453  foreach($_POST["id"] as $id)
454  {
455  if ($id != IL_FIRST_NODE)
456  {
457  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
458  $confirmation_gui->addItem("id[]", $node_obj->getId(),
459  $node_obj->getTitle(), ilUtil::getImagePath("icon_".$node_obj->getType().".svg"));
460  }
461  }
462 
463  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelDelete");
464  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
465 
466  $tpl->setContent($confirmation_gui->getHTML());
467  }
$_POST['username']
Definition: cron.php:12
$_SESSION["AccountId"]
$_GET["client_id"]
static _lookupTrefIdsForTemplateId($a_tid)
Get all tref ids for a template id.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
const IL_FIRST_NODE
Definition: class.ilTree.php:5
redirection script todo: (a better solution should control the processing via a xml file) ...
static _lookupTemplateId($a_obj_id)
Lookup template ID.
TableGUI class for skill usages.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Skill usage.
$html
Definition: example_001.php:87
Confirmation screen class.
+ Here is the call graph for this function:

◆ editSettings()

ilObjSkillManagementGUI::editSettings ( )

Edit news settings.

Definition at line 196 of file class.ilObjSkillManagementGUI.php.

References $ilCtrl, $ilSetting, ilObjectGUI\$lng, ilObjectGUI\checkPermissionBool(), and ilCheckboxInputGUI\setValue().

197  {
198  global $ilCtrl, $lng, $ilSetting, $ilTabs;
199 
200  $ilTabs->activateTab("settings");
201 
202  include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
203  $skmg_set = new ilSkillManagementSettings();
204  $enable_skmg = $skmg_set->isActivated();
205 
206  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
207  $form = new ilPropertyFormGUI();
208  $form->setFormAction($ilCtrl->getFormAction($this));
209  $form->setTitle($lng->txt("skmg_settings"));
210 
211  // Enable skill management
212  $cb_prop = new ilCheckboxInputGUI($lng->txt("skmg_enable_skmg"),
213  "enable_skmg");
214  $cb_prop->setValue("1");
215  $cb_prop->setChecked($enable_skmg);
216  $form->addItem($cb_prop);
217 
218  // command buttons
219  if ($this->checkPermissionBool("write"))
220  {
221  $form->addCommandButton("saveSettings", $lng->txt("save"));
222  }
223 
224  $this->tpl->setContent($form->getHTML());
225  }
This class represents a property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
setValue($a_value)
Set Value.
global $ilSetting
Definition: privfeed.php:40
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ editSkills()

ilObjSkillManagementGUI::editSkills ( )

Edit skills.

Definition at line 251 of file class.ilObjSkillManagementGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

252  {
253  global $tpl, $ilTabs, $lng, $ilCtrl;
254 
255  $ilTabs->activateTab("skills");
256 
257  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
258  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
259 
260  }
global $ilCtrl
Definition: ilias.php:18

◆ editSkillTemplates()

ilObjSkillManagementGUI::editSkillTemplates ( )

Edit skill templates.

Definition at line 766 of file class.ilObjSkillManagementGUI.php.

References $ilCtrl, ilObjectGUI\$lng, and ilObjectGUI\$tpl.

767  {
768  global $tpl, $ilTabs, $lng, $ilCtrl;
769 
770  $ilTabs->activateTab("skill_templates");
771  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
772  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
773 
774  }
global $ilCtrl
Definition: ilias.php:18

◆ executeCommand()

ilObjSkillManagementGUI::executeCommand ( )

Execute command.

public

Definition at line 48 of file class.ilObjSkillManagementGUI.php.

References $_GET, $cmd, $ilErr, $ret, ilObjectGUI\prepareOutput(), and showTree().

49  {
50  global $rbacsystem, $ilErr, $ilAccess, $ilTabs;
51 
52  $next_class = $this->ctrl->getNextClass($this);
53  $cmd = $this->ctrl->getCmd();
54 
55  $this->prepareOutput();
56 
57  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
58  {
59  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
60  }
61 
62  switch($next_class)
63  {
64  case 'ilskillrootgui':
65  include_once("./Services/Skill/classes/class.ilSkillRootGUI.php");
66  $skrt_gui = new ilSkillRootGUI((int) $_GET["obj_id"], $this);
67  $skrt_gui->setParentGUI($this);
68  $ret = $this->ctrl->forwardCommand($skrt_gui);
69  break;
70 
71  case 'ilskillcategorygui':
72  $this->tabs_gui->activateTab("skills");
73  include_once("./Services/Skill/classes/class.ilSkillCategoryGUI.php");
74  $scat_gui = new ilSkillCategoryGUI((int) $_GET["obj_id"]);
75  $scat_gui->setParentGUI($this);
76  $this->showTree(false, $scat_gui, "listItems");
77  $ret = $this->ctrl->forwardCommand($scat_gui);
78  break;
79 
80  case 'ilbasicskillgui':
81  $this->tabs_gui->activateTab("skills");
82  include_once("./Services/Skill/classes/class.ilBasicSkillGUI.php");
83  $skill_gui = new ilBasicSkillGUI((int) $_GET["obj_id"]);
84  $skill_gui->setParentGUI($this);
85  $this->showTree(false, $skill_gui, "edit");
86  $ret = $this->ctrl->forwardCommand($skill_gui);
87  break;
88 
89  case 'ilskilltemplatecategorygui':
90  $this->tabs_gui->activateTab("skill_templates");
91  include_once("./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
92  $sctp_gui = new ilSkillTemplateCategoryGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
93  $sctp_gui->setParentGUI($this);
94  $this->showTree(((int) $_GET["tref_id"] == 0), $sctp_gui, "listItems");
95  $ret = $this->ctrl->forwardCommand($sctp_gui);
96  break;
97 
98  case 'ilbasicskilltemplategui':
99  $this->tabs_gui->activateTab("skill_templates");
100  include_once("./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
101  $sktp_gui = new ilBasicSkillTemplateGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
102  $sktp_gui->setParentGUI($this);
103  $this->showTree(((int) $_GET["tref_id"] == 0), $sktp_gui, "edit");
104  $ret = $this->ctrl->forwardCommand($sktp_gui);
105  break;
106 
107  case 'ilskilltemplatereferencegui':
108  $this->tabs_gui->activateTab("skills");
109  include_once("./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
110  $sktr_gui = new ilSkillTemplateReferenceGUI((int) $_GET["tref_id"]);
111  $sktr_gui->setParentGUI($this);
112  $this->showTree(false, $sktr_gui, "listItems");
113  $ret = $this->ctrl->forwardCommand($sktr_gui);
114  break;
115 
116  case "ilskillprofilegui":
117  $ilTabs->activateTab("profiles");
118  include_once("./Services/Skill/classes/class.ilSkillProfileGUI.php");
119  $skprof_gui = new ilSkillProfileGUI();
120  $ret = $this->ctrl->forwardCommand($skprof_gui);
121  break;
122 
123  case 'ilpermissiongui':
124  $this->tabs_gui->activateTab('permissions');
125  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
126  $perm_gui =& new ilPermissionGUI($this);
127  $ret = $this->ctrl->forwardCommand($perm_gui);
128  break;
129 
130  default:
131  if(!$cmd || $cmd == 'view')
132  {
133  $cmd = "editSkills";
134  }
135 
136  if ($cmd == "showTree")
137  {
138  $this->showTree($_GET["templates_tree"]);
139  }
140  else
141  {
142  $this->$cmd();
143  }
144  break;
145  }
146  return true;
147  }
Skill category GUI class.
Skill root GUI class.
Skill profile GUI class.
showTree($a_templates, $a_gui="", $a_gui_cmd="")
Show Editing Tree.
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
Skill template reference GUI class.
prepareOutput()
prepare output
Skill template category GUI class.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Basic skill GUI class.
Basic skill template GUI class.
+ Here is the call graph for this function:

◆ expandAll()

ilObjSkillManagementGUI::expandAll (   $a_redirect = true)

Expand all.

Definition at line 321 of file class.ilObjSkillManagementGUI.php.

References $_GET, $_SESSION, $n, and saveAllTitles().

322  {
323  $_GET["skexpand"] = "";
324  $n_id = ($_GET["obj_id"] > 0)
325  ? $_GET["obj_id"]
326  : $this->skill_tree->readRootId();
327  $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
328  $n_arr = array();
329  foreach ($stree as $n)
330  {
331  $n_arr[] = $n["child"];
332  $_SESSION["skexpand"] = $n_arr;
333  }
334  $this->saveAllTitles(false);
335  }
$_SESSION["AccountId"]
$_GET["client_id"]
$n
Definition: RandomTest.php:80
saveAllTitles($a_succ_mess=true)
Save all titles of chapters/scos/pages.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjSkillManagementGUI::getAdminTabs ( )

Get tabs.

public

Definition at line 155 of file class.ilObjSkillManagementGUI.php.

References ilObjectGUI\$lng.

156  {
157  global $rbacsystem, $ilAccess, $lng;
158 
159  if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
160  {
161  $this->tabs_gui->addTab("skills",
162  $lng->txt("skmg_skills"),
163  $this->ctrl->getLinkTarget($this, "editSkills"));
164 
165  $this->tabs_gui->addTab("skill_templates",
166  $lng->txt("skmg_skill_templates"),
167  $this->ctrl->getLinkTarget($this, "editSkillTemplates"));
168 
169  $this->tabs_gui->addTab("settings",
170  $lng->txt("settings"),
171  $this->ctrl->getLinkTarget($this, "editSettings"));
172 
173  $this->tabs_gui->addTab("profiles",
174  $lng->txt("skmg_skill_profiles"),
175  $this->ctrl->getLinkTargetByClass("ilskillprofilegui"));
176 
177  if (DEVMODE == 1)
178  {
179  $this->tabs_gui->addTab("test",
180  "Test (DEVMODE)",
181  $this->ctrl->getLinkTarget($this, "test"));
182  }
183  }
184 
185  if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
186  {
187  $this->tabs_gui->addTab("permissions",
188  $lng->txt("perm_settings"),
189  $this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"));
190  }
191  }

◆ saveAllTemplateTitles()

ilObjSkillManagementGUI::saveAllTemplateTitles (   $a_succ_mess = true)

Save all titles of chapters/scos/pages.

Definition at line 293 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilSkillTreeNode\_writeTitle(), ilSkillTreeNodeFactory\getInstance(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

294  {
295  global $ilCtrl, $lng;
296 
297  if (is_array($_POST["title"]))
298  {
299  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
300  foreach($_POST["title"] as $id => $title)
301  {
302  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
303  if (is_object($node_obj))
304  {
305  // update title
307  }
308  }
309  if ($a_succ_mess)
310  {
311  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
312  }
313  }
314  $ilCtrl->redirect($this, "editSkillTemplates");
315  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static _writeTitle($a_obj_id, $a_title)
Write Title.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:

◆ saveAllTitles()

ilObjSkillManagementGUI::saveAllTitles (   $a_succ_mess = true)

Save all titles of chapters/scos/pages.

Definition at line 266 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, ilSkillTreeNode\_writeTitle(), ilSkillTreeNodeFactory\getInstance(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

Referenced by collapseAll(), and expandAll().

267  {
268  global $ilCtrl, $lng;
269 
270  if (is_array($_POST["title"]))
271  {
272  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
273  foreach($_POST["title"] as $id => $title)
274  {
275  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
276  if (is_object($node_obj))
277  {
278  // update title
280  }
281  }
282  if ($a_succ_mess)
283  {
284  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
285  }
286  }
287  $ilCtrl->redirect($this, "editSkills");
288  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static _writeTitle($a_obj_id, $a_title)
Write Title.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSettings()

ilObjSkillManagementGUI::saveSettings ( )

Save skill management settings.

Definition at line 230 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, $ilSetting, ilObjectGUI\checkPermissionBool(), and ilUtil\sendSuccess().

231  {
232  global $ilCtrl, $ilSetting;
233 
234  if (!$this->checkPermissionBool("write"))
235  {
236  return;
237  }
238 
239  include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
240  $skmg_set = new ilSkillManagementSettings();
241  $skmg_set->activate((int) $_POST["enable_skmg"]);
242 
243  ilUtil::sendSuccess($this->lng->txt("settings_saved"),true);
244 
245  $ilCtrl->redirect($this, "editSettings");
246  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:40
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
+ Here is the call graph for this function:

◆ setTestSubtabs()

ilObjSkillManagementGUI::setTestSubtabs (   $a_act)

Set test subtabs.

Parameters

Definition at line 735 of file class.ilObjSkillManagementGUI.php.

References $ilCtrl.

736  {
737  global $ilTabs, $ilCtrl;
738 
739  $ilTabs->addSubtab("test",
740  "getCompletionDateForTriggerRefId",
741  $ilCtrl->getLinkTarget($this, "test"));
742 
743  $ilTabs->addSubtab("cert",
744  "checkUserCertificateForTriggerRefId",
745  $ilCtrl->getLinkTarget($this, "testCert"));
746 
747  $ilTabs->addSubtab("all_cert",
748  "getTriggerOfAllCertificates",
749  $ilCtrl->getLinkTarget($this, "testAllCert"));
750 
751  $ilTabs->addSubtab("levels",
752  "getSkillLevelsForTrigger",
753  $ilCtrl->getLinkTarget($this, "testLevels"));
754 
755  $ilTabs->activateSubtab($a_act);
756 
757  }
global $ilCtrl
Definition: ilias.php:18

◆ showTree()

ilObjSkillManagementGUI::showTree (   $a_templates,
  $a_gui = "",
  $a_gui_cmd = "" 
)

Show Editing Tree.

Definition at line 783 of file class.ilObjSkillManagementGUI.php.

References $_GET, $ilCtrl, $ilUser, ilObjectGUI\$lng, $path, ilObjectGUI\$tpl, and ilSkillTreeNode\_lookupType().

Referenced by executeCommand().

784  {
785  global $ilUser, $tpl, $ilCtrl, $lng;
786 
787  if ($a_templates)
788  {
789  if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1)
790  {
791  return;
792  }
793 
794  if ($_GET["obj_id"] > 1)
795  {
796  $path = $this->skill_tree->getPathId($_GET["obj_id"]);
797  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
798  if (ilSkillTreeNode::_lookupType($path[1]) == "sktp")
799  {
800  return;
801  }
802  }
803  }
804 
805  $ilCtrl->setParameter($this, "templates_tree", $a_templates);
806 
807  if ($a_templates)
808  {
809  include_once("./Services/Skill/classes/class.ilSkillTemplateTreeExplorerGUI.php");
810  $exp = new ilSkillTemplateTreeExplorerGUI($this, "showTree");
811  }
812  else
813  {
814  include_once("./Services/Skill/classes/class.ilSkillTreeExplorerGUI.php");
815  $exp = new ilSkillTreeExplorerGUI($this, "showTree", $a_templates);
816  }
817  if (!$exp->handleCommand())
818  {
819  $tpl->setLeftNavContent($exp->getHTML());
820  }
821  }
$_GET["client_id"]
Explorer class that works on tree objects (Services/Tree)
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
global $ilUser
Definition: imgupload.php:15
$path
Definition: index.php:22
Explorer class that works on tree objects (Services/Tree)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test()

ilObjSkillManagementGUI::test ( )

Test getCompletionDateForTriggerRefId.

Parameters

Definition at line 519 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, $result, ilObjectGUI\$tpl, and ilBasicSkill\getCompletionDateForTriggerRefId().

520  {
521  global $tpl, $lng, $ilCtrl, $ilTabs;
522 
523  $this->setTestSubTabs("test");
524 
525  $ilTabs->activateTab("test");
526 
527  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
528 
529  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
530  $this->form = new ilPropertyFormGUI();
531 
532  $this->form->addCommandButton("test", $lng->txt("execute"));
533 
534  $this->form->setTitle("getCompletionDateForTriggerRefId()");
535  $this->form->setFormAction($ilCtrl->getFormAction($this));
536 
537  // user id
538  $ti = new ilTextInputGUI("User ID(s)", "user_id");
539  $ti->setMaxLength(200);
540  $ti->setInfo("Separate multiple IDs by :");
541  $ti->setValue($_POST["user_id"]);
542  $this->form->addItem($ti);
543 
544  // ref id
545  $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
546  $ti->setMaxLength(200);
547  $ti->setInfo("Separate multiple IDs by :");
548  $ti->setValue($_POST["ref_id"]);
549  $this->form->addItem($ti);
550 
551  $result = "";
552  if (isset($_POST["user_id"]))
553  {
554  $user_ids = explode(":", $_POST["user_id"]);
555  $ref_ids = explode(":", $_POST["ref_id"]);
556  if (count($user_ids) <= 1)
557  {
558  $user_ids = $user_ids[0];
559  }
560  if (count($ref_ids) == 1)
561  {
562  $ref_ids = $ref_ids[0];
563  }
564  else if (count($ref_ids) == 0)
565  {
566  $ref_ids = null;
567  }
568 
570  $result = "<br />Result:<br />".var_export($result, true);
571  }
572 
573  $tpl->setContent($this->form->getHTML().$result);
574 
575  }
$_POST['username']
Definition: cron.php:12
$result
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
static getCompletionDateForTriggerRefId($a_user_id, $a_ref_id=null, $a_self_eval=0)
Get trigger completion.
+ Here is the call graph for this function:

◆ testAllCert()

ilObjSkillManagementGUI::testAllCert ( )

Test getTriggerOfAllCertificates.

Parameters

Definition at line 646 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, $result, ilObjectGUI\$tpl, and ilBasicSkill\getTriggerOfAllCertificates().

647  {
648  global $tpl, $lng, $ilCtrl, $ilTabs;
649 
650  $this->setTestSubTabs("all_cert");
651  $ilTabs->activateTab("test");
652 
653  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
654 
655  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
656  $this->form = new ilPropertyFormGUI();
657 
658  $this->form->addCommandButton("testAllCert", $lng->txt("execute"));
659 
660  $this->form->setTitle("getTriggerOfAllCertificates()");
661  $this->form->setFormAction($ilCtrl->getFormAction($this));
662 
663  // user id
664  $ti = new ilTextInputGUI("User ID(s)", "user_id");
665  $ti->setMaxLength(200);
666  $ti->setInfo("Separate multiple IDs by :");
667  $ti->setValue($_POST["user_id"]);
668  $this->form->addItem($ti);
669 
670  $result = "";
671  if (isset($_POST["user_id"]))
672  {
673  $user_ids = explode(":", $_POST["user_id"]);
674  $ref_ids = explode(":", $_POST["ref_id"]);
675  if (count($user_ids) <= 1)
676  {
677  $user_ids = $user_ids[0];
678  }
679 
681  $result = "<br />Result:<br />".var_export($result, true);
682  }
683 
684  $tpl->setContent($this->form->getHTML().$result);
685 
686  }
$_POST['username']
Definition: cron.php:12
$result
This class represents a property form user interface.
static getTriggerOfAllCertificates($a_user_id, $a_self_eval=0)
Get trigger completion.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
+ Here is the call graph for this function:

◆ testCert()

ilObjSkillManagementGUI::testCert ( )

Test checkUserCertificateForTriggerRefId.

Parameters

Definition at line 583 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, $result, ilObjectGUI\$tpl, and ilBasicSkill\checkUserCertificateForTriggerRefId().

584  {
585  global $tpl, $lng, $ilCtrl, $ilTabs;
586 
587  $this->setTestSubTabs("cert");
588  $ilTabs->activateTab("test");
589 
590  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
591 
592  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
593  $this->form = new ilPropertyFormGUI();
594 
595  $this->form->addCommandButton("testCert", $lng->txt("execute"));
596 
597  $this->form->setTitle("checkUserCertificateForTriggerRefId()");
598  $this->form->setFormAction($ilCtrl->getFormAction($this));
599 
600  // user id
601  $ti = new ilTextInputGUI("User ID(s)", "user_id");
602  $ti->setMaxLength(200);
603  $ti->setInfo("Separate multiple IDs by :");
604  $ti->setValue($_POST["user_id"]);
605  $this->form->addItem($ti);
606 
607  // ref id
608  $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
609  $ti->setMaxLength(200);
610  $ti->setInfo("Separate multiple IDs by :");
611  $ti->setValue($_POST["ref_id"]);
612  $this->form->addItem($ti);
613 
614  $result = "";
615  if (isset($_POST["user_id"]))
616  {
617  $user_ids = explode(":", $_POST["user_id"]);
618  $ref_ids = explode(":", $_POST["ref_id"]);
619  if (count($user_ids) <= 1)
620  {
621  $user_ids = $user_ids[0];
622  }
623  if (count($ref_ids) == 1)
624  {
625  $ref_ids = $ref_ids[0];
626  }
627  else if (count($ref_ids) == 0)
628  {
629  $ref_ids = null;
630  }
631 
633  $result = "<br />Result:<br />".var_export($result, true);
634  }
635 
636  $tpl->setContent($this->form->getHTML().$result);
637 
638  }
$_POST['username']
Definition: cron.php:12
$result
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
static checkUserCertificateForTriggerRefId($a_user_id, $a_ref_id, $a_self_eval=0)
Get trigger completion.
This class represents a text property in a property form.
+ Here is the call graph for this function:

◆ testLevels()

ilObjSkillManagementGUI::testLevels ( )

Test getSkillLevelsForTrigger.

Parameters

Definition at line 694 of file class.ilObjSkillManagementGUI.php.

References $_POST, $ilCtrl, ilObjectGUI\$lng, $result, ilObjectGUI\$tpl, and ilBasicSkill\getSkillLevelsForTrigger().

695  {
696  global $tpl, $lng, $ilCtrl, $ilTabs;
697 
698  $this->setTestSubTabs("levels");
699  $ilTabs->activateTab("test");
700 
701  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
702 
703  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
704  $this->form = new ilPropertyFormGUI();
705 
706  $this->form->addCommandButton("testLevels", $lng->txt("execute"));
707 
708  $this->form->setTitle("getTriggerOfAllCertificates()");
709  $this->form->setFormAction($ilCtrl->getFormAction($this));
710 
711  // user id
712  $ti = new ilTextInputGUI("Ref ID", "ref_id");
713  $ti->setMaxLength(200);
714  $ti->setValue($_POST["ref_id"]);
715  $this->form->addItem($ti);
716 
717  $result = "";
718  if (isset($_POST["ref_id"]))
719  {
721  $result = "<br />Result:<br />".var_export($result, true);
722  }
723 
724  $tpl->setContent($this->form->getHTML().$result);
725 
726  }
$_POST['username']
Definition: cron.php:12
$result
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
static getSkillLevelsForTrigger($a_ref_id)
Get assigned skill levels for trigger.
+ Here is the call graph for this function:

Field Documentation

◆ $skill_tree

ilObjSkillManagementGUI::$skill_tree
protected

Definition at line 20 of file class.ilObjSkillManagementGUI.php.


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