row actions change

This commit is contained in:
yuri
2015-03-30 15:32:18 +03:00
parent c91365f627
commit 7201f517e8
5 changed files with 82 additions and 39 deletions
@@ -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 () {
@@ -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;
}
});
@@ -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
];
}
},
});
});
@@ -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;
},
});
});
@@ -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;
},
});