From d0c5d2aace8e1f32136783e24c31059d121e898b Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 30 Jul 2019 11:26:16 +0300 Subject: [PATCH 1/4] lead capture hooks --- application/Espo/Services/LeadCapture.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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) { From ec5bd78a33112d93073386df7846cc5dda1964c7 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 30 Jul 2019 12:43:36 +0300 Subject: [PATCH 2/4] access modal backdrop --- client/src/views/user/modals/access.js | 2 ++ 1 file changed, 2 insertions(+) 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(), From 3224795368709f32a56f50129a85ce7776641efd Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 30 Jul 2019 13:41:09 +0300 Subject: [PATCH 3/4] sth collection fix --- application/Espo/ORM/SthCollection.php | 5 +++++ 1 file changed, 5 insertions(+) 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; + } } From e680be54ad5082849c5fba4aa659347b967ac2b7 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 30 Jul 2019 14:58:56 +0300 Subject: [PATCH 4/4] fix mapper --- application/Espo/ORM/DB/Mapper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }