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 ,
'integer').
" ".
122 "AND crs_id = ".$ilDB->quote($this->
getId(),
'integer').
" ";
131 $query =
"SELECT * FROM crs_start ".
132 "WHERE crs_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ".
133 "AND item_ref_id = ".$ilDB->quote($a_item_ref_id ,
'integer').
" ";
136 return $res->numRows() ?
true :
false;
139 function add($a_item_ref_id)
145 $next_id = $ilDB->nextId(
'crs_start');
146 $query =
"INSERT INTO crs_start (crs_start_id,crs_id,item_ref_id) ".
148 $ilDB->quote($next_id,
'integer').
", ".
149 $ilDB->quote($this->
getId() ,
'integer').
", ".
150 $ilDB->quote($a_item_ref_id ,
'integer').
" ".
162 $query =
"DELETE FROM crs_start ".
163 "WHERE crs_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
171 foreach($item_obj->getItems() as $node)
173 switch($node[
'type'])
179 $poss_items[] = $node[
'ref_id'];
183 return $poss_items ? $poss_items : array();
201 global $ilObjDataCache;
203 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
205 $continue_data = $lm_continue->getLMHistory();
207 $obj_id = $ilObjDataCache->lookupObjId($item_id);
208 $type = $ilObjDataCache->lookupType($obj_id);
213 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
221 include_once
'./Modules/Survey/classes/class.ilObjSurveyAccess.php';
228 include_once
'Services/Tracking/classes/class.ilLPStatusWrapper.php';
230 if(!in_array($user_id,$completed))
237 if(!isset($continue_data[$item_id]))
251 $this->start_objs = array();
253 $query =
"SELECT * FROM crs_start ".
254 "WHERE crs_id = ".$ilDB->quote($this->
getId() ,
'integer').
" ";
259 if($tree->isInTree(
$row->item_ref_id))
261 $this->start_objs[
$row->crs_start_id][
'item_ref_id'] =
$row->item_ref_id;
265 $this->
delete(
$row->item_ref_id);