diff --git a/frontend/client/src/views/record/detail-bottom.js b/frontend/client/src/views/record/detail-bottom.js index 1089d38573..10a8bf1261 100644 --- a/frontend/client/src/views/record/detail-bottom.js +++ b/frontend/client/src/views/record/detail-bottom.js @@ -58,7 +58,7 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) { var panels = Espo.Utils.clone(this.getMetadata().get('clientDefs.' + scope + '.bottomPanels.' + this.mode) || []); if (this.mode == 'detail' && this.getMetadata().get('scopes.' + scope + '.stream')) { - panels.unshift({ + panels.push({ "name":"stream", "label":"Stream", "view":"Stream.Panel", @@ -157,6 +157,29 @@ Espo.define('Views.Record.DetailBottom', 'View', function (Dep) { return filtered; }, + getFields: function () { + var fields = {}; + this.panels.forEach(function (p) { + var panel = this.getView(p.name); + if ('getFields' in panel) { + fields = _.extend(fields, panel.getFields()); + } + }, this); + return fields; + }, + + fetch: function () { + var data = {}; + + this.panels.forEach(function (p) { + var panel = this.getView(p.name); + if ('fetch' in panel) { + data = _.extend(data, panel.fetch()); + } + }, this); + return data; + }, + }); }); diff --git a/frontend/client/src/views/record/detail-side.js b/frontend/client/src/views/record/detail-side.js index 655ebbcd39..2e59a176fa 100644 --- a/frontend/client/src/views/record/detail-side.js +++ b/frontend/client/src/views/record/detail-side.js @@ -143,6 +143,18 @@ return fields; }, + fetch: function () { + var data = {}; + + this.panels.forEach(function (p) { + var panel = this.getView(p.name); + if ('fetch' in panel) { + data = _.extend(data, panel.fetch()); + } + }, this); + return data; + }, + filterActions: function (actions) { var filtered = []; actions.forEach(function (item) { diff --git a/frontend/client/src/views/record/detail.js b/frontend/client/src/views/record/detail.js index b171352729..a93ccc519c 100644 --- a/frontend/client/src/views/record/detail.js +++ b/frontend/client/src/views/record/detail.js @@ -196,6 +196,17 @@ Espo.define('Views.Record.Detail', 'Views.Record.Base', function (Dep) { } }, + fetch: function () { + var data = Dep.prototype.fetch.call(this); + if (this.hasView('side')) { + data = _.extend(data, this.getView('side').fetch()); + } + if (this.hasView('bottom')) { + data = _.extend(data, this.getView('bottom').fetch()); + } + return data; + }, + setEditMode: function () { this.$el.find('.record-buttons').addClass('hidden'); this.$el.find('.edit-buttons').removeClass('hidden'); @@ -263,6 +274,9 @@ Espo.define('Views.Record.Detail', 'Views.Record.Base', function (Dep) { if (this.hasView('side')) { _.extend(fields, this.getView('side').getFields()); } + if (this.hasView('bottom')) { + _.extend(fields, this.getView('bottom').getFields()); + } return fields; },