20 $ilLog = $DIC[
'ilLog'];
21 $message =
"Standard fields cannot be read from DB";
23 $ilLog->write(
"[ilDclStandardField] " .
$message);
30 $ilLog = $DIC[
'ilLog'];
31 $message =
"Standard fields cannot be written to DB";
33 $ilLog->write(
"[ilDclStandardField] " .
$message);
48 $this->
setOrder($original_record->getOrder());
49 $this->
setUnique($original_record->isUnique());
77 "title" =>
$lng->txt(
"dcl_id"),
78 "description" =>
$lng->txt(
"dcl_id_description"),
82 "id" =>
"create_date",
83 "title" =>
$lng->txt(
"dcl_creation_date"),
84 "description" =>
$lng->txt(
"dcl_creation_date_description"),
88 "id" =>
"last_update",
89 "title" =>
$lng->txt(
"dcl_last_update"),
90 "description" =>
$lng->txt(
"dcl_last_update_description"),
95 "title" =>
$lng->txt(
"dcl_owner"),
96 "description" =>
$lng->txt(
"dcl_owner_description"),
100 "id" =>
"last_edit_by",
101 "title" =>
$lng->txt(
"dcl_last_edited_by"),
102 "description" =>
$lng->txt(
"dcl_last_edited_by_description"),
107 'title' =>
$lng->txt(
'dcl_comments'),
108 'description' =>
$lng->txt(
'dcl_comments_desc'),
124 $stdFields = array();
125 foreach (self::_getStandardFieldsAsArray() as $array) {
129 $field->buildFromDBRecord($array);
130 $stdFields[] = $field;
144 $ilDB = $DIC[
'ilDB'];
151 'dcl_last_edited_by',
155 $identifiers .=
$ilDB->quote($id,
'text') .
',';
157 $identifiers = rtrim($identifiers,
',');
159 'SELECT value FROM lng_data WHERE identifier IN (' . $identifiers
163 while ($rec =
$ilDB->fetchAssoc($sql)) {
164 $titles[] = $rec[
'value'];
178 $ilDB = $DIC[
'ilDB'];
180 foreach (array(
'dcl_owner') as
$id) {
181 $identifiers .=
$ilDB->quote($id,
'text') .
',';
183 $identifiers = rtrim($identifiers,
',');
185 'SELECT value, identifier FROM lng_data WHERE identifier IN (' 189 while ($rec =
$ilDB->fetchAssoc($sql)) {
190 $titles[$rec[
'identifier']][] = $rec[
'value'];
205 foreach (self::_getStandardFieldsAsArray() as $field) {
206 if ($field[
"id"] == $field_id) {
225 foreach (self::_getStandardFieldsAsArray() as $fields_data) {
226 if (
$id == $fields_data[
'id']) {
267 if ($this->
getId() ==
'owner' || $this->
getId() ==
'last_edit_by') {
268 $join_str =
"LEFT JOIN usr_data AS sort_usr_data_{$this->getId()} ON (sort_usr_data_{$this->getId()}.usr_id = record.{$this->getId()})";
269 $select_str =
" sort_usr_data_{$this->getId()}.login AS field_{$this->getId()},";
271 $select_str =
" record.{$this->getId()} AS field_{$this->getId()},";
274 $sql_obj->setSelectStatement($select_str);
275 $sql_obj->setJoinStatement($join_str);
277 if ($this->
getId() !==
"comments") {
278 $sql_obj->setOrderStatement(
"field_{$this->getId()} " . $direction);
296 $ilDB = $DIC[
'ilDB'];
298 $where_additions =
"";
301 $join_str =
"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 " 302 .
$ilDB->quote(
"%$filter_value%",
'text') .
") ";
305 $from = (isset($filter_value[
'from'])) ? $filter_value[
'from'] : null;
306 $to = (isset($filter_value[
'to'])) ? $filter_value[
'to'] : null;
307 if (is_numeric($from)) {
308 $where_additions .=
" AND record.{$this->getId()} >= " 309 .
$ilDB->quote($from,
'integer');
311 if (is_numeric($to)) {
312 $where_additions .=
" AND record.{$this->getId()} <= " 313 .
$ilDB->quote($to,
'integer');
317 $date_from = (isset($filter_value[
'from'])
318 && is_object($filter_value[
'from'])) ? $filter_value[
'from'] : null;
319 $date_to = (isset($filter_value[
'to'])
320 && is_object($filter_value[
'to'])) ? $filter_value[
'to'] : null;
325 $where_additions .=
" AND (record.{$this->getId()} >= " 326 . strip_tags(
$ilDB->quote($date_from,
'date')) .
")";
329 $where_additions .=
" AND (record.{$this->getId()} <= " 330 . strip_tags(
$ilDB->quote($date_to,
'date')) .
")";
337 $sql_obj->setJoinStatement($join_str);
338 $sql_obj->setWhereStatement($where_additions);
349 if ($this->
getId() ==
'comments') {
362 if ($this->
getId() ==
'comments') {
366 return parent::hasNumericSorting();
376 return $this->
id !=
'comments' 388 parent::fillHeaderExcel($worksheet, $row, $col);
389 if ($this->
getId() ==
'owner') {
392 $worksheet->
setCell($row, $col,
$lng->txt(
"dcl_owner_name"));
407 $value = $excel->getCell($row, $col);
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.
static _getNonImportableStandardFieldTitles()
Class ilDclRecordQueryObject.
static _lookupId($a_user_str)
Lookup id by login.
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 _getImportableStandardFieldTitle()
static _getStandardFields($table_id)
static _getStandardFieldsAsArray()
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
Class ilDclBaseFieldModel.
const INPUTFORMAT_DATETIME
fillHeaderExcel(ilExcel $worksheet, &$row, &$col)
static _isStandardField($field_id)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
updateTableFieldSetting()
update exportable and fieldorder
setExportable($exportable)
getValueFromExcel($excel, $row, $col)
getDatatypeId()
Get datatype_id.