44 global $ilObjDataCache,
$ilDB;
48 $this->obj_id = $a_obj_id;
62 global $ilObjDataCache,
$ilLog;
64 $target_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
66 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
68 $mappings = $cwo->getMappings();
71 foreach($this->items as $item)
73 if(!isset($mappings[$item]) or !$mappings[$item])
77 $new_collections->add($mappings[$item]);
78 $ilLog->write(__METHOD__.
': Added learning progress collection.');
94 return (
bool) in_array($a_ref_id,$this->items);
97 function add($item_id)
101 $query =
"DELETE FROM ut_lp_collections ".
102 "WHERE obj_id = ".$ilDB->quote($this->obj_id ,
'integer').
" ".
103 "AND item_id = ".$ilDB->quote($item_id ,
'integer').
" ";
106 $query =
"INSERT INTO ut_lp_collections (obj_id, item_id) ".
108 $ilDB->quote($this->obj_id ,
'integer').
", ".
109 $ilDB->quote($item_id ,
'integer').
117 function delete($item_id)
121 $query =
"DELETE FROM ut_lp_collections ".
122 "WHERE item_id = ".$ilDB->quote($item_id ,
'integer').
" ".
123 "AND obj_id = ".$ilDB->quote($this->obj_id ,
'integer').
" ";
137 if($tree->isDeleted($a_target_id))
142 $node_data = $tree->getNodeData($a_target_id);
143 foreach($tree->getSubTree($node_data) as $node)
146 if($node[
'ref_id'] == $a_target_id)
151 switch($node[
'type'])
161 $all_possible[] = $node[
'ref_id'];
166 return $all_possible ? $all_possible : array();
186 include_once
'./Modules/ScormAicc/classes/class.ilObjSAHSLearningModule.php';
192 include_once
'./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php';
196 $items[
"$item[obj_id]"][
'title'] = $item[
'title'];
197 #$items[$item->getId()]['title'] = $item->getTitle();
202 include_once
'./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php';
203 include_once
'./Modules/ScormAicc/classes/SCORM/class.ilSCORMItem.php';
207 $items[$item->getId()][
'title'] = $item->getTitle();
212 include_once
'./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php';
216 $items[$item[
"id"]][
'title'] = $item[
"title"];
233 $query =
"DELETE FROM ut_lp_collections ".
234 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
"";
242 global $ilObjDataCache;
245 include_once
'Services/Tracking/classes/class.ilLPObjSettings.php';
250 include_once
'Modules/Course/classes/class.ilCourseObjective.php';
258 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
261 $course_ref_id = end($course_ref_ids);
264 $query =
"SELECT * FROM ut_lp_collections utc ".
265 "JOIN object_reference obr ON item_id = ref_id ".
266 "JOIN object_data obd ON obr.obj_id = obd.obj_id ".
267 "WHERE utc.obj_id = ".$ilDB->quote($a_obj_id,
'integer').
" ".
273 $query =
"SELECT * FROM ut_lp_collections WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ";
279 if($ilObjDataCache->lookupType($a_obj_id) !=
'sahs')
281 if(!in_array(
$row->item_id,$possible_items))
288 if($ilObjDataCache->lookupType($item_obj_id = $ilObjDataCache->lookupObjId(
$row->item_id)) ==
'tst')
290 include_once
'./Modules/Test/classes/class.ilObjTest.php';
307 $query =
"DELETE FROM ut_lp_collections ".
308 "WHERE obj_id = ".$ilDB->quote($a_obj_id ,
'integer').
" ".
309 "AND item_id = ".$ilDB->quote($a_item_id ,
'integer').
" ";
317 global $ilObjDataCache,
$ilDB;
319 if($ilObjDataCache->lookupType($this->getObjId()) !=
'sahs')
322 $course_ref_id = end($course_ref_ids);
323 $query =
"SELECT * FROM ut_lp_collections utc ".
324 "JOIN object_reference obr ON item_id = ref_id ".
325 "JOIN object_data obd ON obr.obj_id = obd.obj_id ".
326 "WHERE utc.obj_id = ".$this->db->quote($this->obj_id,
'integer').
" ".
331 $query =
"SELECT * FROM ut_lp_collections WHERE obj_id = ".$ilDB->quote($this->
getObjId() ,
'integer').
" ";
336 if($ilObjDataCache->lookupType($this->getObjId()) !=
'sahs')
345 if($ilObjDataCache->lookupType($item_obj_id = $ilObjDataCache->lookupObjId(
$row->item_id)) ==
'tst')
347 include_once
'./Modules/Test/classes/class.ilObjTest.php';
354 $this->items[] =
$row->item_id;