ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillProfileGUI Class Reference

Skill profile GUI class. More...

+ Collaboration diagram for ilSkillProfileGUI:

Public Member Functions

 __construct (SkillTreeAccess $skill_tree_access_manager, int $skill_tree_id=0)
 
 executeCommand ()
 
 setTabs (string $a_active)
 
 listProfiles ()
 
 listLocalProfiles ()
 
 create ()
 
 createLocal ()
 
 edit ()
 
 initProfileForm (string $a_mode="edit")
 
 save ()
 
 saveLocal ()
 
 update ()
 
 deleteProfiles ()
 
 showLevelsWithTableContext ()
 
 showLevels ()
 
 showLevelsWithLocalContext ()
 
 assignLevel ()
 
 assignLevelSelectSkill (bool $update=false)
 Output level table for profile assignment. More...
 
 updateLevelOfSelectedSkill ()
 
 assignLevelToProfile (Profile\SkillProfileLevel $level=null)
 
 updateLevelOfProfile ()
 
 confirmLevelAssignmentRemoval ()
 
 removeLevelAssignments ()
 
 saveLevelOrder ()
 
 showUsers ()
 
 assignUser ()
 
 assignRole (array $role_ids)
 
 removeUsers ()
 
 showObjects ()
 
 exportProfiles ()
 
 showImportForm ()
 
 initInputForm ()
 
 importProfiles ()
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs
 
ilGlobalTemplateInterface $tpl
 
ilHelpGUI $help
 
ilToolbarGUI $toolbar
 
UI Factory $ui_fac
 
UI Renderer $ui_ren
 
ILIAS Data Factory $df
 
ServerRequestInterface $request
 
ArrayBasedRequestWrapper $query
 
int $id = 0
 
Profile SkillProfile $profile = null
 
SkillTreeService $tree_service
 
SkillTreeAccess $skill_tree_access_manager
 
int $skill_tree_id = 0
 
SkillAdminGUIRequest $admin_gui_request
 
int $requested_ref_id = 0
 
int $requested_sprof_id = 0
 
SkillInternalFactoryService $skill_factory
 
Profile SkillProfileManager $profile_manager
 
Profile SkillProfileCompletionManager $profile_completion_manager
 
Table TableManager $table_manager
 
Usage SkillUsageManager $usage_manager
 
array $requested_profile_ids = []
 
bool $requested_local_context = false
 
string $requested_cskill_id = ""
 
array $requested_level_ass_ids = []
 
array $requested_level_order = []
 
string $requested_user_login = ""
 
array $requested_users = []
 
array $requested_user_ids = []
 
string $requested_table_profile_action = ""
 
array $requested_table_profile_ids = []
 
int $requested_level_id = 0
 
bool $local_context = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillProfileGUI::__construct ( SkillTreeAccess  $skill_tree_access_manager,
int  $skill_tree_id = 0 
)

Definition at line 104 of file class.ilSkillProfileGUI.php.

References $DIC, $requested_local_context, $requested_sprof_id, $skill_tree_access_manager, $skill_tree_id, ILIAS\Repository\ctrl(), ILIAS\Repository\help(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

105  {
106  global $DIC;
107 
108  $this->ctrl = $DIC->ctrl();
109  $this->lng = $DIC->language();
110  $this->tabs = $DIC->tabs();
111  $this->tpl = $DIC["tpl"];
112  $this->help = $DIC["ilHelp"];
113  $this->toolbar = $DIC->toolbar();
114  $this->ui_fac = $DIC->ui()->factory();
115  $this->ui_ren = $DIC->ui()->renderer();
116  $this->df = new \ILIAS\Data\Factory();
117  $this->request = $DIC->http()->request();
118  $this->query = $DIC->http()->wrapper()->query();
119  $this->tree_service = $DIC->skills()->tree();
120  $this->skill_tree_access_manager = $skill_tree_access_manager;
121  $this->skill_tree_id = $skill_tree_id;
122  $this->admin_gui_request = $DIC->skills()->internal()->gui()->admin_request();
123  $this->skill_factory = $DIC->skills()->internal()->factory();
124  $this->profile_manager = $DIC->skills()->internal()->manager()->getProfileManager();
125  $this->profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
126  $this->table_manager = $DIC->skills()->internal()->manager()->getTableManager();
127  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
128 
129  $this->ctrl->saveParameter($this, ["sprof_id", "local_context"]);
130 
131  $this->requested_ref_id = $this->admin_gui_request->getRefId();
132  $this->requested_sprof_id = $this->admin_gui_request->getSkillProfileId();
133  $this->requested_profile_ids = $this->admin_gui_request->getProfileIds();
134  $this->requested_local_context = $this->admin_gui_request->getLocalContext();
135  $this->requested_cskill_id = $this->admin_gui_request->getCombinedSkillId();
136  $this->requested_level_ass_ids = $this->admin_gui_request->getAssignedLevelIds();
137  $this->requested_level_order = $this->admin_gui_request->getOrder();
138  $this->requested_user_login = $this->admin_gui_request->getUserLogin();
139  $this->requested_users = $this->admin_gui_request->getUsers();
140  $this->requested_user_ids = $this->admin_gui_request->getUserIds();
141  $this->requested_table_profile_action = $this->admin_gui_request->getTableProfileAction();
142  $this->requested_table_profile_ids = $this->admin_gui_request->getTableProfileIds();
143  $this->requested_level_id = $this->admin_gui_request->getLevelId();
144 
145  if ($this->requested_sprof_id > 0) {
146  $this->id = $this->requested_sprof_id;
147  }
148 
149  if ($this->id > 0) {
150  $this->profile = $this->profile_manager->getProfile($this->id);
151  if ($this->skill_tree_id == 0) {
152  $this->skill_tree_id = $this->profile->getSkillTreeId();
153  }
154  if ($this->profile->getRefId() > 0 && $this->requested_local_context) {
155  $this->local_context = true;
156  }
157  }
158  }
SkillTreeAccess $skill_tree_access_manager
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ assignLevel()

ilSkillProfileGUI::assignLevel ( )

Definition at line 587 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $local_context, $tabs, $tpl, ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), ilGlobalTemplateInterface\setDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

587  : void
588  {
589  $lng = $this->lng;
590  $ilTabs = $this->tabs;
591  $ilCtrl = $this->ctrl;
592  $tpl = $this->tpl;
593  $local = $this->local_context;
594 
595  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
596  $this->profile->getTitle());
597  $tpl->setDescription("");
598 
599  //$this->setTabs("levels");
600 
601  $this->tpl->setOnScreenMessage('info', $lng->txt("skmg_select_skill_level_assign"));
602 
603  $ilTabs->clearTargets();
604  if ($local) {
605  $ilTabs->setBackTarget(
606  $lng->txt("back"),
607  $ilCtrl->getLinkTarget($this, "showLevelsWithLocalContext")
608  );
609  } else {
610  $ilTabs->setBackTarget(
611  $lng->txt("back"),
612  $ilCtrl->getLinkTarget($this, "showLevels")
613  );
614  }
615 
616 
617  $exp = new ilSkillSelectorGUI(
618  $this,
619  "assignLevel",
620  $this,
621  "assignLevelSelectSkill",
622  "cskill_id",
623  $this->skill_tree_id
624  );
625  if (!$exp->handleCommand()) {
626  $tpl->setContent($exp->getHTML());
627  }
628  }
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
Explorer class that works on tree objects (Services/Tree)
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:

◆ assignLevelSelectSkill()

ilSkillProfileGUI::assignLevelSelectSkill ( bool  $update = false)

Output level table for profile assignment.

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

References $ctrl, $lng, $local_context, $tabs, $tpl, ILIAS\Repository\int(), ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), ilGlobalTemplateInterface\setDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

Referenced by updateLevelOfSelectedSkill().

633  : void
634  {
635  $tpl = $this->tpl;
636  $lng = $this->lng;
637  $ilCtrl = $this->ctrl;
638  $ilTabs = $this->tabs;
639  $local = $this->local_context;
640 
641  $ilCtrl->saveParameter($this, "cskill_id");
642 
643  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
644  $this->profile->getTitle());
645  $tpl->setDescription("");
646 
647  $ilTabs->clearTargets();
648  if ($local) {
649  $ilTabs->setBackTarget(
650  $lng->txt("back"),
651  $ilCtrl->getLinkTarget($this, "showLevelsWithLocalContext")
652  );
653  } else {
654  $ilTabs->setBackTarget(
655  $lng->txt("back"),
656  $ilCtrl->getLinkTarget($this, "showLevels")
657  );
658  }
659 
660  $id_parts = explode(":", $this->requested_cskill_id);
661  $skill_id = (int) $id_parts[0];
662  $skill = new ilBasicSkill($skill_id);
663  $level_data = $skill->getLevelData();
664 
665  $items = [];
666  foreach ($level_data as $levels) {
667  $ilCtrl->setParameterByClass(self::class, "level_id", $levels["id"]);
668  $items[] = $this->ui_fac->item()->standard($levels["title"])->withMainAction(
669  $this->ui_fac->link()->standard(
670  $lng->txt("skmg_assign_level"),
671  $ilCtrl->getLinkTarget($this, $update ? "updateLevelOfProfile" : "assignLevelToProfile")
672  )
673  );
674  $ilCtrl->clearParameterByClass(self::class, "level_id");
675  }
676 
677  $list = $this->ui_fac->panel()->listing()->standard(
678  $skill->getTitle() . ", " . $lng->txt("skmg_skill_levels"),
679  [
680  $this->ui_fac->item()->group("", $items)
681  ]
682  );
683 
684  $tpl->setContent($this->ui_ren->render($list));
685  }
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setDescription(string $a_descr)
Sets description below title in standard template.
Basic Skill.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignLevelToProfile()

ilSkillProfileGUI::assignLevelToProfile ( Profile\SkillProfileLevel  $level = null)

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

References $ctrl, $lng, $local_context, $parts, $requested_level_id, ILIAS\Repository\int(), ILIAS\Repository\profile(), and ilLanguage\txt().

Referenced by updateLevelOfProfile().

692  : void
693  {
694  $ilCtrl = $this->ctrl;
695  $lng = $this->lng;
696  $local = $this->local_context;
697 
698  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
699  return;
700  }
701 
702  if ($level) {
703  $this->profile_manager->updateSkillLevel($level);
704  } else {
705  $parts = explode(":", $this->requested_cskill_id);
706  $level = $this->skill_factory->profile()->profileLevel(
707  $this->profile->getId(),
708  (int) $parts[0],
709  (int) $parts[1],
711  $this->profile_manager->getMaxLevelOrderNr($this->profile->getId()) + 10
712  );
713  $this->profile_manager->addSkillLevel($level);
714  }
715 
716  // profile completion check because of profile editing
717  $this->profile_completion_manager->writeCompletionEntryForAllAssignedUsersOfProfile($this->profile->getId());
718 
719  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
720  if ($local) {
721  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
722  }
723  $ilCtrl->redirect($this, "showLevels");
724  }
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...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assignRole()

ilSkillProfileGUI::assignRole ( array  $role_ids)

Definition at line 907 of file class.ilSkillProfileGUI.php.

References $ctrl, $id, $lng, ILIAS\Repository\profile(), and ilLanguage\txt().

907  : void
908  {
909  $ilCtrl = $this->ctrl;
910  $lng = $this->lng;
911 
912  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
913  return;
914  }
915 
916  $success = false;
917  foreach ($role_ids as $id) {
918  if ($id > 0) {
919  $this->profile_manager->addRoleToProfile($this->profile->getId(), $id);
920  $this->profile_completion_manager->writeCompletionEntryForRole($id, $this->profile->getId());
921  $success = true;
922  }
923  }
924  if ($success) {
925  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
926  }
927 
928  $ilCtrl->redirect($this, "showUsers");
929  }
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...
+ Here is the call graph for this function:

◆ assignUser()

ilSkillProfileGUI::assignUser ( )

Definition at line 873 of file class.ilSkillProfileGUI.php.

References $ctrl, $id, $lng, $requested_users, ilObjUser\_lookupId(), ILIAS\Repository\profile(), and ilLanguage\txt().

873  : void
874  {
875  $ilCtrl = $this->ctrl;
876  $lng = $this->lng;
877 
878  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
879  return;
880  }
881 
882  // user assignment with toolbar
883  $user_id = ilObjUser::_lookupId($this->requested_user_login);
884  if ($user_id > 0) {
885  $this->profile_manager->addUserToProfile($this->profile->getId(), $user_id);
886  // profile completion check for added user
887  $this->profile_completion_manager->writeCompletionEntryForSingleProfileOfUser($user_id, $this->profile->getId());
888  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
889  }
890 
891  // user assignment with ilRepositorySearchGUI
892  $users = $this->requested_users;
893  if (!empty($users)) {
894  foreach ($users as $id) {
895  if ($id > 0) {
896  $this->profile_manager->addUserToProfile($this->profile->getId(), $id);
897  // profile completion check for added user
898  $this->profile_completion_manager->writeCompletionEntryForSingleProfileOfUser($id, $this->profile->getId());
899  }
900  }
901  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
902  }
903 
904  $ilCtrl->redirect($this, "showUsers");
905  }
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...
static _lookupId($a_user_str)
+ Here is the call graph for this function:

◆ confirmLevelAssignmentRemoval()

ilSkillProfileGUI::confirmLevelAssignmentRemoval ( )

Definition at line 740 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $local_context, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilTabsGUI\clearTargets(), ilBasicSkill\lookupLevelTitle(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

740  : void
741  {
742  $ilCtrl = $this->ctrl;
743  $tpl = $this->tpl;
744  $lng = $this->lng;
745  $tabs = $this->tabs;
746  $local = $this->local_context;
747 
748  if ($local) {
749  $tabs->clearTargets();
750  } else {
751  $this->setTabs("levels");
752  }
753 
754  if (empty($this->requested_level_ass_ids)) {
755  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
756  if ($local) {
757  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
758  }
759  $ilCtrl->redirect($this, "showLevels");
760  } else {
761  $cgui = new ilConfirmationGUI();
762  $cgui->setFormAction($ilCtrl->getFormAction($this));
763  $cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
764  if ($local) {
765  $cgui->setCancel($lng->txt("cancel"), "showLevelsWithLocalContext");
766  } else {
767  $cgui->setCancel($lng->txt("cancel"), "showLevels");
768  }
769  $cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
770 
771  foreach ($this->requested_level_ass_ids as $i) {
772  $id_arr = explode(":", $i);
773  $cgui->addItem(
774  "ass_id[]",
775  $i,
776  ilBasicSkill::_lookupTitle((int) $id_arr[0]) . ": " .
777  ilBasicSkill::lookupLevelTitle((int) $id_arr[2])
778  );
779  }
780 
781  $tpl->setContent($cgui->getHTML());
782  }
783  }
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...
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static lookupLevelTitle(int $a_id)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
clearTargets()
clear all targets
+ Here is the call graph for this function:

◆ create()

ilSkillProfileGUI::create ( )

Definition at line 283 of file class.ilSkillProfileGUI.php.

References $tpl, initProfileForm(), and ilGlobalTemplateInterface\setContent().

283  : void
284  {
285  $tpl = $this->tpl;
286 
287  $form = $this->initProfileForm("create");
288  $tpl->setContent($this->ui_ren->render($form));
289  }
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ createLocal()

ilSkillProfileGUI::createLocal ( )

Definition at line 291 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tabs, $tpl, ilTabsGUI\clearTargets(), ilCtrl\getLinkTargetByClass(), initProfileForm(), ilTabsGUI\setBackTarget(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

291  : void
292  {
293  $tpl = $this->tpl;
294  $lng = $this->lng;
295  $ctrl = $this->ctrl;
296  $tabs = $this->tabs;
297 
298  $tabs->clearTargets();
300  $lng->txt("back_to_course"),
301  $ctrl->getLinkTargetByClass("ilcontskilladmingui", "listProfiles")
302  );
303 
304  $form = $this->initProfileForm("createLocal");
305  $tpl->setContent($this->ui_ren->render($form));
306  }
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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...
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setBackTarget(string $a_title, string $a_target, string $a_frame="")
clearTargets()
clear all targets
+ Here is the call graph for this function:

◆ deleteProfiles()

ilSkillProfileGUI::deleteProfiles ( )

Definition at line 499 of file class.ilSkillProfileGUI.php.

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

499  : void
500  {
501  $ilCtrl = $this->ctrl;
502  $tpl = $this->tpl;
503  $lng = $this->lng;
504 
505  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
506  return;
507  }
508 
509  if (!empty($this->requested_profile_ids)) {
510  foreach ($this->requested_profile_ids as $i) {
511  $this->profile_manager->delete($i);
512  $this->profile_completion_manager->deleteEntriesForProfile($i);
513  }
514  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
515  }
516 
517  $ilCtrl->redirect($this, "listProfiles");
518  }
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...
ilGlobalTemplateInterface $tpl
+ Here is the call graph for this function:

◆ edit()

ilSkillProfileGUI::edit ( )

Definition at line 308 of file class.ilSkillProfileGUI.php.

References $tpl, initProfileForm(), ilGlobalTemplateInterface\setContent(), and setTabs().

308  : void
309  {
310  $tpl = $this->tpl;
311 
312  $this->setTabs("settings");
313  $form = $this->initProfileForm("edit");
314  $tpl->setContent($this->ui_ren->render($form));
315  }
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillProfileGUI::executeCommand ( )

Definition at line 160 of file class.ilSkillProfileGUI.php.

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

160  : void
161  {
162  $ilCtrl = $this->ctrl;
163  $lng = $this->lng;
164 
165  $cmd = $ilCtrl->getCmd("listProfiles");
166  $next_class = $ilCtrl->getNextClass();
167  switch ($next_class) {
168  case 'ilrepositorysearchgui':
169  $user_search = new ilRepositorySearchGUI();
170  $user_search->setTitle($lng->txt('skmg_add_user_to_profile'));
171  $user_search->setCallback($this, 'assignUser');
172  $user_search->setRoleCallback($this, 'assignRole');
173 
174  // Set tabs
175  //$this->tabs_gui->setTabActive('user_assignment');
176  $ilCtrl->setReturn($this, 'showUsers');
177  $ret = $ilCtrl->forwardCommand($user_search);
178  break;
179 
180  default:
181  if (in_array($cmd, array("listProfiles", "create", "edit", "save", "update",
182  "deleteProfiles", "showLevels", "assignLevel",
183  "assignLevelSelectSkill", "updateLevelOfSelectedSkill",
184  "assignLevelToProfile", "updateLevelOfProfile",
185  "confirmLevelAssignmentRemoval", "removeLevelAssignments",
186  "showUsers", "assignUser", "assignRole",
187  "confirmUserRemoval", "removeUsers", "exportProfiles", "showImportForm",
188  "importProfiles", "saveLevelOrder", "createLocal", "saveLocal",
189  "listLocalProfiles", "showLevelsWithLocalContext", "showObjects",
190  "showLevelsWithTableContext"))) {
191  $this->$cmd();
192  }
193  break;
194  }
195  }
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...
+ Here is the call graph for this function:

◆ exportProfiles()

ilSkillProfileGUI::exportProfiles ( )

Definition at line 979 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, ilObject\_lookupObjId(), ilSkillExportConfig\MODE_PROFILES, and ilLanguage\txt().

979  : void
980  {
981  $ilCtrl = $this->ctrl;
982  $lng = $this->lng;
983 
984  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
985  return;
986  }
987 
988  $profiles_to_export = [];
989  if ($this->requested_table_profile_action === "exportProfiles"
990  && !empty($this->requested_table_profile_ids)
991  && $this->requested_table_profile_ids[0] === "ALL_OBJECTS"
992  ) {
993  $profiles = $this->skill_tree_id
994  ? $this->profile_manager->getProfilesForSkillTree($this->skill_tree_id)
995  : $this->profile_manager->getProfilesForAllSkillTrees();
996  foreach ($profiles as $profile) {
997  $profiles_to_export[] = $profile->getId();
998  }
999  } elseif ($this->requested_table_profile_action === "exportProfiles") {
1000  $profiles_to_export = array_map("intval", $this->requested_table_profile_ids);
1001  }
1002 
1003  if (empty($profiles_to_export)) {
1004  $this->tpl->setOnScreenMessage('info', $lng->txt("no_checkbox"), true);
1005  $ilCtrl->redirect($this, "");
1006  }
1007 
1008  $exp = new ilExport();
1009  $conf = $exp->getConfig("Services/Skill");
1010  $conf->setMode(ilSkillExportConfig::MODE_PROFILES);
1011  $conf->setSelectedProfiles($profiles_to_export);
1012  $conf->setSkillTreeId($this->skill_tree_id);
1013  $exp->exportObject("skmg", ilObject::_lookupObjId($this->requested_ref_id));
1014 
1015  //ilExport::_createExportDirectory(0, "xml", "");
1016  //$export_dir = ilExport::_getExportDirectory($a_id, "xml", $a_type);
1017  //$exp->exportEntity("skprof", $_POST["id"], "", "Services/Skill", $a_title, $a_export_dir, "skprof");
1018 
1019  $ilCtrl->redirectByClass(array("ilobjskilltreegui", "ilexportgui"), "");
1020  }
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...
Profile SkillProfile $profile
Export.
static _lookupObjId(int $ref_id)
+ Here is the call graph for this function:

◆ importProfiles()

ilSkillProfileGUI::importProfiles ( )

Definition at line 1052 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tpl, initInputForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

1052  : void
1053  {
1054  $tpl = $this->tpl;
1055  $lng = $this->lng;
1056  $ilCtrl = $this->ctrl;
1057 
1058  $form = $this->initInputForm();
1059  if ($form->checkInput()) {
1060  $imp = new ilImport();
1061  $conf = $imp->getConfig("Services/Skill");
1062  $conf->setSkillTreeId($this->skill_tree_id);
1063  $imp->importEntity($_FILES["import_file"]["tmp_name"], $_FILES["import_file"]["name"], "skmg", "Services/Skill");
1064 
1065  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
1066  $ilCtrl->redirect($this, "");
1067  } else {
1068  $form->setValuesByPost();
1069  $tpl->setContent($form->getHTML());
1070  }
1071  }
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...
Import class.
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ initInputForm()

ilSkillProfileGUI::initInputForm ( )

Definition at line 1030 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, ilFileInputGUI\setSuffixes(), and ilLanguage\txt().

Referenced by importProfiles(), and showImportForm().

1031  {
1032  $lng = $this->lng;
1033  $ilCtrl = $this->ctrl;
1034 
1035  $form = new ilPropertyFormGUI();
1036 
1037  $fi = new ilFileInputGUI($lng->txt("skmg_input_file"), "import_file");
1038  $fi->setSuffixes(array("zip"));
1039  $fi->setRequired(true);
1040  $form->addItem($fi);
1041 
1042  // save and cancel commands
1043  $form->addCommandButton("importProfiles", $lng->txt("import"));
1044  $form->addCommandButton("", $lng->txt("cancel"));
1045 
1046  $form->setTitle($lng->txt("import"));
1047  $form->setFormAction($ilCtrl->getFormAction($this));
1048 
1049  return $form;
1050  }
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 class represents a file property in a property form.
setSuffixes(array $a_suffixes)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initProfileForm()

ilSkillProfileGUI::initProfileForm ( string  $a_mode = "edit")

Definition at line 317 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, ILIAS\Repository\profile(), ilCtrl\setParameter(), and ilLanguage\txt().

Referenced by create(), createLocal(), edit(), save(), saveLocal(), and update().

318  {
319  $lng = $this->lng;
320  $ilCtrl = $this->ctrl;
321 
322  $ilCtrl->setParameter(
323  $this,
324  "profile",
325  "profile_settings"
326  );
327 
328  // title
329  $ti = $this->ui_fac->input()->field()->text($lng->txt("title"))
330  ->withRequired(true);
331 
332  // description
333  $desc = $this->ui_fac->input()->field()->textarea($lng->txt("description"));
334 
335  // skill trees (if local profile)
336  $se = null;
337  if ($a_mode == "createLocal") {
338  $options = [];
339  $trees = $this->tree_service->getObjSkillTrees();
340  foreach ($trees as $tree) {
341  $options[$tree->getId()] = $tree->getTitle();
342  }
343  $se = $this->ui_fac->input()->field()->select($lng->txt("skmg_skill_tree"), $options)->withRequired(true);
344  }
345 
346  // image
347  $img = $this->ui_fac->input()->field()->file(new ilSkillProfileUploadHandlerGUI(), $lng->txt("image"))
348  ->withAcceptedMimeTypes([MimeType::IMAGE__PNG, MimeType::IMAGE__JPEG]);
349 
350  // save commands
351  $sec_des = "";
352  $form_action = "";
353  if ($this->skill_tree_access_manager->hasManageProfilesPermission()) {
354  if ($a_mode == "create") {
355  $sec_des = $lng->txt("skmg_add_profile");
356  $form_action = $ilCtrl->getFormAction($this, "save");
357  } elseif ($a_mode == "createLocal") {
358  $sec_des = $lng->txt("skmg_add_local_profile");
359  $form_action = $ilCtrl->getFormAction($this, "saveLocal");
360  } else {
361  // set values
362  $ti = $ti->withValue($this->profile->getTitle());
363  $desc = $desc->withValue($this->profile->getDescription());
364  $img = $this->profile->getImageId() ? $img->withValue([$this->profile->getImageId()]) : $img;
365 
366  $sec_des = $lng->txt("skmg_edit_profile");
367  $form_action = $ilCtrl->getFormAction($this, "update");
368  }
369  }
370 
371  if (is_null($se)) {
372  $section_basic = $this->ui_fac->input()->field()->section(
373  ["title" => $ti, "description" => $desc],
374  $sec_des
375  );
376  } else {
377  $section_basic = $this->ui_fac->input()->field()->section(
378  ["title" => $ti, "description" => $desc, "skill_tree" => $se],
379  $sec_des
380  );
381  }
382  $section_advanced = $this->ui_fac->input()->field()->section(["image" => $img], $lng->txt("skmg_form_presentation"));
383 
384  $form = $this->ui_fac->input()->container()->form()->standard(
385  $form_action,
386  ["section_basic" => $section_basic, "section_advanced" => $section_advanced]
387  );
388 
389  return $form;
390  }
This describes commonalities between all forms.
Definition: Form.php:32
Class ilSkillProfileUploadHandlerGUI.
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...
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listLocalProfiles()

ilSkillProfileGUI::listLocalProfiles ( )

Definition at line 276 of file class.ilSkillProfileGUI.php.

References $ctrl, and ilCtrl\redirectByClass().

276  : void
277  {
278  $ilCtrl = $this->ctrl;
279 
280  $ilCtrl->redirectByClass("ilcontskilladmingui", "listProfiles");
281  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
+ Here is the call graph for this function:

◆ listProfiles()

ilSkillProfileGUI::listProfiles ( )

Definition at line 252 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $toolbar, $tpl, ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

252  : void
253  {
254  $tpl = $this->tpl;
255  $ilToolbar = $this->toolbar;
256  $lng = $this->lng;
257  $ilCtrl = $this->ctrl;
258 
259  if ($this->skill_tree_access_manager->hasManageProfilesPermission()) {
260  $ilToolbar->addButton(
261  $lng->txt("skmg_add_profile"),
262  $ilCtrl->getLinkTarget($this, "create")
263  );
264 
265  $ilToolbar->addButton(
266  $lng->txt("import"),
267  $ilCtrl->getLinkTarget($this, "showImportForm")
268  );
269  }
270 
271  $table = $this->table_manager->getProfileTable($this->requested_ref_id, $this->skill_tree_id)->getComponent();
272 
273  $tpl->setContent($this->ui_ren->render($table));
274  }
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ removeLevelAssignments()

ilSkillProfileGUI::removeLevelAssignments ( )

Definition at line 785 of file class.ilSkillProfileGUI.php.

References $ctrl, $local_context, ILIAS\Repository\int(), and ILIAS\Repository\profile().

785  : void
786  {
787  $ilCtrl = $this->ctrl;
788  $local = $this->local_context;
789 
790  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
791  return;
792  }
793 
794  if (!empty($this->requested_level_ass_ids)) {
795  foreach ($this->requested_level_ass_ids as $i) {
796  $id_arr = explode(":", $i);
797  $level = $this->skill_factory->profile()->profileLevel(
798  $this->profile->getId(),
799  (int) $id_arr[0],
800  (int) $id_arr[1],
801  (int) $id_arr[2],
802  (int) $id_arr[3]
803  );
804  $this->profile_manager->removeSkillLevel($level);
805  }
806  $this->profile_manager->fixSkillOrderNumbering($this->profile->getId());
807  }
808 
809  // profile completion check because of profile editing
810  $this->profile_completion_manager->writeCompletionEntryForAllAssignedUsersOfProfile($this->profile->getId());
811 
812  if ($local) {
813  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
814  }
815  $ilCtrl->redirect($this, "showLevels");
816  }
+ Here is the call graph for this function:

◆ removeUsers()

ilSkillProfileGUI::removeUsers ( )

Definition at line 931 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, ilObject\_lookupType(), ILIAS\Repository\profile(), and ilLanguage\txt().

931  : void
932  {
933  $ilCtrl = $this->ctrl;
934  $lng = $this->lng;
935 
936  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
937  return;
938  }
939 
940  if (!empty($this->requested_user_ids)) {
941  foreach ($this->requested_user_ids as $i) {
942  $type = ilObject::_lookupType($i);
943  switch ($type) {
944  case "usr":
945  $this->profile_manager->removeUserFromProfile($this->profile->getId(), $i);
946  break;
947 
948  case "role":
949  $this->profile_manager->removeRoleFromProfile($this->profile->getId(), $i);
950  break;
951 
952  default:
953  echo "not deleted";
954  }
955  }
956  $this->tpl->setOnScreenMessage("success", $lng->txt("msg_obj_modified"), true);
957  }
958  $ilCtrl->redirect($this, "showUsers");
959  }
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...
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

◆ save()

ilSkillProfileGUI::save ( )

Definition at line 392 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tpl, initProfileForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

392  : void
393  {
394  $tpl = $this->tpl;
395  $lng = $this->lng;
396  $ilCtrl = $this->ctrl;
397 
398  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
399  return;
400  }
401 
402  $form = $this->initProfileForm("create");
403  if ($this->request->getMethod() == "POST"
404  && $this->request->getQueryParams()["profile"] == "profile_settings") {
405  $form = $form->withRequest($this->request);
406  $result = $form->getData();
407  if (is_null($result)) {
408  $tpl->setContent($this->ui_ren->render($form));
409  return;
410  }
411  $profile = $this->skill_factory->profile()->profile(
412  0,
413  $result["section_basic"]["title"],
414  $result["section_basic"]["description"],
415  $this->skill_tree_id,
416  $result["section_advanced"]["image"][0] ?? ""
417  );
418  $this->profile_manager->createProfile($profile);
419 
420  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
421  $ilCtrl->redirect($this, "listProfiles");
422  }
423  $ilCtrl->redirect($this, "listProfiles");
424  }
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...
Profile SkillProfile $profile
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ saveLevelOrder()

ilSkillProfileGUI::saveLevelOrder ( )

Definition at line 818 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $local_context, ILIAS\Repository\profile(), ilArrayUtil\stripSlashesArray(), and ilLanguage\txt().

818  : void
819  {
820  $lng = $this->lng;
821  $ilCtrl = $this->ctrl;
822  $local = $this->local_context;
823 
824  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
825  return;
826  }
827 
828  $order = ilArrayUtil::stripSlashesArray($this->requested_level_order);
829  $this->profile_manager->updateSkillOrder($this->profile->getId(), $order);
830 
831  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
832  if ($local) {
833  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
834  }
835  $ilCtrl->redirect($this, "showLevels");
836  }
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...
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:

◆ saveLocal()

ilSkillProfileGUI::saveLocal ( )

Definition at line 426 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tpl, ilParticipants\getDefaultMemberRole(), initProfileForm(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

426  : void
427  {
428  $tpl = $this->tpl;
429  $lng = $this->lng;
430  $ilCtrl = $this->ctrl;
431 
432  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
433  return;
434  }
435 
436  $form = $this->initProfileForm("createLocal");
437  if ($this->request->getMethod() == "POST"
438  && $this->request->getQueryParams()["profile"] == "profile_settings") {
439  $form = $form->withRequest($this->request);
440  $result = $form->getData();
441  if (is_null($result)) {
442  $tpl->setContent($this->ui_ren->render($form));
443  return;
444  }
445  $profile = $this->skill_factory->profile()->profile(
446  0,
447  $result["section_basic"]["title"],
448  $result["section_basic"]["description"],
449  (int) $result["section_basic"]["skill_tree"],
450  $result["section_advanced"]["image"][0] ?? "",
451  $this->requested_ref_id
452  );
453  $new_profile = $this->profile_manager->createProfile($profile);
454  $this->profile_manager->addRoleToProfile(
455  $new_profile->getId(),
456  ilParticipants::getDefaultMemberRole($this->requested_ref_id)
457  );
458  $this->tpl->setOnScreenMessage('success', $lng->txt("msg_obj_modified"), true);
459  $ilCtrl->redirectByClass("ilcontskilladmingui", "listProfiles");
460  }
461  $ilCtrl->redirectByClass("ilcontskilladmingui", "listProfiles");
462  }
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...
Profile SkillProfile $profile
static getDefaultMemberRole(int $a_ref_id)
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ setTabs()

ilSkillProfileGUI::setTabs ( string  $a_active)

Definition at line 197 of file class.ilSkillProfileGUI.php.

References $ctrl, $help, $lng, $tabs, $tpl, ILIAS\Repository\profile(), ilGlobalTemplateInterface\setDescription(), ilGlobalTemplateInterface\setTitle(), and ilLanguage\txt().

Referenced by confirmLevelAssignmentRemoval(), edit(), showLevels(), showObjects(), and showUsers().

197  : void
198  {
199  $ilTabs = $this->tabs;
200  $lng = $this->lng;
201  $ilCtrl = $this->ctrl;
202  $tpl = $this->tpl;
203  $ilHelp = $this->help;
204 
205  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
206  $this->profile->getTitle());
207  $tpl->setDescription($this->profile->getDescription());
208 
209  $ilTabs->clearTargets();
210  $ilHelp->setScreenIdComponent("skmg_prof");
211 
212  $ilCtrl->clearParameterByClass(self::class, "sprof_id");
213  $ilTabs->setBackTarget(
214  $lng->txt("skmg_skill_profiles"),
215  $ilCtrl->getLinkTarget($this, "")
216  );
217  $ilCtrl->setParameter($this, "sprof_id", $this->requested_sprof_id);
218 
219  // levels
220  $ilTabs->addTab(
221  "levels",
222  $lng->txt("skmg_assigned_skill_levels"),
223  $ilCtrl->getLinkTarget($this, "showLevels")
224  );
225 
226  // users
227  $ilTabs->addTab(
228  "users",
229  $lng->txt("skmg_assigned_users"),
230  $ilCtrl->getLinkTarget($this, "showUsers")
231  );
232 
233  // objects
234  $ilTabs->addTab(
235  "objects",
236  $lng->txt("skmg_assigned_objects"),
237  $ilCtrl->getLinkTarget($this, "showObjects")
238  );
239 
240  // settings
241  if ($this->skill_tree_access_manager->hasManageProfilesPermission()) {
242  $ilTabs->addTab(
243  "settings",
244  $lng->txt("settings"),
245  $ilCtrl->getLinkTarget($this, "edit")
246  );
247  }
248 
249  $ilTabs->activateTab($a_active);
250  }
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...
ilGlobalTemplateInterface $tpl
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
setDescription(string $a_descr)
Sets description below title in standard template.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showImportForm()

ilSkillProfileGUI::showImportForm ( )

Definition at line 1022 of file class.ilSkillProfileGUI.php.

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

1022  : void
1023  {
1024  $tpl = $this->tpl;
1025  $ilTabs = $this->tabs;
1026 
1027  $tpl->setContent($this->initInputForm()->getHTML());
1028  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showLevels()

ilSkillProfileGUI::showLevels ( )

Definition at line 534 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $toolbar, $tpl, ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

534  : void
535  {
536  $tpl = $this->tpl;
537  $ilCtrl = $this->ctrl;
538  $lng = $this->lng;
539  $ilToolbar = $this->toolbar;
540 
541  $this->setTabs("levels");
542 
543  if ($this->skill_tree_access_manager->hasManageProfilesPermission()) {
544  $ilToolbar->addButton(
545  $lng->txt("skmg_assign_level"),
546  $ilCtrl->getLinkTarget($this, "assignLevel")
547  );
548  }
549 
550  $tab = new ilSkillProfileLevelsTableGUI(
551  $this,
552  "showLevels",
553  $this->profile
554  );
555  $tpl->setContent($tab->getHTML());
556  }
TableGUI class for skill profile levels.
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showLevelsWithLocalContext()

ilSkillProfileGUI::showLevelsWithLocalContext ( )

Definition at line 558 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tabs, $toolbar, $tpl, ilToolbarGUI\addButton(), ilTabsGUI\clearTargets(), ilCtrl\getLinkTarget(), ilCtrl\getLinkTargetByClass(), ILIAS\Repository\profile(), ilTabsGUI\setBackTarget(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

558  : void
559  {
560  $tpl = $this->tpl;
561  $lng = $this->lng;
562  $ctrl = $this->ctrl;
563  $tabs = $this->tabs;
565 
566  $tabs->clearTargets();
568  $lng->txt("back_to_course"),
569  $ctrl->getLinkTargetByClass("ilcontskilladmingui", "listProfiles")
570  );
571 
572  if ($this->skill_tree_access_manager->hasManageProfilesPermission()) {
574  $lng->txt("skmg_assign_level"),
575  $ctrl->getLinkTarget($this, "assignLevel")
576  );
577  }
578 
579  $tab = new ilSkillProfileLevelsTableGUI(
580  $this,
581  "showLevelsWithLocalContext",
582  $this->profile
583  );
584  $tpl->setContent($tab->getHTML());
585  }
TableGUI class for skill profile levels.
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
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...
ilGlobalTemplateInterface $tpl
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')
setContent(string $a_html)
Sets content for standard template.
setBackTarget(string $a_title, string $a_target, string $a_frame="")
clearTargets()
clear all targets
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
+ Here is the call graph for this function:

◆ showLevelsWithTableContext()

ilSkillProfileGUI::showLevelsWithTableContext ( )

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

References $ctrl, and ilCtrl\setParameter().

524  : void
525  {
526  $ilCtrl = $this->ctrl;
527 
528  if ($this->requested_table_profile_action === "editProfile" && !empty($this->requested_table_profile_ids)) {
529  $ilCtrl->setParameter($this, "sprof_id", $this->requested_table_profile_ids[0]);
530  $ilCtrl->redirect($this, "showLevels");
531  }
532  }
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ Here is the call graph for this function:

◆ showObjects()

ilSkillProfileGUI::showObjects ( )

Definition at line 961 of file class.ilSkillProfileGUI.php.

References $tpl, ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), and setTabs().

961  : void
962  {
963  $tpl = $this->tpl;
964 
965  $this->setTabs("objects");
966 
967  $objects = $this->usage_manager->getAssignedObjectsForSkillProfile($this->profile->getId());
968 
969  $table = $this->table_manager->getAssignedObjectsTable(
970  $this,
971  $objects,
972  0,
973  0,
974  $this->profile->getId()
975  )->getComponent();
976  $tpl->setContent($this->ui_ren->render($table));
977  }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ showUsers()

ilSkillProfileGUI::showUsers ( )

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

References $lng, $toolbar, $tpl, ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), setTabs(), and ilLanguage\txt().

838  : void
839  {
840  $lng = $this->lng;
841  $tpl = $this->tpl;
842  $ilToolbar = $this->toolbar;
843 
844  // add member
845  if ($this->skill_tree_access_manager->hasManageProfilesPermission() && !$this->profile->getRefId() > 0) {
847  $this,
848  $ilToolbar,
849  array(
850  'auto_complete_name' => $lng->txt('user'),
851  'submit_name' => $lng->txt('skmg_assign_user')
852  )
853  );
854 
855  $ilToolbar->addSeparator();
856 
857  $button = $this->ui_fac->button()->standard(
858  $this->lng->txt("skmg_add_assignment"),
859  $this->ctrl->getLinkTargetByClass("ilRepositorySearchGUI", "start")
860  );
861  $ilToolbar->addComponent($button);
862  }
863 
864  $this->setTabs("users");
865 
866  $table = $this->table_manager->getProfileUserAssignmentTable(
867  $this->profile,
868  $this->skill_tree_access_manager
869  )->getComponent();
870  $tpl->setContent($this->ui_ren->render($table));
871  }
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...
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
+ Here is the call graph for this function:

◆ update()

ilSkillProfileGUI::update ( )

Definition at line 464 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, $tpl, initProfileForm(), ILIAS\Repository\profile(), ilGlobalTemplateInterface\setContent(), and ilLanguage\txt().

464  : void
465  {
466  $lng = $this->lng;
467  $ilCtrl = $this->ctrl;
468  $tpl = $this->tpl;
469 
470  if (!$this->skill_tree_access_manager->hasManageProfilesPermission()) {
471  return;
472  }
473 
474  $form = $this->initProfileForm("edit");
475  if ($this->request->getMethod() == "POST"
476  && $this->request->getQueryParams()["profile"] == "profile_settings") {
477  $form = $form->withRequest($this->request);
478  $result = $form->getData();
479  if (is_null($result)) {
480  $tpl->setContent($this->ui_ren->render($form));
481  return;
482  }
483  $profile = $this->skill_factory->profile()->profile(
484  $this->profile->getId(),
485  $result["section_basic"]["title"],
486  $result["section_basic"]["description"],
487  $this->profile->getSkillTreeId(),
488  $result["section_advanced"]["image"][0] ?? "",
489  $this->profile->getRefId()
490  );
491  $this->profile_manager->updateProfile($profile);
492 
493  $this->tpl->setOnScreenMessage('info', $lng->txt("msg_obj_modified"), true);
494  $ilCtrl->redirect($this, "edit");
495  }
496  $ilCtrl->redirect($this, "listProfiles");
497  }
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...
Profile SkillProfile $profile
initProfileForm(string $a_mode="edit")
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
+ Here is the call graph for this function:

◆ updateLevelOfProfile()

ilSkillProfileGUI::updateLevelOfProfile ( )

Definition at line 726 of file class.ilSkillProfileGUI.php.

References $parts, $requested_level_id, assignLevelToProfile(), ILIAS\Repository\int(), and ILIAS\Repository\profile().

726  : void
727  {
728  $parts = explode(":", $this->requested_cskill_id);
729  $level = $this->profile_manager->getSkillLevel($this->profile->getId(), (int) $parts[0], (int) $parts[1]);
730  $level_updated = $this->skill_factory->profile()->profileLevel(
731  $level->getProfileId(),
732  $level->getBaseSkillId(),
733  $level->getTrefId(),
735  $level->getOrderNr()
736  );
737  $this->assignLevelToProfile($level_updated);
738  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:64
assignLevelToProfile(Profile\SkillProfileLevel $level=null)
+ Here is the call graph for this function:

◆ updateLevelOfSelectedSkill()

ilSkillProfileGUI::updateLevelOfSelectedSkill ( )

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

References assignLevelSelectSkill().

687  : void
688  {
689  $this->assignLevelSelectSkill(true);
690  }
assignLevelSelectSkill(bool $update=false)
Output level table for profile assignment.
+ Here is the call graph for this function:

Field Documentation

◆ $admin_gui_request

SkillAdminGUIRequest ilSkillProfileGUI::$admin_gui_request
protected

Definition at line 59 of file class.ilSkillProfileGUI.php.

◆ $ctrl

◆ $df

ILIAS Data Factory ilSkillProfileGUI::$df
protected

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

◆ $help

ilHelpGUI ilSkillProfileGUI::$help
protected

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

Referenced by setTabs().

◆ $id

int ilSkillProfileGUI::$id = 0
protected

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

Referenced by assignRole(), and assignUser().

◆ $lng

◆ $local_context

bool ilSkillProfileGUI::$local_context = false
protected

◆ $profile

Profile SkillProfile ilSkillProfileGUI::$profile = null
protected

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

◆ $profile_completion_manager

Profile SkillProfileCompletionManager ilSkillProfileGUI::$profile_completion_manager
protected

Definition at line 64 of file class.ilSkillProfileGUI.php.

◆ $profile_manager

Profile SkillProfileManager ilSkillProfileGUI::$profile_manager
protected

Definition at line 63 of file class.ilSkillProfileGUI.php.

◆ $query

ArrayBasedRequestWrapper ilSkillProfileGUI::$query
protected

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

◆ $request

ServerRequestInterface ilSkillProfileGUI::$request
protected

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

◆ $requested_cskill_id

string ilSkillProfileGUI::$requested_cskill_id = ""
protected

Definition at line 73 of file class.ilSkillProfileGUI.php.

◆ $requested_level_ass_ids

array ilSkillProfileGUI::$requested_level_ass_ids = []
protected

Definition at line 78 of file class.ilSkillProfileGUI.php.

◆ $requested_level_id

int ilSkillProfileGUI::$requested_level_id = 0
protected

Definition at line 101 of file class.ilSkillProfileGUI.php.

Referenced by assignLevelToProfile(), and updateLevelOfProfile().

◆ $requested_level_order

array ilSkillProfileGUI::$requested_level_order = []
protected

Definition at line 83 of file class.ilSkillProfileGUI.php.

◆ $requested_local_context

bool ilSkillProfileGUI::$requested_local_context = false
protected

Definition at line 72 of file class.ilSkillProfileGUI.php.

Referenced by __construct().

◆ $requested_profile_ids

array ilSkillProfileGUI::$requested_profile_ids = []
protected

Definition at line 71 of file class.ilSkillProfileGUI.php.

◆ $requested_ref_id

int ilSkillProfileGUI::$requested_ref_id = 0
protected

Definition at line 60 of file class.ilSkillProfileGUI.php.

◆ $requested_sprof_id

int ilSkillProfileGUI::$requested_sprof_id = 0
protected

Definition at line 61 of file class.ilSkillProfileGUI.php.

Referenced by __construct().

◆ $requested_table_profile_action

string ilSkillProfileGUI::$requested_table_profile_action = ""
protected

Definition at line 95 of file class.ilSkillProfileGUI.php.

◆ $requested_table_profile_ids

array ilSkillProfileGUI::$requested_table_profile_ids = []
protected

Definition at line 100 of file class.ilSkillProfileGUI.php.

◆ $requested_user_ids

array ilSkillProfileGUI::$requested_user_ids = []
protected

Definition at line 94 of file class.ilSkillProfileGUI.php.

◆ $requested_user_login

string ilSkillProfileGUI::$requested_user_login = ""
protected

Definition at line 84 of file class.ilSkillProfileGUI.php.

◆ $requested_users

array ilSkillProfileGUI::$requested_users = []
protected

Definition at line 89 of file class.ilSkillProfileGUI.php.

Referenced by assignUser().

◆ $skill_factory

SkillInternalFactoryService ilSkillProfileGUI::$skill_factory
protected

Definition at line 62 of file class.ilSkillProfileGUI.php.

◆ $skill_tree_access_manager

SkillTreeAccess ilSkillProfileGUI::$skill_tree_access_manager
protected

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

Referenced by __construct().

◆ $skill_tree_id

int ilSkillProfileGUI::$skill_tree_id = 0
protected

Definition at line 58 of file class.ilSkillProfileGUI.php.

Referenced by __construct().

◆ $table_manager

Table TableManager ilSkillProfileGUI::$table_manager
protected

Definition at line 65 of file class.ilSkillProfileGUI.php.

◆ $tabs

◆ $toolbar

ilToolbarGUI ilSkillProfileGUI::$toolbar
protected

◆ $tpl

◆ $tree_service

SkillTreeService ilSkillProfileGUI::$tree_service
protected

Definition at line 56 of file class.ilSkillProfileGUI.php.

◆ $ui_fac

UI Factory ilSkillProfileGUI::$ui_fac
protected

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

◆ $ui_ren

UI Renderer ilSkillProfileGUI::$ui_ren
protected

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

◆ $usage_manager

Usage SkillUsageManager ilSkillProfileGUI::$usage_manager
protected

Definition at line 66 of file class.ilSkillProfileGUI.php.


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