ILIAS  release_7 Revision v7.30-3-g800a261c036
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 ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Protected Attributes

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

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 ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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 36 of file class.ilObjSkillManagementGUI.php.

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

37  {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $this->rbacsystem = $DIC->rbac()->system();
42  $this->error = $DIC["ilErr"];
43  $this->access = $DIC->access();
44  $this->tabs = $DIC->tabs();
45  $this->lng = $DIC->language();
46  $this->settings = $DIC->settings();
47  $this->tpl = $DIC["tpl"];
48  $this->toolbar = $DIC->toolbar();
49  $this->user = $DIC->user();
50  $ilCtrl = $DIC->ctrl();
51 
52  $this->tool_context = $DIC->globalScreen()->tool()->context();
53 
54  $this->type = 'skmg';
55  parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
56 
57  $this->lng->loadLanguageModule('skmg');
58 
59  $this->skill_tree = new ilSkillTree();
60 
61  $ilCtrl->saveParameter($this, "obj_id");
62  }
settings()
Definition: settings.php:2
Skill tree.
user()
Definition: user.php:4
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ cancelDelete()

ilObjSkillManagementGUI::cancelDelete ( )

cancel delete

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

532  {
533  $this->ctrl->redirect($this, "editSkills");
534  }

◆ collapseAll()

ilObjSkillManagementGUI::collapseAll (   $a_redirect = true)

Collapse all.

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

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

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

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

540  {
541  $ilCtrl = $this->ctrl;
542 
543  // delete all selected objects
544  foreach ($_POST["id"] as $id) {
545  if ($id != IL_FIRST_NODE) {
547  $node_data = $this->skill_tree->getNodeData($id);
548  if (is_object($obj)) {
549  $obj->delete();
550  }
551  if ($this->skill_tree->isInTree($id)) {
552  $this->skill_tree->deleteTree($node_data);
553  }
554  }
555  }
556 
557  // feedback
558  ilUtil::sendInfo($this->lng->txt("info_deleted"), true);
559  }
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 424 of file class.ilObjSkillManagementGUI.php.

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

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

◆ editSettings()

ilObjSkillManagementGUI::editSettings ( )

Edit news settings.

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

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

235  {
236  $ilCtrl = $this->ctrl;
237  $lng = $this->lng;
238  $ilTabs = $this->tabs;
239 
240  $ilTabs->activateTab("settings");
241 
242  $skmg_set = new ilSkillManagementSettings();
243  $enable_skmg = $skmg_set->isActivated();
244 
245  $form = new ilPropertyFormGUI();
246  $form->setFormAction($ilCtrl->getFormAction($this));
247  $form->setTitle($lng->txt("skmg_settings"));
248 
249  // Enable skill management
250  $cb_prop = new ilCheckboxInputGUI(
251  $lng->txt("skmg_enable_skmg"),
252  "enable_skmg"
253  );
254  $cb_prop->setValue("1");
255  $cb_prop->setChecked($enable_skmg);
256  $form->addItem($cb_prop);
257 
258  // Hide Competence Profile Data before Self-Assessment
259  $cb_prop = new ilCheckboxInputGUI(
260  $lng->txt("skmg_hide_profile_self_eval"),
261  "hide_profile_self_eval"
262  );
263  $cb_prop->setValue("1");
264  $cb_prop->setInfo($lng->txt("skmg_hide_profile_self_eval_info"));
265  $cb_prop->setChecked($skmg_set->getHideProfileBeforeSelfEval());
266  $form->addItem($cb_prop);
267 
268  // Allow local assignment of global profiles
269  $cb_prop = new ilCheckboxInputGUI(
270  $lng->txt("skmg_local_assignment_profiles"),
271  "local_assignment_profiles"
272  );
273  $cb_prop->setValue("1");
274  $cb_prop->setChecked($skmg_set->getLocalAssignmentOfProfiles());
275  $form->addItem($cb_prop);
276 
277  // Allow creation of local profiles
278  $cb_prop = new ilCheckboxInputGUI(
279  $lng->txt("skmg_allow_local_profiles"),
280  "allow_local_profiles"
281  );
282  $cb_prop->setValue("1");
283  $cb_prop->setInfo($lng->txt("skmg_allow_local_profiles_info"));
284  $cb_prop->setChecked($skmg_set->getAllowLocalProfiles());
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.
setValue($a_value)
Set Value.
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 321 of file class.ilObjSkillManagementGUI.php.

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

322  {
323  $tpl = $this->tpl;
324  $ilTabs = $this->tabs;
325  $lng = $this->lng;
326  $ilCtrl = $this->ctrl;
327 
328  $ilTabs->activateTab("skills");
329 
330  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
331  $ilCtrl->redirectByClass("ilskillrootgui", "listSkills");
332  }

◆ editSkillTemplates()

ilObjSkillManagementGUI::editSkillTemplates ( )

Edit skill templates.

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

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

820  {
821  $tpl = $this->tpl;
822  $ilTabs = $this->tabs;
823  $lng = $this->lng;
824  $ilCtrl = $this->ctrl;
825 
826  $ilTabs->activateTab("skill_templates");
827  $ilCtrl->setParameterByClass("ilobjskillmanagementgui", "obj_id", $this->skill_tree->getRootId());
828  $ilCtrl->redirectByClass("ilskillrootgui", "listTemplates");
829  }

◆ executeCommand()

ilObjSkillManagementGUI::executeCommand ( )

Execute command.

public

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

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

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

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

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

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

175  {
177  $ilAccess = $this->access;
178  $lng = $this->lng;
179 
180  if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
181  $this->tabs_gui->addTab(
182  "skills",
183  $lng->txt("skmg_skills"),
184  $this->ctrl->getLinkTarget($this, "editSkills")
185  );
186 
187  $this->tabs_gui->addTab(
188  "skill_templates",
189  $lng->txt("skmg_skill_templates"),
190  $this->ctrl->getLinkTarget($this, "editSkillTemplates")
191  );
192 
193  $this->tabs_gui->addTab(
194  "profiles",
195  $lng->txt("skmg_skill_profiles"),
196  $this->ctrl->getLinkTargetByClass("ilskillprofilegui")
197  );
198 
199  $this->tabs_gui->addTab(
200  "settings",
201  $lng->txt("settings"),
202  $this->ctrl->getLinkTarget($this, "editSettings")
203  );
204 
205  if ($ilAccess->checkAccess("write", "", $this->object->getRefId())) {
206  $this->tabs_gui->addTab(
207  "export",
208  $lng->txt("export"),
209  $this->ctrl->getLinkTargetByClass("ilexportgui", "")
210  );
211  }
212 
213  if (DEVMODE == 1) {
214  $this->tabs_gui->addTab(
215  "test",
216  "Test (DEVMODE)",
217  $this->ctrl->getLinkTarget($this, "test")
218  );
219  }
220  }
221 
222  if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
223  $this->tabs_gui->addTab(
224  "permissions",
225  $lng->txt("perm_settings"),
226  $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
227  );
228  }
229  }

◆ 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, ilObjectGUI\$lng, ilSkillTreeNode\_writeTitle(), ilSkillTreeNodeFactory\getInstance(), and ilUtil\stripSlashes().

362  {
363  $ilCtrl = $this->ctrl;
364  $lng = $this->lng;
365 
366  if (is_array($_POST["title"])) {
367  foreach ($_POST["title"] as $id => $title) {
368  $node_obj = ilSkillTreeNodeFactory::getInstance($id);
369  if (is_object($node_obj)) {
370  // update title
372  }
373  }
374  if ($a_succ_mess) {
375  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
376  }
377  }
378  $ilCtrl->redirect($this, "editSkillTemplates");
379  }
static _writeTitle($a_obj_id, $a_title)
Write Title.
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 338 of file class.ilObjSkillManagementGUI.php.

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

Referenced by collapseAll(), and expandAll().

339  {
340  $ilCtrl = $this->ctrl;
341  $lng = $this->lng;
342 
343  if (is_array($_POST["title"])) {
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.
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, $ilSetting, ilObjectGUI\$settings, and ilObjectGUI\checkPermissionBool().

299  {
300  $ilCtrl = $this->ctrl;
302 
303  if (!$this->checkPermissionBool("write")) {
304  return;
305  }
306 
307  $skmg_set = new ilSkillManagementSettings();
308  $skmg_set->activate((int) $_POST["enable_skmg"]);
309  $skmg_set->setHideProfileBeforeSelfEval((int) $_POST["hide_profile_self_eval"]);
310  $skmg_set->setLocalAssignmentOfProfiles((int) $_POST["local_assignment_profiles"]);
311  $skmg_set->setAllowLocalProfiles((int) $_POST["allow_local_profiles"]);
312 
313  ilUtil::sendSuccess($this->lng->txt("settings_saved"), true);
314 
315  $ilCtrl->redirect($this, "editSettings");
316  }
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 780 of file class.ilObjSkillManagementGUI.php.

References ilObjectGUI\$ctrl, and $tabs.

781  {
782  $ilTabs = $this->tabs;
783  $ilCtrl = $this->ctrl;
784 
785  $ilTabs->addSubtab(
786  "test",
787  "getCompletionDateForTriggerRefId",
788  $ilCtrl->getLinkTarget($this, "test")
789  );
790 
791  $ilTabs->addSubtab(
792  "cert",
793  "checkUserCertificateForTriggerRefId",
794  $ilCtrl->getLinkTarget($this, "testCert")
795  );
796 
797  $ilTabs->addSubtab(
798  "all_cert",
799  "getTriggerOfAllCertificates",
800  $ilCtrl->getLinkTarget($this, "testAllCert")
801  );
802 
803  $ilTabs->addSubtab(
804  "levels",
805  "getSkillLevelsForTrigger",
806  $ilCtrl->getLinkTarget($this, "testLevels")
807  );
808 
809  $ilTabs->activateSubtab($a_act);
810  }

◆ showTree()

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

Show Editing Tree.

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

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

Referenced by executeCommand().

839  {
841  $tpl = $this->tpl;
842  $ilCtrl = $this->ctrl;
843  $lng = $this->lng;
844 
845  if ($a_templates) {
846  if ($_GET["obj_id"] == "" || $_GET["obj_id"] == 1) {
847  return;
848  }
849 
850  if ($_GET["obj_id"] > 1) {
851  $path = $this->skill_tree->getPathId($_GET["obj_id"]);
852  if (ilSkillTreeNode::_lookupType($path[1]) == "sktp") {
853  return;
854  }
855  }
856  }
857 
858  $ilCtrl->setParameter($this, "templates_tree", $a_templates);
859 
860  if ($a_templates) {
861  $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_TEMPLATE_TREE, true);
862  $exp = new ilSkillTemplateTreeExplorerGUI($this, "showTree");
863  } else {
864  $this->tool_context->current()->addAdditionalData(ilSkillGSToolProvider::SHOW_SKILL_TREE, true);
865  $exp = new ilSkillTreeExplorerGUI($this, "showTree");
866  }
867  if (!$exp->handleCommand()) {
868  $tpl->setLeftNavContent($exp->getHTML());
869  }
870  }
$_GET["client_id"]
Explorer class that works on tree objects (Services/Tree)
static _lookupType($a_obj_id)
Lookup Type.
Explorer class that works on tree objects (Services/Tree)
$ilUser
Definition: imgupload.php:18
+ 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 573 of file class.ilObjSkillManagementGUI.php.

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

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

◆ testAllCert()

ilObjSkillManagementGUI::testAllCert ( )

Test getTriggerOfAllCertificates.

Parameters

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

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

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

◆ testCert()

ilObjSkillManagementGUI::testCert ( )

Test checkUserCertificateForTriggerRefId.

Parameters

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

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

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

◆ testLevels()

ilObjSkillManagementGUI::testLevels ( )

Test getSkillLevelsForTrigger.

Parameters

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

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

740  {
741  $tpl = $this->tpl;
742  $lng = $this->lng;
743  $ilCtrl = $this->ctrl;
744  $ilTabs = $this->tabs;
745 
746  $this->setTestSubTabs("levels");
747  $ilTabs->activateTab("test");
748 
749  $this->form = new ilPropertyFormGUI();
750 
751  if ($this->rbacsystem->checkAccess('write', $_GET['ref_id'])) {
752  $this->form->addCommandButton("testLevels", $lng->txt("execute"));
753  }
754 
755  $this->form->setTitle("getTriggerOfAllCertificates()");
756  $this->form->setFormAction($ilCtrl->getFormAction($this));
757 
758  // user id
759  $ti = new ilTextInputGUI("Ref ID", "ref_id");
760  $ti->setMaxLength(200);
761  $ti->setValue($_POST["ref_id"]);
762  $this->form->addItem($ti);
763 
764  $result = "";
765  if (isset($_POST["ref_id"])) {
766  $result = ilBasicSkill::getSkillLevelsForTrigger($_POST["ref_id"]);
767  $result = "<br />Result:<br />" . var_export($result, true);
768  }
769 
770  $tpl->setContent($this->form->getHTML() . $result);
771  }
$result
This class represents a property form user interface.
$_GET["client_id"]
$_POST["username"]

Field Documentation

◆ $error

ilObjSkillManagementGUI::$error
protected

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

Referenced by executeCommand().

◆ $rbacsystem

ilObjSkillManagementGUI::$rbacsystem
protected

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

Referenced by executeCommand(), and getAdminTabs().

◆ $skill_tree

ilObjSkillManagementGUI::$skill_tree
protected

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

◆ $tabs


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