ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSkillSelfEvaluationGUI Class Reference

Self evaluation. More...

+ Collaboration diagram for ilSkillSelfEvaluationGUI:

Public Member Functions

 __construct ()
 Constructor.
 executeCommand ()
 Execute command.
 readSelfEvaluation ()
 Read self_evaluation.
 listSelfEvaluations ()
 List all self evaluations.
 confirmSelfEvaluationDeletion ()
 Confirm self_evaluation deletion.
 deleteSelfEvaluation ()
 Delete self_evaluation.
 startSelfEvaluation ($a_mode="create")
 startSelfEvaluation
 saveSelfEvaluation ()
 Save self evaluation.
 editSelfEvaluation ()
 Edit self evaluation.
 updateBackSelfEvaluation ()
 Update self evaluation and go one step back.
 updateSelfEvaluation ($a_back=false)
 Update self evaluation.
 getPresentationView ($a_user_id)
 Get presentation view.
 setSelfEvaluationPresentationForm ($se)
 Set self evaluation presentation form.

Detailed Description

Self evaluation.

Author
Alex Killing alex..nosp@m.kili.nosp@m.ng@gm.nosp@m.x.de
Version
$Id$ ilSkillSelfEvaluationGUI:

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

Constructor & Destructor Documentation

ilSkillSelfEvaluationGUI::__construct ( )

Constructor.

Parameters
@return

Definition at line 20 of file class.ilSkillSelfEvaluationGUI.php.

References $_GET, $_POST, $ilCtrl, $lng, and readSelfEvaluation().

{
global $ilCtrl, $lng;
$ilCtrl->saveParameter($this, array("se_id", "sn_id"));
$lng->loadLanguageModule("skmg");
$this->se_id = (int) $_GET["se_id"];
$this->sn_id = ((int) $_POST["sn_id"] > 0)
? (int) $_POST["sn_id"]
: (int) $_GET["sn_id"];
$ilCtrl->setParameter($this, "sn_id", $this->sn_id);
}

+ Here is the call graph for this function:

Member Function Documentation

ilSkillSelfEvaluationGUI::confirmSelfEvaluationDeletion ( )

Confirm self_evaluation deletion.

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

References $_POST, $ilCtrl, $lng, $tpl, ilSkillTreeNode\_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, "listSelfEvaluations");
}
else
{
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
$cgui = new ilConfirmationGUI();
$cgui->setFormAction($ilCtrl->getFormAction($this));
$cgui->setHeaderText($lng->txt("skmg_sure_delete_self_evaluation"));
$cgui->setCancel($lng->txt("cancel"), "listSelfEvaluations");
$cgui->setConfirm($lng->txt("delete"), "deleteSelfEvaluation");
foreach ($_POST["id"] as $i)
{
$se = new ilSkillSelfEvaluation((int) $i);
$se_title =
ilSkillTreeNode::_lookupTitle($se->getTopSkillId());
$cgui->addItem("id[]", $i, $se_title.", ".$lng->txt("created").": ".
$se->getCreated().", ".$lng->txt("last_update").": ".$se->getLastUpdate());
}
$tpl->setContent($cgui->getHTML());
}
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::deleteSelfEvaluation ( )

Delete self_evaluation.

Parameters
@return

Definition at line 139 of file class.ilSkillSelfEvaluationGUI.php.

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

{
global $ilCtrl, $lng, $ilUser;
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
if (is_array($_POST["id"]))
{
foreach ($_POST["id"] as $i)
{
$se = new ilSkillSelfEvaluation((int) $i);
if ($se->getUserId() == $ilUser->getId())
{
$se->delete();
}
}
}
ilUtil::sendSuccess("msg_obj_modified");
$ilCtrl->redirect($this, "listSelfEvaluations");
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::editSelfEvaluation ( )

Edit self evaluation.

Parameters
@return

Definition at line 267 of file class.ilSkillSelfEvaluationGUI.php.

References startSelfEvaluation().

{
$this->startSelfEvaluation("edit");
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::executeCommand ( )

Execute command.

Definition at line 39 of file class.ilSkillSelfEvaluationGUI.php.

References $cmd, and $ilCtrl.

{
global $ilCtrl;
$cmd = $ilCtrl->getCmd("listSelfEvaluations");
$this->$cmd();
}
ilSkillSelfEvaluationGUI::getPresentationView (   $a_user_id)

Get presentation view.

Parameters
@return

Definition at line 338 of file class.ilSkillSelfEvaluationGUI.php.

References ilSkillSelfEvaluation\getAllSelfEvaluationsOfUser(), and setSelfEvaluationPresentationForm().

{
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
$html = "";
foreach ($ses as $se)
{
$html.= $this->form->getHTML()."<br /><br />";
}
return $html;
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::listSelfEvaluations ( )

List all self evaluations.

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

References $ilCtrl, $lng, $options, $si, $tpl, and ilSkillTreeNode\getAllSelfEvaluationNodes().

{
global $tpl, $ilToolbar, $ilCtrl, $lng;
$ilToolbar->setFormAction($ilCtrl->getFormAction($this));
// desc
/*$ne = new ilNonEditableValueGUI($lng->txt("lang"), var);
$ne->setValue();
$ne->setInfo();
$this->form->addItem($ne);*/
// select skill for self evaluation
include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
foreach ($se_nodes as $n_id => $title)
{
$options[$n_id] = $title;
}
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$si = new ilSelectInputGUI($lng->txt("skmg_please_select_self_skill"), "sn_id");
$si->setOptions($options);
//$si->setInfo($lng->txt(""));
$ilToolbar->addInputItem($si, true);
$ilToolbar->addFormButton($lng->txt("skmg_execute_self_evaluation"), "startSelfEvaluation");
include_once("./Services/Skill/classes/class.ilSelfEvaluationTableGUI.php");
$table = new ilSelfEvaluationTableGUI($this, "listSelfEvaluations");
$tpl->setContent($table->getHTML());
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::readSelfEvaluation ( )

Read self_evaluation.

Parameters
@return

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

Referenced by __construct().

{
// $this->self_evaluation = new ilSelfEvaluation((int) $_GET[save_param]);
}

+ Here is the caller graph for this function:

ilSkillSelfEvaluationGUI::saveSelfEvaluation ( )

Save self evaluation.

Parameters
@return

Definition at line 232 of file class.ilSkillSelfEvaluationGUI.php.

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, $steps, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

{
global $ilUser, $lng, $ilCtrl;
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
$se = new ilSkillSelfEvaluation();
$se->setUserId($ilUser->getId());
$se->setTopSkillId($_GET["sn_id"]);
if (is_array($_POST["se_sk"]))
{
$se->setLevels($_POST["se_sk"]);
}
$se->create();
$cstep = (int) $_GET["step"];
if (count($steps))
{
$ilCtrl->setParameter($this, "step", 1);
$ilCtrl->setParameter($this, "se_id", $se->getId());
$ilCtrl->redirect($this, "editSelfEvaluation");
}
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
$ilCtrl->redirect($this, "");
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::setSelfEvaluationPresentationForm (   $se)

Set self evaluation presentation form.

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

References $ilCtrl, $lng, $path, ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilDatePresentation\setUseRelativeDates().

Referenced by getPresentationView().

{
global $lng, $ilCtrl;
include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
$this->form = new ilPropertyFormGUI();
$dates = ", ".
$lng->txt("created").": ".
new ilDateTime($se["created"], IL_CAL_DATETIME));
if ($se["created"] != $se["last_update"])
{
$dates.= ", ".$lng->txt("last_update").": ".
new ilDateTime($se["last_update"], IL_CAL_DATETIME));
}
$se = new ilSkillSelfEvaluation($se["id"]);
$levels = $se->getLevels();
$this->form->setTitle($lng->txt("skmg_self_evaluation").$dates);
include_once("./Services/Skill/classes/class.ilBasicSkill.php");
include_once("./Services/Skill/classes/class.ilSkillTree.php");
$stree = new ilSkillTree();
if ($stree->isInTree($se->getTopSkillId()))
{
$cnode = $stree->getNodeData($se->getTopSkillId());
$childs = $stree->getSubTree($cnode);
foreach ($childs as $child)
{
if ($child["type"] == "skll")
{
// build title
$path = $stree->getPathFull($child["child"]);
$title = $sep = "";
foreach ($path as $p)
{
if ($p["type"] != "skrt")
{
$title.= $sep.$p["title"];
$sep = " > ";
}
}
$sk = new ilBasicSkill($child["child"]);
$ls = $sk->getLevelData();
$ne = new ilNonEditableValueGUI($title, "");
foreach ($ls as $ld)
{
if ($ld["id"] == $levels[$child["child"]])
{
$ne->setValue($ld["title"]);
}
}
$this->form->addItem($ne);
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillSelfEvaluationGUI::startSelfEvaluation (   $a_mode = "create")

startSelfEvaluation

Parameters
@return

Definition at line 166 of file class.ilSkillSelfEvaluationGUI.php.

References $_GET, $ilCtrl, $lng, $steps, $tpl, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

Referenced by editSelfEvaluation().

{
global $tpl, $ilCtrl, $lng;
$se = null;
if ($a_mode == "edit")
{
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
$se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
$this->sn_id = $se->getTopSkillId();
}
ilUtil::sendInfo($lng->txt("skmg_please_select_your_skill_levels"));
$se_tpl = new ilTemplate("tpl.self_evaluation.html", true, true, "Services/Skill");
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
$cstep = (int) $_GET["step"];
$ilCtrl->setParameter($this, "step", $cstep);
include_once("./Services/Skill/classes/class.ilSkillSelfEvalSkillTableGUI.php");
$table = new ilSkillSelfEvalSkillTableGUI($this, "startSelfEvaluation",
$steps[$cstep], $se);
$se_tpl->setCurrentBlock("se_table");
$se_tpl->setVariable("SE_TABLE", $table->getHTML());
$se_tpl->parseCurrentBlock();
include_once("./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
$tb = new ilToolbarGUI();
if ($a_mode == "edit")
{
if ($cstep > 0)
{
$tb->addFormButton("< ".$lng->txt("skmg_previous_step"), "updateBackSelfEvaluation");
}
if ($cstep < count($steps) - 1)
{
$tb->addFormButton($lng->txt("skmg_next_step")." >", "updateSelfEvaluation");
}
else if ($cstep == count($steps) - 1)
{
$tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "updateSelfEvaluation");
}
}
else
{
if ($cstep < count($steps) - 1)
{
$tb->addFormButton($lng->txt("skmg_next_step")." >", "saveSelfEvaluation");
}
else if ($cstep == count($steps) - 1)
{
$tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "saveSelfEvaluation");
}
}
$se_tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this));
$se_tpl->setVariable("TOOLBAR", $tb->getHTML());
$tpl->setContent($se_tpl->get());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSkillSelfEvaluationGUI::updateBackSelfEvaluation ( )

Update self evaluation and go one step back.

Parameters
@return

Definition at line 278 of file class.ilSkillSelfEvaluationGUI.php.

References updateSelfEvaluation().

{
$this->updateSelfEvaluation(true);
}

+ Here is the call graph for this function:

ilSkillSelfEvaluationGUI::updateSelfEvaluation (   $a_back = false)

Update self evaluation.

Parameters
@return

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

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, $steps, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

Referenced by updateBackSelfEvaluation().

{
global $ilUser, $lng, $ilCtrl;
include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
$se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
if ($se->getUserId() == $ilUser->getId())
{
$cstep = (int) $_GET["step"];
if (is_array($_POST["se_sk"]))
{
$se->setLevels($_POST["se_sk"], true);
}
$se->update();
if ($a_back)
{
$ilCtrl->setParameter($this, "step", (int) $_GET["step"] - 1);
$ilCtrl->setParameter($this, "se_id", $se->getId());
$ilCtrl->redirect($this, "editSelfEvaluation");
}
else if (count($steps) - 1 > $cstep)
{
$ilCtrl->setParameter($this, "step", (int) $_GET["step"] + 1);
$ilCtrl->setParameter($this, "se_id", $se->getId());
$ilCtrl->redirect($this, "editSelfEvaluation");
}
ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
}
$ilCtrl->redirect($this, "");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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