47 public function __construct($a_course_ref_id, $a_course_obj_id)
55 $this->ref_id = $a_course_ref_id;
56 $this->
id = $a_course_obj_id;
70 $this->ref_id = $a_ref_id;
78 return $this->start_objs ? $this->start_objs : array();
93 $ilObjDataCache = $DIC[
'ilObjDataCache'];
96 $ilLog->write(__METHOD__ .
': Begin course start objects...');
98 $new_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
101 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
103 $mappings = $cwo->getMappings();
105 $item_ref_id =
$data[
'item_ref_id'];
106 if (isset($mappings[$item_ref_id])
and $mappings[$item_ref_id]) {
107 $ilLog->write(__METHOD__ .
': Clone start object nr. ' . $item_ref_id);
108 $start->add($mappings[$item_ref_id]);
110 $ilLog->write(__METHOD__ .
': No mapping found for start object nr. ' . $item_ref_id);
113 $ilLog->write(__METHOD__ .
': ... end course start objects');
117 public function delete($a_crs_start_id)
121 $ilDB = $DIC[
'ilDB'];
123 $query =
"DELETE FROM crs_start " .
124 "WHERE crs_start_id = " .
$ilDB->quote($a_crs_start_id,
'integer') .
" " .
125 "AND crs_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
134 $ilDB = $DIC[
'ilDB'];
136 $query =
"SELECT * FROM crs_start " .
137 "WHERE crs_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" " .
138 "AND item_ref_id = " .
$ilDB->quote($a_item_ref_id,
'integer') .
" ";
141 return $res->numRows() ? true :
false;
144 public function add($a_item_ref_id)
148 $ilDB = $DIC[
'ilDB'];
150 if ($a_item_ref_id) {
151 $next_id =
$ilDB->nextId(
'crs_start');
152 $query =
"INSERT INTO crs_start (crs_start_id,crs_id,item_ref_id) " .
154 $ilDB->quote($next_id,
'integer') .
", " .
155 $ilDB->quote($this->
getId(),
'integer') .
", " .
156 $ilDB->quote($a_item_ref_id,
'integer') .
" " .
168 $ilDB = $DIC[
'ilDB'];
170 $query =
"DELETE FROM crs_start " .
171 "WHERE crs_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
179 include_once
"Services/Object/classes/class.ilObjectActivation.php";
181 switch ($node[
'type']) {
186 $poss_items[] = $node[
'ref_id'];
190 return $poss_items ? $poss_items : array();
196 if (!$this->
isFullfilled($user_id, $item[
'item_ref_id'])) {
208 $ilObjDataCache = $DIC[
'ilObjDataCache'];
210 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
212 $continue_data = $lm_continue->getLMHistory();
214 $obj_id = $ilObjDataCache->lookupObjId($item_id);
215 $type = $ilObjDataCache->lookupType($obj_id);
219 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
220 include_once
'./Services/Conditions/classes/class.ilConditionHandler.php';
227 include_once
'./Modules/Survey/classes/class.ilObjSurveyAccess.php';
233 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
240 if (!isset($continue_data[$item_id])) {
253 $tree = $DIC[
'tree'];
254 $ilDB = $DIC[
'ilDB'];
256 $this->start_objs = array();
258 $query =
"SELECT * FROM crs_start " .
259 "WHERE crs_id = " .
$ilDB->quote($this->
getId(),
'integer') .
" ";
263 if (
$tree->isInTree(
$row->item_ref_id)) {
264 $this->start_objs[
$row->crs_start_id][
'item_ref_id'] =
$row->item_ref_id;
266 $this->
delete(
$row->item_ref_id);
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
isFullfilled($user_id, $item_id)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
__construct($a_course_ref_id, $a_course_obj_id)
Constructor public.
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
static _lookupFinished($a_obj_id, $a_user_id="")
get finished status
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
cloneDependencies($a_target_id, $a_copy_id)
Clone dependencies.