diff --git a/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmall.json b/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmall.json index 550fdcb1e3..257f53d071 100644 --- a/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmall.json +++ b/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmall.json @@ -1,5 +1,4 @@ [ - {"name":"status", "width": 30, "notSortable": true}, - {"name":"target", "notSortable": true}, - {"name":"executionTime", "width": 30, "notSortable": true} + {"name":"status", "notSortable": true}, + {"name":"executionTime", "width": 25, "notSortable": true} ] diff --git a/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmallWithTarget.json b/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmallWithTarget.json new file mode 100644 index 0000000000..014542b92b --- /dev/null +++ b/application/Espo/Resources/layouts/ScheduledJobLogRecord/listSmallWithTarget.json @@ -0,0 +1,5 @@ +[ + {"name":"status", "width": 30, "notSortable": true}, + {"name":"target", "notSortable": true}, + {"name":"executionTime", "width": 25, "notSortable": true} +] diff --git a/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json b/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json index e3ef4cf6c1..8fa717979a 100644 --- a/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json +++ b/application/Espo/Resources/metadata/clientDefs/ScheduledJob.json @@ -1,15 +1,19 @@ { - "controller": "controllers/record", - "relationshipPanels":{ - "log":{ - "readOnly": true - } - }, - "recordViews":{ - "list": "views/scheduled-job/record/list", - "detail": "views/scheduled-job/record/detail" - }, - "views": { - "list": "views/scheduled-job/list" - } + "controller": "controllers/record", + "relationshipPanels": { + "log": { + "readOnly": true, + "view": "views/scheduled-job/record/panels/log" + } + }, + "recordViews":{ + "list": "views/scheduled-job/record/list", + "detail": "views/scheduled-job/record/detail" + }, + "views": { + "list": "views/scheduled-job/list" + }, + "jobWithTargetList": [ + "CheckEmailAccounts" + ] } diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js index 7daa91416a..8a220e32d6 100644 --- a/client/src/views/record/panels/relationship.js +++ b/client/src/views/record/panels/relationship.js @@ -111,6 +111,12 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' this.setupActions(); var layoutName = 'listSmall'; + this.setupListLayout(); + + if (this.listLayoutName) { + layoutName = this.listLayoutName; + } + var listLayout = null; var layout = this.defs.layout || null; if (layout) { @@ -120,7 +126,8 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' layoutName = 'listRelationshipCustom'; listLayout = layout; } - } + } + var sortBy = this.defs.sortBy || null; var asc = this.defs.asc || null; @@ -176,6 +183,8 @@ Espo.define('views/record/panels/relationship', ['views/record/panels/bottom', ' this.setupFilterActions(); }, + setupListLayout: function () {}, + setupActions: function () {}, setupFilterActions: function () { diff --git a/client/src/views/scheduled-job/record/panels/log.js b/client/src/views/scheduled-job/record/panels/log.js new file mode 100644 index 0000000000..119b83f1e9 --- /dev/null +++ b/client/src/views/scheduled-job/record/panels/log.js @@ -0,0 +1,41 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2018 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + * Website: http://www.espocrm.com + * + * EspoCRM is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * EspoCRM is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with EspoCRM. If not, see http://www.gnu.org/licenses/. + * + * The interactive user interfaces in modified source and object code versions + * of this program must display Appropriate Legal Notices, as required under + * Section 5 of the GNU General Public License version 3. + * + * In accordance with Section 7(b) of the GNU General Public License version 3, + * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. + ************************************************************************/ + +Espo.define('views/scheduled-job/record/panels/log', 'views/record/panels/relationship', function (Dep) { + + return Dep.extend({ + + setupListLayout: function () { + var jobWithTargetList = this.getMetadata().get(['clientDefs', 'ScheduledJob', 'jobWithTargetList']) || []; + if (~jobWithTargetList.indexOf(this.model.get('job'))) { + this.listLayoutName = 'listSmallWithTarget' + } + } + + }); +});