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();
68 $this->container_gui = $a_container_gui;
71 $this->container = $obj;
72 $this->ref_id = $this->container->getRefId();
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();
84 $this->
ctrl->saveParameter($this,
"profile_id");
85 $this->params = $this->
ctrl->getParameterArray($this);
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();
94 $this->
lng->loadLanguageModule(
"skmg");
95 $this->
lng->loadLanguageModule(
"error");
100 $next_class = $this->
ctrl->getNextClass($this);
101 $cmd = $this->
ctrl->getCmd(
"listMembers");
103 switch ($next_class) {
104 case "ilskillprofilegui":
106 $this->
ctrl->setReturn($this,
"listProfiles");
107 $ret = $this->
ctrl->forwardCommand($profile_gui);
109 case "ilskillprofileuploadhandlergui":
111 $ret = $this->
ctrl->forwardCommand($skprof_upl_gui);
115 ($this->
access->checkAccess(
"write",
"", $this->ref_id) &&
117 "listCompetences",
"settings",
"saveSettings",
"selectSkill",
118 "saveSelectedSkill",
"confirmRemoveSelectedSkill",
"removeSelectedSkill",
119 "listProfiles",
"saveSelectedProfile",
"confirmRemoveSelectedGlobalProfiles",
120 "removeSelectedGlobalProfiles",
"confirmRemoveSingleGlobalProfile",
"removeSingleGlobalProfile",
121 "confirmDeleteSingleLocalProfile",
"deleteSingleLocalProfile",
122 "confirmDeleteSelectedLocalProfiles",
"deleteSelectedLocalProfiles"
125 ($this->
access->checkAccess(
"grade",
"", $this->ref_id) &&
127 "listMembers",
"assignCompetences",
128 "saveCompetenceAssignment",
"publishAssignments",
"deassignCompetencesConfirm",
"deassignCompetences"
173 $mem_levels = $mem_skills->getSkillLevels();
178 $ne->setValue(
$name[
"lastname"] .
", " .
$name[
"firstname"] .
" [" .
$name[
"login"] .
"]");
181 if (empty($this->container_skills->getOrderedSkills())) {
186 foreach ($this->container_skills->getOrderedSkills() as $sk) {
191 "-1" => $this->
lng->txt(
"cont_skill_do_not_set"),
193 foreach ($skill->getLevelData() as $l) {
194 $options[$l[
"id"]] = $l[
"title"];
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"]]);
206 $form->addCommandButton(
"saveCompetenceAssignment", $this->
lng->txt(
"save"));
207 $form->addCommandButton(
"listMembers", $this->
lng->txt(
"cancel"));
209 $form->setTitle($this->
lng->txt(
"cont_assign_skills"));
210 $form->setFormAction($this->
ctrl->getFormAction($this));
217 $path = $this->tree_service->getSkillTreePath($a_skill_id, $a_tref_id);
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"];
225 return implode(
" > ", $titles);
237 foreach ($this->container_skills->getSkills() as $sk) {
238 $l = $form->getInput(
"skill_" . $sk[
"skill_id"] .
"_" . $sk[
"tref_id"]);
240 $levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]] = $l;
245 $mem_skills->saveLevelForSkills($levels);
248 $mem_skills->publish($this->container->getRefId());
251 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
261 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
266 foreach ($user_ids as $user_id) {
268 if (!$mem_skills->publish($this->container->getRefId())) {
269 $not_changed[] = $user_id;
273 if (count($not_changed) === 0) {
274 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"cont_skll_published"),
true);
276 $names = array_map(
static function (
$id) {
279 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_skll_published_some_not") .
" (" . implode(
"; ", $names) .
")",
true);
295 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
299 if (!is_array($user_ids) || count($user_ids) === 0) {
300 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
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");
309 foreach ($user_ids as
$i) {
311 $cgui->addItem(
"usr_ids[]", (
string)
$i,
$name);
323 foreach ($this->requested_usr_ids as $user_id) {
325 $mem_skills->removeAllSkillLevels();
328 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
354 $this->container_skills,
355 $this->container_global_profiles,
356 $this->container_local_profiles
370 if (!$sel->handleCommand()) {
380 $s = explode(
":", ($this->requested_selected_skill));
382 $this->container_skills->addSkill((
int) $s[0], (
int) $s[1]);
383 $this->container_skills->save();
386 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
400 if (empty($this->requested_combined_skill_ids)) {
401 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
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");
410 foreach ($this->requested_combined_skill_ids as
$i) {
411 $s = explode(
":",
$i);
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]);
430 $this->container_skills->save();
432 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
451 $options[0] =
$lng->
txt(
"please_select");
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;
462 foreach ($selectable_profiles as $profile) {
463 $tree = $this->tree_service->getObjSkillTreeById($profile[
"skill_tree_id"]);
464 $options[$profile[
"id"]] = $tree->getTitle() .
": " . $profile[
"title"];
467 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
469 $select->setOptions($options);
470 $select->setValue(0);
474 $button->setCaption(
"cont_add_global_profile");
475 $button->setCommand(
"saveSelectedProfile");
479 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
480 && $this->skmg_settings->getAllowLocalProfiles()) {
484 if ($this->skmg_settings->getAllowLocalProfiles()) {
486 $button->setCaption(
"cont_add_local_profile");
497 $this->container_global_profiles,
498 $this->container_local_profiles
511 if (!($profile_id > 0)) {
512 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"cont_skill_no_profile_selected"),
true);
516 $this->container_global_profiles->addProfile($profile_id);
517 $this->container_global_profiles->save();
519 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
533 if (empty($this->requested_profile_ids)) {
534 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
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");
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);
548 $cgui->addItem(
"id[]", (
string)
$i, $this->profile_service->lookupTitle(
$i));
560 if (!empty($this->requested_profile_ids)) {
561 foreach ($this->requested_profile_ids as
$id) {
562 $this->container_global_profiles->removeProfile(
$id);
564 $this->container_global_profiles->save();
566 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
580 $profile_id = (
int) $this->params[
"profile_id"];
582 if (!($profile_id > 0)) {
583 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"error_sry_error"),
true);
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));
602 $profile_id = (
int) $this->params[
"profile_id"];
604 if ($profile_id > 0) {
605 $this->container_global_profiles->removeProfile($profile_id);
606 $this->container_global_profiles->save();
608 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
622 if (empty($this->requested_profile_ids)) {
623 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"no_checkbox"),
true);
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");
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);
637 $cgui->addItem(
"id[]", (
string)
$i, $this->profile_service->lookupTitle(
$i));
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);
656 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
670 $profile_id = (
int) $this->params[
"profile_id"];
672 if (!($profile_id > 0)) {
673 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"error_sry_error"),
true);
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));
692 $profile_id = (
int) $this->params[
"profile_id"];
694 if ($profile_id > 0) {
695 $this->profile_service->delete($profile_id);
697 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
727 $radg->addOption($op1);
729 $radg->addOption($op2);
730 $form->addItem($radg);
733 $form->addCommandButton(
"saveSettings",
$lng->
txt(
"save"));
735 $form->setTitle(
$lng->
txt(
"settings"));
750 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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...
TableGUI class for competence profiles in containers.
Container skills administration.
ilGlobalTemplateInterface $tpl
confirmRemoveSelectedGlobalProfiles()
removeSelectedGlobalProfiles()
SkillTreeService $tree_service
string $requested_selected_skill
ilSkillManagementSettings $skmg_settings
initCompetenceAssignmentForm()
int $requested_selected_profile_id
SkillTreeAccess $tree_access_manager
deleteSelectedLocalProfiles()
confirmDeleteSelectedLocalProfiles()
ilContainerLocalProfiles $container_local_profiles
deleteSingleLocalProfile()
array $requested_combined_skill_ids
confirmDeleteSingleLocalProfile()
getPathString(int $a_skill_id, int $a_tref_id=0)
ilContainerGlobalProfiles $container_global_profiles
confirmRemoveSelectedSkill()
__construct(ilContainerGUI $a_container_gui)
removeSingleGlobalProfile()
ilSkillContainerGUIRequest $container_gui_request
SkillProfileService $profile_service
saveCompetenceAssignment()
ilContainerGUI $container_gui
array $requested_profile_ids
deassignCompetencesConfirm()
ilContainerSkills $container_skills
confirmRemoveSingleGlobalProfile()
TableGUI class for container members / skill assignments.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
Class ilCtrl provides processing control methods.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
@inheritDoc
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
@inheritDoc
saveParameter(object $a_gui_obj, $a_parameter)
@inheritDoc
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=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...
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 file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
Class ilSkillProfileUploadHandlerGUI.
Explorer class that works on tree objects (Services/Tree)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static setUsage(int $a_obj_id, int $a_skill_id, int $a_tref_id, bool $a_use=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
activateSubTab(string $a_id)
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:
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...
setContent(string $a_html)
Sets content for standard template.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.