diff --git a/components/ILIAS/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php b/components/ILIAS/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php index e1cc42456da9..9c646f694e3d 100755 --- a/components/ILIAS/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php +++ b/components/ILIAS/DataCollection/classes/Fields/Formula/class.ilDclFormulaFieldModel.php @@ -20,6 +20,13 @@ class ilDclFormulaFieldModel extends ilDclBaseFieldModel { + public const SUPPORTED_FIELDS = [ + ilDclDatatype::INPUTFORMAT_NUMBER, + ilDclDatatype::INPUTFORMAT_TEXT, + ilDclDatatype::INPUTFORMAT_BOOLEAN, + ilDclDatatype::INPUTFORMAT_DATETIME, + ]; + /** * Returns a query-object for building the record-loader-sql-query */ diff --git a/components/ILIAS/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php b/components/ILIAS/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php index 75f27edd481b..c63da43e691b 100755 --- a/components/ILIAS/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php +++ b/components/ILIAS/DataCollection/classes/Fields/Text/class.ilDclTextRecordRepresentation.php @@ -86,10 +86,6 @@ public function getHTML(bool $link = true, array $options = []): string $html = (is_array($value) && isset($value['link'])) ? $value['link'] : nl2br((string) $value); } - if (!$html) { - $html = ""; - } - return $html; } diff --git a/components/ILIAS/DataCollection/classes/Table/class.ilDclTable.php b/components/ILIAS/DataCollection/classes/Table/class.ilDclTable.php index 66834b998912..fff19ffa5b83 100755 --- a/components/ILIAS/DataCollection/classes/Table/class.ilDclTable.php +++ b/components/ILIAS/DataCollection/classes/Table/class.ilDclTable.php @@ -18,6 +18,8 @@ declare(strict_types=1); +use ILIAS\Modules\DataCollection\Fields\Formula\FormulaParser\Token\Tokenizer; + class ilDclTable { protected int $id = 0; @@ -528,23 +530,14 @@ public function getFirstTableViewId(int $ref_id, int $user_id = 0, bool $with_de */ public function getFieldsForFormula(): array { - $unsupported = [ - ilDclDatatype::INPUTFORMAT_ILIAS_REF, - ilDclDatatype::INPUTFORMAT_FORMULA, - ilDclDatatype::INPUTFORMAT_MOB, - ilDclDatatype::INPUTFORMAT_REFERENCELIST, - ilDclDatatype::INPUTFORMAT_REFERENCE, - ilDclDatatype::INPUTFORMAT_FILEUPLOAD, - ilDclDatatype::INPUTFORMAT_RATING, - ]; - - $this->loadCustomFields(); - $return = $this->getStandardFields(); - /** - * @var $field ilDclBaseFieldModel - */ - foreach ($this->fields as $field) { - if (!in_array($field->getDatatypeId(), $unsupported)) { + $syntax_chars = array_merge(Tokenizer::$operators, Tokenizer::$functions, ['(', ')', ',']); + foreach ($this->getFields() as $field) { + if (in_array($field->getDatatypeId(), ilDclFormulaFieldModel::SUPPORTED_FIELDS)) { + foreach ($syntax_chars as $element) { + if (str_contains($field->getTitle(), $element)) { + continue 2; + } + } $return[] = $field; } } diff --git a/components/ILIAS/DataCollection/classes/class.ilObjDataCollection.php b/components/ILIAS/DataCollection/classes/class.ilObjDataCollection.php index b0c26d326aeb..357fc5f6bfe3 100755 --- a/components/ILIAS/DataCollection/classes/class.ilObjDataCollection.php +++ b/components/ILIAS/DataCollection/classes/class.ilObjDataCollection.php @@ -192,7 +192,7 @@ public function sendNotification($a_action, $a_table_id, $a_record_id = null): v $message .= $this->prepareMessageText($t); } $message .= "------------------------------------\n"; - $message .= $ulng->txt('dcl_changed_by') . ": " . $user->getFullname() . " " . ilUserUtil::getNamePresentation($user->getId()) + $message .= $ulng->txt('dcl_changed_by') . ": " . ilUserUtil::getNamePresentation($user->getId()) . "\n\n"; $message .= $ulng->txt('dcl_change_notification_link') . ": " . $link . "\n\n"; diff --git a/components/ILIAS/DataCollection/templates/default/tpl.tableview_create_view.html b/components/ILIAS/DataCollection/templates/default/tpl.tableview_create_view.html index 08e734743795..4d3f5a27e584 100755 --- a/components/ILIAS/DataCollection/templates/default/tpl.tableview_create_view.html +++ b/components/ILIAS/DataCollection/templates/default/tpl.tableview_create_view.html @@ -1,18 +1,22 @@