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 @@ {TITLE} - - - - - - - - - + + + + + {EXTRA_INPUT} diff --git a/components/ILIAS/DataCollection/templates/default/tpl.tableview_edit_view.html b/components/ILIAS/DataCollection/templates/default/tpl.tableview_edit_view.html index c96c241279b9..be0107b72fc7 100755 --- a/components/ILIAS/DataCollection/templates/default/tpl.tableview_edit_view.html +++ b/components/ILIAS/DataCollection/templates/default/tpl.tableview_edit_view.html @@ -13,19 +13,23 @@ {TITLE} - - - - - - - - - + + + + + diff --git a/lang/ilias_de.lang b/lang/ilias_de.lang index 3b9080e393aa..e7e35c6b76a7 100644 --- a/lang/ilias_de.lang +++ b/lang/ilias_de.lang @@ -8773,7 +8773,7 @@ dcl#:#dcl_plugin_hooks#:#Verfügbare Erweiterungen dcl#:#dcl_plugin_no_hooks_available#:#Keine aktiven Field-Type Plugins gefunden. dcl#:#dcl_prev_record#:#Vorheriger Eintrag dcl#:#dcl_prop_expression#:#Ausdruck -dcl#:#dcl_prop_expression_info#:#Gültige Operatoren: %s
Unterstützte Funktionen: %s
Ausdrücke gruppieren mit Klammern: ( )
Zeichenketten und Platzhalter verbinden mit &: "Das Resultat ist " & [[Int 1]] * [[Int 2]]
Verwenden der Funktionen: SUM([[Int 1]];[[Int 2]])
Achtung: Einträge in Datums- und Zahlenfeldern in einer Formel sind als Sekunden dimensioniert und müssen beispielsweise mit 86.400 multipliziert werden.

Folgende Platzhalter können im Ausdruck eingefügt werden:
%s +dcl#:#dcl_prop_expression_info#:#Gültige Operatoren: %s
Unterstützte Funktionen: %s
Verwenden Sie Klammern "(", ")" zum Gruppieren von Ausdrücken.
Zeichenketten und Platzhalter verbinden mit &: "Das Resultat ist " & [[Int 1]] * [[Int 2]]
Verwenden der Funktionen: SUM([[Int 1]];[[Int 2]])

Gültige Felder (auf den Titel klicken um als Platzhalter in Ausdruck einzufügen):
%
(Erlaubte Felder sind Checkbox, Zahl, Text und Datum die keine Formular-sensitiven Zeichen im Titel enthalten) dcl#:#dcl_public_comments#:#Kommentare dcl#:#dcl_public_comments_desc#:#Benutzer können Datensätze dieser Tabelle kommentieren. dcl#:#dcl_rating#:#Bewertung diff --git a/lang/ilias_en.lang b/lang/ilias_en.lang index 49481ee6bac7..777c9cfbb8ed 100755 --- a/lang/ilias_en.lang +++ b/lang/ilias_en.lang @@ -8774,7 +8774,7 @@ dcl#:#dcl_plugin_hooks#:#Available Plugins dcl#:#dcl_plugin_no_hooks_available#:#No active field-type plugins found dcl#:#dcl_prev_record#:#Previous Entry dcl#:#dcl_prop_expression#:#Expression -dcl#:#dcl_prop_expression_info#:#Supported operators: %s
Supported functions: %s
Use brackets ‘(’, ‘)’ to group calculations.
Concatenate strings and placeholders with &: ‘The result is ’ & [[Int 1]] * [[Int2]]
Using functions: SUM([[Int 1]];[[Int 2]])
When using date fields and number fields in a formula, the number fields are considered seconds and must be multiplied by 86400, for example.

Available fields (click on title to copy field inside expression):
%s +dcl#:#dcl_prop_expression_info#:#Supported operators: %s
Supported functions: %s
Use brackets ‘(’, ‘)’ to group calculations.
Concatenate strings and placeholders with &: ‘The result is ’ & [[Int 1]] * [[Int2]]
Using functions: SUM([[Int 1]];[[Int 2]])

Allowed fields (click on title to copy field inside expression):
%s
(Allowed fields are boolean, number, text and date that dont contain formular-sensitive chars inside their title) dcl#:#dcl_public_comments#:#Activate Public Comments dcl#:#dcl_public_comments_desc#:#Users can comment on entries of the table. dcl#:#dcl_rating#:#Rating