This commit is contained in:
Yuri Kuznetsov
2024-08-05 10:12:55 +03:00
parent 4e3cb38477
commit 7bc8c2f161
8 changed files with 185 additions and 188 deletions
@@ -26,11 +26,10 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/detail-quick', ['views/email/record/detail'], function (Dep) {
import EmailDetailRecordView from 'views/email/record/detail';
return Dep.extend({
export default class extends EmailDetailRecordView {
isWide: true,
sideView: false,
});
});
isWide = true
sideView = false
}
+2 -3
View File
@@ -26,7 +26,6 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/detail-side', ['views/record/detail-side'], function (Dep) {
import DetailSideRecordView from 'views/record/detail-side';
return Dep.extend({});
});
export default class extends DetailSideRecordView {}
+5 -6
View File
@@ -26,11 +26,10 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/edit-quick', ['views/email/record/edit'], function (Dep) {
import EmailEditRecordView from 'views/email/record/edit';
return Dep.extend({
export default class extends EmailEditRecordView {
isWide: true,
sideView: false,
});
});
isWide = true
sideView = false
}
+16 -17
View File
@@ -26,24 +26,23 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define(
'views/email/record/list-expanded',
['views/record/list-expanded', 'views/email/record/list'],
function (Dep, List) {
import ListExpandedRecordView from 'views/record/list-expanded';
import List from 'views/email/record/list';
return Dep.extend({
export default class extends ListExpandedRecordView {
actionMarkAsImportant: function (data) {
List.prototype.actionMarkAsImportant.call(this, data);
},
// noinspection JSUnusedGlobalSymbols
actionMarkAsImportant(data) {
List.prototype.actionMarkAsImportant.call(this, data);
}
actionMarkAsNotImportant: function (data) {
List.prototype.actionMarkAsNotImportant.call(this, data);
},
// noinspection JSUnusedGlobalSymbols
actionMarkAsNotImportant(data) {
List.prototype.actionMarkAsNotImportant.call(this, data);
}
actionMoveToTrash: function (data) {
List.prototype.actionMoveToTrash.call(this, data);
},
});
});
// noinspection JSUnusedGlobalSymbols
actionMoveToTrash(data) {
List.prototype.actionMoveToTrash.call(this, data);
}
}
@@ -26,10 +26,10 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/list-related', ['views/record/list'], function (Dep) {
import ListRecordView from 'views/record/list';
return Dep.extend({
export default class extends ListRecordView {
massActionList = ['remove', 'massUpdate']
}
massActionList: ['remove', 'massUpdate'],
});
});
@@ -26,32 +26,34 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/panels/default-side', ['views/record/panels/default-side'], function (Dep) {
import DefaultSidePanelView from 'views/record/panels/default-side';
return Dep.extend({
export default class extends DefaultSidePanelView {
setupFields: function () {
Dep.prototype.setupFields.call(this);
setupFields() {
super.setupFields();
this.fieldList.push({
name: 'hasAttachment',
view: 'views/email/fields/has-attachment',
noLabel: true,
});
this.fieldList.push({
name: 'hasAttachment',
view: 'views/email/fields/has-attachment',
noLabel: true,
});
this.controlHasAttachmentField();
this.controlHasAttachmentField();
this.listenTo(this.model, 'change:hasAttachment', this.controlHasAttachmentField, this);
},
this.listenTo(this.model, 'change:hasAttachment', () => this.controlHasAttachmentField());
}
controlHasAttachmentField: function () {
if (this.model.get('hasAttachment')) {
this.recordViewObject.showField('hasAttachment');
/**
* @private
*/
controlHasAttachmentField() {
if (this.model.get('hasAttachment')) {
this.recordViewObject.showField('hasAttachment');
return;
}
return;
}
this.recordViewObject.hideField('hasAttachment');
},
});
});
this.recordViewObject.hideField('hasAttachment');
}
}
+50 -48
View File
@@ -26,62 +26,64 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/panels/event', ['views/record/panels/side'], function (Dep) {
import SidePanelView from 'views/record/panels/side';
return class extends Dep {
export default class extends SidePanelView {
setupFields() {
super.setupFields();
setupFields() {
super.setupFields();
this.fieldList.push({
name: 'icsEventDateStart',
readOnly: true,
labelText: this.translate('dateStart', 'fields', 'Meeting'),
});
this.fieldList.push({
name: 'icsEventDateStart',
readOnly: true,
labelText: this.translate('dateStart', 'fields', 'Meeting'),
});
this.fieldList.push({
name: 'createdEvent',
readOnly: true,
});
this.fieldList.push({
name: 'createdEvent',
readOnly: true,
});
this.fieldList.push({
name: 'createEvent',
readOnly: true,
noLabel: true,
});
this.fieldList.push({
name: 'createEvent',
readOnly: true,
noLabel: true,
});
this.controlEventField();
this.controlEventField();
this.listenTo(this.model, 'change:icsEventData', this.controlEventField, this);
this.listenTo(this.model, 'change:createdEventId', this.controlEventField, this);
}
controlEventField() {
if (!this.model.get('icsEventData')) {
this.recordViewObject.hideField('createEvent');
this.recordViewObject.showField('createdEvent');
return;
}
const eventData = this.model.get('icsEventData');
if (eventData.createdEvent) {
this.recordViewObject.hideField('createEvent');
this.recordViewObject.showField('createdEvent');
return;
}
if (!this.model.get('createdEventId')) {
this.recordViewObject.hideField('createdEvent');
this.recordViewObject.showField('createEvent');
return;
}
this.listenTo(this.model, 'change:icsEventData', this.controlEventField, this);
this.listenTo(this.model, 'change:createdEventId', this.controlEventField, this);
}
/**
* @private
*/
controlEventField() {
if (!this.model.get('icsEventData')) {
this.recordViewObject.hideField('createEvent');
this.recordViewObject.showField('createdEvent');
return;
}
};
});
const eventData = this.model.get('icsEventData');
if (eventData.createdEvent) {
this.recordViewObject.hideField('createEvent');
this.recordViewObject.showField('createdEvent');
return;
}
if (!this.model.get('createdEventId')) {
this.recordViewObject.hideField('createdEvent');
this.recordViewObject.showField('createEvent');
return;
}
this.recordViewObject.hideField('createEvent');
this.recordViewObject.showField('createdEvent');
}
}
@@ -26,99 +26,96 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('views/email/record/row-actions/dashlet', ['views/record/row-actions/default'], function (Dep) {
import DefaultRowActionsView from 'views/record/row-actions/default';
return Dep.extend({
export default class extends DefaultRowActionsView {
setup: function () {
Dep.prototype.setup.call(this);
setup() {
super.setup();
this.listenTo(this.model, 'change:isImportant', () => {
setTimeout(() => {
this.reRender();
}, 10);
});
},
this.listenTo(this.model, 'change:isImportant', () => {
setTimeout(() => this.reRender(), 10);
});
}
getActionList: function () {
var list = [{
action: 'quickView',
label: 'View',
data: {
id: this.model.id
},
groupIndex: 0,
}];
getActionList() {
let list = [{
action: 'quickView',
label: 'View',
data: {
id: this.model.id
},
groupIndex: 0,
}];
if (this.options.acl.edit) {
list = list.concat([
{
action: 'quickEdit',
label: 'Edit',
data: {
id: this.model.id
},
groupIndex: 0,
}
]);
}
if (this.model.get('isUsers') && this.model.get('status') !== 'Draft') {
if (!this.model.get('inTrash')) {
list.push({
action: 'moveToTrash',
label: 'Move to Trash',
data: {
id: this.model.id
},
groupIndex: 1,
});
} else {
list.push({
action: 'retrieveFromTrash',
label: 'Retrieve from Trash',
data: {
id: this.model.id
},
groupIndex: 1,
});
}
}
if (this.getAcl().checkModel(this.model, 'delete')) {
list.push({
action: 'quickRemove',
label: 'Remove',
if (this.options.acl.edit) {
list = list.concat([
{
action: 'quickEdit',
label: 'Edit',
data: {
id: this.model.id
},
groupIndex: 0,
}
]);
}
if (this.model.get('isUsers') && this.model.get('status') !== 'Draft') {
if (!this.model.get('inTrash')) {
list.push({
action: 'moveToTrash',
label: 'Move to Trash',
data: {
id: this.model.id
},
groupIndex: 1,
});
} else {
list.push({
action: 'retrieveFromTrash',
label: 'Retrieve from Trash',
data: {
id: this.model.id
},
groupIndex: 1,
});
}
}
if (this.model.get('isUsers')) {
if (!this.model.get('isImportant')) {
list.push({
action: 'markAsImportant',
label: 'Mark as Important',
data: {
id: this.model.id
},
groupIndex: 1,
});
} else {
list.push({
action: 'markAsNotImportant',
label: 'Unmark Importance',
data: {
id: this.model.id
},
groupIndex: 1,
});
}
if (this.getAcl().checkModel(this.model, 'delete')) {
list.push({
action: 'quickRemove',
label: 'Remove',
data: {
id: this.model.id
},
groupIndex: 0,
});
}
if (this.model.get('isUsers')) {
if (!this.model.get('isImportant')) {
list.push({
action: 'markAsImportant',
label: 'Mark as Important',
data: {
id: this.model.id
},
groupIndex: 1,
});
} else {
list.push({
action: 'markAsNotImportant',
label: 'Unmark Importance',
data: {
id: this.model.id
},
groupIndex: 1,
});
}
}
return list;
},
});
});
return list;
}
}