22 $this->obj_id = $a_obj_id;
23 $this->mode = $a_mode;
26 $this->
read($a_obj_id);
32 $path =
"Services/Tracking/classes/collection/";
37 include_once
$path .
"class.ilLPCollectionOfRepositoryObjects.php";
41 include_once
$path .
"class.ilLPCollectionOfObjectives.php";
45 include_once
$path .
"class.ilLPCollectionOfSCOs.php";
50 include_once
$path .
"class.ilLPCollectionOfLMChapters.php";
54 include_once
$path .
"class.ilLPCollectionOfMediaObjects.php";
84 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
86 $mappings = $cwo->getMappings();
89 $new_collection =
new static($target_obj_id,
$this->mode);
90 foreach ($this->items as $item) {
91 if (!isset($mappings[$item])
or !$mappings[$item]) {
95 $new_collection->addEntry($mappings[$item]);
98 $ilLog->write(__METHOD__ .
': cloned learning progress collection.');
111 protected function read($a_obj_id)
115 $ilDB = $DIC[
'ilDB'];
119 $res =
$ilDB->query(
"SELECT * FROM ut_lp_collections" .
120 " WHERE obj_id = " .
$ilDB->quote($a_obj_id,
"integer"));
132 public function delete()
136 $ilDB = $DIC[
'ilDB'];
138 $query =
"DELETE FROM ut_lp_collections" .
139 " WHERE obj_id = " .
$ilDB->quote($this->obj_id,
"integer");
142 $query =
"DELETE FROM ut_lp_coll_manual" .
143 " WHERE obj_id = " .
$ilDB->quote($this->obj_id,
"integer");
147 $this->items = array();
163 if (is_array($this->items)) {
164 return (
bool) in_array($a_item_id, $this->items);
173 $ilDB = $DIC[
'ilDB'];
176 $query =
"INSERT INTO ut_lp_collections" .
177 " (obj_id, lpmode, item_id)" .
178 " VALUES (" .
$ilDB->quote($this->obj_id,
"integer") .
179 ", " .
$ilDB->quote($this->mode,
"integer") .
180 ", " .
$ilDB->quote($a_item_id,
"integer") .
183 $this->items[] = $a_item_id;
192 $ilDB = $DIC[
'ilDB'];
194 $query =
"DELETE FROM ut_lp_collections" .
195 " WHERE obj_id = " .
$ilDB->quote($this->obj_id,
"integer") .
196 " AND item_id = " .
$ilDB->quote($a_item_id,
"integer");
203 foreach ($a_item_ids as $item_id) {
210 foreach ($a_item_ids as $item_id) {
const LP_MODE_MANUAL_BY_TUTOR
LP collection of objectives.
LP collection of learning module chapters.
const LP_MODE_COLLECTION_MANUAL
const LP_MODE_COLLECTION_TLT
static getInstanceByMode($a_obj_id, $a_mode)
LP collection of repository objects.
cloneCollection($a_target_id, $a_copy_id)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
deactivateEntries(array $a_item_ids)
static _lookupObjId($a_id)
LP collection base class.
validateEntry($a_item_id)
__construct($a_obj_id, $a_mode)
isAssignedEntry($a_item_id)
const LP_MODE_COLLECTION_MOBS
activateEntries(array $a_item_ids)
static getCollectionModes()