mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
Merge branch 'hotfix/4.8.5'
This commit is contained in:
@@ -25,12 +25,25 @@
|
||||
*
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
* these Appropriate Legal Notices must retain the display of the "EspoCRM" word.
|
||||
************************************************************************/
|
||||
************************************************************************/
|
||||
|
||||
namespace Espo\Modules\Crm\Entities;
|
||||
|
||||
class Lead extends \Espo\Core\Entities\Person
|
||||
{
|
||||
|
||||
protected function _getName()
|
||||
{
|
||||
if (!array_key_exists('name', $this->valuesContainer) || !$this->valuesContainer['name']) {
|
||||
if ($this->get('accountName')) {
|
||||
return $this->get('accountName');
|
||||
} else if ($this->get('emailAddress')) {
|
||||
return $this->get('emailAddress');
|
||||
} else if ($this->get('phoneNumber')) {
|
||||
return $this->get('phoneNumber');
|
||||
}
|
||||
}
|
||||
return $this->valuesContainer['name'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -122,5 +122,27 @@
|
||||
"style": "success"
|
||||
}
|
||||
],
|
||||
"boolFilterList": ["onlyMy"]
|
||||
"boolFilterList": ["onlyMy"],
|
||||
"dynamicLogic": {
|
||||
"fields": {
|
||||
"name": {
|
||||
"required": {
|
||||
"conditionGroup": [
|
||||
{
|
||||
"type": "isEmpty",
|
||||
"attribute": "accountName"
|
||||
},
|
||||
{
|
||||
"type": "isEmpty",
|
||||
"attribute": "emailAddress"
|
||||
},
|
||||
{
|
||||
"type": "isEmpty",
|
||||
"attribute": "phoneNumber"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
"lastName": {
|
||||
"type": "varchar",
|
||||
"maxLength": 100,
|
||||
"required": true,
|
||||
"default":""
|
||||
},
|
||||
"title": {
|
||||
|
||||
@@ -98,6 +98,14 @@
|
||||
"view": "views/admin/dynamic-logic/conditions/field-types/base",
|
||||
"typeList": ["equals", "notEquals", "isEmpty", "isNotEmpty"]
|
||||
},
|
||||
"email": {
|
||||
"view": "views/admin/dynamic-logic/conditions/field-types/base",
|
||||
"typeList": ["isEmpty", "isNotEmpty"]
|
||||
},
|
||||
"phone": {
|
||||
"view": "views/admin/dynamic-logic/conditions/field-types/base",
|
||||
"typeList": ["isEmpty", "isNotEmpty"]
|
||||
},
|
||||
"text": {
|
||||
"view": "views/admin/dynamic-logic/conditions/field-types/base",
|
||||
"typeList": ["isEmpty", "isNotEmpty"]
|
||||
|
||||
@@ -262,13 +262,13 @@ Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
|
||||
this.on('after:render', function () {
|
||||
if (this.mode === 'edit') {
|
||||
if (this.isRequired()) {
|
||||
if (this.hasRequiredMarker()) {
|
||||
this.showRequiredSign();
|
||||
} else {
|
||||
this.hideRequiredSign();
|
||||
}
|
||||
} else {
|
||||
if (this.isRequired()) {
|
||||
if (!this.hasRequiredMarker()) {
|
||||
this.hideRequiredSign();
|
||||
}
|
||||
}
|
||||
@@ -580,6 +580,10 @@ Espo.define('views/fields/base', 'view', function (Dep) {
|
||||
}
|
||||
},
|
||||
|
||||
hasRequiredMarker: function () {
|
||||
return this.isRequired();
|
||||
},
|
||||
|
||||
fetchToModel: function () {
|
||||
this.model.set(this.fetch(), {silent: true});
|
||||
},
|
||||
|
||||
@@ -82,7 +82,7 @@ Espo.define('views/fields/person-name', 'views/fields/varchar', function (Dep) {
|
||||
},
|
||||
|
||||
validateRequired: function () {
|
||||
var isRequired = this.model.getFieldParam(this.name, 'required');
|
||||
var isRequired = this.isRequired();
|
||||
|
||||
var validate = function (name) {
|
||||
if (this.model.isRequired(name)) {
|
||||
@@ -109,11 +109,11 @@ Espo.define('views/fields/person-name', 'views/fields/varchar', function (Dep) {
|
||||
return result;
|
||||
},
|
||||
|
||||
isRequired: function () {
|
||||
hasRequiredMarker: function () {
|
||||
if (this.isRequired()) return true;
|
||||
return this.model.getFieldParam(this.salutationField, 'required') ||
|
||||
this.model.getFieldParam(this.firstField, 'required') ||
|
||||
this.model.getFieldParam(this.lastField, 'required') ||
|
||||
this.model.getFieldParam(this.name, 'required');
|
||||
this.model.getFieldParam(this.lastField, 'required');
|
||||
},
|
||||
|
||||
fetch: function (form) {
|
||||
|
||||
Reference in New Issue
Block a user