diff --git a/application/Espo/Core/Templates/Metadata/Base/entityDefs.json b/application/Espo/Core/Templates/Metadata/Base/entityDefs.json index 5286073dba..3d0f245116 100644 --- a/application/Espo/Core/Templates/Metadata/Base/entityDefs.json +++ b/application/Espo/Core/Templates/Metadata/Base/entityDefs.json @@ -29,7 +29,7 @@ "assignedUser": { "type": "link", "required": true, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Core/Templates/Metadata/Person/entityDefs.json b/application/Espo/Core/Templates/Metadata/Person/entityDefs.json index 54f9ba53b9..bc8e154bcf 100644 --- a/application/Espo/Core/Templates/Metadata/Person/entityDefs.json +++ b/application/Espo/Core/Templates/Metadata/Person/entityDefs.json @@ -70,7 +70,7 @@ "assignedUser": { "type": "link", "required": false, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json index fb4a3b9634..71bde8a29a 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Call.json @@ -109,7 +109,7 @@ "assignedUser": { "type": "link", "required": true, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json index 1ca7a62e94..3fbe6e015d 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Campaign.json @@ -44,7 +44,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json index 5c9c8423fd..dcf8507db9 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Case.json @@ -73,7 +73,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json index 46f9015b30..d93b884542 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Document.json @@ -61,7 +61,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/KnowledgeBaseArticle.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/KnowledgeBaseArticle.json index 38af2d1192..f01588fc86 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/KnowledgeBaseArticle.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/KnowledgeBaseArticle.json @@ -51,7 +51,8 @@ "readOnly": true }, "assignedUser": { - "type": "link" + "type": "link", + "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json index c3342cf699..3319621ace 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Lead.json @@ -107,7 +107,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "acceptanceStatus": { "type": "varchar", diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json index 49f3aa4ac8..9d8a741268 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Meeting.json @@ -104,7 +104,7 @@ "assignedUser": { "type": "link", "required": true, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json index ef6e03cb14..16722e4a81 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Opportunity.json @@ -91,7 +91,7 @@ "assignedUser": { "type": "link", "required": false, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json index ac4a3c6da6..21d2b6d30f 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Target.json @@ -83,7 +83,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/TargetList.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/TargetList.json index f8e342882d..e759554e7a 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/TargetList.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/TargetList.json @@ -33,7 +33,7 @@ }, "assignedUser": { "type": "link", - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json index a1665ddce4..959b5665b7 100644 --- a/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json +++ b/application/Espo/Modules/Crm/Resources/metadata/entityDefs/Task.json @@ -82,7 +82,7 @@ "assignedUser": { "type": "link", "required": true, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "teams": { "type": "linkMultiple" diff --git a/application/Espo/Resources/metadata/entityDefs/Email.json b/application/Espo/Resources/metadata/entityDefs/Email.json index c5f783460d..093704d4d9 100644 --- a/application/Espo/Resources/metadata/entityDefs/Email.json +++ b/application/Espo/Resources/metadata/entityDefs/Email.json @@ -183,7 +183,7 @@ "assignedUser": { "type": "link", "required": false, - "view": "views/fields/user" + "view": "views/fields/assigned-user" }, "replied": { "type": "link", diff --git a/application/Espo/Services/Record.php b/application/Espo/Services/Record.php index 30e9f6f7bb..e80808605b 100644 --- a/application/Espo/Services/Record.php +++ b/application/Espo/Services/Record.php @@ -361,13 +361,16 @@ class Record extends \Espo\Core\Services\Base $assignedUserId = $entity->get('assignedUserId'); + $assignmentPermission = $this->getAcl()->get('assignmentPermission'); + if (empty($assignedUserId)) { + if ($assignmentPermission === 'no') { + return false; + } return true; } - $assignmentPermission = $this->getAcl()->get('assignmentPermission'); - - if (empty($assignmentPermission) || $assignmentPermission === true || !in_array($assignmentPermission, ['team', 'no'])) { + if ($assignmentPermission === true || !in_array($assignmentPermission, ['team', 'no'])) { return true; }