diff --git a/application/Espo/ORM/DB/Mapper.php b/application/Espo/ORM/DB/Mapper.php index 478e2714b3..e112c2b06f 100644 --- a/application/Espo/ORM/DB/Mapper.php +++ b/application/Espo/ORM/DB/Mapper.php @@ -257,7 +257,7 @@ abstract class Mapper implements IMapper if (!$returnTotalCount) { if (!empty($params['returnSthCollection']) && $relType !== IEntity::HAS_ONE) { - $collection = $this->createSthCollection($entity->getEntityType()); + $collection = $this->createSthCollection($relEntity->getEntityType()); $collection->setQuery($sql); return $collection; } @@ -316,7 +316,7 @@ abstract class Mapper implements IMapper if (!$returnTotalCount) { if (!empty($params['returnSthCollection'])) { - $collection = $this->createSthCollection($entity->getEntityType()); + $collection = $this->createSthCollection($relEntity->getEntityType()); $collection->setQuery($sql); return $collection; } diff --git a/application/Espo/ORM/SthCollection.php b/application/Espo/ORM/SthCollection.php index 40500fa5b7..bd9d550334 100644 --- a/application/Espo/ORM/SthCollection.php +++ b/application/Espo/ORM/SthCollection.php @@ -150,4 +150,9 @@ class SthCollection implements \IteratorAggregate { return $this->isFetched; } + + public function getEntityType() + { + return $this->entityType; + } } diff --git a/application/Espo/Services/LeadCapture.php b/application/Espo/Services/LeadCapture.php index 81ef238733..5405ecdad1 100644 --- a/application/Espo/Services/LeadCapture.php +++ b/application/Espo/Services/LeadCapture.php @@ -342,6 +342,15 @@ class LeadCapture extends Record 'leadCaptureId' => $leadCapture->id, ]); } + + $this->getInjection('hookManager')->process('LeadCapture', 'afterLeadCapture', $leadCapture, [], [ + 'targetId' => $contact->id, + 'targetType' => 'Contact', + ]); + + $this->getInjection('hookManager')->process('Contact', 'afterLeadCapture', $contact, [], [ + 'leadCaptureId' => $leadCapture->id, + ]); } } } @@ -390,6 +399,15 @@ class LeadCapture extends Record 'leadCaptureId' => $leadCapture->id, ]); } + + $this->getInjection('hookManager')->process('LeadCapture', 'afterLeadCapture', $leadCapture, [], [ + 'targetId' => $targetLead->id, + 'targetType' => 'Lead', + ]); + + $this->getInjection('hookManager')->process('Lead', 'afterLeadCapture', $targetLead, [], [ + 'leadCaptureId' => $leadCapture->id, + ]); } if (!$isLogged) { diff --git a/client/src/views/user/modals/access.js b/client/src/views/user/modals/access.js index 6b1d67dee3..b9171f3a06 100644 --- a/client/src/views/user/modals/access.js +++ b/client/src/views/user/modals/access.js @@ -38,6 +38,8 @@ Espo.define('views/user/modals/access', 'views/modal', function (Dep) { header: false, + backdrop: true, + data: function () { return { valuePermissionDataList: this.getValuePermissionList(),