ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSkillProfileGUI Class Reference

Skill profile GUI class. More...

+ Collaboration diagram for ilSkillProfileGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 setTabs ($a_active)
 Set tabs.
 listProfiles ()
 List profiles.
 create ()
 Create.
 edit ()
 Edit.
 initProfileForm ($a_mode="edit")
 Init profile form.
 save ()
 Save profile form.
 update ()
 Update.
 confirmDeleteProfiles ()
 Confirm profile deletion.
 deleteProfiles ()
 Delete profiles.
 showLevels ()
 Show skill levels.
 assignLevel ()
 Assign Level.
 assignLevelSelectSkill ()
 Output level table for profile assignment.
 assignLevelToProfile ()
 Assign level to profile.
 confirmLevelAssignmentRemoval ()
 Confirm level assignment removal.
 removeLevelAssignments ()
 Remove level assignment.
 showUsers ()
 Show users.
 assignUser ()
 Assign user.
 confirmUserRemoval ()
 Confirm user removal.
 removeUsers ()
 Remove users.

Protected Attributes

 $profile = null

Detailed Description

Skill profile GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ ilSkillProfileGUI: ilRepositorySearchGUI /

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

Constructor & Destructor Documentation

ilSkillProfileGUI::__construct ( )

Constructor.

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

References $_GET, and $ilCtrl.

{
global $ilCtrl;
$ilCtrl->saveParameter($this, "sprof_id");
if ((int) $_GET["sprof_id"] > 0)
{
$this->id = (int) $_GET["sprof_id"];
}
if ($this->id > 0)
{
$this->profile = new ilSkillProfile($this->id);
}
}

Member Function Documentation

ilSkillProfileGUI::assignLevel ( )

Assign Level.

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

References $ilCtrl, $lng, $tpl, and ilUtil\sendInfo().

{
global $lng, $ilTabs, $ilCtrl, $tpl;
$tpl->setTitle($lng->txt("skmg_profile").": ".
$this->profile->getTitle());
$tpl->setDescription("");
//$this->setTabs("levels");
ilUtil::sendInfo($lng->txt("skmg_select_skill_level_assign"));
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "showLevels"));
include_once("./Services/Skill/classes/class.ilSkillSelectorGUI.php");
$exp = new ilSkillSelectorGUI($this, "assignLevel", $this, "assignLevelSelectSkill", "cskill_id");
if (!$exp->handleCommand())
{
$tpl->setContent($exp->getHTML());
}
}

+ Here is the call graph for this function:

ilSkillProfileGUI::assignLevelSelectSkill ( )

Output level table for profile assignment.

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

References $_GET, $ilCtrl, $lng, $tab, and $tpl.

{
global $tpl, $lng, $ilCtrl, $ilTabs;
$ilCtrl->saveParameter($this, "cskill_id");
$tpl->setTitle($lng->txt("skmg_profile").": ".
$this->profile->getTitle());
$tpl->setDescription("");
$ilTabs->clearTargets();
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, "showLevels"));
include_once("./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
$tab = new ilSkillLevelProfileAssignmentTableGUI($this, "assignLevelSelectSkill",
$_GET["cskill_id"]);
$tpl->setContent($tab->getHTML());
}
ilSkillProfileGUI::assignLevelToProfile ( )

Assign level to profile.

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

References $_GET, $ilCtrl, $lng, and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
$parts = explode(":", $_GET["cskill_id"]);
$this->profile->addSkillLevel((int) $parts[0],
(int) $parts[1], (int) $_GET["level_id"]);
$this->profile->update();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "showLevels");
}

+ Here is the call graph for this function:

ilSkillProfileGUI::assignUser ( )

Assign user.

Parameters
@return

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

References $_POST, $ilCtrl, $lng, ilObjUser\_lookupId(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

{
global $ilCtrl, $lng;
$user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["user_login"]));
if ($user_id > 0)
{
$this->profile->addUserToProfile($user_id);
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->redirect($this, "showUsers");
}

+ Here is the call graph for this function:

ilSkillProfileGUI::confirmDeleteProfiles ( )

Confirm profile deletion.

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

References $_POST, $ilCtrl, $lng, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

{
global $ilCtrl, $tpl, $lng;
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "listProfiles");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("skmg_delete_profiles"));
$cgui->setCancel($lng->txt("cancel"), "listProfiles");
$cgui->setConfirm($lng->txt("delete"), "deleteProfiles");
foreach ($_POST["id"] as $i)
{
$cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilSkillProfileGUI::confirmLevelAssignmentRemoval ( )

Confirm level assignment removal.

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

References $_POST, $ilCtrl, $lng, $tpl, ilSkillTreeNode\_lookupTitle(), ilBasicSkill\lookupLevelTitle(), ilUtil\sendInfo(), and setTabs().

{
global $ilCtrl, $tpl, $lng;
$this->setTabs("levels");
if (!is_array($_POST["ass_id"]) || count($_POST["ass_id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "showLevels");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
$cgui->setCancel($lng->txt("cancel"), "showLevels");
$cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
include_once("./Services/Skill/classes/class.ilBasicSkill.php");
foreach ($_POST["ass_id"] as $i)
{
$id_arr = explode(":", $i);
$cgui->addItem("ass_id[]", $i,
ilBasicSkill::_lookupTitle($id_arr[0]).": ".
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilSkillProfileGUI::confirmUserRemoval ( )

Confirm user removal.

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

References $_POST, $ilCtrl, $lng, $tpl, ilObjUser\_lookupName(), ilUtil\sendInfo(), and setTabs().

{
global $ilCtrl, $tpl, $lng;
$this->setTabs("users");
if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
{
ilUtil::sendInfo($lng->txt("no_checkbox"), true);
$ilCtrl->redirect($this, "showUsers");
}
else
{
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("skmg_confirm_user_removal"));
$cgui->setCancel($lng->txt("cancel"), "showUsers");
$cgui->setConfirm($lng->txt("remove"), "removeUsers");
foreach ($_POST["id"] as $i)
{
$cgui->addItem("id[]", $i,
$name["lastname"].", ".$name["firstname"].
" [".$name["login"]."]");
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilSkillProfileGUI::create ( )

Create.

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

References $tpl, and initProfileForm().

{
global $tpl;
$form = $this->initProfileForm("create");
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilSkillProfileGUI::deleteProfiles ( )

Delete profiles.

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

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

{
global $ilCtrl, $tpl, $lng;
if (is_array($_POST["id"]))
{
foreach ($_POST["id"] as $i)
{
$prof = new ilSkillProfile($i);
$prof->delete();
}
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->redirect($this, "listProfiles");
}

+ Here is the call graph for this function:

ilSkillProfileGUI::edit ( )

Edit.

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

References $tpl, initProfileForm(), and setTabs().

{
global $tpl;
$this->setTabs("settings");
$form = $this->initProfileForm("edit");
$tpl->setContent($form->getHTML());
}

+ Here is the call graph for this function:

ilSkillProfileGUI::executeCommand ( )

Execute command.

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

References $cmd, $ilCtrl, $lng, and $ret.

{
global $ilCtrl, $lng;
$cmd = $ilCtrl->getCmd("listProfiles");
$next_class = $ilCtrl->getNextClass();
switch($next_class)
{
case 'ilrepositorysearchgui':
include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
$user_search = new ilRepositorySearchGUI();
$user_search->setTitle($lng->txt('skmg_add_user_to_profile'));
$user_search->setCallback($this, 'assignUser');
// Set tabs
//$this->tabs_gui->setTabActive('user_assignment');
$ilCtrl->setReturn($this, 'listUsers');
$ret = $ilCtrl->forwardCommand($user_search);
break;
default:
if (in_array($cmd, array("listProfiles", "create", "edit", "save", "update",
"confirmDeleteProfiles", "deleteProfiles", "showLevels", "assignLevel",
"assignLevelSelectSkill", "assignLevelToProfile",
"confirmLevelAssignmentRemoval", "removeLevelAssignments",
"showUsers", "assignUser",
"confirmUserRemoval", "removeUsers")))
{
$this->$cmd();
}
break;
}
}
ilSkillProfileGUI::initProfileForm (   $a_mode = "edit")

Init profile form.

Parameters
string$a_modeedit mode

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

References $ilCtrl, $lng, ilTextAreaInputGUI\setCols(), and ilTextInputGUI\setMaxLength().

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

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$form = new ilPropertyFormGUI();
// title
$ti = new ilTextInputGUI($lng->txt("title"), "title");
$ti->setMaxLength(200);
$ti->setSize(40);
$ti->setRequired(true);
$form->addItem($ti);
// description
$desc = new ilTextAreaInputGUI($lng->txt("description"), "description");
$desc->setCols(40);
$desc->setRows(4);
$form->addItem($desc);
// save and cancel commands
if ($a_mode == "create")
{
$form->addCommandButton("save", $lng->txt("save"));
$form->addCommandButton("listProfiles", $lng->txt("cancel"));
$form->setTitle($lng->txt("skmg_add_profile"));
}
else
{
// set values
$ti->setValue($this->profile->getTitle());
$desc->setValue($this->profile->getDescription());
$form->addCommandButton("update", $lng->txt("save"));
$form->addCommandButton("listProfiles", $lng->txt("cancel"));
$form->setTitle($lng->txt("skmg_edit_profile"));
}
$form->setFormAction($ilCtrl->getFormAction($this));
return $form;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillProfileGUI::listProfiles ( )

List profiles.

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

References $ilCtrl, $lng, $tab, and $tpl.

{
global $tpl, $ilToolbar, $lng, $ilCtrl;
$ilToolbar->addButton($lng->txt("skmg_add_profile"),
$ilCtrl->getLinkTarget($this, "create"));
include_once("./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
$tab = new ilSkillProfileTableGUI($this, "listProfiles");
$tpl->setContent($tab->getHTML());
}
ilSkillProfileGUI::removeLevelAssignments ( )

Remove level assignment.

Parameters
@return

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

References $_POST, and $ilCtrl.

{
global $ilCtrl;
if (is_array($_POST["ass_id"]))
{
foreach ($_POST["ass_id"] as $i)
{
$id_arr = explode(":", $i);
$this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
}
$this->profile->update();
}
$ilCtrl->redirect($this, "showLevels");
}
ilSkillProfileGUI::removeUsers ( )

Remove users.

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

References $_POST, $ilCtrl, $lng, and ilUtil\sendSuccess().

{
global $ilCtrl, $lng;
if (is_array($_POST["id"]))
{
foreach ($_POST["id"] as $i)
{
$this->profile->removeUserFromProfile((int) $i);
}
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->redirect($this, "showUsers");
}

+ Here is the call graph for this function:

ilSkillProfileGUI::save ( )

Save profile form.

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

References $ilCtrl, $lng, $tpl, initProfileForm(), and ilUtil\sendSuccess().

{
global $tpl, $lng, $ilCtrl;
$form = $this->initProfileForm("create");
if ($form->checkInput())
{
$prof = new ilSkillProfile();
$prof->setTitle($form->getInput("title"));
$prof->setDescription($form->getInput("description"));
$prof->create();
ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listProfiles");
}
else
{
$form->setValuesByPost();
$tpl->setContent($form->getHtml());
}
}

+ Here is the call graph for this function:

ilSkillProfileGUI::setTabs (   $a_active)

Set tabs.

Parameters
@return

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

References $ilCtrl, $lng, and $tpl.

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

{
global $ilTabs, $lng, $ilCtrl, $tpl, $ilHelp;
$tpl->setTitle($lng->txt("skmg_profile").": ".
$this->profile->getTitle());
$tpl->setDescription("");
$ilTabs->clearTargets();
$ilHelp->setScreenIdComponent("skmg_prof");
$ilTabs->setBackTarget($lng->txt("back"),
$ilCtrl->getLinkTarget($this, ""));
// users
$ilTabs->addTab("users",
$lng->txt("skmg_assigned_users"),
$ilCtrl->getLinkTarget($this, "showUsers"));
// levels
$ilTabs->addTab("levels",
$lng->txt("skmg_assigned_skill_levels"),
$ilCtrl->getLinkTarget($this, "showLevels"));
// settings
$ilTabs->addTab("settings",
$lng->txt("settings"),
$ilCtrl->getLinkTarget($this, "edit"));
$ilTabs->activateTab($a_active);
}

+ Here is the caller graph for this function:

ilSkillProfileGUI::showLevels ( )

Show skill levels.

Parameters
@return

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

References $ilCtrl, $lng, $tab, $tpl, and setTabs().

{
global $tpl, $ilCtrl, $lng, $ilToolbar;
$this->setTabs("levels");
$ilToolbar->addButton($lng->txt("skmg_assign_level"),
$ilCtrl->getLinkTarget($this, "assignLevel")
);
include_once("./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
$tab = new ilSkillProfileLevelsTableGUI($this, "showLevels", $this->profile);
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

ilSkillProfileGUI::showUsers ( )

Show users.

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

References $lng, $tab, $tpl, ilRepositorySearchGUI\fillAutoCompleteToolbar(), and setTabs().

{
global $lng, $tpl, $ilToolbar;
// add member
include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
$this,
$ilToolbar,
array(
'auto_complete_name' => $lng->txt('user'),
'submit_name' => $lng->txt('skmg_assign_user')
)
);
$this->setTabs("users");
include_once("./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
$tab = new ilSkillProfileUserTableGUI($this, "showUsers",
$this->profile);
$tpl->setContent($tab->getHTML());
}

+ Here is the call graph for this function:

ilSkillProfileGUI::update ( )

Update.

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

References $ilCtrl, $lng, $tpl, initProfileForm(), and ilUtil\sendInfo().

{
global $lng, $ilCtrl, $tpl;
$form = $this->initProfileForm("edit");
if ($form->checkInput())
{
$this->profile->setTitle($form->getInput("title"));
$this->profile->setDescription($form->getInput("description"));
$this->profile->update();
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "listProfiles");
}
else
{
$form->setValuesByPost();
$tpl->setContent($form->getHtml());
}
}

+ Here is the call graph for this function:

Field Documentation

ilSkillProfileGUI::$profile = null
protected

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


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