19 declare(strict_types=1);
37 protected \ILIAS\Container\InternalGUIService
$gui;
67 $this->
ctrl = $DIC->ctrl();
68 $this->
tabs = $DIC->tabs();
69 $this->
lng = $DIC->language();
70 $this->tpl = $DIC[
"tpl"];
71 $this->
toolbar = $DIC->toolbar();
72 $this->
access = $DIC->access();
74 $this->container_gui = $a_container_gui;
77 $this->container = $obj;
78 $this->ref_id = $this->container->getRefId();
81 $this->tree_service = $DIC->skills()->tree();
82 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->ref_id);
83 $this->profile_service = $DIC->skills()->profile();
84 $this->cont_skill_manager = $DIC->skills()->internalContainer()->manager()->getSkillManager(
85 $this->container->getId(),
86 $this->container->getRefId()
88 $this->usage_service = $DIC->skills()->usage();
91 $this->container_gui_request = $DIC->skills()->internalContainer()->gui()->request();
93 $this->
ctrl->saveParameter($this,
"profile_id");
94 $this->params = $this->
ctrl->getParameterArray($this);
96 $this->requested_usr_id = $this->container_gui_request->getUserId();
97 $this->requested_usr_ids = $this->container_gui_request->getUserIds();
98 $this->requested_selected_skill = $this->container_gui_request->getSelectedSkill();
99 $this->requested_combined_skill_ids = $this->container_gui_request->getCombinedSkillIds();
100 $this->requested_selected_profile_id = $this->container_gui_request->getSelectedProfileId();
101 $this->requested_profile_ids = $this->container_gui_request->getProfileIds();
103 $this->
lng->loadLanguageModule(
"skmg");
104 $this->
lng->loadLanguageModule(
"error");
105 $this->gui = $DIC->container()->internal()->gui();
106 $this->skills_gui = $DIC->skills()->internalContainer()->gui();
107 $this->skills_domain = $DIC->skills()->internalContainer()->manager();
112 $next_class = $this->
ctrl->getNextClass($this);
113 $cmd = $this->
ctrl->getCmd(
"listMembers");
115 switch ($next_class) {
116 case "ilskillprofilegui":
118 $this->
ctrl->setReturn($this,
"listProfiles");
119 $ret = $this->
ctrl->forwardCommand($profile_gui);
121 case "ilskillprofileuploadhandlergui":
123 $ret = $this->
ctrl->forwardCommand($skprof_upl_gui);
127 ($this->
access->checkAccess(
"write",
"", $this->ref_id) &&
129 "listCompetences",
"settings",
"saveSettings",
"selectSkill",
130 "saveSelectedSkill",
"confirmRemoveSelectedSkill",
"removeSelectedSkill",
131 "listProfiles",
"saveSelectedProfile",
"confirmRemoveSelectedGlobalProfiles",
132 "removeSelectedGlobalProfiles",
"confirmRemoveSingleGlobalProfile",
"removeSingleGlobalProfile",
133 "confirmDeleteSingleLocalProfile",
"deleteSingleLocalProfile",
134 "confirmDeleteSelectedLocalProfiles",
"deleteSelectedLocalProfiles" 137 ($this->
access->checkAccess(
"grade",
"", $this->ref_id) &&
139 "listMembers",
"assignCompetences",
140 "saveCompetenceAssignment",
"publishAssignments",
"deassignCompetencesConfirm",
"deassignCompetences" 158 $table = $this->skills_gui->contSkillMemberTableBuilder(
159 $this->skills_domain,
160 $this->cont_skill_manager,
166 if ($table->handleCommand()) {
199 $ne->setValue($name[
"lastname"] .
", " . $name[
"firstname"] .
" [" . $name[
"login"] .
"]");
202 if (empty($this->cont_skill_manager->getSkillsForContainerOrdered())) {
204 $ctrl->
redirect($this,
"listMembers");
207 foreach ($this->cont_skill_manager->getSkillsForContainerOrdered() as $sk) {
212 "-1" => $this->
lng->txt(
"cont_skill_do_not_set"),
214 foreach ($skill->getLevelData() as $l) {
215 $options[$l[
"id"]] = $l[
"title"];
219 "skill_" . $sk->getBaseSkillId() .
"_" . $sk->getTrefId()
222 $si->setInfo($this->
getPathString($sk->getBaseSkillId(), $sk->getTrefId()));
223 $mem_level = $this->cont_skill_manager->getMemberSkillLevel(
225 $sk->getBaseSkillId(),
229 $si->setValue($mem_level);
235 $form->addCommandButton(
"saveCompetenceAssignment", $this->
lng->txt(
"save"));
236 $form->addCommandButton(
"listMembers", $this->
lng->txt(
"cancel"));
238 $form->setTitle($this->
lng->txt(
"cont_assign_skills"));
239 $form->setFormAction($this->
ctrl->getFormAction($this));
246 $path = $this->tree_service->getSkillTreePath($a_skill_id, $a_tref_id);
248 foreach (
$path as $v) {
249 if ($v[
"type"] !==
"skrt" && !($v[
"skill_id"] == $a_skill_id && $v[
"tref_id"] == $a_tref_id)) {
250 $titles[] = $v[
"title"];
254 return implode(
" > ", $titles);
265 foreach ($this->cont_skill_manager->getSkillsForContainer() as $sk) {
266 $l = (
int) $form->getInput(
"skill_" . $sk->getBaseSkillId() .
"_" . $sk->getTrefId());
268 $this->cont_skill_manager->removeMemberSkillFromContainer(
269 $this->requested_usr_id,
270 $sk->getBaseSkillId(),
274 $this->cont_skill_manager->addMemberSkillForContainer(
275 $this->requested_usr_id,
276 $sk->getBaseSkillId(),
284 $this->cont_skill_manager->publishMemberSkills($this->requested_usr_id);
287 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
288 $ctrl->
redirect($this,
"listMembers");
297 if (empty($user_ids) && $this->requested_usr_id > 0) {
303 if (!$this->cont_skill_manager->publishMemberSkills($user_id)) {
308 if (count($not_changed) === 0) {
309 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"cont_skll_published"),
true);
314 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skll_published_some_not") .
" (" . implode(
"; ", $names) .
")",
true);
317 $ctrl->
redirect($this,
"listMembers");
330 if (empty($user_ids) && $this->requested_usr_id > 0) {
334 if (!is_array($user_ids) || count($user_ids) === 0) {
335 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
336 $ctrl->
redirect($this,
"listMembers");
340 $cgui->setHeaderText($lng->
txt(
"cont_really_deassign_skills"));
341 $cgui->setCancel($lng->
txt(
"cancel"),
"listMembers");
342 $cgui->setConfirm($lng->
txt(
"cont_deassign_competence"),
"deassignCompetences");
344 foreach ($user_ids as $i) {
346 $cgui->addItem(
"usr_ids[]", (
string) $i, $name);
358 foreach ($this->requested_usr_ids as
$user_id) {
359 $this->cont_skill_manager->removeAllMemberSkillsFromContainer($user_id);
362 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
363 $ctrl->
redirect($this,
"listMembers");
380 $lng->
txt(
"cont_add_skill"),
385 $table = $this->skills_gui->contSkillTableBuilder(
386 $this->skills_domain,
387 $this->cont_skill_manager,
388 $this->container->getId(),
389 $this->container->getRefId(),
394 if ($table->handleCommand()) {
409 if (!$sel->handleCommand()) {
419 $s = explode(
":", ($this->requested_selected_skill));
421 $this->cont_skill_manager->addSkillForContainer((
int) $s[0], (
int) $s[1]);
422 $this->usage_service->addUsage($this->container->getId(), (
int) $s[0], (
int) $s[1]);
424 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
426 $ctrl->
redirect($this,
"listCompetences");
438 if ($skill_id ===
"") {
439 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
440 $ctrl->
redirect($this,
"listCompetences");
444 $cgui->setHeaderText($lng->
txt(
"cont_really_remove_skill_from_course"));
445 $cgui->setCancel($lng->
txt(
"cancel"),
"listCompetences");
446 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSelectedSkill");
448 $s = explode(
":", $skill_id);
460 if (!empty($this->requested_combined_skill_ids)) {
461 foreach ($this->requested_combined_skill_ids as
$id) {
462 $s = explode(
":", $id);
463 $this->cont_skill_manager->removeSkillFromContainer((
int) $s[0], (
int) $s[1]);
464 $this->usage_service->removeUsage($this->container->getId(), (
int) $s[0], (
int) $s[1]);
467 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
469 $ctrl->
redirect($this,
"listCompetences");
485 $options[0] = $lng->
txt(
"please_select");
487 $selectable_profiles = [];
488 $all_profiles = $this->profile_service->getAllGlobalProfiles();
489 $selected_profiles = $this->profile_service->getGlobalProfilesOfRole($this->cont_member_role_id);
490 foreach ($all_profiles as $profile) {
491 if (!array_key_exists($profile->getId(), $selected_profiles)) {
492 $selectable_profiles[$profile->getId()] = $profile;
496 foreach ($selectable_profiles as $profile) {
497 $tree = $this->tree_service->getObjSkillTreeById($profile->getSkillTreeId());
498 $options[$profile->getId()] = $tree->getTitle() .
": " . $profile->getTitle();
501 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
504 $select->setValue(0);
508 $this->
lng->txt(
"cont_add_global_profile"),
509 "saveSelectedProfile" 510 )->submit()->toToolbar();
513 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
514 && $this->skmg_settings->getAllowLocalProfiles()) {
518 if ($this->skmg_settings->getAllowLocalProfiles()) {
520 $this->
lng->txt(
"cont_add_local_profile"),
522 )->emphasised()->toToolbar();
528 $table = $this->skills_gui->contProfileTableBuilder(
529 $this->skills_domain,
530 $this->profile_service,
531 $this->skmg_settings,
533 $this->cont_member_role_id,
538 if ($table->handleCommand()) {
552 if (!($profile_id > 0)) {
553 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skill_no_profile_selected"),
true);
554 $ctrl->
redirect($this,
"listProfiles");
557 $this->profile_service->addRoleToProfile($profile_id, $this->cont_member_role_id);
559 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
561 $ctrl->
redirect($this,
"listProfiles");
573 if (empty($this->requested_profile_ids)) {
574 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
575 $ctrl->
redirect($this,
"listProfiles");
579 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_remove_profiles_from_list"));
580 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
581 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSelectedGlobalProfiles");
583 foreach ($this->requested_profile_ids as $i) {
584 if ($this->profile_service->lookupProfileRefId($i) > 0) {
585 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skill_removal_not_possible"),
true);
586 $ctrl->
redirect($this,
"listProfiles");
588 $cgui->addItem(
"id[]", (
string) $i, $this->profile_service->lookupProfileTitle($i));
600 foreach ($this->requested_profile_ids as
$id) {
601 $this->profile_service->removeRoleFromProfile($id, $this->cont_member_role_id);
604 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
606 $ctrl->
redirect($this,
"listProfiles");
619 if (!($profile_id > 0)) {
620 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"error_sry_error"),
true);
621 $ctrl->
redirect($this,
"listProfiles");
625 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_remove_profile_from_list"));
626 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
627 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSingleGlobalProfile");
628 $cgui->addItem(
"", (
string) $profile_id, $this->profile_service->lookupProfileTitle($profile_id));
639 $profile_id = (
int) $this->params[
"profile_id"];
641 if ($profile_id > 0) {
642 $this->profile_service->removeRoleFromProfile($profile_id, $this->cont_member_role_id);
644 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
646 $ctrl->
redirect($this,
"listProfiles");
660 if (!($profile_id > 0)) {
661 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"error_sry_error"),
true);
662 $ctrl->
redirect($this,
"listProfiles");
666 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_delete_profile_from_list"));
667 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
668 $cgui->setConfirm($lng->
txt(
"delete"),
"deleteSingleLocalProfile");
669 $cgui->addItem(
"", (
string) $profile_id, $this->profile_service->lookupProfileTitle($profile_id));
680 $profile_id = (
int) $this->params[
"profile_id"];
682 if ($profile_id > 0) {
683 $this->profile_service->deleteProfile($profile_id);
685 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
687 $ctrl->
redirect($this,
"listProfiles");
714 $op1 =
new ilRadioOption($lng->
txt(
"cont_skill_publish_auto"),
'0', $lng->
txt(
"cont_skill_publish_auto_info"));
715 $radg->addOption($op1);
716 $op2 =
new ilRadioOption($lng->
txt(
"cont_skill_publish_manual"),
'1', $lng->
txt(
"cont_skill_publish_manual_info"));
717 $radg->addOption($op2);
718 $form->addItem($radg);
721 $form->addCommandButton(
"saveSettings", $lng->
txt(
"save"));
723 $form->setTitle($lng->
txt(
"settings"));
738 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
array $requested_profile_ids
This class represents an option in a radio group.
getFormAction(object $a_gui_obj, ?string $a_fallback_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
ilContainerGUI $container_gui
saveCompetenceAssignment()
Class ilSkillProfileUploadHandlerGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
ContainerSkills SkillInternalGUIService $skills_gui
publishAssignments(?array $usr_ids=null)
Skill management settings.
ILIAS Container InternalGUIService $gui
activateSubTab(string $a_id)
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupName(int $a_user_id)
lookup user name
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setParameterByClass(string $a_class, string $a_parameter, $a_value)
deleteSingleLocalProfile()
confirmDeleteSingleLocalProfile(int $profile_id)
static getDefaultMemberRole(int $a_ref_id)
confirmRemoveSelectedSkill(string $skill_id)
ContainerSkills SkillContainerGUIRequest $container_gui_request
SkillTreeAccess $tree_access_manager
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $requested_selected_skill
ContainerSkills SkillInternalManagerService $skills_domain
Request wrapper for skill guis in container classes.
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:
ContainerSkills ContainerSkillManager $cont_skill_manager
removeSingleGlobalProfile()
redirect(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
int $requested_selected_profile_id
assignCompetences(int $user_id)
array $requested_combined_skill_ids
__construct(ilContainerGUI $a_container_gui)
setValue(string $a_value)
confirmRemoveSingleGlobalProfile(int $profile_id)
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
Explorer class that works on tree objects (Services/Tree)
confirmRemoveSelectedGlobalProfiles()
Container skills administration.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
removeSelectedGlobalProfiles()
initCompetenceAssignmentForm()
SkillUsageService $usage_service
ilSkillManagementSettings $skmg_settings
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
SkillTreeService $tree_service
SkillProfileService $profile_service
deassignCompetencesConfirm(?array $usr_ids=null)
getPathString(int $a_skill_id, int $a_tref_id=0)
getLinkTargetByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)