4 include_once
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldModel.php';
5 include_once
'./Modules/DataCollection/classes/Fields/Base/class.ilDclDatatype.php';
27 $message =
"Standard fields cannot be read from DB";
29 $ilLog->write(
"[ilDclStandardField] ".$message);
39 $message =
"Standard fields cannot be written to DB";
41 $ilLog->write(
"[ilDclStandardField] ".$message);
57 $this->
setLocked($original_record->getLocked());
58 $this->
setOrder($original_record->getOrder());
59 $this->
setRequired($original_record->getRequired());
60 $this->
setUnique($original_record->isUnique());
100 foreach(self::_getStandardFieldsAsArray() as $array)
105 $field->buildFromDBRecord($array);
106 $stdFields[] = $field;
117 foreach (
array(
'dcl_id',
'dcl_creation_date',
'dcl_last_update',
'dcl_owner',
'dcl_last_edited_by',
'dcl_comments') as
$id) {
118 $identifiers .= $ilDB->quote($id,
'text') .
',';
120 $identifiers = rtrim($identifiers,
',');
121 $sql = $ilDB->query(
'SELECT value FROM lng_data WHERE identifier IN (' . $identifiers .
')');
123 while ($rec = $ilDB->fetchAssoc($sql)) {
124 $titles[] = $rec[
'value'];
136 foreach(self::_getStandardFieldsAsArray() as $field)
138 if($field[
"id"] == $field_id)
154 foreach (self::_getStandardFieldsAsArray() as $fields_data) {
155 if (
$id == $fields_data[
'id']) {
192 if ($this->
getId() ==
'owner' || $this->
getId() ==
'last_edit_by') {
193 $join_str =
"LEFT JOIN usr_data AS sort_usr_data_{$this->getId()} ON (sort_usr_data_{$this->getId()}.usr_id = record.{$this->getId()})";
194 $select_str =
" sort_usr_data_{$this->getId()}.login AS field_{$this->getId()},";
196 $select_str =
" record.{$this->getId()} AS field_{$this->getId()},";
199 $sql_obj->setSelectStatement($select_str);
200 $sql_obj->setJoinStatement($join_str);
202 if($this->
getId() !==
"comments") {
203 $sql_obj->setOrderStatement(
"field_{$this->getId()} ".$direction);
220 $ilDB = $DIC[
'ilDB'];
222 $where_additions =
"";
226 "INNER JOIN usr_data AS filter_usr_data_{$this->getId()} ON (filter_usr_data_{$this->getId()}.usr_id = record.{$this->getId()} AND filter_usr_data_{$this->getId()}.login LIKE " 227 .
$ilDB->quote(
"%$filter_value%",
'text') .
") ";
230 $from = (isset($filter_value[
'from'])) ? $filter_value[
'from'] : NULL;
231 $to = (isset($filter_value[
'to'])) ? $filter_value[
'to'] : NULL;
232 if (is_numeric($from)) {
233 $where_additions .=
" AND record.{$this->getId()} >= " .
$ilDB->quote($from,
'integer');
235 if (is_numeric($to)) {
236 $where_additions .=
" AND record.{$this->getId()} <= " .
$ilDB->quote($to,
'integer');
240 $date_from = (isset($filter_value[
'from']) && is_object($filter_value[
'from'])) ? $filter_value[
'from'] : NULL;
241 $date_to = (isset($filter_value[
'to']) && is_object($filter_value[
'to'])) ? $filter_value[
'to'] : NULL;
246 $where_additions .=
" AND (record.{$this->getId()} >= " . strip_tags(
$ilDB->quote($date_from,
'date')) .
")";
249 $where_additions .=
" AND (record.{$this->getId()} <= " . strip_tags(
$ilDB->quote($date_to,
'date')) .
")";
255 $sql_obj->setJoinStatement($join_str);
256 $sql_obj->setWhereStatement($where_additions);
262 if($this->
getId() ==
'comments') {
269 if($this->
getId() ==
'comments') {
273 return parent::hasNumericSorting();
getRecordQuerySortObject($direction="asc", $sort_by_status=false)
Returns a query-object for building the record-loader-sql-query.
Class ilDclBaseFieldModel.
getRecordQueryFilterObject($filter_value="", ilDclBaseFieldModel $sort_field=NULL)
Returns a query-object for building the record-loader-sql-query.
Class ilDclRecordQueryObject.
cloneStructure($original_record)
static getTableCache($table_id=0)
static _getDatatypeForId($id)
gives you the datatype id of a specified standard field.
getTableId()
Get table id.
static _getAllStandardFieldTitles()
static _getStandardFields($table_id)
static _getStandardFieldsAsArray()
setRequired($a_required)
Set Required.
Class ilDclBaseFieldModel.
const INPUTFORMAT_DATETIME
static _isStandardField($field_id)
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
updateTableFieldSetting()
update exportable and fieldorder
setExportable($exportable)
getDatatypeId()
Get datatype_id.