21 $message =
"Standard fields cannot be read from DB";
31 $message =
"Standard fields cannot be written to DB";
48 $this->
setLocked($original_record->getLocked());
49 $this->
setOrder($original_record->getOrder());
50 $this->
setRequired($original_record->getRequired());
51 $this->
setUnique($original_record->isUnique());
79 "title" =>
$lng->txt(
"dcl_id"),
80 "description" =>
$lng->txt(
"dcl_id_description"),
85 "id" =>
"create_date",
86 "title" =>
$lng->txt(
"dcl_creation_date"),
87 "description" =>
$lng->txt(
"dcl_creation_date_description"),
92 "id" =>
"last_update",
93 "title" =>
$lng->txt(
"dcl_last_update"),
94 "description" =>
$lng->txt(
"dcl_last_update_description"),
100 "title" =>
$lng->txt(
"dcl_owner"),
101 "description" =>
$lng->txt(
"dcl_owner_description"),
106 "id" =>
"last_edit_by",
107 "title" =>
$lng->txt(
"dcl_last_edited_by"),
108 "description" =>
$lng->txt(
"dcl_last_edited_by_description"),
114 'title' =>
$lng->txt(
'dcl_comments'),
115 'description' =>
$lng->txt(
'dcl_comments_desc'),
132 $stdFields = array();
133 foreach (self::_getStandardFieldsAsArray() as $array) {
137 $field->buildFromDBRecord($array);
138 $stdFields[] = $field;
152 $ilDB = $DIC[
'ilDB'];
159 'dcl_last_edited_by',
163 $identifiers .=
$ilDB->quote($id,
'text') .
',';
165 $identifiers = rtrim($identifiers,
',');
167 'SELECT value FROM lng_data WHERE identifier IN (' . $identifiers
171 while ($rec =
$ilDB->fetchAssoc($sql)) {
172 $titles[] = $rec[
'value'];
186 $ilDB = $DIC[
'ilDB'];
188 foreach (array(
'dcl_owner') as
$id) {
189 $identifiers .=
$ilDB->quote($id,
'text') .
',';
191 $identifiers = rtrim($identifiers,
',');
193 'SELECT value, identifier FROM lng_data WHERE identifier IN (' 197 while ($rec =
$ilDB->fetchAssoc($sql)) {
198 $titles[$rec[
'identifier']][] = $rec[
'value'];
213 foreach (self::_getStandardFieldsAsArray() as $field) {
214 if ($field[
"id"] == $field_id) {
233 foreach (self::_getStandardFieldsAsArray() as $fields_data) {
234 if (
$id == $fields_data[
'id']) {
275 if ($this->
getId() ==
'owner' || $this->
getId() ==
'last_edit_by') {
276 $join_str =
"LEFT JOIN usr_data AS sort_usr_data_{$this->getId()} ON (sort_usr_data_{$this->getId()}.usr_id = record.{$this->getId()})";
277 $select_str =
" sort_usr_data_{$this->getId()}.login AS field_{$this->getId()},";
279 $select_str =
" record.{$this->getId()} AS field_{$this->getId()},";
282 $sql_obj->setSelectStatement($select_str);
283 $sql_obj->setJoinStatement($join_str);
285 if ($this->
getId() !==
"comments") {
286 $sql_obj->setOrderStatement(
"field_{$this->getId()} " . $direction);
304 $ilDB = $DIC[
'ilDB'];
306 $where_additions =
"";
309 $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 " 310 .
$ilDB->quote(
"%$filter_value%",
'text') .
") ";
313 $from = (isset($filter_value[
'from'])) ? $filter_value[
'from'] : null;
314 $to = (isset($filter_value[
'to'])) ? $filter_value[
'to'] : null;
315 if (is_numeric(
$from)) {
316 $where_additions .=
" AND record.{$this->getId()} >= " 319 if (is_numeric($to)) {
320 $where_additions .=
" AND record.{$this->getId()} <= " 321 .
$ilDB->quote($to,
'integer');
325 $date_from = (isset($filter_value[
'from'])
326 && is_object($filter_value[
'from'])) ? $filter_value[
'from'] : null;
327 $date_to = (isset($filter_value[
'to'])
328 && is_object($filter_value[
'to'])) ? $filter_value[
'to'] : null;
333 $where_additions .=
" AND (record.{$this->getId()} >= " 334 . strip_tags(
$ilDB->quote($date_from,
'date')) .
")";
337 $where_additions .=
" AND (record.{$this->getId()} <= " 338 . strip_tags(
$ilDB->quote($date_to,
'date')) .
")";
345 $sql_obj->setJoinStatement($join_str);
346 $sql_obj->setWhereStatement($where_additions);
357 if ($this->
getId() ==
'comments') {
360 return parent::getSortField();
369 if ($this->
getId() ==
'comments') {
373 return parent::hasNumericSorting();
383 return $this->
id !=
'comments' 395 parent::fillHeaderExcel($worksheet,
$row, $col);
396 if ($this->
getId() ==
'owner') {
414 $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)
catch(Exception $e) $message
static _getStandardFieldsAsArray()
setRequired($a_required)
Set Required.
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.