ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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
 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...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 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 ()
 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...
 
 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...
 
 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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 

Protected Attributes

 $rbacsystem
 
 $error
 
 $tabs
 
 $skill_tree
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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
 
 $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
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 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...
 
 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...
 
 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...
 
 getTabs ()
 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 (ilColumnGUI $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 42 of file class.ilObjSkillManagementGUI.php.

References $DIC, $ilCtrl, ILIAS\GlobalScreen\Provider\__construct(), settings(), and user().

43  {
44  global $DIC;
45 
46  $this->ctrl = $DIC->ctrl();
47  $this->rbacsystem = $DIC->rbac()->system();
48  $this->error = $DIC["ilErr"];
49  $this->access = $DIC->access();
50  $this->tabs = $DIC->tabs();
51  $this->lng = $DIC->language();
52  $this->settings = $DIC->settings();
53  $this->tpl = $DIC["tpl"];
54  $this->toolbar = $DIC->toolbar();
55  $this->user = $DIC->user();
56  $ilCtrl = $DIC->ctrl();
57 
58  $this->tool_context = $DIC->globalScreen()->tool()->context();
59 
60  $this->type = 'skmg';
61  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
62 
63  $this->lng->loadLanguageModule('skmg');
64 
65  include_once("./Services/Skill/classes/class.ilSkillTree.php");
66  $this->skill_tree = new ilSkillTree();
67 
68  $ilCtrl->saveParameter($this, "obj_id");
69  }
settings()
Definition: settings.php:2
Skill tree.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelDelete()

ilObjSkillManagementGUI::cancelDelete ( )

cancel delete

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

530  {
531  $this->ctrl->redirect($this, "editSkills");
532  }

◆ collapseAll()

ilObjSkillManagementGUI::collapseAll (   $a_redirect = true)

Collapse all.

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

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

405  {
406  $_GET["skexpand"] = "";
407  $n_id = ($_GET["obj_id"] > 0)
408  ? $_GET["obj_id"]
409  : $this->skill_tree->readRootId();
410  $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
411  $old = $_SESSION["skexpand"];
412  foreach ($stree as $n) {
413  if (in_array($n["child"], $old) && $n["child"] != $n_id) {
414  $k = array_search($n["child"], $old);
415  unset($old[$k]);
416  }
417  }
418  $_SESSION["skexpand"] = $old;
419  $this->saveAllTitles(false);
420  }
$_SESSION["AccountId"]
$_GET["client_id"]
$n
Definition: RandomTest.php:85
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 537 of file class.ilObjSkillManagementGUI.php.

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

538  {
540 
541  // delete all selected objects
542  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
543  foreach ($_POST["id"] as $id) {
544  if ($id != IL_FIRST_NODE) {
546  $node_data = $this->skill_tree->getNodeData($id);
547  if (is_object($obj)) {
548  $obj->delete();
549  }
550  if ($this->skill_tree->isInTree($id)) {
551  $this->skill_tree->deleteTree($node_data);
552  }
553  }
554  }
555 
556  // feedback
557  ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
558  }
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
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteNodes()

ilObjSkillManagementGUI::deleteNodes (   $a_gui)

confirm deletion screen of skill tree nodes

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

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

426  {
427  $lng = $this->lng;
428  $tpl = $this->tpl;
430  $ilTabs = $this->tabs;
431  $ilToolbar = $this->toolbar;
432 
433  if (!isset($_POST["id"])) {
434  $this->ilias->raiseError($this->lng->txt("no_checkbox"), $this->ilias->error_obj->MESSAGE);
435  }
436 
437  $ilTabs->clearTargets();
438 
439  // check usages
440  $mode = "";
441  $cskill_ids = array();
442  foreach ($_POST["id"] as $id) {
443  if (in_array(ilSkillTreeNode::_lookupType($id), array("skll", "scat", "sktr"))) {
444  if ($mode == "templates") {
445  $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
446  }
447  $mode = "basic";
448  $skill_id = $id;
449  $tref_id = 0;
450  if (ilSkillTreeNode::_lookupType($id) == "sktr") {
451  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
453  $tref_id = $id;
454  }
455  $cskill_ids[] = array("skill_id" => $skill_id, "tref_id" => $tref_id);
456  }
457  if (in_array(ilSkillTreeNode::_lookupType($id), array("sktp", "sctp"))) {
458  if ($mode == "basic") {
459  $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
460  }
461  $mode = "templates";
462 
463  foreach (ilSkillTemplateReference::_lookupTrefIdsForTemplateId($id) as $tref_id) {
464  $cskill_ids[] = array("skill_id" => $id, "tref_id" => $tref_id);
465  }
466  }
467  // for cats, skills and template references, get "real" usages
468  // for skill and category templates check usage in references
469  }
470 
471  if ($mode == "basic" || $mode == "templates") {
472  include_once("./Services/Skill/classes/class.ilSkillUsage.php");
473  $u = new ilSkillUsage();
474  $usages = $u->getAllUsagesInfoOfSubtrees($cskill_ids);
475  if (count($usages) > 0) {
476  $html = "";
477  foreach ($usages as $k => $usage) {
478  include_once("./Services/Skill/classes/class.ilSkillUsageTableGUI.php");
479  $tab = new ilSkillUsageTableGUI($this, "showUsage", $k, $usage);
480  $html .= $tab->getHTML() . "<br/><br/>";
481  }
482  $tpl->setContent($html);
483  $ilCtrl->saveParameter($a_gui, "tmpmode");
484  $ilToolbar->addButton(
485  $lng->txt("back"),
486  $ilCtrl->getLinkTarget($a_gui, "cancelDelete")
487  );
488  ilUtil::sendFailure($lng->txt("skmg_cannot_delete_nodes_in_use"));
489  return;
490  }
491  } else {
492  $this->ilias->raiseError("Skill Deletion - type mismatch.", $this->ilias->error_obj->MESSAGE);
493  }
494 
495  // SAVE POST VALUES
496  $_SESSION["saved_post"] = $_POST["id"];
497 
498  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
499  $confirmation_gui = new ilConfirmationGUI();
500 
501  $ilCtrl->setParameter($a_gui, "tmpmode", $_GET["tmpmode"]);
502  $a_form_action = $this->ctrl->getFormAction($a_gui);
503  $confirmation_gui->setFormAction($a_form_action);
504  $confirmation_gui->setHeaderText($this->lng->txt("info_delete_sure"));
505 
506  // Add items to delete
507  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
508  foreach ($_POST["id"] as $id) {
509  if ($id != IL_FIRST_NODE) {
510  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
511  $confirmation_gui->addItem(
512  "id[]",
513  $node_obj->getId(),
514  $node_obj->getTitle(),
515  ilUtil::getImagePath("icon_" . $node_obj->getType() . ".svg")
516  );
517  }
518  }
519 
520  $confirmation_gui->setCancel($lng->txt("cancel"), "cancelDelete");
521  $confirmation_gui->setConfirm($lng->txt("confirm"), "confirmedDelete");
522 
523  $tpl->setContent($confirmation_gui->getHTML());
524  }
$_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.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ editSettings()

ilObjSkillManagementGUI::editSettings ( )

Edit news settings.

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

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

251  {
253  $lng = $this->lng;
255  $ilTabs = $this->tabs;
256 
257  $ilTabs->activateTab("settings");
258 
259  include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
260  $skmg_set = new ilSkillManagementSettings();
261  $enable_skmg = $skmg_set->isActivated();
262 
263  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
264  $form = new ilPropertyFormGUI();
265  $form->setFormAction($ilCtrl->getFormAction($this));
266  $form->setTitle($lng->txt("skmg_settings"));
267 
268  // Enable skill management
269  $cb_prop = new ilCheckboxInputGUI(
270  $lng->txt("skmg_enable_skmg"),
271  "enable_skmg"
272  );
273  $cb_prop->setValue("1");
274  $cb_prop->setChecked($enable_skmg);
275  $form->addItem($cb_prop);
276 
277  // Hide Competence Profile Data before Self-Assessment
278  $cb_prop = new ilCheckboxInputGUI(
279  $lng->txt("skmg_hide_profile_self_eval"),
280  "hide_profile_self_eval"
281  );
282  $cb_prop->setValue("1");
283  $cb_prop->setInfo($lng->txt("skmg_hide_profile_self_eval_info"));
284  $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
285  $form->addItem($cb_prop);
286 
287  // command buttons
288  if ($this->checkPermissionBool("write")) {
289  $form->addCommandButton("saveSettings", $lng->txt("save"));
290  }
291 
292  $this->tpl->setContent($form->getHTML());
293  }
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:17
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 320 of file class.ilObjSkillManagementGUI.php.

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

321  {
322  $tpl = $this->tpl;
323  $ilTabs = $this->tabs;
324  $lng = $this->lng;
326 
327  $ilTabs->activateTab("skills");
328 
329  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
330  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
331  }
global $ilCtrl
Definition: ilias.php:18

◆ editSkillTemplates()

ilObjSkillManagementGUI::editSkillTemplates ( )

Edit skill templates.

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

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

831  {
832  $tpl = $this->tpl;
833  $ilTabs = $this->tabs;
834  $lng = $this->lng;
836 
837  $ilTabs->activateTab("skill_templates");
838  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
839  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
840  }
global $ilCtrl
Definition: ilias.php:18

◆ executeCommand()

ilObjSkillManagementGUI::executeCommand ( )

Execute command.

public

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

References $_GET, $error, ilObjectGUI\$ilErr, $rbacsystem, $ret, $tabs, ilObjectGUI\prepareOutput(), and showTree().

78  {
81  $ilTabs = $this->tabs;
82 
83  $next_class = $this->ctrl->getNextClass($this);
84  $cmd = $this->ctrl->getCmd();
85 
86  $this->prepareOutput();
87 
88 
89  if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
90  $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
91  }
92 
93  switch ($next_class) {
94  case 'ilskillrootgui':
95  include_once("./Services/Skill/classes/class.ilSkillRootGUI.php");
96  $skrt_gui = new ilSkillRootGUI((int) $_GET["obj_id"], $this);
97  $skrt_gui->setParentGUI($this);
98  $ret = $this->ctrl->forwardCommand($skrt_gui);
99  break;
100 
101  case 'ilskillcategorygui':
102  $this->tabs_gui->activateTab("skills");
103  include_once("./Services/Skill/classes/class.ilSkillCategoryGUI.php");
104  $scat_gui = new ilSkillCategoryGUI((int) $_GET["obj_id"]);
105  $scat_gui->setParentGUI($this);
106  $this->showTree(false, $scat_gui, "listItems");
107  $ret = $this->ctrl->forwardCommand($scat_gui);
108  break;
109 
110  case 'ilbasicskillgui':
111  $this->tabs_gui->activateTab("skills");
112  include_once("./Services/Skill/classes/class.ilBasicSkillGUI.php");
113  $skill_gui = new ilBasicSkillGUI((int) $_GET["obj_id"]);
114  $skill_gui->setParentGUI($this);
115  $this->showTree(false, $skill_gui, "edit");
116  $ret = $this->ctrl->forwardCommand($skill_gui);
117  break;
118 
119  case 'ilskilltemplatecategorygui':
120  $this->tabs_gui->activateTab("skill_templates");
121  include_once("./Services/Skill/classes/class.ilSkillTemplateCategoryGUI.php");
122  $sctp_gui = new ilSkillTemplateCategoryGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
123  $sctp_gui->setParentGUI($this);
124  $this->showTree(((int) $_GET["tref_id"] == 0), $sctp_gui, "listItems");
125  $ret = $this->ctrl->forwardCommand($sctp_gui);
126  break;
127 
128  case 'ilbasicskilltemplategui':
129  $this->tabs_gui->activateTab("skill_templates");
130  include_once("./Services/Skill/classes/class.ilBasicSkillTemplateGUI.php");
131  $sktp_gui = new ilBasicSkillTemplateGUI((int) $_GET["obj_id"], (int) $_GET["tref_id"]);
132  $sktp_gui->setParentGUI($this);
133  $this->showTree(((int) $_GET["tref_id"] == 0), $sktp_gui, "edit");
134  $ret = $this->ctrl->forwardCommand($sktp_gui);
135  break;
136 
137  case 'ilskilltemplatereferencegui':
138  $this->tabs_gui->activateTab("skills");
139  include_once("./Services/Skill/classes/class.ilSkillTemplateReferenceGUI.php");
140  $sktr_gui = new ilSkillTemplateReferenceGUI((int) $_GET["tref_id"]);
141  $sktr_gui->setParentGUI($this);
142  $this->showTree(false, $sktr_gui, "listItems");
143  $ret = $this->ctrl->forwardCommand($sktr_gui);
144  break;
145 
146  case "ilskillprofilegui":
147  $ilTabs->activateTab("profiles");
148  include_once("./Services/Skill/classes/class.ilSkillProfileGUI.php");
149  $skprof_gui = new ilSkillProfileGUI();
150  $ret = $this->ctrl->forwardCommand($skprof_gui);
151  break;
152 
153  case 'ilpermissiongui':
154  $this->tabs_gui->activateTab('permissions');
155  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
156  $perm_gui = new ilPermissionGUI($this);
157  $ret = $this->ctrl->forwardCommand($perm_gui);
158  break;
159 
160  case "ilexportgui":
161  $this->tabs_gui->activateTab('export');
162  include_once("./Services/Export/classes/class.ilExportGUI.php");
163  $exp_gui = new ilExportGUI($this);
164  $exp_gui->addFormat("xml");
165  //$exp_gui->addFormat("html", "", $this, "exportHTML");
166  $ret = $this->ctrl->forwardCommand($exp_gui);
167  break;
168 
169  default:
170  if (!$cmd || $cmd == 'view') {
171  $cmd = "editSkills";
172  }
173 
174  if ($cmd == "showTree") {
175  $this->showTree($_GET["templates_tree"]);
176  } else {
177  $this->$cmd();
178  }
179  break;
180  }
181  return true;
182  }
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"]
Export User Interface Class.
prepareOutput($a_show_subobjects=true)
prepare output
Skill template reference GUI class.
Skill template category GUI class.
$ret
Definition: parser.php:6
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 386 of file class.ilObjSkillManagementGUI.php.

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

387  {
388  $_GET["skexpand"] = "";
389  $n_id = ($_GET["obj_id"] > 0)
390  ? $_GET["obj_id"]
391  : $this->skill_tree->readRootId();
392  $stree = $this->skill_tree->getSubTree($this->skill_tree->getNodeData($n_id));
393  $n_arr = array();
394  foreach ($stree as $n) {
395  $n_arr[] = $n["child"];
396  $_SESSION["skexpand"] = $n_arr;
397  }
398  $this->saveAllTitles(false);
399  }
$_SESSION["AccountId"]
$_GET["client_id"]
$n
Definition: RandomTest.php:85
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 190 of file class.ilObjSkillManagementGUI.php.

References ilObjectGUI\$access, ilObjectGUI\$lng, and $rbacsystem.

191  {
193  $ilAccess = $this->access;
194  $lng = $this->lng;
195 
196  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
197  $this->tabs_gui->addTab(
198  "skills",
199  $lng->txt("skmg_skills"),
200  $this->ctrl->getLinkTarget($this, "editSkills")
201  );
202 
203  $this->tabs_gui->addTab(
204  "skill_templates",
205  $lng->txt("skmg_skill_templates"),
206  $this->ctrl->getLinkTarget($this, "editSkillTemplates")
207  );
208 
209  $this->tabs_gui->addTab(
210  "settings",
211  $lng->txt("settings"),
212  $this->ctrl->getLinkTarget($this, "editSettings")
213  );
214 
215  $this->tabs_gui->addTab(
216  "profiles",
217  $lng->txt("skmg_skill_profiles"),
218  $this->ctrl->getLinkTargetByClass("ilskillprofilegui")
219  );
220 
221  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
222  $this->tabs_gui->addTab(
223  "export",
224  $lng->txt("export"),
225  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
226  );
227  }
228 
229  if (DEVMODE == 1) {
230  $this->tabs_gui->addTab(
231  "test",
232  "Test (DEVMODE)",
233  $this->ctrl->getLinkTarget($this, "test")
234  );
235  }
236  }
237 
238  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
239  $this->tabs_gui->addTab(
240  "permissions",
241  $lng->txt("perm_settings"),
242  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
243  );
244  }
245  }

◆ saveAllTemplateTitles()

ilObjSkillManagementGUI::saveAllTemplateTitles (   $a_succ_mess = true)

Save all titles of chapters/scos/pages.

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

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

362  {
364  $lng = $this->lng;
365 
366  if (is_array($_POST["title"])) {
367  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
368  foreach ($_POST["title"] as $id => $title) {
369  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
370  if (is_object($node_obj)) {
371  // update title
373  }
374  }
375  if ($a_succ_mess) {
376  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
377  }
378  }
379  $ilCtrl->redirect($this, "editSkillTemplates");
380  }
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
$_POST["username"]
+ 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 337 of file class.ilObjSkillManagementGUI.php.

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

Referenced by collapseAll(), and expandAll().

338  {
340  $lng = $this->lng;
341 
342  if (is_array($_POST["title"])) {
343  include_once("./Services/Skill/classes/class.ilSkillTreeNodeFactory.php");
344  foreach ($_POST["title"] as $id => $title) {
345  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
346  if (is_object($node_obj)) {
347  // update title
349  }
350  }
351  if ($a_succ_mess) {
352  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
353  }
354  }
355  $ilCtrl->redirect($this, "editSkills");
356  }
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
$_POST["username"]
+ 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 298 of file class.ilObjSkillManagementGUI.php.

References $_POST, ilObjectGUI\$ctrl, $ilCtrl, $ilSetting, ilObjectGUI\$settings, and ilObjectGUI\checkPermissionBool().

299  {
302 
303  if (!$this->checkPermissionBool("write")) {
304  return;
305  }
306 
307  include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
308  $skmg_set = new ilSkillManagementSettings();
309  $skmg_set->activate((int) $_POST["enable_skmg"]);
310  $skmg_set->setHideProfileBeforeSelfEval((int) $_POST["hide_profile_self_eval"]);
311 
312  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
313 
314  $ilCtrl->redirect($this, "editSettings");
315  }
global $ilCtrl
Definition: ilias.php:18
global $ilSetting
Definition: privfeed.php:17
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
$_POST["username"]
+ Here is the call graph for this function:

◆ setTestSubtabs()

ilObjSkillManagementGUI::setTestSubtabs (   $a_act)

Set test subtabs.

Parameters

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

References ilObjectGUI\$ctrl, $ilCtrl, and $tabs.

792  {
793  $ilTabs = $this->tabs;
795 
796  $ilTabs->addSubtab(
797  "test",
798  "getCompletionDateForTriggerRefId",
799  $ilCtrl->getLinkTarget($this, "test")
800  );
801 
802  $ilTabs->addSubtab(
803  "cert",
804  "checkUserCertificateForTriggerRefId",
805  $ilCtrl->getLinkTarget($this, "testCert")
806  );
807 
808  $ilTabs->addSubtab(
809  "all_cert",
810  "getTriggerOfAllCertificates",
811  $ilCtrl->getLinkTarget($this, "testAllCert")
812  );
813 
814  $ilTabs->addSubtab(
815  "levels",
816  "getSkillLevelsForTrigger",
817  $ilCtrl->getLinkTarget($this, "testLevels")
818  );
819 
820  $ilTabs->activateSubtab($a_act);
821  }
global $ilCtrl
Definition: ilias.php:18

◆ showTree()

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

Show Editing Tree.

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

References $_GET, ilObjectGUI\$ctrl, $ilCtrl, $ilUser, ilObjectGUI\$lng, ilObjectGUI\$tpl, ilObjectGUI\$user, ilSkillTreeNode\_lookupType(), ilSkillGSToolProvider\SHOW_SKILL_TREE, and ilSkillGSToolProvider\SHOW_TEMPLATE_TREE.

Referenced by executeCommand().

850  {
852  $tpl = $this->tpl;
854  $lng = $this->lng;
855 
856  if ($a_templates) {
857  if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1) {
858  return;
859  }
860 
861  if ($_GET["obj_id"] > 1) {
862  $path = $this->skill_tree->getPathId($_GET["obj_id"]);
863  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
864  if (ilSkillTreeNode::_lookupType($path[1]) == "sktp") {
865  return;
866  }
867  }
868  }
869 
870  $ilCtrl->setParameter($this, "templates_tree", $a_templates);
871 
872  if ($a_templates) {
873  $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_TEMPLATE_TREE, true);
874  $exp = new ilSkillTemplateTreeExplorerGUI($this, "showTree");
875  } else {
876  $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_SKILL_TREE, true);
877  $exp = new ilSkillTreeExplorerGUI($this, "showTree");
878  }
879  if (!$exp->handleCommand()) {
880  $tpl->setLeftNavContent($exp->getHTML());
881  }
882  }
$_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
$ilUser
Definition: imgupload.php:18
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 572 of file class.ilObjSkillManagementGUI.php.

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $result, $tabs, and ilObjectGUI\$tpl.

573  {
574  $tpl = $this->tpl;
575  $lng = $this->lng;
577  $ilTabs = $this->tabs;
578 
579  $this->setTestSubTabs("test");
580 
581  $ilTabs->activateTab("test");
582 
583  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
584 
585  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
586  $this->form = new ilPropertyFormGUI();
587 
588  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
589  $this->form->addCommandButton("test", $lng->txt("execute"));
590  }
591 
592  $this->form->setTitle("getCompletionDateForTriggerRefId()");
593  $this->form->setFormAction($ilCtrl->getFormAction($this));
594 
595  // user id
596  $ti = new ilTextInputGUI("User ID(s)", "user_id");
597  $ti->setMaxLength(200);
598  $ti->setInfo("Separate multiple IDs by :");
599  $ti->setValue($_POST["user_id"]);
600  $this->form->addItem($ti);
601 
602  // ref id
603  $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
604  $ti->setMaxLength(200);
605  $ti->setInfo("Separate multiple IDs by :");
606  $ti->setValue($_POST["ref_id"]);
607  $this->form->addItem($ti);
608 
609  $result = "";
610  if (isset($_POST["user_id"])) {
611  $user_ids = explode(":", $_POST["user_id"]);
612  $ref_ids = explode(":", $_POST["ref_id"]);
613  if (count($user_ids) <= 1) {
614  $user_ids = $user_ids[0];
615  }
616  if (count($ref_ids) == 1) {
617  $ref_ids = $ref_ids[0];
618  } elseif (count($ref_ids) == 0) {
619  $ref_ids = null;
620  }
621 
622  $result = ilBasicSkill::getCompletionDateForTriggerRefId($user_ids, $ref_ids);
623  $result = "<br />Result:<br />" . var_export($result, true);
624  }
625 
626  $tpl->setContent($this->form->getHTML() . $result);
627  }
$result
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ testAllCert()

ilObjSkillManagementGUI::testAllCert ( )

Test getTriggerOfAllCertificates.

Parameters

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

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $result, $tabs, and ilObjectGUI\$tpl.

698  {
699  $tpl = $this->tpl;
700  $lng = $this->lng;
702  $ilTabs = $this->tabs;
703 
704  $this->setTestSubTabs("all_cert");
705  $ilTabs->activateTab("test");
706 
707  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
708 
709  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
710  $this->form = new ilPropertyFormGUI();
711 
712  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
713  $this->form->addCommandButton("testAllCert", $lng->txt("execute"));
714  }
715 
716  $this->form->setTitle("getTriggerOfAllCertificates()");
717  $this->form->setFormAction($ilCtrl->getFormAction($this));
718 
719  // user id
720  $ti = new ilTextInputGUI("User ID(s)", "user_id");
721  $ti->setMaxLength(200);
722  $ti->setInfo("Separate multiple IDs by :");
723  $ti->setValue($_POST["user_id"]);
724  $this->form->addItem($ti);
725 
726  $result = "";
727  if (isset($_POST["user_id"])) {
728  $user_ids = explode(":", $_POST["user_id"]);
729  $ref_ids = explode(":", $_POST["ref_id"]);
730  if (count($user_ids) <= 1) {
731  $user_ids = $user_ids[0];
732  }
733 
734  $result = ilBasicSkill::getTriggerOfAllCertificates($user_ids);
735  $result = "<br />Result:<br />" . var_export($result, true);
736  }
737 
738  $tpl->setContent($this->form->getHTML() . $result);
739  }
$result
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ testCert()

ilObjSkillManagementGUI::testCert ( )

Test checkUserCertificateForTriggerRefId.

Parameters

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

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $result, $tabs, and ilObjectGUI\$tpl.

636  {
637  $tpl = $this->tpl;
638  $lng = $this->lng;
640  $ilTabs = $this->tabs;
641 
642  $this->setTestSubTabs("cert");
643  $ilTabs->activateTab("test");
644 
645  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
646 
647  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
648  $this->form = new ilPropertyFormGUI();
649 
650  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
651  $this->form->addCommandButton("testCert", $lng->txt("execute"));
652  }
653 
654  $this->form->setTitle("checkUserCertificateForTriggerRefId()");
655  $this->form->setFormAction($ilCtrl->getFormAction($this));
656 
657  // user id
658  $ti = new ilTextInputGUI("User ID(s)", "user_id");
659  $ti->setMaxLength(200);
660  $ti->setInfo("Separate multiple IDs by :");
661  $ti->setValue($_POST["user_id"]);
662  $this->form->addItem($ti);
663 
664  // ref id
665  $ti = new ilTextInputGUI("Ref ID(s)", "ref_id");
666  $ti->setMaxLength(200);
667  $ti->setInfo("Separate multiple IDs by :");
668  $ti->setValue($_POST["ref_id"]);
669  $this->form->addItem($ti);
670 
671  $result = "";
672  if (isset($_POST["user_id"])) {
673  $user_ids = explode(":", $_POST["user_id"]);
674  $ref_ids = explode(":", $_POST["ref_id"]);
675  if (count($user_ids) <= 1) {
676  $user_ids = $user_ids[0];
677  }
678  if (count($ref_ids) == 1) {
679  $ref_ids = $ref_ids[0];
680  } elseif (count($ref_ids) == 0) {
681  $ref_ids = null;
682  }
683 
684  $result = ilBasicSkill::checkUserCertificateForTriggerRefId($user_ids, $ref_ids);
685  $result = "<br />Result:<br />" . var_export($result, true);
686  }
687 
688  $tpl->setContent($this->form->getHTML() . $result);
689  }
$result
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ testLevels()

ilObjSkillManagementGUI::testLevels ( )

Test getSkillLevelsForTrigger.

Parameters

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

References $_GET, $_POST, ilObjectGUI\$ctrl, $ilCtrl, ilObjectGUI\$lng, $result, $tabs, and ilObjectGUI\$tpl.

748  {
749  $tpl = $this->tpl;
750  $lng = $this->lng;
752  $ilTabs = $this->tabs;
753 
754  $this->setTestSubTabs("levels");
755  $ilTabs->activateTab("test");
756 
757  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
758 
759  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
760  $this->form = new ilPropertyFormGUI();
761 
762  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
763  $this->form->addCommandButton("testLevels", $lng->txt("execute"));
764  }
765 
766  $this->form->setTitle("getTriggerOfAllCertificates()");
767  $this->form->setFormAction($ilCtrl->getFormAction($this));
768 
769  // user id
770  $ti = new ilTextInputGUI("Ref ID", "ref_id");
771  $ti->setMaxLength(200);
772  $ti->setValue($_POST["ref_id"]);
773  $this->form->addItem($ti);
774 
775  $result = "";
776  if (isset($_POST["ref_id"])) {
777  $result = ilBasicSkill::getSkillLevelsForTrigger($_POST["ref_id"]);
778  $result = "<br />Result:<br />" . var_export($result, true);
779  }
780 
781  $tpl->setContent($this->form->getHTML() . $result);
782  }
$result
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

Field Documentation

◆ $error

ilObjSkillManagementGUI::$error
protected

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

Referenced by executeCommand().

◆ $rbacsystem

ilObjSkillManagementGUI::$rbacsystem
protected

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

Referenced by executeCommand(), and getAdminTabs().

◆ $skill_tree

ilObjSkillManagementGUI::$skill_tree
protected

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

◆ $tabs


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