diff --git a/application/Espo/ORM/Repository/Deprecation/RDBRepositoryDeprecationTrait.php b/application/Espo/ORM/Repository/Deprecation/RDBRepositoryDeprecationTrait.php index 02f1774fa6..7fe5bdd319 100644 --- a/application/Espo/ORM/Repository/Deprecation/RDBRepositoryDeprecationTrait.php +++ b/application/Espo/ORM/Repository/Deprecation/RDBRepositoryDeprecationTrait.php @@ -30,7 +30,6 @@ namespace Espo\ORM\Repository\Deprecation; use Espo\ORM\Entity; -use Espo\ORM\Mapper\BaseMapper; /** * @internal @@ -38,21 +37,6 @@ use Espo\ORM\Mapper\BaseMapper; */ trait RDBRepositoryDeprecationTrait { - /** - * @deprecated Use QueryBuilder instead. - * @todo Rewrite usages. - */ - public function deleteFromDb(string $id, bool $onlyDeleted = false): void - { - $mapper = $this->getMapper(); - - if (!$mapper instanceof BaseMapper) { - throw new \RuntimeException("Not supported 'deleteFromDb'."); - } - - $mapper->deleteFromDb($this->entityType, $id, $onlyDeleted); - } - /** * Get an entity. If ID is NULL, a new entity is returned. * diff --git a/application/Espo/ORM/Repository/RDBRepository.php b/application/Espo/ORM/Repository/RDBRepository.php index 63dcdf5106..67d73dd492 100644 --- a/application/Espo/ORM/Repository/RDBRepository.php +++ b/application/Espo/ORM/Repository/RDBRepository.php @@ -33,7 +33,6 @@ use Espo\ORM\Defs\RelationDefs; use Espo\ORM\EntityCollection; use Espo\ORM\EntityManager; use Espo\ORM\EntityFactory; -use Espo\ORM\Collection; use Espo\ORM\Name\Attribute; use Espo\ORM\Relation\Relations; use Espo\ORM\Relation\RelationsMap; @@ -756,4 +755,15 @@ class RDBRepository implements Repository $this->getRelation($entity, $name)->relate($related); } + + public function deleteFromDb(string $id, bool $onlyDeleted = false): void + { + $mapper = $this->getMapper(); + + if (!$mapper instanceof BaseMapper) { + throw new RuntimeException("Not supported 'deleteFromDb'."); + } + + $mapper->deleteFromDb($this->entityType, $id, $onlyDeleted); + } } diff --git a/application/Espo/Resources/i18n/en_US/LayoutManager.json b/application/Espo/Resources/i18n/en_US/LayoutManager.json index 480543cf87..79b845e5de 100644 --- a/application/Espo/Resources/i18n/en_US/LayoutManager.json +++ b/application/Espo/Resources/i18n/en_US/LayoutManager.json @@ -6,7 +6,7 @@ "align": "Align", "panelName": "Panel Name", "style": "Style", - "sticked": "Sticked", + "sticked": "Stick to top", "isMuted": "Muted color", "isLarge": "Large font size", "hidden": "Hidden", diff --git a/client/src/views/lead-capture/form.js b/client/src/views/lead-capture/form.js index 393dc5d89c..6f1d95d508 100644 --- a/client/src/views/lead-capture/form.js +++ b/client/src/views/lead-capture/form.js @@ -136,6 +136,8 @@ export default class LeadCaptureFormView extends View { }); this.assignView('record', this.recordView, '.record'); + + this.whenReady().then(() => this.initAutocomplete()); } afterRender() { @@ -199,4 +201,79 @@ export default class LeadCaptureFormView extends View { }); }) } + + /** + * @private + */ + initAutocomplete() { + const emailAddressView = this.recordView.getFieldView('emailAddress'); + + if (emailAddressView) { + this.listenTo(emailAddressView, 'after:render', () => { + /** @type {HTMLInputElement} */ + const element = emailAddressView.element.querySelector('input'); + + if (element) { + element.autocomplete = 'email'; + } + }); + } + + const phoneNumberView = this.recordView.getFieldView('phoneNumber'); + + if (phoneNumberView) { + this.listenTo(phoneNumberView, 'after:render', () => { + /** @type {HTMLInputElement} */ + const element = phoneNumberView.element.querySelector('input'); + + if (element) { + element.autocomplete = 'tel'; + } + }); + } + + const nameView = this.recordView.getFieldView('name'); + + this.listenTo(nameView, 'after:render', () => { + /** @type {HTMLInputElement} */ + const elementFirst = nameView.element.querySelector('input[data-name="firstName"]'); + + if (elementFirst) { + elementFirst.autocomplete = 'given-name'; + } + + /** @type {HTMLInputElement} */ + const elementLast = nameView.element.querySelector('input[data-name="lastName"]'); + + if (elementLast) { + elementLast.autocomplete = 'family-name'; + } + }); + + const firstName = this.recordView.getFieldView('firstName'); + + if (firstName) { + this.listenTo(firstName, 'after:render', () => { + /** @type {HTMLInputElement} */ + const element = firstName.element.querySelector('input'); + + if (element) { + element.autocomplete = 'given-name'; + } + }); + } + + const lastName = this.recordView.getFieldView('lastName'); + + if (lastName) { + this.listenTo(lastName, 'after:render', () => { + /** @type {HTMLInputElement} */ + const element = lastName.element.querySelector('input'); + + if (element) { + element.autocomplete = 'family-name'; + } + }); + } + } }