diff --git a/frontend/client/src/views/record/row-actions/default.js b/frontend/client/src/views/record/row-actions/default.js index f50b6af604..8331ed40bd 100644 --- a/frontend/client/src/views/record/row-actions/default.js +++ b/frontend/client/src/views/record/row-actions/default.js @@ -26,15 +26,15 @@ Espo.define('Views.Record.RowActions.Default', 'View', function (Dep) { template: 'record.row-actions.default', getActions: function () { + var list = [{ + action: 'quickView', + label: 'View', + data: { + id: this.model.id + } + }]; if (this.options.acl.edit) { - return [ - { - action: 'quickView', - label: 'View', - data: { - id: this.model.id - } - }, + list = list.concat([ { action: 'quickEdit', label: 'Edit', @@ -49,8 +49,9 @@ Espo.define('Views.Record.RowActions.Default', 'View', function (Dep) { id: this.model.id } } - ]; + ]); } + return list; }, data: function () { diff --git a/frontend/client/src/views/record/row-actions/relationship-no-unlink.js b/frontend/client/src/views/record/row-actions/relationship-no-unlink.js index 846c2ee0e6..2cd91f846c 100644 --- a/frontend/client/src/views/record/row-actions/relationship-no-unlink.js +++ b/frontend/client/src/views/record/row-actions/relationship-no-unlink.js @@ -24,15 +24,15 @@ Espo.define('Views.Record.RowActions.RelationshipNoUnlink', 'Views.Record.RowAct return Dep.extend({ getActions: function () { + var list = [{ + action: 'viewRelated', + label: 'View', + data: { + id: this.model.id + } + }]; if (this.options.acl.edit) { - var list = [ - { - action: 'viewRelated', - label: 'View', - data: { - id: this.model.id - } - }, + list = list.concat([ { action: 'editRelated', label: 'Edit', @@ -47,13 +47,10 @@ Espo.define('Views.Record.RowActions.RelationshipNoUnlink', 'Views.Record.RowAct id: this.model.id } } - ] - if (this.model.name == 'User') { - return []; - } - return list; + ]); } - }, + return list; + } }); diff --git a/frontend/client/src/views/record/row-actions/relationship-unlink-only.js b/frontend/client/src/views/record/row-actions/relationship-unlink-only.js index 4cc7af14d3..2db1d87007 100644 --- a/frontend/client/src/views/record/row-actions/relationship-unlink-only.js +++ b/frontend/client/src/views/record/row-actions/relationship-unlink-only.js @@ -17,8 +17,8 @@ * * You should have received a copy of the GNU General Public License * along with EspoCRM. If not, see http://www.gnu.org/licenses/. - ************************************************************************/ - + ************************************************************************/ + Espo.define('Views.Record.RowActions.RelationshipUnlinkOnly', 'Views.Record.RowActions.Relationship', function (Dep) { return Dep.extend({ @@ -36,7 +36,6 @@ Espo.define('Views.Record.RowActions.RelationshipUnlinkOnly', 'Views.Record.RowA ]; } }, - }); }); diff --git a/frontend/client/src/views/record/row-actions/relationship-view-and-edit.js b/frontend/client/src/views/record/row-actions/relationship-view-and-edit.js new file mode 100644 index 0000000000..4df25ed69e --- /dev/null +++ b/frontend/client/src/views/record/row-actions/relationship-view-and-edit.js @@ -0,0 +1,49 @@ +/************************************************************************ + * This file is part of EspoCRM. + * + * EspoCRM - Open Source CRM application. + * Copyright (C) 2014-2015 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/. + ************************************************************************/ + +Espo.define('Views.Record.RowActions.RelationshipViewAndEdit', 'Views.Record.RowActions.Relationship', function (Dep) { + + return Dep.extend({ + + getActions: function () { + var list = [{ + action: 'viewRelated', + label: 'View', + data: { + id: this.model.id + } + }]; + if (this.options.acl.edit) { + list.push({ + action: 'editRelated', + label: 'Edit', + data: { + id: this.model.id + } + }); + } + return list; + }, + + }); + +}); + diff --git a/frontend/client/src/views/record/row-actions/relationship.js b/frontend/client/src/views/record/row-actions/relationship.js index 3f477847ae..aa60107614 100644 --- a/frontend/client/src/views/record/row-actions/relationship.js +++ b/frontend/client/src/views/record/row-actions/relationship.js @@ -24,15 +24,15 @@ Espo.define('Views.Record.RowActions.Relationship', 'Views.Record.RowActions.Def return Dep.extend({ getActions: function () { + var list = [{ + action: 'viewRelated', + label: 'View', + data: { + id: this.model.id + } + }]; if (this.options.acl.edit) { - var list = [ - { - action: 'viewRelated', - label: 'View', - data: { - id: this.model.id - } - }, + list = list.concat([ { action: 'editRelated', label: 'Edit', @@ -54,12 +54,9 @@ Espo.define('Views.Record.RowActions.Relationship', 'Views.Record.RowActions.Def id: this.model.id } } - ] - if (this.model.name == 'User') { - return []; - } - return list; + ]); } + return list; }, });