ILIAS  release_8 Revision v8.24
ilContSkillAdminGUI Class Reference

Container skills administration. More...

+ Collaboration diagram for ilContSkillAdminGUI:

Public Member Functions

 __construct (ilContainerGUI $a_container_gui)
 
 executeCommand ()
 
 listMembers ()
 
 assignCompetences ()
 
 initCompetenceAssignmentForm ()
 
 getPathString (int $a_skill_id, int $a_tref_id=0)
 
 saveCompetenceAssignment ()
 
 publishAssignments ()
 
 deassignCompetencesConfirm ()
 
 deassignCompetences ()
 
 listCompetences ()
 
 selectSkill ()
 
 saveSelectedSkill ()
 
 confirmRemoveSelectedSkill ()
 
 removeSelectedSkill ()
 
 listProfiles ()
 
 saveSelectedProfile ()
 
 confirmRemoveSelectedGlobalProfiles ()
 
 removeSelectedGlobalProfiles ()
 
 confirmRemoveSingleGlobalProfile ()
 
 removeSingleGlobalProfile ()
 
 confirmDeleteSelectedLocalProfiles ()
 
 deleteSelectedLocalProfiles ()
 
 confirmDeleteSingleLocalProfile ()
 
 deleteSingleLocalProfile ()
 
 settings ()
 
 initSettingsForm ()
 
 saveSettings ()
 

Protected Attributes

ilCtrl $ctrl
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 
ilContainerGUI $container_gui
 
ilContainer $container
 
ilContainerSkills $container_skills
 
ilContainerGlobalProfiles $container_global_profiles
 
ilContainerLocalProfiles $container_local_profiles
 
ilSkillManagementSettings $skmg_settings
 
ilToolbarGUI $toolbar
 
ilAccessHandler $access
 
int $ref_id = 0
 
SkillTreeService $tree_service
 
SkillTreeAccess $tree_access_manager
 
SkillProfileService $profile_service
 
array $params = []
 
ilSkillContainerGUIRequest $container_gui_request
 
int $requested_usr_id = 0
 
array $requested_usr_ids = []
 
string $requested_selected_skill = ""
 
array $requested_combined_skill_ids = []
 
int $requested_selected_profile_id = 0
 
array $requested_profile_ids = []
 

Detailed Description

Container skills administration.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de @ilCtrl_Calls ilContSkillAdminGUI: ilSkillProfileGUI

Definition at line 30 of file class.ilContSkillAdminGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContSkillAdminGUI::__construct ( ilContainerGUI  $a_container_gui)

Definition at line 57 of file class.ilContSkillAdminGUI.php.

58 {
59 global $DIC;
60
61 $this->ctrl = $DIC->ctrl();
62 $this->tabs = $DIC->tabs();
63 $this->lng = $DIC->language();
64 $this->tpl = $DIC["tpl"];
65 $this->toolbar = $DIC->toolbar();
66 $this->access = $DIC->access();
67
68 $this->container_gui = $a_container_gui;
69 /* @var $obj ilContainer */
70 $obj = $this->container_gui->getObject();
71 $this->container = $obj;
72 $this->ref_id = $this->container->getRefId();
73
74 $this->tree_service = $DIC->skills()->tree();
75 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->ref_id);
76 $this->profile_service = $DIC->skills()->profile();
77
78 $this->container_skills = new ilContainerSkills($this->container->getId());
79 $this->container_global_profiles = new ilContainerGlobalProfiles($this->container->getId());
80 $this->container_local_profiles = new ilContainerLocalProfiles($this->container->getId());
81 $this->skmg_settings = new ilSkillManagementSettings();
82 $this->container_gui_request = new ilSkillContainerGUIRequest();
83
84 $this->ctrl->saveParameter($this, "profile_id");
85 $this->params = $this->ctrl->getParameterArray($this);
86
87 $this->requested_usr_id = $this->container_gui_request->getUserId();
88 $this->requested_usr_ids = $this->container_gui_request->getUserIds();
89 $this->requested_selected_skill = $this->container_gui_request->getSelectedSkill();
90 $this->requested_combined_skill_ids = $this->container_gui_request->getCombinedSkillIds();
91 $this->requested_selected_profile_id = $this->container_gui_request->getSelectedProfileId();
92 $this->requested_profile_ids = $this->container_gui_request->getProfileIds();
93
94 $this->lng->loadLanguageModule("skmg");
95 $this->lng->loadLanguageModule("error");
96 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Skills of a container.
Request wrapper for skill guis in container classes.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObjectGUI\getObject(), ILIAS\Repository\lng(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ assignCompetences()

ilContSkillAdminGUI::assignCompetences ( )

Definition at line 151 of file class.ilContSkillAdminGUI.php.

151 : void
152 {
156
157 $ctrl->saveParameter($this, "usr_id");
158 $tabs->activateSubTab("members");
159
160 $form = $this->initCompetenceAssignmentForm();
161 $tpl->setContent($form->getHTML());
162 }
ilGlobalTemplateInterface $tpl
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
activateSubTab(string $a_id)
setContent(string $a_html)
Sets content for standard template.

References $ctrl, $tabs, $tpl, ilTabsGUI\activateSubTab(), initCompetenceAssignmentForm(), ilCtrl\saveParameter(), and ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ confirmDeleteSelectedLocalProfiles()

ilContSkillAdminGUI::confirmDeleteSelectedLocalProfiles ( )

Definition at line 613 of file class.ilContSkillAdminGUI.php.

613 : void
614 {
619
620 $tabs->activateSubTab("profiles");
621
622 if (empty($this->requested_profile_ids)) {
623 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
624 $ctrl->redirect($this, "listProfiles");
625 } else {
626 $cgui = new ilConfirmationGUI();
627 $cgui->setFormAction($ctrl->getFormAction($this));
628 $cgui->setHeaderText($lng->txt("cont_skill_really_delete_profiles_from_list"));
629 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
630 $cgui->setConfirm($lng->txt("delete"), "deleteSelectedLocalProfiles");
631
632 foreach ($this->requested_profile_ids as $i) {
633 if (!($this->profile_service->lookupRefId($i) > 0)) {
634 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_skill_deletion_not_possible"), true);
635 $ctrl->redirect($this, "listProfiles");
636 }
637 $cgui->addItem("id[]", (string) $i, $this->profile_service->lookupTitle($i));
638 }
639
640 $tpl->setContent($cgui->getHTML());
641 }
642 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
$i
Definition: metadata.php:41

References $ctrl, $i, $lng, $tabs, $tpl, ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmDeleteSingleLocalProfile()

ilContSkillAdminGUI::confirmDeleteSingleLocalProfile ( )

Definition at line 661 of file class.ilContSkillAdminGUI.php.

661 : void
662 {
667
668 $tabs->activateSubTab("profiles");
669
670 $profile_id = (int) $this->params["profile_id"];
671
672 if (!($profile_id > 0)) {
673 $this->tpl->setOnScreenMessage('failure', $lng->txt("error_sry_error"), true);
674 $ctrl->redirect($this, "listProfiles");
675 } else {
676 $cgui = new ilConfirmationGUI();
677 $cgui->setFormAction($ctrl->getFormAction($this));
678 $cgui->setHeaderText($lng->txt("cont_skill_really_delete_profile_from_list"));
679 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
680 $cgui->setConfirm($lng->txt("delete"), "deleteSingleLocalProfile");
681 $cgui->addItem("", (string) $profile_id, $this->profile_service->lookupTitle($profile_id));
682
683 $tpl->setContent($cgui->getHTML());
684 }
685 }

References $ctrl, $lng, $tabs, $tpl, ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ILIAS\Repository\int(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmRemoveSelectedGlobalProfiles()

ilContSkillAdminGUI::confirmRemoveSelectedGlobalProfiles ( )

Definition at line 524 of file class.ilContSkillAdminGUI.php.

524 : void
525 {
530
531 $tabs->activateSubTab("profiles");
532
533 if (empty($this->requested_profile_ids)) {
534 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
535 $ctrl->redirect($this, "listProfiles");
536 } else {
537 $cgui = new ilConfirmationGUI();
538 $cgui->setFormAction($ctrl->getFormAction($this));
539 $cgui->setHeaderText($lng->txt("cont_skill_really_remove_profiles_from_list"));
540 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
541 $cgui->setConfirm($lng->txt("remove"), "removeSelectedGlobalProfiles");
542
543 foreach ($this->requested_profile_ids as $i) {
544 if ($this->profile_service->lookupRefId($i) > 0) {
545 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_skill_removal_not_possible"), true);
546 $ctrl->redirect($this, "listProfiles");
547 }
548 $cgui->addItem("id[]", (string) $i, $this->profile_service->lookupTitle($i));
549 }
550
551 $tpl->setContent($cgui->getHTML());
552 }
553 }

References $ctrl, $i, $lng, $tabs, $tpl, ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmRemoveSelectedSkill()

ilContSkillAdminGUI::confirmRemoveSelectedSkill ( )

Definition at line 391 of file class.ilContSkillAdminGUI.php.

391 : void
392 {
397
398 $tabs->activateSubTab("competences");
399
400 if (empty($this->requested_combined_skill_ids)) {
401 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
402 $ctrl->redirect($this, "listCompetences");
403 } else {
404 $cgui = new ilConfirmationGUI();
405 $cgui->setFormAction($ctrl->getFormAction($this));
406 $cgui->setHeaderText($lng->txt("cont_really_remove_skill_from_course"));
407 $cgui->setCancel($lng->txt("cancel"), "listCompetences");
408 $cgui->setConfirm($lng->txt("remove"), "removeSelectedSkill");
409
410 foreach ($this->requested_combined_skill_ids as $i) {
411 $s = explode(":", $i);
412 $cgui->addItem("id[]", (string) $i, ilBasicSkill::_lookupTitle((int) $s[0], (int) $s[1]));
413 }
414
415 $tpl->setContent($cgui->getHTML());
416 }
417 }
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)

References $ctrl, $i, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ confirmRemoveSingleGlobalProfile()

ilContSkillAdminGUI::confirmRemoveSingleGlobalProfile ( )

Definition at line 571 of file class.ilContSkillAdminGUI.php.

571 : void
572 {
577
578 $tabs->activateSubTab("profiles");
579
580 $profile_id = (int) $this->params["profile_id"];
581
582 if (!($profile_id > 0)) {
583 $this->tpl->setOnScreenMessage('failure', $lng->txt("error_sry_error"), true);
584 $ctrl->redirect($this, "listProfiles");
585 } else {
586 $cgui = new ilConfirmationGUI();
587 $cgui->setFormAction($ctrl->getFormAction($this));
588 $cgui->setHeaderText($lng->txt("cont_skill_really_remove_profile_from_list"));
589 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
590 $cgui->setConfirm($lng->txt("remove"), "removeSingleGlobalProfile");
591 $cgui->addItem("", (string) $profile_id, $this->profile_service->lookupTitle($profile_id));
592
593 $tpl->setContent($cgui->getHTML());
594 }
595 }

References $ctrl, $lng, $tabs, $tpl, ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ILIAS\Repository\int(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deassignCompetences()

ilContSkillAdminGUI::deassignCompetences ( )

Definition at line 318 of file class.ilContSkillAdminGUI.php.

318 : void
319 {
322
323 foreach ($this->requested_usr_ids as $user_id) {
324 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
325 $mem_skills->removeAllSkillLevels();
326 }
327
328 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
329 $ctrl->redirect($this, "listMembers");
330 }

References $ctrl, $lng, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deassignCompetencesConfirm()

ilContSkillAdminGUI::deassignCompetencesConfirm ( )

Definition at line 285 of file class.ilContSkillAdminGUI.php.

285 : void
286 {
291
292 $tabs->activateSubTab("members");
293
294 $user_ids = $this->requested_usr_ids;
295 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
296 $user_ids[] = $this->requested_usr_id;
297 }
298
299 if (!is_array($user_ids) || count($user_ids) === 0) {
300 $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
301 $ctrl->redirect($this, "listMembers");
302 } else {
303 $cgui = new ilConfirmationGUI();
304 $cgui->setFormAction($ctrl->getFormAction($this));
305 $cgui->setHeaderText($lng->txt("cont_really_deassign_skills"));
306 $cgui->setCancel($lng->txt("cancel"), "listMembers");
307 $cgui->setConfirm($lng->txt("cont_deassign_competence"), "deassignCompetences");
308
309 foreach ($user_ids as $i) {
310 $name = ilUserUtil::getNamePresentation($i, false, false, "", true);
311 $cgui->addItem("usr_ids[]", (string) $i, $name);
312 }
313
314 $tpl->setContent($cgui->getHTML());
315 }
316 }
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link="", bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
if($format !==null) $name
Definition: metadata.php:247

References $ctrl, $i, $lng, $name, $requested_usr_id, $requested_usr_ids, $tabs, $tpl, ilTabsGUI\activateSubTab(), ilCtrl\getFormAction(), ilUserUtil\getNamePresentation(), ilCtrl\redirect(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deleteSelectedLocalProfiles()

ilContSkillAdminGUI::deleteSelectedLocalProfiles ( )

Definition at line 644 of file class.ilContSkillAdminGUI.php.

644 : void
645 {
648
649 if (!empty($this->requested_profile_ids)) {
650 foreach ($this->requested_profile_ids as $id) {
651 if ($this->profile_service->lookupRefId($id) > 0) {
652 $this->profile_service->delete($id);
653 }
654 }
655 }
656 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
657
658 $ctrl->redirect($this, "listProfiles");
659 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $ctrl, $id, $lng, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ deleteSingleLocalProfile()

ilContSkillAdminGUI::deleteSingleLocalProfile ( )

Definition at line 687 of file class.ilContSkillAdminGUI.php.

687 : void
688 {
691
692 $profile_id = (int) $this->params["profile_id"];
693
694 if ($profile_id > 0) {
695 $this->profile_service->delete($profile_id);
696 }
697 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
698
699 $ctrl->redirect($this, "listProfiles");
700 }

References $ctrl, $lng, ILIAS\Repository\int(), ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ executeCommand()

ilContSkillAdminGUI::executeCommand ( )

Definition at line 98 of file class.ilContSkillAdminGUI.php.

98 : void
99 {
100 $next_class = $this->ctrl->getNextClass($this);
101 $cmd = $this->ctrl->getCmd("listMembers");
102
103 switch ($next_class) {
104 case "ilskillprofilegui":
105 $profile_gui = new ilSkillProfileGUI($this->tree_access_manager);
106 $this->ctrl->setReturn($this, "listProfiles");
107 $ret = $this->ctrl->forwardCommand($profile_gui);
108 break;
109 case "ilskillprofileuploadhandlergui":
110 $skprof_upl_gui = new ilSkillProfileUploadHandlerGUI();
111 $ret = $this->ctrl->forwardCommand($skprof_upl_gui);
112 break;
113 default:
114 if (
115 ($this->access->checkAccess("write", "", $this->ref_id) &&
116 in_array($cmd, [
117 "listCompetences", "settings", "saveSettings", "selectSkill",
118 "saveSelectedSkill", "confirmRemoveSelectedSkill", "removeSelectedSkill",
119 "listProfiles", "saveSelectedProfile", "confirmRemoveSelectedGlobalProfiles",
120 "removeSelectedGlobalProfiles", "confirmRemoveSingleGlobalProfile", "removeSingleGlobalProfile",
121 "confirmDeleteSingleLocalProfile", "deleteSingleLocalProfile",
122 "confirmDeleteSelectedLocalProfiles", "deleteSelectedLocalProfiles"
123 ]))
124 ||
125 ($this->access->checkAccess("grade", "", $this->ref_id) &&
126 in_array($cmd, [
127 "listMembers", "assignCompetences",
128 "saveCompetenceAssignment", "publishAssignments", "deassignCompetencesConfirm", "deassignCompetences"
129 ]))
130 ) {
131 $this->$cmd();
132 }
133 }
134 }
Skill profile GUI class.
Class ilSkillProfileUploadHandlerGUI.

References ILIAS\Repository\access(), and ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getPathString()

ilContSkillAdminGUI::getPathString ( int  $a_skill_id,
int  $a_tref_id = 0 
)

Definition at line 215 of file class.ilContSkillAdminGUI.php.

215 : string
216 {
217 $path = $this->tree_service->getSkillTreePath($a_skill_id, $a_tref_id);
218 $titles = [];
219 foreach ($path as $v) {
220 if ($v["type"] !== "skrt" && !($v["skill_id"] == $a_skill_id && $v["tref_id"] == $a_tref_id)) {
221 $titles[] = $v["title"];
222 }
223 }
224
225 return implode(" > ", $titles);
226 }
$path
Definition: ltiservices.php:32

References $path.

Referenced by initCompetenceAssignmentForm().

+ Here is the caller graph for this function:

◆ initCompetenceAssignmentForm()

ilContSkillAdminGUI::initCompetenceAssignmentForm ( )

Definition at line 164 of file class.ilContSkillAdminGUI.php.

165 {
169
170 $form = new ilPropertyFormGUI();
171
172 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->requested_usr_id);
173 $mem_levels = $mem_skills->getSkillLevels();
174
175 // user name
176 $name = ilObjUser::_lookupName($this->requested_usr_id);
177 $ne = new ilNonEditableValueGUI($this->lng->txt("obj_user"), "");
178 $ne->setValue($name["lastname"] . ", " . $name["firstname"] . " [" . $name["login"] . "]");
179 $form->addItem($ne);
180
181 if (empty($this->container_skills->getOrderedSkills())) {
182 $tpl->setOnScreenMessage('info', $lng->txt("cont_skill_no_skills_selected"), true);
183 $ctrl->redirect($this, "listMembers");
184 }
185
186 foreach ($this->container_skills->getOrderedSkills() as $sk) {
187 $skill = new ilBasicSkill($sk["skill_id"]);
188
189 // skill level options
190 $options = [
191 "-1" => $this->lng->txt("cont_skill_do_not_set"),
192 ];
193 foreach ($skill->getLevelData() as $l) {
194 $options[$l["id"]] = $l["title"];
195 }
196 $si = new ilSelectInputGUI(ilBasicSkill::_lookupTitle($sk["skill_id"], $sk["tref_id"]), "skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
197 $si->setOptions($options);
198 $si->setInfo($this->getPathString($sk["skill_id"], $sk["tref_id"]));
199 if (isset($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]])) {
200 $si->setValue($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]]);
201 }
202 $form->addItem($si);
203 }
204
205 // save and cancel commands
206 $form->addCommandButton("saveCompetenceAssignment", $this->lng->txt("save"));
207 $form->addCommandButton("listMembers", $this->lng->txt("cancel"));
208
209 $form->setTitle($this->lng->txt("cont_assign_skills"));
210 $form->setFormAction($this->ctrl->getFormAction($this));
211
212 return $form;
213 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPathString(int $a_skill_id, int $a_tref_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupName(int $a_user_id)
lookup user name
This class represents a property form user interface.
This class represents a selection list property in a property form.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.

References $ctrl, $lng, $name, $tpl, ilObjUser\_lookupName(), ilSkillTreeNode\_lookupTitle(), ILIAS\Repository\ctrl(), getPathString(), ILIAS\Repository\lng(), ilCtrl\redirect(), ilGlobalTemplateInterface\setOnScreenMessage(), and ilLanguage\txt().

Referenced by assignCompetences(), and saveCompetenceAssignment().

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

◆ initSettingsForm()

ilContSkillAdminGUI::initSettingsForm ( )

Definition at line 717 of file class.ilContSkillAdminGUI.php.

718 {
721
722 $form = new ilPropertyFormGUI();
723
724 // publish
725 $radg = new ilRadioGroupInputGUI($lng->txt("cont_skill_publish"), "cont_skill_publish");
726 $op1 = new ilRadioOption($lng->txt("cont_skill_publish_auto"), '0', $lng->txt("cont_skill_publish_auto_info"));
727 $radg->addOption($op1);
728 $op2 = new ilRadioOption($lng->txt("cont_skill_publish_manual"), '1', $lng->txt("cont_skill_publish_manual_info"));
729 $radg->addOption($op2);
730 $form->addItem($radg);
731 $radg->setValue(ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", '0'));
732
733 $form->addCommandButton("saveSettings", $lng->txt("save"));
734
735 $form->setTitle($lng->txt("settings"));
736 $form->setFormAction($ctrl->getFormAction($this));
737
738 return $form;
739 }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $ctrl, $lng, ilContainer\_lookupContainerSetting(), ilCtrl\getFormAction(), and ilLanguage\txt().

Referenced by saveSettings(), and settings().

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

◆ listCompetences()

ilContSkillAdminGUI::listCompetences ( )

Definition at line 335 of file class.ilContSkillAdminGUI.php.

335 : void
336 {
342
343 $tabs->activateSubTab("competences");
344
346 $lng->txt("cont_add_skill"),
347 $ctrl->getLinkTarget($this, "selectSkill")
348 );
349
350 // table
351 $tab = new ilContSkillTableGUI(
352 $this,
353 "listCompetences",
354 $this->container_skills,
355 $this->container_global_profiles,
356 $this->container_local_profiles
357 );
358
359 $tpl->setContent($tab->getHTML());
360 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
addButton(string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')

References $ctrl, $lng, $tabs, $toolbar, $tpl, ilTabsGUI\activateSubTab(), ilToolbarGUI\addButton(), ilCtrl\getLinkTarget(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ listMembers()

ilContSkillAdminGUI::listMembers ( )

Definition at line 138 of file class.ilContSkillAdminGUI.php.

138 : void
139 {
142
143 $tabs->activateSubTab("members");
144
145 // table
146 $tab = new ilContSkillMemberTableGUI($this, "listMembers", $this->container_skills);
147
148 $tpl->setContent($tab->getHTML());
149 }
TableGUI class for container members / skill assignments.

References $tabs, $tpl, ilTabsGUI\activateSubTab(), and ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ listProfiles()

ilContSkillAdminGUI::listProfiles ( )

Definition at line 440 of file class.ilContSkillAdminGUI.php.

440 : void
441 {
447
448 $tabs->activateSubTab("profiles");
449
450 $options = [];
451 $options[0] = $lng->txt("please_select");
452
453 $selectable_profiles = [];
454 $all_profiles = $this->profile_service->getAllGlobalProfiles();
455 $selected_profiles = $this->container_global_profiles->getProfiles();
456 foreach ($all_profiles as $id => $profile) {
457 if (!array_key_exists($id, $selected_profiles)) {
458 $selectable_profiles[$id] = $profile;
459 }
460 }
461
462 foreach ($selectable_profiles as $profile) {
463 $tree = $this->tree_service->getObjSkillTreeById($profile["skill_tree_id"]);
464 $options[$profile["id"]] = $tree->getTitle() . ": " . $profile["title"];
465 }
466
467 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
468 $select = new ilSelectInputGUI($lng->txt("skmg_profile"), "p_id");
469 $select->setOptions($options);
470 $select->setValue(0);
471 $toolbar->addInputItem($select, true);
472
473 $button = ilSubmitButton::getInstance();
474 $button->setCaption("cont_add_global_profile");
475 $button->setCommand("saveSelectedProfile");
476 $toolbar->addButtonInstance($button);
477 }
478
479 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
480 && $this->skmg_settings->getAllowLocalProfiles()) {
482 }
483
484 if ($this->skmg_settings->getAllowLocalProfiles()) {
485 $button = ilLinkButton::getInstance();
486 $button->setCaption("cont_add_local_profile");
487 $button->setUrl($ctrl->getLinkTargetByClass("ilskillprofilegui", "createLocal"));
488 $toolbar->addButtonInstance($button);
489 }
490
492
493 // table
494 $tab = new ilContProfileTableGUI(
495 $this,
496 "listProfiles",
497 $this->container_global_profiles,
498 $this->container_local_profiles
499 );
500
501 $tpl->setContent($tab->getHTML());
502 }
TableGUI class for competence profiles in containers.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
setFormAction(string $a_val, bool $a_multipart=false, string $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
addButtonInstance(ilButtonBase $a_button)
Add button instance.
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)

References $ctrl, $id, $lng, $tabs, $toolbar, $tpl, ilTabsGUI\activateSubTab(), ilToolbarGUI\addButtonInstance(), ilToolbarGUI\addInputItem(), ilToolbarGUI\addSeparator(), ilCtrl\getFormAction(), ilLinkButton\getInstance(), ilSubmitButton\getInstance(), ilCtrl\getLinkTargetByClass(), ilGlobalTemplateInterface\setContent(), ilToolbarGUI\setFormAction(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ publishAssignments()

ilContSkillAdminGUI::publishAssignments ( )

Definition at line 255 of file class.ilContSkillAdminGUI.php.

255 : void
256 {
259
260 $user_ids = $this->requested_usr_ids;
261 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
262 $user_ids[] = $this->requested_usr_id;
263 }
264
265 $not_changed = [];
266 foreach ($user_ids as $user_id) {
267 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
268 if (!$mem_skills->publish($this->container->getRefId())) {
269 $not_changed[] = $user_id;
270 }
271 }
272
273 if (count($not_changed) === 0) {
274 $this->tpl->setOnScreenMessage('success', $lng->txt("cont_skll_published"), true);
275 } else {
276 $names = array_map(static function ($id) {
277 return ilUserUtil::getNamePresentation($id, false, false, "", true);
278 }, $not_changed);
279 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_skll_published_some_not") . " (" . implode("; ", $names) . ")", true);
280 }
281
282 $ctrl->redirect($this, "listMembers");
283 }

References $ctrl, $id, $lng, $requested_usr_id, $requested_usr_ids, ilUserUtil\getNamePresentation(), ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ removeSelectedGlobalProfiles()

ilContSkillAdminGUI::removeSelectedGlobalProfiles ( )

Definition at line 555 of file class.ilContSkillAdminGUI.php.

555 : void
556 {
559
560 if (!empty($this->requested_profile_ids)) {
561 foreach ($this->requested_profile_ids as $id) {
562 $this->container_global_profiles->removeProfile($id);
563 }
564 $this->container_global_profiles->save();
565 }
566 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
567
568 $ctrl->redirect($this, "listProfiles");
569 }

References $ctrl, $id, $lng, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ removeSelectedSkill()

ilContSkillAdminGUI::removeSelectedSkill ( )

Definition at line 419 of file class.ilContSkillAdminGUI.php.

419 : void
420 {
423
424 if (!empty($this->requested_combined_skill_ids)) {
425 foreach ($this->requested_combined_skill_ids as $id) {
426 $s = explode(":", $id);
427 $this->container_skills->removeSkill($s[0], $s[1]);
428 ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1], false);
429 }
430 $this->container_skills->save();
431 }
432 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
433
434 $ctrl->redirect($this, "listCompetences");
435 }
static setUsage(int $a_obj_id, int $a_skill_id, int $a_tref_id, bool $a_use=true)

References $ctrl, $id, $lng, ilCtrl\redirect(), ilSkillUsage\setUsage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ removeSingleGlobalProfile()

ilContSkillAdminGUI::removeSingleGlobalProfile ( )

Definition at line 597 of file class.ilContSkillAdminGUI.php.

597 : void
598 {
601
602 $profile_id = (int) $this->params["profile_id"];
603
604 if ($profile_id > 0) {
605 $this->container_global_profiles->removeProfile($profile_id);
606 $this->container_global_profiles->save();
607 }
608 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
609
610 $ctrl->redirect($this, "listProfiles");
611 }

References $ctrl, $lng, ILIAS\Repository\int(), ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveCompetenceAssignment()

ilContSkillAdminGUI::saveCompetenceAssignment ( )

Definition at line 228 of file class.ilContSkillAdminGUI.php.

228 : void
229 {
232
233 $form = $this->initCompetenceAssignmentForm();
234 $form->checkInput();
235
236 $levels = [];
237 foreach ($this->container_skills->getSkills() as $sk) {
238 $l = $form->getInput("skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
239 if ($l != -1) {
240 $levels[$sk["skill_id"] . ":" . $sk["tref_id"]] = $l;
241 }
242 }
243
244 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->requested_usr_id);
245 $mem_skills->saveLevelForSkills($levels);
246
247 if (!ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", '0')) {
248 $mem_skills->publish($this->container->getRefId());
249 }
250
251 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
252 $ctrl->redirect($this, "listMembers");
253 }

References $ctrl, $lng, ilContainer\_lookupContainerSetting(), initCompetenceAssignmentForm(), ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveSelectedProfile()

ilContSkillAdminGUI::saveSelectedProfile ( )

Definition at line 504 of file class.ilContSkillAdminGUI.php.

504 : void
505 {
508
510
511 if (!($profile_id > 0)) {
512 $this->tpl->setOnScreenMessage('info', $lng->txt("cont_skill_no_profile_selected"), true);
513 $ctrl->redirect($this, "listProfiles");
514 }
515
516 $this->container_global_profiles->addProfile($profile_id);
517 $this->container_global_profiles->save();
518
519 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
520
521 $ctrl->redirect($this, "listProfiles");
522 }

References $ctrl, $lng, $requested_selected_profile_id, ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveSelectedSkill()

ilContSkillAdminGUI::saveSelectedSkill ( )

Definition at line 375 of file class.ilContSkillAdminGUI.php.

375 : void
376 {
379
380 $s = explode(":", ($this->requested_selected_skill));
381
382 $this->container_skills->addSkill((int) $s[0], (int) $s[1]);
383 $this->container_skills->save();
384 ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1]);
385
386 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
387
388 $ctrl->redirect($this, "listCompetences");
389 }

References $ctrl, $lng, ilCtrl\redirect(), ilSkillUsage\setUsage(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ saveSettings()

ilContSkillAdminGUI::saveSettings ( )

Definition at line 741 of file class.ilContSkillAdminGUI.php.

741 : void
742 {
745
746 $form = $this->initSettingsForm();
747 $form->checkInput();
748 ilContainer::_writeContainerSetting($this->container->getId(), "cont_skill_publish", $form->getInput("cont_skill_publish"));
749
750 $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
751
752 $ctrl->redirect($this, "settings");
753 }
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)

References $ctrl, $lng, ilContainer\_writeContainerSetting(), initSettingsForm(), ilCtrl\redirect(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ selectSkill()

ilContSkillAdminGUI::selectSkill ( )

Definition at line 362 of file class.ilContSkillAdminGUI.php.

362 : void
363 {
366
367 $tabs->activateSubTab("competences");
368
369 $sel = new ilSkillSelectorGUI($this, "selectSkill", $this, "saveSelectedSkill");
370 if (!$sel->handleCommand()) {
371 $tpl->setContent($sel->getHTML());
372 }
373 }
Explorer class that works on tree objects (Services/Tree)

References $tabs, $tpl, ilTabsGUI\activateSubTab(), and ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

◆ settings()

ilContSkillAdminGUI::settings ( )

Definition at line 705 of file class.ilContSkillAdminGUI.php.

705 : void
706 {
709
710 $tabs->activateSubTab("settings");
711
712 $form = $this->initSettingsForm();
713
714 $tpl->setContent($form->getHTML());
715 }

References $tabs, $tpl, ilTabsGUI\activateSubTab(), initSettingsForm(), and ilGlobalTemplateInterface\setContent().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilAccessHandler ilContSkillAdminGUI::$access
protected

Definition at line 43 of file class.ilContSkillAdminGUI.php.

◆ $container

ilContainer ilContSkillAdminGUI::$container
protected

Definition at line 37 of file class.ilContSkillAdminGUI.php.

◆ $container_global_profiles

ilContainerGlobalProfiles ilContSkillAdminGUI::$container_global_profiles
protected

Definition at line 39 of file class.ilContSkillAdminGUI.php.

◆ $container_gui

ilContainerGUI ilContSkillAdminGUI::$container_gui
protected

Definition at line 36 of file class.ilContSkillAdminGUI.php.

◆ $container_gui_request

ilSkillContainerGUIRequest ilContSkillAdminGUI::$container_gui_request
protected

Definition at line 49 of file class.ilContSkillAdminGUI.php.

◆ $container_local_profiles

ilContainerLocalProfiles ilContSkillAdminGUI::$container_local_profiles
protected

Definition at line 40 of file class.ilContSkillAdminGUI.php.

◆ $container_skills

ilContainerSkills ilContSkillAdminGUI::$container_skills
protected

Definition at line 38 of file class.ilContSkillAdminGUI.php.

◆ $ctrl

◆ $lng

◆ $params

array ilContSkillAdminGUI::$params = []
protected

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

◆ $profile_service

SkillProfileService ilContSkillAdminGUI::$profile_service
protected

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

◆ $ref_id

int ilContSkillAdminGUI::$ref_id = 0
protected

Definition at line 44 of file class.ilContSkillAdminGUI.php.

◆ $requested_combined_skill_ids

array ilContSkillAdminGUI::$requested_combined_skill_ids = []
protected

Definition at line 53 of file class.ilContSkillAdminGUI.php.

◆ $requested_profile_ids

array ilContSkillAdminGUI::$requested_profile_ids = []
protected

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

◆ $requested_selected_profile_id

int ilContSkillAdminGUI::$requested_selected_profile_id = 0
protected

Definition at line 54 of file class.ilContSkillAdminGUI.php.

Referenced by saveSelectedProfile().

◆ $requested_selected_skill

string ilContSkillAdminGUI::$requested_selected_skill = ""
protected

Definition at line 52 of file class.ilContSkillAdminGUI.php.

◆ $requested_usr_id

int ilContSkillAdminGUI::$requested_usr_id = 0
protected

Definition at line 50 of file class.ilContSkillAdminGUI.php.

Referenced by deassignCompetencesConfirm(), and publishAssignments().

◆ $requested_usr_ids

array ilContSkillAdminGUI::$requested_usr_ids = []
protected

Definition at line 51 of file class.ilContSkillAdminGUI.php.

Referenced by deassignCompetencesConfirm(), and publishAssignments().

◆ $skmg_settings

ilSkillManagementSettings ilContSkillAdminGUI::$skmg_settings
protected

Definition at line 41 of file class.ilContSkillAdminGUI.php.

◆ $tabs

◆ $toolbar

ilToolbarGUI ilContSkillAdminGUI::$toolbar
protected

Definition at line 42 of file class.ilContSkillAdminGUI.php.

Referenced by listCompetences(), and listProfiles().

◆ $tpl

◆ $tree_access_manager

SkillTreeAccess ilContSkillAdminGUI::$tree_access_manager
protected

Definition at line 46 of file class.ilContSkillAdminGUI.php.

◆ $tree_service

SkillTreeService ilContSkillAdminGUI::$tree_service
protected

Definition at line 45 of file class.ilContSkillAdminGUI.php.


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