4 require_once
'./Modules/DataCollection/exceptions/class.ilDataCollectionInputException.php';
5 require_once
'./Modules/DataCollection/classes/class.ilDataCollectionILIASRefField.php';
6 require_once
'./Modules/DataCollection/classes/class.ilDataCollectionReferenceField.php';
7 require_once
'class.ilDataCollectionRatingField.php';
44 $query =
"SELECT * FROM il_dcl_record_field WHERE field_id LIKE ".$ilDB->quote($this->field->getId(),
"text").
" AND record_id = ".$ilDB->quote($this->record->getId(),
"integer");
45 $set = $ilDB->query(
$query);
46 $rec = $ilDB->fetchAssoc($set);
47 $this->
id = $rec[
'id'];
63 $id = $ilDB->nextId(
"il_dcl_record_field");
64 $query =
"INSERT INTO il_dcl_record_field (id, record_id, field_id) VALUES (".$ilDB->quote(
$id,
"integer").
", ".$ilDB->quote($this->record->getId(),
"integer").
", ".$ilDB->quote($this->field->getId(),
"text").
")";
77 $datatype = $this->field->getDatatype();
78 $query =
"DELETE FROM il_dcl_stloc".$datatype->getStorageLocation().
"_value WHERE record_field_id = ".$ilDB->quote($this->
id,
"integer");
80 $next_id = $ilDB->nextId(
"il_dcl_stloc".$datatype->getStorageLocation().
"_value");
82 $ilDB->insert(
"il_dcl_stloc".$datatype->getStorageLocation().
"_value",
83 array(
"value" => array($datatype->getDbType(),
$this->value),
84 "record_field_id " => array(
"integer", $this->
id),
85 "id" => array(
"integer", $next_id))
92 public function delete()
96 $datatype = $this->field->getDatatype();
97 $query =
"DELETE FROM il_dcl_stloc".$datatype->getStorageLocation().
"_value WHERE record_field_id = ".$ilDB->quote($this->
id,
"integer");
100 $query2 =
"DELETE FROM il_dcl_record_field WHERE id = ".$ilDB->quote($this->
id,
"integer");
101 $ilDB->manipulate($query2);
119 $type = $this->field->getDatatype()->getId();
121 $tmp = $this->field->getDatatype()->parseValue(
$value, $this);
131 $this->record->deleteFile($old);
141 $datatype = $this->field->getDatatype();
143 return $datatype->parseFormInput($this->
getValue(), $this);
151 $datatype = $this->field->getDatatype();
153 return $datatype->parseExportValue($this->
getValue());
168 $datatype = $this->field->getDatatype();
169 return $datatype->parseHTML($this->
getValue(), $this);
185 if($this->value === NULL)
188 $datatype = $this->field->getDatatype();
189 $query =
"SELECT * FROM il_dcl_stloc".$datatype->getStorageLocation().
"_value WHERE record_field_id = ".$ilDB->quote($this->
id,
"integer");
190 $set = $ilDB->query(
$query);
191 $rec = $ilDB->fetchAssoc($set);
192 $this->value = $rec[
'value'];