53 $this->ref_id = $a_course_ref_id;
54 $this->
id = $a_course_obj_id;
68 $this->ref_id = $a_ref_id;
76 return $this->start_objs ? $this->start_objs : array();
89 global $ilObjDataCache,
$ilLog;
91 $ilLog->write(__METHOD__.
': Begin course start objects...');
93 $new_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
96 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
98 $mappings = $cwo->getMappings();
101 $item_ref_id =
$data[
'item_ref_id'];
102 if(isset($mappings[$item_ref_id]) and $mappings[$item_ref_id])
104 $ilLog->write(__METHOD__.
': Clone start object nr. '.$item_ref_id);
105 $start->add($mappings[$item_ref_id]);
109 $ilLog->write(__METHOD__.
': No mapping found for start object nr. '.$item_ref_id);
112 $ilLog->write(__METHOD__.
': ... end course start objects');
116 function delete($a_crs_start_id)
120 $query =
"DELETE FROM crs_start ".
121 "WHERE crs_start_id = ".$ilDB->quote($a_crs_start_id).
" ".
122 "AND crs_id = ".$ilDB->quote($this->
getId()).
" ";
124 $this->db->query($query);
133 $query =
"SELECT * FROM crs_start ".
134 "WHERE crs_id = ".$ilDB->quote($this->
getId()).
" ".
135 "AND item_ref_id = ".$a_item_ref_id.
" ";
137 $res = $this->db->query($query);
139 return $res->numRows() ?
true :
false;
142 function add($a_item_ref_id)
148 $query =
"INSERT INTO crs_start ".
149 "SET crs_id = ".$ilDB->quote($this->
getId()).
", ".
150 "item_ref_id = ".$ilDB->quote($a_item_ref_id).
" ";
152 $this->db->query($query);
163 $query =
"DELETE FROM crs_start ".
164 "WHERE crs_id = ".$ilDB->quote($this->
getId()).
" ";
167 $this->db->query($query);
174 foreach($item_obj->getItems() as $node)
176 switch($node[
'type'])
182 $poss_items[] = $node[
'ref_id'];
186 return $poss_items ? $poss_items : array();
204 global $ilObjDataCache;
206 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
208 $continue_data = $lm_continue->getLMHistory();
210 $obj_id = $ilObjDataCache->lookupObjId($item_id);
211 $type = $ilObjDataCache->lookupType($obj_id);
216 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
224 include_once
'./Modules/Survey/classes/class.ilObjSurveyAccess.php';
231 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
233 if(!in_array($user_id,$completed))
240 if(!isset($continue_data[$item_id]))
254 $this->start_objs = array();
256 $query =
"SELECT * FROM crs_start ".
257 "WHERE crs_id = ".$ilDB->quote($this->
getId()).
" ";
259 $res = $this->db->query($query);
262 if($tree->isInTree($row->item_ref_id))
264 $this->start_objs[$row->crs_start_id][
'item_ref_id'] = $row->item_ref_id;
268 $this->
delete($row->item_ref_id);