ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContSkillAdminGUI Class Reference

Container skills administration. More...

+ Collaboration diagram for ilContSkillAdminGUI:

Public Member Functions

 __construct ($a_container_gui)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 listMembers ()
 List members. More...
 
 assignCompetences ()
 Assign competences to a member. More...
 
 initCompetenceAssignmentForm ()
 Init competence assignment form. More...
 
 getPathString ($a_skill_id, $a_tref_id=0)
 Get path string. More...
 
 saveCompetenceAssignment ()
 Save competence assignment. More...
 
 publishAssignments ()
 Publish assignments. More...
 
 deassignCompetencesConfirm ()
 Deassign competences confirmation. More...
 
 deassignCompetences ()
 Deassign competences. More...
 
 listCompetences ()
 Select competences. More...
 
 selectSkill ()
 Select skill for container. More...
 
 saveSelectedSkill ()
 Save selected skill. More...
 
 confirmRemoveSelectedSkill ()
 Confirm. More...
 
 removeSelectedSkill ()
 Remove skill from course selection. More...
 
 listProfiles ()
 Select competence profiles. More...
 
 saveSelectedProfile ()
 Save selected profile. More...
 
 confirmRemoveSelectedGlobalProfiles ()
 Confirm removal for selected global profiles. More...
 
 removeSelectedGlobalProfiles ()
 Remove global profiles from course selection. More...
 
 confirmRemoveSingleGlobalProfile ()
 Confirm removal for single global profile. More...
 
 removeSingleGlobalProfile ()
 Remove single global profile from course. More...
 
 confirmDeleteSelectedLocalProfiles ()
 Confirm deletion for selected local profiles. More...
 
 deleteSelectedLocalProfiles ()
 Delete local profiles from course selection. More...
 
 confirmDeleteSingleLocalProfile ()
 Confirm deletion for single local profile. More...
 
 deleteSingleLocalProfile ()
 Delete single local profile from course. More...
 
 settings ()
 Settings. More...
 
 initSettingsForm ()
 Init settings form. More...
 
 saveSettings ()
 Save settings. More...
 

Protected Attributes

 $ctrl
 
 $tabs
 
 $lng
 
 $tpl
 
 $container_gui
 
 $container
 
 $container_skills
 
 $container_global_profiles
 
 $container_local_profiles
 
 $skmg_settings
 
 $toolbar
 
 $access
 
 $params
 

Detailed Description

Container skills administration.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

ilContSkillAdminGUI: ilSkillProfileGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilContSkillAdminGUI::__construct (   $a_container_gui)

Constructor.

Parameters

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

References $_GET, and $DIC.

85  {
86  global $DIC;
87 
88  $this->ctrl = $DIC->ctrl();
89  $this->tabs = $DIC->tabs();
90  $this->lng = $DIC->language();
91  $this->tpl = $DIC["tpl"];
92  $this->toolbar = $DIC->toolbar();
93  $this->access = $DIC->access();
94 
95  $this->container_gui = $a_container_gui;
96  $this->container = $a_container_gui->object;
97  $this->ref_id = $this->container->getRefId();
98 
99  $this->skill_tree = new ilSkillTree();
100 
101  include_once("./Services/Container/Skills/classes/class.ilContainerSkills.php");
102  $this->container_skills = new ilContainerSkills($this->container->getId());
103  $this->container_global_profiles = new ilContainerGlobalProfiles($this->container->getId());
104  $this->container_local_profiles = new ilContainerLocalProfiles($this->container->getId());
105  $this->skmg_settings = new ilSkillManagementSettings();
106 
107  $this->user_id = (int) $_GET["usr_id"];
108 
109  $this->ctrl->saveParameter($this, "profile_id");
110  $this->params = $this->ctrl->getParameterArray($this);
111 
112  $this->lng->loadLanguageModule("skmg");
113  $this->lng->loadLanguageModule("error");
114  }
Skill tree.
$_GET["client_id"]
Skills of a container.
Global competence profiles of a container.
global $DIC
Definition: goto.php:24
Local competence profiles of a container.

Member Function Documentation

◆ assignCompetences()

ilContSkillAdminGUI::assignCompetences ( )

Assign competences to a member.

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

References $ctrl, $tabs, $tpl, and initCompetenceAssignmentForm().

172  {
173  $tpl = $this->tpl;
174  $tabs = $this->tabs;
175  $ctrl = $this->ctrl;
176 
177  $ctrl->saveParameter($this, "usr_id");
178  $tabs->activateSubTab("members");
179 
180  $form = $this->initCompetenceAssignmentForm();
181  $tpl->setContent($form->getHTML());
182  }
initCompetenceAssignmentForm()
Init competence assignment form.
+ Here is the call graph for this function:

◆ confirmDeleteSelectedLocalProfiles()

ilContSkillAdminGUI::confirmDeleteSelectedLocalProfiles ( )

Confirm deletion for selected local profiles.

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

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillProfile\lookupRefId(), ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

702  {
703  $lng = $this->lng;
704  $ctrl = $this->ctrl;
705  $tpl = $this->tpl;
706  $tabs = $this->tabs;
707 
708  $tabs->activateSubTab("profiles");
709 
710  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
711  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
712  $ctrl->redirect($this, "listProfiles");
713  } else {
714  $cgui = new ilConfirmationGUI();
715  $cgui->setFormAction($ctrl->getFormAction($this));
716  $cgui->setHeaderText($lng->txt("cont_skill_really_delete_profiles_from_list"));
717  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
718  $cgui->setConfirm($lng->txt("delete"), "deleteSelectedLocalProfiles");
719 
720  foreach ($_POST["id"] as $i) {
721  if (!ilSkillProfile::lookupRefId($i) > 0) {
722  ilUtil::sendInfo($lng->txt("cont_skill_deletion_not_possible"), true);
723  $ctrl->redirect($this, "listProfiles");
724  }
725  $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
726  }
727 
728  $tpl->setContent($cgui->getHTML());
729  }
730  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupRefId($a_id)
static lookupTitle($a_id)
Lookup title.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmDeleteSingleLocalProfile()

ilContSkillAdminGUI::confirmDeleteSingleLocalProfile ( )

Confirm deletion for single local profile.

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

References $ctrl, $lng, $tabs, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendFailure().

757  {
758  $lng = $this->lng;
759  $ctrl = $this->ctrl;
760  $tpl = $this->tpl;
761  $tabs = $this->tabs;
762 
763  $tabs->activateSubTab("profiles");
764 
765  $profile_id = (int) $this->params["profile_id"];
766 
767  if (!$profile_id > 0) {
768  ilUtil::sendFailure($lng->txt("error_sry_error"), true);
769  $ctrl->redirect($this, "listProfiles");
770  } else {
771  $cgui = new ilConfirmationGUI();
772  $cgui->setFormAction($ctrl->getFormAction($this));
773  $cgui->setHeaderText($lng->txt("cont_skill_really_delete_profile_from_list"));
774  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
775  $cgui->setConfirm($lng->txt("delete"), "deleteSingleLocalProfile");
776  $cgui->addItem("", $profile_id, ilSkillProfile::lookupTitle($profile_id));
777 
778  $tpl->setContent($cgui->getHTML());
779  }
780  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupTitle($a_id)
Lookup title.
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRemoveSelectedGlobalProfiles()

ilContSkillAdminGUI::confirmRemoveSelectedGlobalProfiles ( )

Confirm removal for selected global profiles.

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

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillProfile\lookupRefId(), ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

601  {
602  $lng = $this->lng;
603  $ctrl = $this->ctrl;
604  $tpl = $this->tpl;
605  $tabs = $this->tabs;
606 
607  $tabs->activateSubTab("profiles");
608 
609  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
610  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
611  $ctrl->redirect($this, "listProfiles");
612  } else {
613  $cgui = new ilConfirmationGUI();
614  $cgui->setFormAction($ctrl->getFormAction($this));
615  $cgui->setHeaderText($lng->txt("cont_skill_really_remove_profiles_from_list"));
616  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
617  $cgui->setConfirm($lng->txt("remove"), "removeSelectedGlobalProfiles");
618 
619  foreach ($_POST["id"] as $i) {
620  if (ilSkillProfile::lookupRefId($i) > 0) {
621  ilUtil::sendInfo($lng->txt("cont_skill_removal_not_possible"), true);
622  $ctrl->redirect($this, "listProfiles");
623  }
624  $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
625  }
626 
627  $tpl->setContent($cgui->getHTML());
628  }
629  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupRefId($a_id)
static lookupTitle($a_id)
Lookup title.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRemoveSelectedSkill()

ilContSkillAdminGUI::confirmRemoveSelectedSkill ( )

Confirm.

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

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), and ilUtil\sendInfo().

456  {
457  $lng = $this->lng;
458  $ctrl = $this->ctrl;
459  $tpl = $this->tpl;
460  $tabs = $this->tabs;
461 
462  $tabs->activateSubTab("competences");
463 
464  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
465  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
466  $ctrl->redirect($this, "listCompetences");
467  } else {
468  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
469  $cgui = new ilConfirmationGUI();
470  $cgui->setFormAction($ctrl->getFormAction($this));
471  $cgui->setHeaderText($lng->txt("cont_really_remove_skill_from_course"));
472  $cgui->setCancel($lng->txt("cancel"), "listCompetences");
473  $cgui->setConfirm($lng->txt("remove"), "removeSelectedSkill");
474 
475  foreach ($_POST["id"] as $i) {
476  $s = explode(":", $i);
477  $cgui->addItem("id[]", $i, ilBasicSkill::_lookupTitle((int) $s[0], (int) $s[1]));
478  }
479 
480  $tpl->setContent($cgui->getHTML());
481  }
482  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmRemoveSingleGlobalProfile()

ilContSkillAdminGUI::confirmRemoveSingleGlobalProfile ( )

Confirm removal for single global profile.

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

References $ctrl, $lng, $tabs, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendFailure().

654  {
655  $lng = $this->lng;
656  $ctrl = $this->ctrl;
657  $tpl = $this->tpl;
658  $tabs = $this->tabs;
659 
660  $tabs->activateSubTab("profiles");
661 
662  $profile_id = (int) $this->params["profile_id"];
663 
664  if (!$profile_id > 0) {
665  ilUtil::sendFailure($lng->txt("error_sry_error"), true);
666  $ctrl->redirect($this, "listProfiles");
667  } else {
668  $cgui = new ilConfirmationGUI();
669  $cgui->setFormAction($ctrl->getFormAction($this));
670  $cgui->setHeaderText($lng->txt("cont_skill_really_remove_profile_from_list"));
671  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
672  $cgui->setConfirm($lng->txt("remove"), "removeSingleGlobalProfile");
673  $cgui->addItem("", $profile_id, ilSkillProfile::lookupTitle($profile_id));
674 
675  $tpl->setContent($cgui->getHTML());
676  }
677  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static lookupTitle($a_id)
Lookup title.
Confirmation screen class.
+ Here is the call graph for this function:

◆ deassignCompetences()

ilContSkillAdminGUI::deassignCompetences ( )

Deassign competences.

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

References $_POST, $ctrl, $lng, and ilContainerMemberSkills\removeAllSkillLevels().

369  {
370  $ctrl = $this->ctrl;
371  $lng = $this->lng;
372 
373  foreach ($_POST["usr_id"] as $user_id) {
374  include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
375  $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
376  $mem_skills->removeAllSkillLevels($this->container->getRefId());
377  }
378 
379  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
380  $ctrl->redirect($this, "listMembers");
381  }
removeAllSkillLevels()
Remove all skill levels.
$_POST["username"]
+ Here is the call graph for this function:

◆ deassignCompetencesConfirm()

ilContSkillAdminGUI::deassignCompetencesConfirm ( )

Deassign competences confirmation.

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

References $_GET, $_POST, $ctrl, $i, $lng, $name, $tabs, $tpl, ilUserUtil\getNamePresentation(), and ilUtil\sendInfo().

332  {
333  $ctrl = $this->ctrl;
334  $lng = $this->lng;
335  $tpl = $this->tpl;
336  $tabs = $this->tabs;
337 
338  $tabs->activateSubTab("members");
339 
340  $user_ids = $_POST["usr_id"];
341  if (!is_array($_POST["usr_id"]) && $_GET["usr_id"] > 0) {
342  $user_ids[] = $_GET["usr_id"];
343  }
344 
345  if (!is_array($user_ids) || count($user_ids) == 0) {
346  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
347  $ctrl->redirect($this, "listMembers");
348  } else {
349  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
350  $cgui = new ilConfirmationGUI();
351  $cgui->setFormAction($ctrl->getFormAction($this));
352  $cgui->setHeaderText($lng->txt("cont_really_deassign_skills"));
353  $cgui->setCancel($lng->txt("cancel"), "listMembers");
354  $cgui->setConfirm($lng->txt("cont_deassign_competence"), "deassignCompetences");
355 
356  foreach ($user_ids as $i) {
357  $name = ilUserUtil::getNamePresentation($i, false, false, "", true);
358  $cgui->addItem("usr_id[]", $i, $name);
359  }
360 
361  $tpl->setContent($cgui->getHTML());
362  }
363  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($format !==null) $name
Definition: metadata.php:230
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteSelectedLocalProfiles()

ilContSkillAdminGUI::deleteSelectedLocalProfiles ( )

Delete local profiles from course selection.

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

References $_POST, $ctrl, $lng, and ilSkillProfile\lookupRefId().

736  {
737  $lng = $this->lng;
738  $ctrl = $this->ctrl;
739 
740  if (is_array($_POST["id"]) && count($_POST["id"]) > 0) {
741  foreach ($_POST["id"] as $id) {
742  if (ilSkillProfile::lookupRefId($id) > 0) {
743  $prof = new ilSkillProfile($id);
744  $prof->delete();
745  }
746  }
747  }
748  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
749 
750  $ctrl->redirect($this, "listProfiles");
751  }
static lookupRefId($a_id)
$_POST["username"]
+ Here is the call graph for this function:

◆ deleteSingleLocalProfile()

ilContSkillAdminGUI::deleteSingleLocalProfile ( )

Delete single local profile from course.

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

References $ctrl, and $lng.

786  {
787  $lng = $this->lng;
788  $ctrl = $this->ctrl;
789 
790  $profile_id = (int) $this->params["profile_id"];
791 
792  if ($profile_id > 0) {
793  $prof = new ilSkillProfile($profile_id);
794  $prof->delete();
795  }
796  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
797 
798  $ctrl->redirect($this, "listProfiles");
799  }

◆ executeCommand()

ilContSkillAdminGUI::executeCommand ( )

Execute command.

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

References $ret.

120  {
121  $next_class = $this->ctrl->getNextClass($this);
122  $cmd = $this->ctrl->getCmd("listMembers");
123 
124  switch ($next_class) {
125  case "ilskillprofilegui":
126  $profile_gui = new ilSkillProfileGUI();
127  $this->ctrl->setReturn($this, "listProfiles");
128  $ret = $this->ctrl->forwardCommand($profile_gui);
129  break;
130  default:
131  if (
132  ($this->access->checkAccess("write", "", $this->ref_id) &&
133  in_array($cmd, array("listCompetences", "settings", "saveSettings", "selectSkill",
134  "saveSelectedSkill", "confirmRemoveSelectedSkill", "removeSelectedSkill",
135  "listProfiles", "saveSelectedProfile", "confirmRemoveSelectedGlobalProfiles",
136  "removeSelectedGlobalProfiles", "confirmRemoveSingleGlobalProfile", "removeSingleGlobalProfile",
137  "confirmDeleteSingleLocalProfile", "deleteSingleLocalProfile",
138  "confirmDeleteSelectedLocalProfiles", "deleteSelectedLocalProfiles")))
139  ||
140  ($this->access->checkAccess("grade", "", $this->ref_id) &&
141  in_array($cmd, array("listMembers", "assignCompetences",
142  "saveCompetenceAssignment", "publishAssignments", "deassignCompetencesConfirm", "deassignCompetences")))
143  ) {
144  $this->$cmd();
145  }
146  }
147  }
Skill profile GUI class.
$ret
Definition: parser.php:6

◆ getPathString()

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

Get path string.

Returns
string path string

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

Referenced by initCompetenceAssignmentForm().

246  {
247  $skill_tree = $this->skill_tree;
248 
249  $path = $skill_tree->getSkillTreePath($a_skill_id, $a_tref_id);
250  $titles = array();
251  foreach ($path as $v) {
252  if ($v["type"] != "skrt" && !($v["skill_id"] == $a_skill_id && $v["tref_id"] == $a_tref_id)) {
253  $titles[] = $v["title"];
254  }
255  }
256 
257  return implode(" > ", $titles);
258  }
+ Here is the caller graph for this function:

◆ initCompetenceAssignmentForm()

ilContSkillAdminGUI::initCompetenceAssignmentForm ( )

Init competence assignment form.

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

References $ctrl, $lng, $name, $si, $tpl, ilObjUser\_lookupName(), ilSkillTreeNode\_lookupTitle(), getPathString(), ilContainerMemberSkills\getSkillLevels(), and ilNonEditableValueGUI\setValue().

Referenced by assignCompetences(), and saveCompetenceAssignment().

188  {
189  $tpl = $this->tpl;
190  $ctrl = $this->ctrl;
191  $lng = $this->lng;
192 
193  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
194  $form = new ilPropertyFormGUI();
195 
196  include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
197  $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->user_id);
198  $mem_levels = $mem_skills->getSkillLevels();
199 
200  // user name
201  $name = ilObjUser::_lookupName($this->user_id);
202  $ne = new ilNonEditableValueGUI($this->lng->txt("obj_user"), "");
203  $ne->setValue($name["lastname"] . ", " . $name["firstname"] . " [" . $name["login"] . "]");
204  $form->addItem($ne);
205 
206  if (empty($this->container_skills->getOrderedSkills())) {
207  $tpl->setOnScreenMessage('info', $lng->txt("cont_skill_no_skills_selected"), true);
208  $ctrl->redirect($this, "listMembers");
209  }
210 
211  foreach ($this->container_skills->getOrderedSkills() as $sk) {
212  $skill = new ilBasicSkill($sk["skill_id"]);
213 
214  // skill level options
215  $options = array(
216  "-1" => $this->lng->txt("cont_skill_do_not_set"),
217  );
218  foreach ($skill->getLevelData() as $l) {
219  $options[$l["id"]] = $l["title"];
220  }
221  $si = new ilSelectInputGUI(ilBasicSkill::_lookupTitle($sk["skill_id"], $sk["tref_id"]), "skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
222  $si->setOptions($options);
223  $si->setInfo($this->getPathString($sk["skill_id"], $sk["tref_id"]));
224  if (isset($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]])) {
225  $si->setValue($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]]);
226  }
227  $form->addItem($si);
228  }
229 
230  // save and cancel commands
231  $form->addCommandButton("saveCompetenceAssignment", $this->lng->txt("save"));
232  $form->addCommandButton("listMembers", $this->lng->txt("cancel"));
233 
234  $form->setTitle($this->lng->txt("cont_assign_skills"));
235  $form->setFormAction($this->ctrl->getFormAction($this));
236 
237  return $form;
238  }
static _lookupName($a_user_id)
lookup user name
This class represents a property form user interface.
getPathString($a_skill_id, $a_tref_id=0)
Get path string.
if($format !==null) $name
Definition: metadata.php:230
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
This class represents a non editable value in a property form.
Basic Skill.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilContSkillAdminGUI::initSettingsForm ( )

Init settings form.

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

References $ctrl, $lng, ilContainer\_lookupContainerSetting(), and ilRadioOption\setValue().

Referenced by saveSettings(), and settings().

823  {
824  $lng = $this->lng;
825  $ctrl = $this->ctrl;
826 
827  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
828  $form = new ilPropertyFormGUI();
829 
830  // publish
831  $radg = new ilRadioGroupInputGUI($lng->txt("cont_skill_publish"), "cont_skill_publish");
832  $op1 = new ilRadioOption($lng->txt("cont_skill_publish_auto"), 0, $lng->txt("cont_skill_publish_auto_info"));
833  $radg->addOption($op1);
834  $op2 = new ilRadioOption($lng->txt("cont_skill_publish_manual"), 1, $lng->txt("cont_skill_publish_manual_info"));
835  $radg->addOption($op2);
836  $form->addItem($radg);
837  $radg->setValue(ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", 0));
838 
839  $form->addCommandButton("saveSettings", $lng->txt("save"));
840 
841  $form->setTitle($lng->txt("settings"));
842  $form->setFormAction($ctrl->getFormAction($this));
843 
844  return $form;
845  }
This class represents an option in a radio group.
This class represents a property form user interface.
This class represents a property in a property form.
setValue($a_value)
Set Value.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listCompetences()

ilContSkillAdminGUI::listCompetences ( )

Select competences.

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

References $ctrl, $lng, $tabs, $toolbar, and $tpl.

390  {
391  $tpl = $this->tpl;
392  $tabs = $this->tabs;
394  $ctrl = $this->ctrl;
395  $lng = $this->lng;
396 
397  $tabs->activateSubTab("competences");
398 
399  $toolbar->addButton(
400  $lng->txt("cont_add_skill"),
401  $ctrl->getLinkTarget($this, "selectSkill")
402  );
403 
404  // table
405  include_once("./Services/Container/Skills/classes/class.ilContSkillTableGUI.php");
406  $tab = new ilContSkillTableGUI(
407  $this,
408  "listCompetences",
409  $this->container_skills,
410  $this->container_global_profiles,
411  $this->container_local_profiles
412  );
413 
414  $tpl->setContent($tab->getHTML());
415  }
TableGUI class for competences in containers.

◆ listMembers()

ilContSkillAdminGUI::listMembers ( )

List members.

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

References $tabs, and $tpl.

155  {
156  $tpl = $this->tpl;
157  $tabs = $this->tabs;
158 
159  $tabs->activateSubTab("members");
160 
161  // table
162  include_once("./Services/Container/Skills/classes/class.ilContSkillMemberTableGUI.php");
163  $tab = new ilContSkillMemberTableGUI($this, "listMembers", $this->container_skills);
164 
165  $tpl->setContent($tab->getHTML());
166  }
TableGUI class for container members / skill assignments.

◆ listProfiles()

ilContSkillAdminGUI::listProfiles ( )

Select competence profiles.

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

References $ctrl, $lng, $tabs, $toolbar, $tpl, ilSkillProfile\getGlobalProfiles(), ilSubmitButton\getInstance(), and ilLinkButton\getInstance().

512  {
513  $tpl = $this->tpl;
514  $tabs = $this->tabs;
516  $ctrl = $this->ctrl;
517  $lng = $this->lng;
518 
519  $tabs->activateSubTab("profiles");
520 
521  $options = array();
522  $options[0] = $lng->txt("please_select");
523 
524  $selectable_profiles = array();
525  $all_profiles = ilSkillProfile::getGlobalProfiles();
526  $selected_profiles = $this->container_global_profiles->getProfiles();
527  foreach ($all_profiles as $id => $profile) {
528  if (!array_key_exists($id, $selected_profiles)) {
529  $selectable_profiles[$id] = $profile;
530  }
531  }
532 
533  foreach ($selectable_profiles as $profile) {
534  $options[$profile["id"]] = $profile["title"];
535  }
536 
537  if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
538  $select = new ilSelectInputGUI($lng->txt("skmg_profile"), "p_id");
539  $select->setOptions($options);
540  $select->setValue(0);
541  $toolbar->addInputItem($select, true);
542 
543  $button = ilSubmitButton::getInstance();
544  $button->setCaption("cont_add_global_profile");
545  $button->setCommand("saveSelectedProfile");
546  $toolbar->addButtonInstance($button);
547  }
548 
549  if ($this->skmg_settings->getLocalAssignmentOfProfiles()
550  && $this->skmg_settings->getAllowLocalProfiles()) {
551  $toolbar->addSeparator();
552  }
553 
554  if ($this->skmg_settings->getAllowLocalProfiles()) {
555  $button = ilLinkButton::getInstance();
556  $button->setCaption("cont_add_local_profile");
557  $button->setUrl($ctrl->getLinkTargetByClass("ilskillprofilegui", "createLocal"));
558  $toolbar->addButtonInstance($button);
559  }
560 
561  $toolbar->setFormAction($ctrl->getFormAction($this));
562 
563  // table
564  $tab = new ilContProfileTableGUI(
565  $this,
566  "listProfiles",
567  $this->container_global_profiles,
568  $this->container_local_profiles
569  );
570 
571  $tpl->setContent($tab->getHTML());
572  }
TableGUI class for competence profiles in containers.
static getGlobalProfiles()
Get global profiles.
+ Here is the call graph for this function:

◆ publishAssignments()

ilContSkillAdminGUI::publishAssignments ( )

Publish assignments.

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

References $_GET, $_POST, $ctrl, $lng, ilUserUtil\getNamePresentation(), and ilUtil\sendInfo().

297  {
298  $ctrl = $this->ctrl;
299  $lng = $this->lng;
300 
301  $user_ids = $_POST["usr_id"];
302  if (!is_array($_POST["usr_id"]) && $_GET["usr_id"] > 0) {
303  $user_ids[] = $_GET["usr_id"];
304  }
305 
306  include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
307  $not_changed = array();
308  foreach ($user_ids as $user_id) {
309  $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
310  if (!$mem_skills->publish($this->container->getRefId())) {
311  $not_changed[] = $user_id;
312  }
313  }
314 
315  if (count($not_changed) == 0) {
316  ilUtil::sendSuccess($lng->txt("cont_skll_published"), true);
317  } else {
318  $names = array_map(function ($id) {
319  return ilUserUtil::getNamePresentation($id, false, false, "", true);
320  }, $not_changed);
321  ilUtil::sendInfo($lng->txt("cont_skll_published_some_not") . " (" . implode("; ", $names) . ")", true);
322  }
323 
324 
325  $ctrl->redirect($this, "listMembers");
326  }
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
$_POST["username"]
+ Here is the call graph for this function:

◆ removeSelectedGlobalProfiles()

ilContSkillAdminGUI::removeSelectedGlobalProfiles ( )

Remove global profiles from course selection.

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

References $_POST, $ctrl, and $lng.

635  {
636  $lng = $this->lng;
637  $ctrl = $this->ctrl;
638 
639  if (is_array($_POST["id"]) && count($_POST["id"]) > 0) {
640  foreach ($_POST["id"] as $id) {
641  $this->container_global_profiles->removeProfile($id);
642  }
643  $this->container_global_profiles->save();
644  }
645  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
646 
647  $ctrl->redirect($this, "listProfiles");
648  }
$_POST["username"]

◆ removeSelectedSkill()

ilContSkillAdminGUI::removeSelectedSkill ( )

Remove skill from course selection.

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

References $_POST, $ctrl, $lng, and ilSkillUsage\setUsage().

488  {
489  $lng = $this->lng;
490  $ctrl = $this->ctrl;
491 
492  if (is_array($_POST["id"]) && count($_POST["id"]) > 0) {
493  foreach ($_POST["id"] as $id) {
494  $s = explode(":", $id);
495  $this->container_skills->removeSkill($s[0], $s[1]);
496  }
497  $this->container_skills->save();
498  ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1], false);
499  }
500  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
501 
502  $ctrl->redirect($this, "listCompetences");
503  }
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.
$_POST["username"]
+ Here is the call graph for this function:

◆ removeSingleGlobalProfile()

ilContSkillAdminGUI::removeSingleGlobalProfile ( )

Remove single global profile from course.

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

References $ctrl, and $lng.

683  {
684  $lng = $this->lng;
685  $ctrl = $this->ctrl;
686 
687  $profile_id = (int) $this->params["profile_id"];
688 
689  if ($profile_id > 0) {
690  $this->container_global_profiles->removeProfile($profile_id);
691  $this->container_global_profiles->save();
692  }
693  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
694 
695  $ctrl->redirect($this, "listProfiles");
696  }

◆ saveCompetenceAssignment()

ilContSkillAdminGUI::saveCompetenceAssignment ( )

Save competence assignment.

Parameters

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

References $ctrl, $lng, ilContainer\_lookupContainerSetting(), initCompetenceAssignmentForm(), and ilContainerMemberSkills\saveLevelForSkills().

266  {
267  $ctrl = $this->ctrl;
268  $lng = $this->lng;
269 
270  $form = $this->initCompetenceAssignmentForm();
271  $form->checkInput();
272 
273  $levels = array();
274  foreach ($this->container_skills->getSkills() as $sk) {
275  $l = $form->getInput("skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
276  if ($l != -1) {
277  $levels[$sk["skill_id"] . ":" . $sk["tref_id"]] = $l;
278  }
279  }
280 
281  include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
282  $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->user_id);
283  $mem_skills->saveLevelForSkills($levels);
284 
285  if (!ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", 0)) {
286  $mem_skills->publish($this->container->getRefId());
287  }
288 
289  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
290  $ctrl->redirect($this, "listMembers");
291  }
saveLevelForSkills($a_level_data)
Save levels for skills.
initCompetenceAssignmentForm()
Init competence assignment form.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

◆ saveSelectedProfile()

ilContSkillAdminGUI::saveSelectedProfile ( )

Save selected profile.

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

References $_POST, $ctrl, $lng, and ilUtil\sendInfo().

578  {
579  $lng = $this->lng;
580  $ctrl = $this->ctrl;
581 
582  $profile_id = (int) $_POST["p_id"];
583 
584  if (!$profile_id > 0) {
585  ilUtil::sendInfo($lng->txt("cont_skill_no_profile_selected"), true);
586  $ctrl->redirect($this, "listProfiles");
587  }
588 
589  $this->container_global_profiles->addProfile((int) $profile_id);
590  $this->container_global_profiles->save();
591 
592  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
593 
594  $ctrl->redirect($this, "listProfiles");
595  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveSelectedSkill()

ilContSkillAdminGUI::saveSelectedSkill ( )

Save selected skill.

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

References $_GET, $ctrl, $lng, and ilSkillUsage\setUsage().

437  {
438  $lng = $this->lng;
439  $ctrl = $this->ctrl;
440 
441  $s = explode(":", ($_GET["selected_skill"]));
442 
443  $this->container_skills->addSkill((int) $s[0], (int) $s[1]);
444  $this->container_skills->save();
445  ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1]);
446 
447  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
448 
449  $ctrl->redirect($this, "listCompetences");
450  }
$_GET["client_id"]
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.
+ Here is the call graph for this function:

◆ saveSettings()

ilContSkillAdminGUI::saveSettings ( )

Save settings.

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

References $ctrl, $lng, ilContainer\_writeContainerSetting(), and initSettingsForm().

851  {
852  $lng = $this->lng;
853  $ctrl = $this->ctrl;
854 
855  $form = $this->initSettingsForm();
856  $form->checkInput();
857  ilContainer::_writeContainerSetting($this->container->getId(), "cont_skill_publish", $form->getInput("cont_skill_publish"));
858 
859  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
860 
861  $ctrl->redirect($this, "settings");
862  }
initSettingsForm()
Init settings form.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
+ Here is the call graph for this function:

◆ selectSkill()

ilContSkillAdminGUI::selectSkill ( )

Select skill for container.

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

References $tabs, and $tpl.

421  {
422  $tpl = $this->tpl;
423  $tabs = $this->tabs;
424 
425  $tabs->activateSubTab("competences");
426 
427  $sel = new ilSkillSelectorGUI($this, "selectSkill", $this, "saveSelectedSkill");
428  if (!$sel->handleCommand()) {
429  $tpl->setContent($sel->getHTML());
430  }
431  }
Explorer class that works on tree objects (Services/Tree)

◆ settings()

ilContSkillAdminGUI::settings ( )

Settings.

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

References $tabs, $tpl, and initSettingsForm().

808  {
809  $tpl = $this->tpl;
810  $tabs = $this->tabs;
811 
812  $tabs->activateSubTab("settings");
813 
814  $form = $this->initSettingsForm();
815 
816  $tpl->setContent($form->getHTML());
817  }
initSettingsForm()
Init settings form.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilContSkillAdminGUI::$access
protected

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

◆ $container

ilContSkillAdminGUI::$container
protected

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

◆ $container_global_profiles

ilContSkillAdminGUI::$container_global_profiles
protected

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

◆ $container_gui

ilContSkillAdminGUI::$container_gui
protected

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

◆ $container_local_profiles

ilContSkillAdminGUI::$container_local_profiles
protected

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

◆ $container_skills

ilContSkillAdminGUI::$container_skills
protected

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

◆ $ctrl

◆ $lng

◆ $params

ilContSkillAdminGUI::$params
protected

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

◆ $skmg_settings

ilContSkillAdminGUI::$skmg_settings
protected

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

◆ $tabs

◆ $toolbar

ilContSkillAdminGUI::$toolbar
protected

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

Referenced by listCompetences(), and listProfiles().

◆ $tpl


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