This commit is contained in:
Yuri Kuznetsov
2025-02-23 15:03:09 +02:00
parent ddae4383dd
commit e79e9d6ce1
12 changed files with 138 additions and 147 deletions
@@ -1,9 +0,0 @@
<div class="container content">
<div class="block-center-md">
<div class="panel panel-default">
<div class="panel-body">
<div class="complex-text">{{complexText message}}</div>
</div>
</div>
</div>
</div>
@@ -26,63 +26,63 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/call/record/detail', ['views/record/detail'], function (Dep) {
import DetailRecordView from 'views/record/detail';
return Dep.extend({
export default class extends DetailRecordView {
duplicateAction: true,
duplicateAction = true
setupActionItems: function () {
Dep.prototype.setupActionItems.call(this);
setupActionItems() {
super.setupActionItems();
if (
this.getAcl().checkModel(this.model, 'edit') &&
this.getAcl().checkField(this.entityType, 'status', 'edit')
) {
if (['Held', 'Not Held'].indexOf(this.model.get('status')) === -1) {
this.dropdownItemList.push({
'label': 'Set Held',
'name': 'setHeld',
});
this.dropdownItemList.push({
'label': 'Set Not Held',
'name': 'setNotHeld',
});
}
}
},
manageAccessEdit: function (second) {
Dep.prototype.manageAccessEdit.call(this, second);
if (second) {
if (!this.getAcl().checkModel(this.model, 'edit', true)) {
this.hideActionItem('setHeld');
this.hideActionItem('setNotHeld');
}
}
},
actionSetHeld: function () {
this.model.save({status: 'Held'}, {patch: true})
.then(() => {
Espo.Ui.success(this.translate('Saved'));
this.removeButton('setHeld');
this.removeButton('setNotHeld');
if (
this.getAcl().checkModel(this.model, 'edit') &&
this.getAcl().checkField(this.entityType, 'status', 'edit')
) {
if (!['Held', 'Not Held'].includes(this.model.attributes.status)) {
this.dropdownItemList.push({
label: 'Set Held',
name: 'setHeld',
onClick: () => this.actionSetHeld(),
});
},
actionSetNotHeld: function () {
this.model.save({status: 'Not Held'}, {patch: true})
.then(() => {
Espo.Ui.success(this.translate('Saved'));
this.removeButton('setHeld');
this.removeButton('setNotHeld');
this.dropdownItemList.push({
label: 'Set Not Held',
name: 'setNotHeld',
onClick: () => this.actionSetNotHeld(),
});
},
});
});
}
}
}
manageAccessEdit(second) {
super.manageAccessEdit(second);
if (second) {
if (!this.getAcl().checkModel(this.model, 'edit', true)) {
this.hideActionItem('setHeld');
this.hideActionItem('setNotHeld');
}
}
}
actionSetHeld() {
this.model.save({status: 'Held'}, {patch: true})
.then(() => {
Espo.Ui.success(this.translate('Saved'));
this.removeActionItem('setHeld');
this.removeActionItem('setNotHeld');
});
}
actionSetNotHeld() {
this.model.save({status: 'Not Held'}, {patch: true})
.then(() => {
Espo.Ui.success(this.translate('Saved'));
this.removeActionItem('setHeld');
this.removeActionItem('setNotHeld');
});
}
}
@@ -26,8 +26,6 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/campaign/detail', ['views/detail'], function (Dep) {
import DetailView from 'views/detail';
/** Left for bc. */
return Dep.extend({});
});
export default class extends DetailView {}
@@ -26,17 +26,27 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/campaign/tracking-url', ['view'], function (Dep) {
import View from 'view';
return Dep.extend({
export default class extends View {
template: 'crm:campaign/tracking-url',
// language=Handlebars
templateContent = `
<div class="container content">
<div class="block-center-md">
<div class="panel panel-default">
<div class="panel-body">
<div class="complex-text">{{complexText message}}</div>
</div>
</div>
</div>
</div>
`
data: function () {
return {
message: this.options.message,
};
}
});
});
data() {
// noinspection JSUnresolvedReference
return {
message: this.options.message,
};
}
}
@@ -26,8 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/case/fields/contact', ['views/fields/link'], function (Dep) {
/** Left for bc. */
import LinkFieldView from 'views/fields/link';
/** Left for bc. */
return Dep.extend({});
});
export default class extends LinkFieldView {}
@@ -26,22 +26,23 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/case/record/detail', ['views/record/detail'], function (Dep) {
import DetailRecordView from 'views/record/detail';
return Dep.extend({
export default class extends DetailRecordView {
selfAssignAction: true,
selfAssignAction = true
getSelfAssignAttributes: function () {
if (this.model.get('status') === 'New') {
if (~(this.getMetadata().get(['entityDefs', 'Case', 'fields', 'status', 'options']) || [])
.indexOf('Assigned')
) {
return {
'status': 'Assigned',
};
}
getSelfAssignAttributes() {
if (this.model.attributes.status === 'New') {
const options = this.getMetadata().get(['entityDefs', 'Case', 'fields', 'status', 'options']) || [];
if (options.includes('Assigned')) {
return {
status: 'Assigned',
};
}
},
});
});
}
return {};
}
}
@@ -26,8 +26,7 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/contact/detail', ['views/detail'], function (Dep) {
import DetailView from 'views/detail';
/** Left for bc. */
return Dep.extend({});
});
/** Left for bc. */
export default class extends DetailView {}
@@ -26,28 +26,25 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/lead/record/detail', ['views/record/detail'], function (Dep) {
import DetailRecordView from 'views/record/detail';
return Dep.extend({
export default class extends DetailRecordView {
selfAssignAction: true,
sideView: 'crm:views/lead/record/detail-side',
selfAssignAction = true
setup: function () {
Dep.prototype.setup.call(this);
},
sideView = 'crm:views/lead/record/detail-side'
getSelfAssignAttributes: function () {
if (this.model.get('status') === 'New') {
if (
~(this.getMetadata().get(['entityDefs', 'Lead', 'fields', 'status', 'options']) || [])
.indexOf('Assigned')
) {
return {
'status': 'Assigned',
};
}
getSelfAssignAttributes() {
if (this.model.attributes.status === 'New') {
const options = this.getMetadata().get(['entityDefs', 'Lead', 'fields', 'status', 'options']) || [];
if (options.includes('Assigned')) {
return {
'status': 'Assigned',
};
}
},
});
});
}
return {};
}
}
@@ -69,7 +69,7 @@ class MeetingDetailRecordView extends DetailRecordView {
}
manageAccessEdit(second) {
super.manageAccessEdit();
super.manageAccessEdit(second);
if (second && !this.getAcl().checkModel(this.model, 'edit', true)) {
this.hideActionItem('setHeld');
+2 -3
View File
@@ -26,7 +26,6 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/task/detail', ['views/detail'], function (Dep) {
import DetailView from 'views/detail';
return Dep.extend({});
});
export default class extends DetailView {}
+2 -4
View File
@@ -26,8 +26,6 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/task/list', ['views/list'], function (Dep) {
import ListView from 'views/list';
return Dep.extend({
});
});
export default class extends ListView {};
@@ -26,32 +26,31 @@
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
************************************************************************/
define('crm:views/task/record/list', ['views/record/list'], function (Dep) {
import ListRecordView from 'views/record/list';
return Dep.extend({
export default class extends ListRecordView {
rowActionsView: 'crm:views/task/record/row-actions/default',
rowActionsView = 'crm:views/task/record/row-actions/default'
actionSetCompleted: function (data) {
const id = data.id;
actionSetCompleted(data) {
const id = data.id;
if (!id) {
return;
}
if (!id) {
return;
}
const model = this.collection.get(id);
const model = this.collection.get(id);
if (!model) {
return;
}
if (!model) {
return;
}
Espo.Ui.notify(this.translate('saving', 'messages'));
Espo.Ui.notify(this.translate('saving', 'messages'));
model.save({status: 'Completed'}, {patch: true}).then(() => {
Espo.Ui.success(this.translate('Saved'));
model.save({status: 'Completed'}, {patch: true}).then(() => {
Espo.Ui.success(this.translate('Saved'));
this.collection.fetch();
});
},
});
});
this.collection.fetch();
});
}
}