From 048f65c8f6d2f7db4fb3299ec62223cc915345d0 Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 3 Aug 2018 11:52:59 +0300 Subject: [PATCH] record view ref --- client/modules/crm/src/views/lead/convert.js | 1 + client/res/templates/record/detail.tpl | 39 +------------------- client/res/templates/record/edit.tpl | 30 +++------------ client/src/views/modals/compose-email.js | 2 +- client/src/views/modals/detail.js | 2 +- client/src/views/modals/edit.js | 2 +- client/src/views/record/detail.js | 16 ++++---- 7 files changed, 19 insertions(+), 73 deletions(-) diff --git a/client/modules/crm/src/views/lead/convert.js b/client/modules/crm/src/views/lead/convert.js index 337ea21030..a585ac9972 100644 --- a/client/modules/crm/src/views/lead/convert.js +++ b/client/modules/crm/src/views/lead/convert.js @@ -106,6 +106,7 @@ Espo.define('crm:views/lead/convert', 'view', function (Dep) { model: model, el: '#main .edit-container-' + Espo.Utils.toDom(scope), buttonsPosition: false, + buttonsDisabled: true, layoutName: 'detailConvert', exit: function () {}, }, function (view) { diff --git a/client/res/templates/record/detail.tpl b/client/res/templates/record/detail.tpl index e43635cbc5..052128f3e7 100644 --- a/client/res/templates/record/detail.tpl +++ b/client/res/templates/record/detail.tpl @@ -1,5 +1,5 @@
- {{#if buttonsTop}} + {{#unless buttonsDisabled}}
{{#each buttonList}}{{button name scope=../../entityType label=label style=style hidden=hidden html=html}}{{/each}} @@ -42,8 +42,7 @@ {{/if}}
- {{/if}} - + {{/unless}}
@@ -55,38 +54,4 @@ {{{side}}}
- - {{#if buttonsBottom}} -
-
- {{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}} - {{#if dropdownItemList}} - - -
- {{/if}} -
-
- - {{/if}} diff --git a/client/res/templates/record/edit.tpl b/client/res/templates/record/edit.tpl index a9e9015771..b7292068d5 100644 --- a/client/res/templates/record/edit.tpl +++ b/client/res/templates/record/edit.tpl @@ -1,5 +1,5 @@
- {{#if buttonsTop}} + {{#unless buttonsDisabled}}
{{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}} @@ -15,36 +15,16 @@ {{/if}}
- {{/if}} - + {{/unless}}
-
+
{{{middle}}}
{{{extra}}}
{{{bottom}}}
-
+
{{{side}}}
- - - {{#if buttonsBottom}} -
-
- {{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}} - {{#if dropdownItemList}} - - - {{/if}} -
-
- {{/if}} -
\ No newline at end of file +
diff --git a/client/src/views/modals/compose-email.js b/client/src/views/modals/compose-email.js index da635dc226..4d1ff67611 100644 --- a/client/src/views/modals/compose-email.js +++ b/client/src/views/modals/compose-email.js @@ -80,7 +80,7 @@ Espo.define('views/modals/compose-email', 'views/modals/edit', function (Dep) { type: 'editSmall', layoutName: this.layoutName || 'detailSmall', columnCount: this.columnCount, - buttonsPosition: false, + buttonsDisabled: true, selectTemplateDisabled: this.options.selectTemplateDisabled, removeAttachmentsOnSelectTemplate: this.options.removeAttachmentsOnSelectTemplate, signatureDisabled: this.options.signatureDisabled, diff --git a/client/src/views/modals/detail.js b/client/src/views/modals/detail.js index 1eddb6d232..0ee2e550e7 100644 --- a/client/src/views/modals/detail.js +++ b/client/src/views/modals/detail.js @@ -239,7 +239,7 @@ Espo.define('views/modals/detail', 'views/modal', function (Dep) { type: 'detailSmall', layoutName: this.layoutName || 'detailSmall', columnCount: this.columnCount, - buttonsPosition: false, + buttonsDisabled: true, inlineEditDisabled: true, sideDisabled: this.sideDisabled, bottomDisabled: this.bottomDisabled, diff --git a/client/src/views/modals/edit.js b/client/src/views/modals/edit.js index 58bd4465f9..e3f76b44dc 100644 --- a/client/src/views/modals/edit.js +++ b/client/src/views/modals/edit.js @@ -151,7 +151,7 @@ Espo.define('views/modals/edit', 'views/modal', function (Dep) { type: 'editSmall', layoutName: this.layoutName || 'detailSmall', columnCount: this.columnCount, - buttonsPosition: false, + buttonsDisabled: true, sideDisabled: this.sideDisabled, bottomDisabled: this.bottomDisabled, exit: function () {} diff --git a/client/src/views/record/detail.js b/client/src/views/record/detail.js index 5047e3ad67..4e80b0e2eb 100644 --- a/client/src/views/record/detail.js +++ b/client/src/views/record/detail.js @@ -44,10 +44,7 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'], detailLayout: null, - /** - * @property {string} or {bool} ['both', 'top', 'bottom', false, true] Where to display buttons. - */ - buttonsPosition: 'top', + buttonsDisabled: false, columnCount: 2, @@ -607,8 +604,7 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'], dropdownItemList: this.dropdownItemList, dropdownEditItemList: this.dropdownEditItemList, dropdownItemListEmpty: this.isDropdownItemListEmpty(), - buttonsTop: this.buttonsPosition === 'both' || this.buttonsPosition === true || this.buttonsPosition === 'top', - buttonsBottom: this.buttonsPosition === 'both' || this.buttonsPosition === true || this.buttonsPosition === 'bottom', + buttonsDisabled: this.buttonsDisabled, name: this.name, id: this.id, isWide: this.isWide, @@ -710,8 +706,12 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'], } } - if ('buttonsPosition' in this.options) { - this.buttonsPosition = this.options.buttonsPosition; + this.buttonsDisabled = this.options.buttonsDisabled || this.buttonsDisabled; + + // for backward compatibility + // TODO remove in 5.6.0 + if ('buttonsPosition' in this.options && !this.options.buttonsPosition) { + this.buttonsDisabled = true; } if ('isWide' in this.options) {