merge
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
"sortBy": "dateStart",
|
||||
"asc": true,
|
||||
"displayRecords": 5,
|
||||
"populateAssignedUser": true,
|
||||
"expandedLayout": {
|
||||
"rows": [
|
||||
[
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"sortBy": "createdAt",
|
||||
"asc": false,
|
||||
"displayRecords": 5,
|
||||
"populateAssignedUser": true,
|
||||
"expandedLayout": {
|
||||
"rows": [
|
||||
[
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"sortBy": "createdAt",
|
||||
"asc": false,
|
||||
"displayRecords": 5,
|
||||
"populateAssignedUser": true,
|
||||
"expandedLayout": {
|
||||
"rows": [
|
||||
[
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"sortBy": "dateStart",
|
||||
"asc": true,
|
||||
"displayRecords": 5,
|
||||
"populateAssignedUser": true,
|
||||
"expandedLayout": {
|
||||
"rows": [
|
||||
[
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"sortBy": "closeDate",
|
||||
"asc": true,
|
||||
"displayRecords": 5,
|
||||
"populateAssignedUser": true,
|
||||
"expandedLayout": {
|
||||
"rows": [
|
||||
[
|
||||
|
||||
@@ -158,6 +158,8 @@ Espo.define('crm:views/dashlets/activities', ['views/dashlets/abstract/base', 'm
|
||||
var scope = data.scope;
|
||||
var attributes = {};
|
||||
|
||||
this.populateAttributesAssignedUser(scope, attributes);
|
||||
|
||||
this.notify('Loading...');
|
||||
var viewName = this.getMetadata().get('clientDefs.'+scope+'.modalViews.edit') || 'views/modals/edit';
|
||||
this.createView('quickCreate', viewName, {
|
||||
@@ -175,6 +177,8 @@ Espo.define('crm:views/dashlets/activities', ['views/dashlets/abstract/base', 'm
|
||||
actionCreateMeeting: function () {
|
||||
var attributes = {};
|
||||
|
||||
this.populateAttributesAssignedUser('Meeting', attributes);
|
||||
|
||||
this.notify('Loading...');
|
||||
var viewName = this.getMetadata().get('clientDefs.Meeting.modalViews.edit') || 'views/modals/edit';
|
||||
this.createView('quickCreate', viewName, {
|
||||
@@ -192,6 +196,8 @@ Espo.define('crm:views/dashlets/activities', ['views/dashlets/abstract/base', 'm
|
||||
actionCreateCall: function () {
|
||||
var attributes = {};
|
||||
|
||||
this.populateAttributesAssignedUser('Call', attributes);
|
||||
|
||||
this.notify('Loading...');
|
||||
var viewName = this.getMetadata().get('clientDefs.Call.modalViews.edit') || 'views/modals/edit';
|
||||
this.createView('quickCreate', viewName, {
|
||||
@@ -204,7 +210,17 @@ Espo.define('crm:views/dashlets/activities', ['views/dashlets/abstract/base', 'm
|
||||
this.actionRefresh();
|
||||
}, this);
|
||||
}.bind(this));
|
||||
},
|
||||
|
||||
populateAttributesAssignedUser: function (scope, attributes) {
|
||||
if (this.getMetadata().get(['entityDefs', scope, 'fields', 'assignedUsers'])) {
|
||||
attributes['assignedUsersIds'] = [this.getUser().id];
|
||||
attributes['assignedUsersNames'] = {};
|
||||
attributes['assignedUsersNames'][this.getUser().id] = this.getUser().get('name');
|
||||
} else {
|
||||
attributes['assignedUserId'] = this.getUser().id;
|
||||
attributes['assignedUserName'] = this.getUser().get('name');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -401,13 +401,24 @@ Espo.define('views/admin/field-manager/edit', ['view', 'model'], function (Dep,
|
||||
Espo.Ui.notify(false);
|
||||
this.enableButtons();
|
||||
|
||||
this.getMetadata().load(function () {
|
||||
this.getMetadata().storeToCache();
|
||||
this.trigger('after:save');
|
||||
}.bind(this), true);
|
||||
|
||||
this.updateLanguage();
|
||||
|
||||
Promise.all([
|
||||
new Promise(function (resolve) {
|
||||
this.getMetadata().load(function () {
|
||||
this.getMetadata().storeToCache();
|
||||
resolve();
|
||||
}.bind(this), true);
|
||||
}.bind(this)),
|
||||
new Promise(function (resolve) {
|
||||
this.getLanguage().load(function () {
|
||||
resolve();
|
||||
}, true);
|
||||
}.bind(this))
|
||||
]).then(function () {
|
||||
this.trigger('after:save');
|
||||
}.bind(this));
|
||||
|
||||
this.model.fetchedAttributes = this.model.getClonedAttributes();
|
||||
}, this);
|
||||
|
||||
|
||||
@@ -349,6 +349,18 @@ Espo.define('views/admin/link-manager/modals/edit', ['views/modal', 'views/admin
|
||||
break;
|
||||
}
|
||||
|
||||
var number = 1;
|
||||
while (this.getMetadata().get(['entityDefs', this.scope, 'links', link])) {
|
||||
link += number.toString();
|
||||
number++;
|
||||
}
|
||||
|
||||
var number = 1;
|
||||
while (this.getMetadata().get(['entityDefs', entityForeign, 'links', linkForeign])) {
|
||||
linkForeign += number.toString();
|
||||
number++;
|
||||
}
|
||||
|
||||
this.model.set('link', link);
|
||||
this.model.set('linkForeign', linkForeign);
|
||||
|
||||
|
||||
@@ -142,6 +142,17 @@ Espo.define('views/dashlets/abstract/record-list', ['views/dashlets/abstract/bas
|
||||
actionCreate: function () {
|
||||
var attributes = this.getCreateAttributes() || {};
|
||||
|
||||
if (this.getOption('populateAssignedUser')) {
|
||||
if (this.getMetadata().get(['entityDefs', this.scope, 'fields', 'assignedUsers'])) {
|
||||
attributes['assignedUsersIds'] = [this.getUser().id];
|
||||
attributes['assignedUsersNames'] = {};
|
||||
attributes['assignedUsersNames'][this.getUser().id] = this.getUser().get('name');
|
||||
} else {
|
||||
attributes['assignedUserId'] = this.getUser().id;
|
||||
attributes['assignedUserName'] = this.getUser().get('name');
|
||||
}
|
||||
}
|
||||
|
||||
this.notify('Loading...');
|
||||
var viewName = this.getMetadata().get('clientDefs.' + this.scope + '.modalViews.edit') || 'views/modals/edit';
|
||||
this.createView('modal', viewName, {
|
||||
|
||||
@@ -91,6 +91,7 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu
|
||||
name: 'select',
|
||||
style: 'primary',
|
||||
label: 'Select',
|
||||
disabled: true,
|
||||
onClick: function (dialog) {
|
||||
var listView = this.getView('list');
|
||||
|
||||
@@ -193,11 +194,21 @@ Espo.define('views/modals/select-records', ['views/modal', 'search-manager'], fu
|
||||
buttonsDisabled: true,
|
||||
skipBuildRows: true
|
||||
}, function (view) {
|
||||
view.once('select', function (model) {
|
||||
this.listenToOnce(view, 'select', function (model) {
|
||||
this.trigger('select', model);
|
||||
this.close();
|
||||
}.bind(this));
|
||||
|
||||
if (this.multiple) {
|
||||
this.listenTo(view, 'check', function () {
|
||||
if (view.checkedList.length) {
|
||||
this.enableButton('select');
|
||||
} else {
|
||||
this.disableButton('select');
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
|
||||
view.getSelectAttributeList(function (selectAttributeList) {
|
||||
if (selectAttributeList) {
|
||||
this.collection.data.select = selectAttributeList.join(',');
|
||||
|
||||
@@ -161,6 +161,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
|
||||
this.$el.find('.actions-button').attr('disabled', true);
|
||||
this.$el.find('.list > table tbody tr').removeClass('active');
|
||||
}
|
||||
|
||||
this.trigger('check');
|
||||
},
|
||||
'click .action': function (e) {
|
||||
var $el = $(e.currentTarget);
|
||||
@@ -1038,6 +1040,8 @@ Espo.define('views/record/list', 'view', function (Dep) {
|
||||
} else {
|
||||
this.$el.find('.select-all').prop('checked', false);
|
||||
}
|
||||
|
||||
this.trigger('check');
|
||||
},
|
||||
|
||||
getRowActionsDefs: function () {
|
||||
|
||||
Reference in New Issue
Block a user