Merge branch 'hotfix/3.7.2'
This commit is contained in:
@@ -194,6 +194,28 @@ class Importer
|
||||
$n = sscanf($reference, '%s %s %d %d espo', $parentType, $parentId, $emailSent, $number);
|
||||
if ($n == 4 && $emailSent < time()) {
|
||||
if (!empty($parentType) && !empty($parentId)) {
|
||||
if ($parentType == 'Lead') {
|
||||
$parent = $this->getEntityManager()->getEntity('Lead', $parentId);
|
||||
if ($parent && $parent->get('status') == 'Converted') {
|
||||
if ($parent->get('createdAccountId')) {
|
||||
$account = $this->getEntityManager()->getEntity('Account', $parent->get('createdAccountId'));
|
||||
if ($account) {
|
||||
$parentType = 'Account';
|
||||
$parentId = $account->id;
|
||||
}
|
||||
} else {
|
||||
if ($this->getConfig()->get('b2cMode')) {
|
||||
if ($parent->get('createdContactId')) {
|
||||
$contact = $this->getEntityManager()->getEntity('Contact', $parent->get('createdContactId'));
|
||||
if ($contact) {
|
||||
$parentType = 'Contact';
|
||||
$parentId = $contact->id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$email->set('parentType', $parentType);
|
||||
$email->set('parentId', $parentId);
|
||||
$parentFound = true;
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
{
|
||||
"name":"statistics",
|
||||
"label":"Statistics",
|
||||
"view":"Crm:Campaign.Record.Panels.Statistics"
|
||||
"view":"Crm:Campaign.Record.Panels.Statistics",
|
||||
"hidden": true
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -29,12 +29,9 @@
|
||||
{
|
||||
"name":"convertedTo",
|
||||
"label":"Converted To",
|
||||
"view": "Record.Panels.Side",
|
||||
"view": "crm:views/lead/record/panels/converted-to",
|
||||
"notRefreshable": true,
|
||||
"hidden": true,
|
||||
"options": {
|
||||
"fieldList": ["createdAccount", "createdContact", "createdOpportunity"]
|
||||
}
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name":"activities",
|
||||
@@ -51,6 +48,33 @@
|
||||
"label":"Tasks",
|
||||
"view":"Crm:Record.Panels.Tasks"
|
||||
}
|
||||
],
|
||||
"edit": [
|
||||
{
|
||||
"name":"convertedTo",
|
||||
"label":"Converted To",
|
||||
"view": "crm:views/lead/record/panels/converted-to",
|
||||
"notRefreshable": true,
|
||||
"hidden": true
|
||||
}
|
||||
],
|
||||
"detailSmall": [
|
||||
{
|
||||
"name":"convertedTo",
|
||||
"label":"Converted To",
|
||||
"view": "crm:views/lead/record/panels/converted-to",
|
||||
"notRefreshable": true,
|
||||
"hidden": true
|
||||
}
|
||||
],
|
||||
"editSmall": [
|
||||
{
|
||||
"name":"convertedTo",
|
||||
"label":"Converted To",
|
||||
"view": "crm:views/lead/record/panels/converted-to",
|
||||
"notRefreshable": true,
|
||||
"hidden": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"relationshipPanels": {
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
},
|
||||
"messages": {
|
||||
"entityCreated": "Entity has been created",
|
||||
"linkAlreadyExists": "Link name conflict."
|
||||
"linkAlreadyExists": "Link name conflict.",
|
||||
"linkConflict": "Link with the same name already exists."
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,6 @@
|
||||
{
|
||||
"name": "defaultReminders"
|
||||
}
|
||||
],
|
||||
[
|
||||
{"name":"theme"},
|
||||
false
|
||||
]
|
||||
]
|
||||
},
|
||||
|
||||
@@ -25,31 +25,6 @@ Espo.define('Crm:Views.Lead.Record.DetailSide', 'Views.Record.DetailSide', funct
|
||||
|
||||
setupPanels: function () {
|
||||
|
||||
/*var panel = {
|
||||
name: 'convertedTo',
|
||||
label: 'Converted To',
|
||||
view: 'Record.Panels.Side',
|
||||
notRefreshable: true,
|
||||
options: {
|
||||
fieldList: [],
|
||||
mode: 'detail',
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
panel.options.fieldList.push('createdAccount');
|
||||
|
||||
|
||||
panel.options.fieldList.push('createdContact');
|
||||
|
||||
|
||||
panel.options.fieldList.push('createdOpportunity');
|
||||
|
||||
|
||||
this.panels = Espo.Utils.clone(this.panels);
|
||||
this.panels.splice(1, 0, panel);*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/************************************************************************
|
||||
* 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('crm:views/lead/record/panels/converted-to', 'views/record/panels/side', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setup: function () {
|
||||
this.fieldList = [];
|
||||
|
||||
if (this.getAcl().check('Account')) {
|
||||
this.fieldList.push('createdAccount');
|
||||
}
|
||||
|
||||
if (this.getAcl().check('Contact')) {
|
||||
this.fieldList.push('createdContact');
|
||||
}
|
||||
if (this.getAcl().check('Opportunity')) {
|
||||
this.fieldList.push('createdOpportunity');
|
||||
}
|
||||
|
||||
Dep.prototype.setup.call(this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
@@ -19,11 +19,11 @@
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('Views.Record.ListTreeItem', 'View', function (Dep) {
|
||||
Espo.define('views/record/list-tree-item', 'view', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
template: 'record.list-tree-item',
|
||||
template: 'record/list-tree-item',
|
||||
|
||||
isEnd: false,
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
* along with EspoCRM. If not, see http://www.gnu.org/licenses/.
|
||||
************************************************************************/
|
||||
|
||||
Espo.define('Views.Record.ListTree', 'Views.Record.List', function (Dep) {
|
||||
Espo.define('views/record/list-tree', 'views/record/list', function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
template: 'record.list-tree',
|
||||
template: 'record/list-tree',
|
||||
|
||||
showMore: false,
|
||||
|
||||
@@ -53,6 +53,8 @@ Espo.define('Views.Record.ListTree', 'Views.Record.List', function (Dep) {
|
||||
|
||||
level: 0,
|
||||
|
||||
itemViewName: 'views/record/list-tree-item',
|
||||
|
||||
data: function () {
|
||||
var data = Dep.prototype.data.call(this);
|
||||
data.createDisabled = this.createDisabled;
|
||||
@@ -151,7 +153,7 @@ Espo.define('Views.Record.ListTree', 'Views.Record.List', function (Dep) {
|
||||
var built = 0;
|
||||
modelList.forEach(function (model, i) {
|
||||
this.rows.push('row-' + i);
|
||||
this.createView('row-' + i, 'Record.ListTreeItem', {
|
||||
this.createView('row-' + i, this.itemViewName, {
|
||||
model: model,
|
||||
collection: this.collection,
|
||||
el: this.options.el + ' ' + this.getRowSelector(model.id),
|
||||
|
||||
@@ -111,7 +111,9 @@ Espo.define('views/stream/list', 'views/record/list-expanded', function (Dep) {
|
||||
});
|
||||
},
|
||||
|
||||
actionViewRecord: function (data) {
|
||||
actionViewRecord: function (data, e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var id = data.id;
|
||||
var scope = data.scope;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user