/**
  * Save item
  */
 function saveItem()
 {
     $it = new ilSkillTemplateCategory();
     $it->setTitle($this->form->getInput("title"));
     $it->setOrderNr($this->form->getInput("order_nr"));
     $it->create();
     ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
 }
 /**
  * Insert one or multiple skill template categories
  */
 function insertSkillTemplateCategory()
 {
     global $ilCtrl, $lng;
     include_once "./Services/Skill/classes/class.ilSkillHFormGUI.php";
     include_once "./Services/Skill/classes/class.ilSkillTreeNode.php";
     $num = ilSkillHFormGUI::getPostMulti();
     $node_id = ilSkillHFormGUI::getPostNodeId();
     if (!ilSkillHFormGUI::getPostFirstChild()) {
         $parent_id = $this->skill_tree->getParentId($node_id);
         $target = $node_id;
     } else {
         $parent_id = $node_id;
         $target = IL_FIRST_NODE;
     }
     include_once "./Services/Skill/classes/class.ilSkillTemplateCategory.php";
     $skill_ids = array();
     for ($i = 1; $i <= $num; $i++) {
         $skill = new ilSkillTemplateCategory();
         $skill->setTitle($lng->txt("skmg_new_skill_template_category"));
         $skill->create();
         ilSkillTreeNode::putInTree($skill, $parent_id, $target);
         $skill_ids[] = $skill->getId();
     }
     $skill_ids = array_reverse($skill_ids);
     $skill_ids = implode($skill_ids, ":");
     $ilCtrl->setParameter($this, "highlight", $skill_ids);
     $ilCtrl->redirect($this, "editSkillTemplates", "node_" . $node_id);
 }
 /**
  * Paste item (tree) from clipboard to skill tree
  */
 static function pasteTree($a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy = false, $a_add_suffix = false)
 {
     global $ilUser, $ilias, $ilLog, $lng;
     $item_type = ilSkillTreeNode::_lookupType($a_item_id);
     if ($item_type == "scat") {
         include_once "./Services/Skill/classes/class.ilSkillCategory.php";
         $item = new ilSkillCategory($a_item_id);
     } else {
         if ($item_type == "skll") {
             include_once "./Services/Skill/classes/class.ilBasicSkill.php";
             $item = new ilBasicSkill($a_item_id);
         } else {
             if ($item_type == "sktr") {
                 include_once "./Services/Skill/classes/class.ilSkillTemplateReference.php";
                 $item = new ilSkillTemplateReference($a_item_id);
             } else {
                 if ($item_type == "sktp") {
                     include_once "./Services/Skill/classes/class.ilBasicSkillTemplate.php";
                     $item = new ilBasicSkillTemplate($a_item_id);
                 } else {
                     if ($item_type == "sctp") {
                         include_once "./Services/Skill/classes/class.ilSkillTemplateCategory.php";
                         $item = new ilSkillTemplateCategory($a_item_id);
                     }
                 }
             }
         }
     }
     $ilLog->write("Getting from clipboard type " . $item_type . ", " . "Item ID: " . $a_item_id);
     if ($a_as_copy) {
         $target_item = $item->copy();
         if ($a_add_suffix) {
             $target_item->setTitle($target_item->getTitle() . " " . $lng->txt("copy_of_suffix"));
             $target_item->update();
         }
         $a_copied_nodes[$item->getId()] = $target_item->getId();
     } else {
         $target_item = $item;
     }
     $ilLog->write("Putting into skill tree type " . $target_item->getType() . "Item ID: " . $target_item->getId() . ", Parent: " . $a_parent_id . ", " . "Target: " . $a_target);
     ilSkillTreeNode::putInTree($target_item, $a_parent_id, $a_target);
     $childs = $ilUser->getClipboardChilds($item->getId(), $a_insert_time);
     foreach ($childs as $child) {
         ilSkillTreeNode::pasteTree($child["id"], $target_item->getId(), IL_LAST_NODE, $a_insert_time, $a_copied_nodes, $a_as_copy);
     }
     return $target_item->getId();
 }
 /**
  * Save item
  */
 function saveItem()
 {
     $sktr = new ilSkillTemplateReference();
     $sktr->setTitle($_POST["title"]);
     $sktr->setSkillTemplateId($_POST["skill_template_id"]);
     $sktr->setSelfEvaluation($_POST["selectable"]);
     $sktr->setOrderNr($_POST["order_nr"]);
     $sktr->setStatus($_POST["status"]);
     $sktr->create();
     ilSkillTreeNode::putInTree($sktr, (int) $_GET["obj_id"], IL_LAST_NODE);
     $this->node_object = $sktr;
 }
Пример #5
0
 /**
  * Save item
  */
 function saveItem()
 {
     $it = new ilBasicSkill();
     $it->setTitle($this->form->getInput("title"));
     $it->setOrderNr($this->form->getInput("order_nr"));
     $it->setStatus($this->form->getInput("status"));
     $it->setSelfEvaluation($_POST["self_eval"]);
     $it->create();
     ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
     $this->node_object = $it;
 }
 /**
  * Save item
  */
 function saveItem()
 {
     include_once "Services/Skill/classes/class.ilSkillCategory.php";
     $it = new ilSkillCategory();
     $it->setTitle($this->form->getInput("title"));
     $it->setOrderNr($this->form->getInput("order_nr"));
     $it->setSelfEvaluation($_POST["self_eval"]);
     $it->setDraft($_POST["draft"]);
     $it->create();
     ilSkillTreeNode::putInTree($it, (int) $_GET["obj_id"], IL_LAST_NODE);
 }