예제 #1
0
 /**
  * Clone object dependencies (start objects, preconditions)
  *
  * @access public
  * @param int target ref id of new course
  * @param int copy id
  * 
  */
 public function cloneDependencies($a_target_id, $a_copy_id)
 {
     parent::cloneDependencies($a_target_id, $a_copy_id);
     // Clone course start objects
     include_once 'Services/Container/classes/class.ilContainerStartObjects.php';
     $start = new ilContainerStartObjects($this->getRefId(), $this->getId());
     $start->cloneDependencies($a_target_id, $a_copy_id);
     // Clone course item settings
     include_once 'Services/Object/classes/class.ilObjectActivation.php';
     ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
     include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
     ilLOSettings::cloneSettings($a_copy_id, $this->getId(), ilObject::_lookupObjId($a_target_id));
     // Clone course learning objectives
     include_once 'Modules/Course/classes/class.ilCourseObjective.php';
     $crs_objective = new ilCourseObjective($this);
     $crs_objective->ilClone($a_target_id, $a_copy_id);
     return true;
 }
예제 #2
0
 /**
  * Clone object dependencies (crs items, preconditions)
  *
  * @access public
  * @param int target ref id of new course
  * @param int copy id
  * 
  */
 public function cloneDependencies($a_target_id, $a_copy_id)
 {
     parent::cloneDependencies($a_target_id, $a_copy_id);
     include_once 'Services/Object/classes/class.ilObjectActivation.php';
     ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
     return true;
 }
예제 #3
0
 public function cloneDependencies($a_target_id, $a_copy_id)
 {
     parent::cloneDependencies($a_target_id, $a_copy_id);
     // clone taxonomies
     include_once "./Services/Taxonomy/classes/class.ilObjTaxonomy.php";
     $all_tax = ilObjTaxonomy::getUsageOfObject($this->getId());
     if (sizeof($all_tax)) {
         include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php";
         $cwo = ilCopyWizardOptions::_getInstance($a_copy_id);
         $mappings = $cwo->getMappings();
         foreach ($all_tax as $old_tax_id) {
             if ($old_tax_id) {
                 // clone it
                 $old_tax = new ilObjTaxonomy($old_tax_id);
                 $new_tax = $old_tax->cloneObject(0, 0, true);
                 $tax_map = $old_tax->getNodeMapping();
                 // assign new taxonomy to new category
                 ilObjTaxonomy::saveUsage($new_tax->getId(), ilObject::_lookupObjId($a_target_id));
                 // clone assignments (for all sub-items)
                 foreach ($mappings as $old_ref_id => $new_ref_id) {
                     if ($old_ref_id != $new_ref_id) {
                         $old_obj_id = ilObject::_lookupObjId($old_ref_id);
                         $new_obj_id = ilObject::_lookupObjId($new_ref_id);
                         $obj_type = ilObject::_lookupType($old_obj_id);
                         $tax_ass = new ilTaxNodeAssignment($obj_type, $old_obj_id, "obj", $old_tax_id);
                         $assignmts = $tax_ass->getAssignmentsOfItem($old_obj_id);
                         if (sizeof($assignmts)) {
                             $new_tax_ass = new ilTaxNodeAssignment($obj_type, $new_obj_id, "obj", $new_tax->getId());
                             foreach ($assignmts as $a) {
                                 if ($tax_map[$a["node_id"]]) {
                                     $new_tax_ass->addAssignment($tax_map[$a["node_id"]], $new_obj_id);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 /**
  * Clone object dependencies (crs items, preconditions)
  *
  * @access public
  * @param int target ref id of new course
  * @param int copy id
  * 
  */
 public function cloneDependencies($a_target_id, $a_copy_id)
 {
     parent::cloneDependencies($a_target_id, $a_copy_id);
     include_once 'Services/Object/classes/class.ilObjectActivation.php';
     ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
     include_once 'Services/Tracking/classes/class.ilLPCollections.php';
     $lp_collection = new ilLPCollections($this->getId());
     $lp_collection->cloneCollections($a_target_id, $a_copy_id);
     return true;
 }
 /**
  * Clone object dependencies (start objects, preconditions)
  *
  * @access public
  * @param int target ref id of new course
  * @param int copy id
  * 
  */
 public function cloneDependencies($a_target_id, $a_copy_id)
 {
     parent::cloneDependencies($a_target_id, $a_copy_id);
     // Clone course start objects
     include_once 'Modules/Course/classes/class.ilCourseStart.php';
     $start = new ilCourseStart($this->getRefId(), $this->getId());
     $start->cloneDependencies($a_target_id, $a_copy_id);
     // Clone course item settings
     include_once 'Services/Object/classes/class.ilObjectActivation.php';
     ilObjectActivation::cloneDependencies($this->getRefId(), $a_target_id, $a_copy_id);
     // Clone course learning objectives
     include_once 'Modules/Course/classes/class.ilCourseObjective.php';
     $crs_objective = new ilCourseObjective($this);
     $crs_objective->ilClone($a_target_id, $a_copy_id);
     include_once 'Services/Tracking/classes/class.ilLPCollections.php';
     $lp_collection = new ilLPCollections($this->getId());
     $lp_collection->cloneCollections($a_target_id, $a_copy_id);
     return true;
 }