42 $this->tree = $DIC->repositoryTree();
43 $this->db = $DIC->database();
44 $this->obj_data_cache = $DIC[
"ilObjDataCache"];
45 $this->log = $DIC[
"ilLog"];
54 $this->obj_id = $a_id;
64 $this->ref_id = $a_ref_id;
74 return $this->start_objs ? $this->start_objs : array();
82 $this->start_objs = array();
84 $query =
"SELECT * FROM crs_start" .
85 " WHERE crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
86 " ORDER BY pos, crs_start_id";
90 $this->start_objs[
$row->crs_start_id][
'item_ref_id'] =
$row->item_ref_id;
92 $this->
delete(
$row->item_ref_id);
103 public function delete($a_crs_start_id)
107 $query =
"DELETE FROM crs_start" .
108 " WHERE crs_start_id = " .
$ilDB->quote($a_crs_start_id,
'integer') .
109 " AND crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer');
122 $query =
"DELETE FROM crs_start" .
123 " WHERE crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
124 " AND item_ref_id = " .
$ilDB->quote($a_item_ref_id,
'integer');
133 $query =
"SELECT * FROM crs_start" .
134 " WHERE crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
135 " AND item_ref_id = " .
$ilDB->quote($a_item_ref_id,
'integer');
138 return $res->numRows() ? true :
false;
141 public function add($a_item_ref_id)
145 if ($a_item_ref_id) {
146 $max_pos =
$ilDB->query(
"SELECT max(pos) pos FROM crs_start" .
147 " WHERE crs_id = " .
$ilDB->quote($this->getObjId(),
"integer"));
148 $max_pos =
$ilDB->fetchAssoc($max_pos);
149 $max_pos = ((int) $max_pos[
"pos"]) + 10;
151 $next_id =
$ilDB->nextId(
'crs_start');
152 $query =
"INSERT INTO crs_start" .
153 " (crs_start_id,crs_id,item_ref_id,pos)" .
155 " (" .
$ilDB->quote($next_id,
'integer') .
157 ", " .
$ilDB->quote($a_item_ref_id,
'integer') .
158 ", " .
$ilDB->quote($max_pos,
'integer') .
170 $query =
"DELETE FROM crs_start" .
171 " WHERE crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer');
180 if (!(
int) $a_start_id || !(
int) $a_pos) {
184 $ilDB->manipulate(
"UPDATE crs_start" .
185 " SET pos = " .
$ilDB->quote($a_pos,
"integer") .
186 " WHERE crs_id = " .
$ilDB->quote($this->
getObjId(),
'integer') .
187 " AND crs_start_id = " .
$ilDB->quote($a_start_id,
'integer'));
192 include_once
"Services/Object/classes/class.ilObjectActivation.php";
194 switch ($node[
'type']) {
200 $poss_items[] = $node[
'ref_id'];
204 return $poss_items ? $poss_items : array();
210 if (!$this->
isFullfilled($a_user_id, $item[
'item_ref_id'])) {
221 $obj_id = $ilObjDataCache->lookupObjId($a_item_id);
226 include_once
'./Modules/Test/classes/class.ilObjTestAccess.php';
234 include_once
'./Modules/Survey/classes/class.ilObjSurveyAccess.php';
241 include_once
'Services/Tracking/classes/class.ilLPStatus.php';
254 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
256 $continue_data = $lm_continue->getLMHistory();
257 if (!isset($continue_data[$a_item_id])) {
271 $ilLog->write(__METHOD__ .
': Begin course start objects...');
273 $new_obj_id = $ilObjDataCache->lookupObjId($a_target_id);
274 $start =
new self($a_target_id, $new_obj_id);
276 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
278 $mappings = $cwo->getMappings();
280 $item_ref_id = $data[
'item_ref_id'];
281 if (isset($mappings[$item_ref_id])
and $mappings[$item_ref_id]) {
282 $ilLog->write(__METHOD__ .
': Clone start object nr. ' . $item_ref_id);
283 $start->add($mappings[$item_ref_id]);
285 $ilLog->write(__METHOD__ .
': No mapping found for start object nr. ' . $item_ref_id);
288 $ilLog->write(__METHOD__ .
': ... end course start objects');
302 $ilDB = $DIC->database();
304 $query =
'SELECT crs_start_id FROM crs_start ' .
305 'WHERE crs_id = ' .
$ilDB->quote($a_container_id,
'integer') .
' ' .
306 'AND item_ref_id = ' .
$ilDB->quote($a_item_ref_id,
'integer');
308 if (
$res->numRows() >= 1) {
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
allFullfilled($a_user_id)
isFullfilled($a_user_id, $a_item_id)
deleteItem($a_item_ref_id)
Delete item by ref_id.
static _getInstance($a_copy_id)
Get instance of copy wizard options.
foreach($_POST as $key=> $value) $res
static _hasUserCompleted($a_obj_id, $a_user_id)
Lookup user object completion.
setObjectPos($a_start_id, $a_pos)
static _lookupFinished($a_obj_id, $a_user_id="")
get finished status
__construct($a_object_ref_id, $a_object_id)
static checkCondition($a_obj_id, $a_operator, $a_value, $a_usr_id)
check condition
cloneDependencies($a_target_id, $a_copy_id)
static isStartObject($a_container_id, $a_item_ref_id)
Check if object is start object.