From 0db2dbc0f387e9d2daf11a157e0f2e8bda043bb1 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 13 Sep 2019 14:57:47 +0300 Subject: [PATCH] field manager custom field tooltip --- application/Espo/Resources/i18n/en_US/FieldManager.json | 1 + .../Espo/Resources/metadata/fields/attachmentMultiple.json | 3 ++- application/Espo/Resources/metadata/fields/file.json | 3 ++- client/src/views/admin/field-manager/edit.js | 7 ++++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/Espo/Resources/i18n/en_US/FieldManager.json b/application/Espo/Resources/i18n/en_US/FieldManager.json index 1cee2654e8..e0a245292d 100644 --- a/application/Espo/Resources/i18n/en_US/FieldManager.json +++ b/application/Espo/Resources/i18n/en_US/FieldManager.json @@ -74,6 +74,7 @@ "before": "The date value should be before the date value of the specified field.", "after": "The date value should be after the date value of the specified field.", "readOnly": "Field value can't be specified by user. But can be calculated by formula.", + "fileAccept": "Which file types to accept. It's possible to add custom items.", "maxFileSize": "If empty or 0 then no limit." }, "fieldParts": { diff --git a/application/Espo/Resources/metadata/fields/attachmentMultiple.json b/application/Espo/Resources/metadata/fields/attachmentMultiple.json index d38067f392..f3e09c0c49 100644 --- a/application/Espo/Resources/metadata/fields/attachmentMultiple.json +++ b/application/Espo/Resources/metadata/fields/attachmentMultiple.json @@ -32,7 +32,8 @@ "audio/*", "video/*", ".pdf" - ] + ], + "tooltip": "fileAccept" } ], "actualFields":[ diff --git a/application/Espo/Resources/metadata/fields/file.json b/application/Espo/Resources/metadata/fields/file.json index f8a4dcb77b..4d04c3d270 100644 --- a/application/Espo/Resources/metadata/fields/file.json +++ b/application/Espo/Resources/metadata/fields/file.json @@ -26,7 +26,8 @@ "audio/*", "video/*", ".pdf" - ] + ], + "tooltip": "fileAccept" }, { "name":"audited", diff --git a/client/src/views/admin/field-manager/edit.js b/client/src/views/admin/field-manager/edit.js index 902ca2c4f1..01784c4b67 100644 --- a/client/src/views/admin/field-manager/edit.js +++ b/client/src/views/admin/field-manager/edit.js @@ -256,7 +256,12 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep, var options = {}; if (o.tooltip || ~this.paramWithTooltipList.indexOf(o.name)) { options.tooltip = true; - options.tooltipText = this.translate(o.name, 'tooltips', 'FieldManager'); + + var tooltip = o.name; + if (typeof o.tooltip == 'string') { + tooltip = o.tooltip; + } + options.tooltipText = this.translate(tooltip, 'tooltips', 'FieldManager'); } this.createFieldView(o.type, o.name, null, o, options); }, this);