Skip to content

EspoCRM – Open Source CRM Application

Image capture parameter

Yurii47c98d1faf88
diff --git a/application/Espo/Resources/i18n/en_US/Admin.json b/application/Espo/Resources/i18n/en_US/Admin.json
index 3445e2b05d..3673891783 100644
--- a/application/Espo/Resources/i18n/en_US/Admin.json
+++ b/application/Espo/Resources/i18n/en_US/Admin.json
@@ -215,6 +215,7 @@
"preview": "Preview",
"attachmentField": "Attachment Field",
"maxFileSize": "Max File Size (Mb)",
+ "capture": "Capture",
"isPersonalData": "Is Personal Data",
"useIframe": "Use Iframe",
"useNumericFormat": "Use Numeric Format",
@@ -359,6 +360,10 @@
"labelType": {
"state": "State",
"regular": "Regular"
+ },
+ "capture": {
+ "user": "User",
+ "environment": "Environment"
}
},
"logicalOperators": {
diff --git a/application/Espo/Resources/i18n/en_US/FieldManager.json b/application/Espo/Resources/i18n/en_US/FieldManager.json
index f64fbc458a..ffea314d14 100644
--- a/application/Espo/Resources/i18n/en_US/FieldManager.json
+++ b/application/Espo/Resources/i18n/en_US/FieldManager.json
@@ -82,6 +82,7 @@
}
},
"tooltips": {
+ "imageCapture": "Specifies which camera to use for capture of image data.",
"optionsReference": "Re-use options from another field.",
"currencyDecimal": "Use the Decimal DB type. In the app, values will be represented as strings. Check this parameter if precision is required.",
"cutHeight": "A text higher then a specified value will be cut with a 'show more' button displayed.",
diff --git a/application/Espo/Resources/metadata/fields/image.json b/application/Espo/Resources/metadata/fields/image.json
index 68709fe0d7..787476535a 100644
--- a/application/Espo/Resources/metadata/fields/image.json
+++ b/application/Espo/Resources/metadata/fields/image.json
@@ -32,6 +32,16 @@
"tooltip": true,
"min": 0
},
+ {
+ "name": "capture",
+ "type": "enum",
+ "options": [
+ "",
+ "user",
+ "environment"
+ ],
+ "tooltip": "imageCapture"
+ },
{
"name": "readOnly",
"type": "bool"
diff --git a/client/res/templates/fields/file/edit.tpl b/client/res/templates/fields/file/edit.tpl
index a29befabef..272254689e 100644
--- a/client/res/templates/fields/file/edit.tpl
+++ b/client/res/templates/fields/file/edit.tpl
@@ -7,6 +7,7 @@
type="file"
class="file pull-right"
{{#if acceptAttribute}}accept="{{acceptAttribute}}"{{/if}}
+ {{#if capture}} capture="{{capture}}" {{/if}}
tabindex="-1"
>
</label>
diff --git a/client/src/views/fields/file.ts b/client/src/views/fields/file.ts
index 2364f612cd..b8c6565f80 100644
--- a/client/src/views/fields/file.ts
+++ b/client/src/views/fields/file.ts
@@ -62,6 +62,12 @@ export interface FileParams extends LinkParams {
* A max file size (in Mb).
*/
maxFileSize?: number;
+ /**
+ * Specifies which camera to use for capture of image data.
+ *
+ * @since 10.0.0
+ */
+ capture?: null | 'user' | 'environment';
}
export interface FileOptions extends LinkOptions {
@@ -128,6 +134,7 @@ class FileFieldView<
...super.data(),
id: this.model.get(this.idName),
acceptAttribute: this.acceptAttribute,
+ capture: this.params.capture,
} as any;
if (this.mode === this.MODE_EDIT) {