27 $this->main_tpl =
$DIC->ui()->mainTemplate();
33 $ilLog =
$DIC[
'ilLog'];
34 $message =
"Standard fields cannot be read from DB";
35 $this->main_tpl->setOnScreenMessage(
'failure',
$message);
36 $ilLog->write(
"[ilDclStandardField] " .
$message);
42 $ilLog =
$DIC[
'ilLog'];
43 $message =
"Standard fields cannot be written to DB";
44 $this->main_tpl->setOnScreenMessage(
'failure',
$message);
45 $ilLog->write(
"[ilDclStandardField] " .
$message);
77 "description" =>
$lng->
txt(
"dcl_id_description"),
81 "id" =>
"create_date",
82 "title" =>
$lng->
txt(
"dcl_creation_date"),
83 "description" =>
$lng->
txt(
"dcl_creation_date_description"),
87 "id" =>
"last_update",
88 "title" =>
$lng->
txt(
"dcl_last_update"),
89 "description" =>
$lng->
txt(
"dcl_last_update_description"),
94 "title" =>
$lng->
txt(
"dcl_owner"),
95 "description" =>
$lng->
txt(
"dcl_owner_description"),
99 "id" =>
"last_edit_by",
100 "title" =>
$lng->
txt(
"dcl_last_edited_by"),
101 "description" =>
$lng->
txt(
"dcl_last_edited_by_description"),
106 'title' =>
$lng->
txt(
'dcl_comments'),
107 'description' =>
$lng->
txt(
'dcl_comments_desc'),
117 $stdFields = array();
118 foreach (self::_getStandardFieldsAsArray() as $array) {
121 $field->buildFromDBRecord($array);
122 $stdFields[] = $field;
142 'dcl_last_edited_by',
146 $identifiers .=
$ilDB->quote(
$id,
'text') .
',';
148 $identifiers = rtrim($identifiers,
',');
150 'SELECT value FROM lng_data WHERE identifier IN (' . $identifiers
154 while ($rec =
$ilDB->fetchAssoc($sql)) {
155 $titles[] = $rec[
'value'];
170 foreach (array(
'dcl_owner') as
$id) {
171 $identifiers .=
$ilDB->quote(
$id,
'text') .
',';
173 $identifiers = rtrim($identifiers,
',');
175 'SELECT value, identifier FROM lng_data WHERE identifier IN ('
179 while ($rec =
$ilDB->fetchAssoc($sql)) {
180 $titles[$rec[
'identifier']][] = $rec[
'value'];
193 foreach (self::_getStandardFieldsAsArray() as $field) {
194 if ($field[
"id"] == $field_id) {
209 foreach (self::_getStandardFieldsAsArray() as $fields_data) {
210 if (
$id == $fields_data[
'id']) {
233 string $direction =
"asc",
234 bool $sort_by_status =
false
239 if ($this->
getId() ==
'owner' || $this->
getId() ==
'last_edit_by') {
240 $join_str =
"LEFT JOIN usr_data AS sort_usr_data_{$this->getId()} ON (sort_usr_data_{$this->getId()}.usr_id = record.{$this->getId()})";
241 $select_str =
" sort_usr_data_{$this->getId()}.login AS field_{$this->getId()},";
243 $select_str =
" record.{$this->getId()} AS field_{$this->getId()},";
247 $sql_obj->setJoinStatement($join_str);
249 if ($this->
getId() !==
"comments") {
250 $sql_obj->setOrderStatement(
"field_{$this->getId()} " . $direction);
266 $where_additions =
"";
269 $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 "
270 .
$ilDB->quote(
"%$filter_value%",
'text') .
") ";
273 $from = (isset($filter_value[
'from'])) ? $filter_value[
'from'] :
null;
274 $to = (isset($filter_value[
'to'])) ? $filter_value[
'to'] :
null;
275 if (is_numeric($from)) {
276 $where_additions .=
" AND record.{$this->getId()} >= "
277 .
$ilDB->quote($from,
'integer');
279 if (is_numeric($to)) {
280 $where_additions .=
" AND record.{$this->getId()} <= "
281 .
$ilDB->quote($to,
'integer');
285 $date_from = (isset($filter_value[
'from'])
286 && is_object($filter_value[
'from'])) ? $filter_value[
'from'] :
null;
287 $date_to = (isset($filter_value[
'to'])
288 && is_object($filter_value[
'to'])) ? $filter_value[
'to'] :
null;
293 $where_additions .=
" AND (record.{$this->getId()} >= "
294 . strip_tags(
$ilDB->quote($date_from,
'date')) .
")";
297 $where_additions .=
" AND (record.{$this->getId()} <= "
298 . strip_tags(
$ilDB->quote($date_to,
'date')) .
")";
305 $sql_obj->setJoinStatement($join_str);
306 $sql_obj->setWhereStatement($where_additions);
313 if ($this->
getId() ==
'comments') {
316 return $this->getTitle();
322 if ($this->
getId() ==
'comments') {
326 return parent::hasNumericSorting();
332 return $this->
id !=
'comments'
338 parent::fillHeaderExcel($worksheet, $row, $col);
339 if ($this->
getId() ==
'owner') {
342 $worksheet->
setCell($row, $col,
$lng->txt(
"dcl_owner_name"));
352 $value = $excel->
getCell($row, $col);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
updateTableFieldSetting()
update exportable and fieldorder
setExportable(bool $exportable)
static getTableCache(int $table_id=null)
const INPUTFORMAT_DATETIME
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setSelectStatement(string $selectStatement)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getRecordQuerySortObject(string $direction="asc", bool $sort_by_status=false)
Returns a query-object for building the record-loader-sql-query.
fillHeaderExcel(ilExcel $worksheet, int &$row, int &$col)
static _getNonImportableStandardFieldTitles()
static _getStandardFields(int $table_id)
clone(ilDclStandardField $original_record)
getSortField()
Returns the sort-field id.
static _isStandardField($field_id)
getValueFromExcel(ilExcel $excel, int $row, int $col)
hasNumericSorting()
Set to true, when the sorting should be handled numerical.
static _getDatatypeForId(string $id)
gives you the datatype id of a specified standard field.
static _getStandardFieldsAsArray()
getRecordQueryFilterObject( $filter_value="", ?ilDclBaseFieldModel $sort_field=null)
Returns a query-object for building the record-loader-sql-query.
ilGlobalTemplateInterface $main_tpl
static _getImportableStandardFieldTitle()
getCell(int $a_row, int $a_col)
Returns the value of a cell.
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupId($a_user_str)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc