24 global $ilObjDataCache,
$ilDB;
28 $this->obj_id = $a_obj_id;
42 global $ilObjDataCache,
$ilLog;
44 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
46 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
48 $mappings = $cwo->getMappings();
51 foreach($this->items as $item)
53 if(!isset($mappings[$item]) or !$mappings[$item])
57 $new_collections->add($mappings[$item]);
58 $ilLog->write(__METHOD__.
': Added learning progress collection.');
74 return (
bool) in_array($a_ref_id,$this->items);
77 function add($item_id)
81 $query =
"DELETE FROM ut_lp_collections ".
82 "WHERE obj_id = ".$ilDB->quote($this->obj_id ,
'integer').
" ".
83 "AND item_id = ".$ilDB->quote($item_id ,
'integer').
" ";
86 $query =
"INSERT INTO ut_lp_collections (obj_id, item_id) ".
88 $ilDB->quote($this->obj_id ,
'integer').
", ".
89 $ilDB->quote($item_id ,
'integer').
97 function delete($item_id)
101 $query =
"DELETE FROM ut_lp_collections ".
102 "WHERE item_id = ".$ilDB->quote($item_id ,
'integer').
" ".
103 "AND obj_id = ".$ilDB->quote($this->obj_id ,
'integer').
" ";
117 if($tree->isDeleted($a_target_id))
122 $node_data = $tree->getNodeData($a_target_id);
123 foreach($tree->getSubTree($node_data) as $node)
126 if($node[
'ref_id'] == $a_target_id)
131 switch($node[
'type'])
141 $all_possible[] = $node[
'ref_id'];
146 return $all_possible ? $all_possible : array();
166 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
172 include_once
'./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
176 $items[
"$item[obj_id]"][
'title'] = $item[
'title'];
177 #$items[$item->getId()]['title'] = $item->getTitle();
182 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
183 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
187 $items[$item->getId()][
'title'] = $item->getTitle();
192 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
196 $items[$item[
"id"]][
'title'] = $item[
"title"];
213 $query =
"DELETE FROM ut_lp_collections ".
214 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
"";
222 global $ilObjDataCache;
225 include_once
'Services/Tracking/classes/class.ilLPObjSettings.php';
230 include_once
'Modules/Course/classes/class.ilCourseObjective.php';
238 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
241 $course_ref_id = end($course_ref_ids);
244 $query =
"SELECT * FROM ut_lp_collections utc ".
245 "JOIN object_reference obr ON item_id = ref_id ".
246 "JOIN object_data obd ON obr.obj_id = obd.obj_id ".
247 "WHERE utc.obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ".
253 $query =
"SELECT * FROM ut_lp_collections WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
259 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
261 if(!in_array(
$row->item_id,$possible_items))
268 if($ilObjDataCache->lookupType($item_obj_id = $ilObjDataCache->lookupObjId(
$row->item_id)) ==
'tst')
270 include_once
'./Modules/Test/classes/class.ilObjTest.php';
287 $query =
"DELETE FROM ut_lp_collections ".
288 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
289 "AND item_id = ".$ilDB->quote($a_item_id ,
'integer').
" ";
297 global $ilObjDataCache,
$ilDB;
299 $this->items = array();
301 if($ilObjDataCache->lookupType($this->getObjId()) !=
'sahs')
304 $course_ref_id = end($course_ref_ids);
305 $query =
"SELECT * FROM ut_lp_collections utc ".
306 "JOIN object_reference obr ON item_id = ref_id ".
307 "JOIN object_data obd ON obr.obj_id = obd.obj_id ".
308 "WHERE utc.obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
313 $query =
"SELECT * FROM ut_lp_collections WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ";
318 if($ilObjDataCache->lookupType($this->getObjId()) !=
'sahs')
327 if($ilObjDataCache->lookupType($item_obj_id = $ilObjDataCache->lookupObjId(
$row->item_id)) ==
'tst')
329 include_once
'./Modules/Test/classes/class.ilObjTest.php';
336 $this->items[] =
$row->item_id;