This commit is contained in:
Yuri Kuznetsov
2021-12-24 11:19:33 +02:00
parent 9f932462a8
commit 31a2ef63ec
20 changed files with 100 additions and 74 deletions

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('crm:views/record/row-actions/activities-dashlet', 'views/record/row-actions/view-and-edit', function (Dep) {
define('crm:views/record/row-actions/activities-dashlet', 'views/record/row-actions/view-and-edit', function (Dep) {
return Dep.extend({
@@ -37,10 +37,9 @@ Espo.define('crm:views/record/row-actions/activities-dashlet', 'views/record/row
actionList.forEach(function (item) {
item.data = item.data || {};
item.data.scope = this.model.name
item.data.scope = this.model.name;
}, this);
if (scope === 'Task') {
if (this.options.acl.edit && !~['Completed', 'Canceled'].indexOf(this.model.get('status'))) {
actionList.push({
@@ -71,6 +70,7 @@ Espo.define('crm:views/record/row-actions/activities-dashlet', 'views/record/row
});
}
}
if (this.options.acl.edit) {
actionList.push({
action: 'quickRemove',
@@ -83,7 +83,7 @@ Espo.define('crm:views/record/row-actions/activities-dashlet', 'views/record/row
}
return actionList;
}
});
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions/relationship', function (Dep) {
define('crm:views/record/row-actions/activities', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -48,6 +49,7 @@ Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions
},
link: '#' + this.model.name + '/edit/' + this.model.id
});
if (this.model.name == 'Meeting' || this.model.name == 'Call') {
list.push({
action: 'setHeld',
@@ -56,6 +58,7 @@ Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions
id: this.model.id
}
});
list.push({
action: 'setNotHeld',
html: this.translate('Set Not Held', 'labels', 'Meeting'),
@@ -65,6 +68,7 @@ Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions
});
}
}
if (this.options.acl.delete) {
list.push({
action: 'removeRelated',
@@ -74,10 +78,9 @@ Espo.define('crm:views/record/row-actions/activities', 'views/record/row-actions
}
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('crm:views/record/row-actions/history', 'views/record/row-actions/relationship', function (Dep) {
define('crm:views/record/row-actions/history', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('crm:views/record/row-actions/history', 'views/record/row-actions/re
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.model.name == 'Email') {
list.push({
action: 'reply',
@@ -48,6 +49,7 @@ Espo.define('crm:views/record/row-actions/history', 'views/record/row-actions/re
}
});
}
if (this.options.acl.edit) {
list = list.concat([
{
@@ -60,6 +62,7 @@ Espo.define('crm:views/record/row-actions/history', 'views/record/row-actions/re
}
]);
}
if (this.options.acl.delete) {
list.push({
action: 'removeRelated',
@@ -69,9 +72,9 @@ Espo.define('crm:views/record/row-actions/history', 'views/record/row-actions/re
}
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('crm:views/record/row-actions/relationship-target', 'views/record/row-actions/relationship-unlink-only', function (Dep) {
define('crm:views/record/row-actions/relationship-target', 'views/record/row-actions/relationship-unlink-only', function (Dep) {
return Dep.extend({
@@ -52,9 +52,9 @@ Espo.define('crm:views/record/row-actions/relationship-target', 'views/record/ro
});
}
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('crm:views/record/row-actions/tasks', 'views/record/row-actions/relationship-no-unlink', function (Dep) {
define('crm:views/record/row-actions/tasks', 'views/record/row-actions/relationship-no-unlink', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('crm:views/record/row-actions/tasks', 'views/record/row-actions/rela
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -59,6 +60,7 @@ Espo.define('crm:views/record/row-actions/tasks', 'views/record/row-actions/rela
});
}
}
if (this.options.acl.delete) {
list.push({
action: 'removeRelated',
@@ -68,9 +70,9 @@ Espo.define('crm:views/record/row-actions/tasks', 'views/record/row-actions/rela
}
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/default-kanban', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.statusFieldIsEditable) {
list.push({
action: 'moveOver',
@@ -48,6 +49,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
}
});
}
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -58,6 +60,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -68,7 +71,7 @@ Espo.define('views/record/row-actions/default-kanban', 'views/record/row-actions
});
}
return list;
}
});
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/default', 'view', function (Dep) {
define('views/record/row-actions/default', 'view', function (Dep) {
return Dep.extend({
@@ -37,22 +37,27 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
},
afterRender: function () {
var $dd = this.$el.find('button[data-toggle="dropdown"]').parent();
let $dd = this.$el.find('button[data-toggle="dropdown"]').parent();
let isChecked = false;
$dd.on('show.bs.dropdown', () => {
let $el = this.$el.closest('.list-row');
var isChecked = false;
$dd.on('show.bs.dropdown', function () {
var $el = this.$el.closest('.list-row');
isChecked = false;
if ($el.hasClass('active')) {
isChecked = true;
}
$el.addClass('active');
}.bind(this));
$dd.on('hide.bs.dropdown', function () {
});
$dd.on('hide.bs.dropdown', () => {
if (!isChecked) {
this.$el.closest('.list-row').removeClass('active');
}
}.bind(this));
});
},
getActionList: function () {
@@ -62,8 +67,9 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
data: {
id: this.model.id
},
link: '#' + this.model.name + '/view/' + this.model.id
link: '#' + this.model.name + '/view/' + this.model.id,
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -71,18 +77,20 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
data: {
id: this.model.id
},
link: '#' + this.model.name + '/edit/' + this.model.id
link: '#' + this.model.name + '/edit/' + this.model.id,
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
label: 'Remove',
data: {
id: this.model.id
id: this.model.id,
}
});
}
return list;
},
@@ -90,9 +98,9 @@ Espo.define('views/record/row-actions/default', 'view', function (Dep) {
return {
acl: this.options.acl,
actionList: this.getActionList(),
scope: this.model.name
scope: this.model.name,
};
}
});
},
});
});

View File

@@ -26,12 +26,13 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/edit-and-remove', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
getActionList: function () {
var list = [];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -42,6 +43,7 @@ Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-action
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -51,9 +53,9 @@ Espo.define('views/record/row-actions/edit-and-remove', 'views/record/row-action
}
});
}
return list;
}
},
});
});

View File

@@ -32,7 +32,7 @@ define('views/record/row-actions/empty', 'views/record/row-actions/default', fun
getActionList: function () {
return [];
}
},
});
});

View File

@@ -26,12 +26,13 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-edit-and-remove', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
getActionList: function () {
var list = [];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -41,6 +42,7 @@ Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/reco
}
});
}
if (this.options.acl.delete) {
list.push({
action: 'quickRemove',
@@ -51,8 +53,7 @@ Espo.define('views/record/row-actions/relationship-edit-and-remove', 'views/reco
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-no-remove', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -58,9 +59,9 @@ Espo.define('views/record/row-actions/relationship-no-remove', 'views/record/row
});
}
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-no-unlink', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list = list.concat([
{
@@ -51,6 +52,7 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
}
]);
}
if (this.options.acl.delete) {
list.push({
action: 'removeRelated',
@@ -60,8 +62,9 @@ Espo.define('views/record/row-actions/relationship-no-unlink', 'views/record/row
}
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-remove-only', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-remove-only', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -42,9 +42,7 @@ Espo.define('views/record/row-actions/relationship-remove-only', 'views/record/r
}
];
}
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-unlink-only', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-unlink-only', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -42,6 +42,7 @@ Espo.define('views/record/row-actions/relationship-unlink-only', 'views/record/r
}
];
}
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-view-and-edit', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -49,10 +50,10 @@ Espo.define('views/record/row-actions/relationship-view-and-edit', 'views/record
link: '#' + this.model.name + '/edit/' + this.model.id
});
}
return list;
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/record/row-actions/relationship', function (Dep) {
define('views/record/row-actions/relationship-view-and-unlink', 'views/record/row-actions/relationship', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/reco
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit && !this.options.unlinkDisabled) {
list.push({
action: 'unlinkRelated',
@@ -52,5 +53,4 @@ Espo.define('views/record/row-actions/relationship-view-and-unlink', 'views/reco
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/relationship', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list.push({
action: 'quickEdit',
@@ -48,6 +49,7 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
},
link: '#' + this.model.name + '/edit/' + this.model.id
});
if (!this.options.unlinkDisabled) {
list.push({
action: 'unlinkRelated',
@@ -68,9 +70,9 @@ Espo.define('views/record/row-actions/relationship', 'views/record/row-actions/d
}
});
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-and-edit', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.edit) {
list = list.concat([
{
@@ -51,11 +52,9 @@ Espo.define('views/record/row-actions/view-and-edit', 'views/record/row-actions/
}
]);
}
return list;
}
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-and-remove', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -39,6 +39,7 @@ Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-action
},
link: '#' + this.model.name + '/view/' + this.model.id
}];
if (this.options.acl.delete) {
actionList.push({
action: 'quickRemove',
@@ -49,8 +50,9 @@ Espo.define('views/record/row-actions/view-and-remove', 'views/record/row-action
});
}
return actionList;
}
});
return actionList;
},
});
});

View File

@@ -26,7 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
Espo.define('views/record/row-actions/view-only', 'views/record/row-actions/default', function (Dep) {
define('views/record/row-actions/view-only', 'views/record/row-actions/default', function (Dep) {
return Dep.extend({
@@ -41,10 +41,7 @@ Espo.define('views/record/row-actions/view-only', 'views/record/row-actions/defa
link: '#' + this.model.name + '/view/' + this.model.id
}
];
}
},
});
});