mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
type fixes
This commit is contained in:
@@ -160,6 +160,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated Use Aware interfaces to inject dependencies.
|
||||
*
|
||||
* @return \Espo\Core\Container
|
||||
*/
|
||||
protected function getContainer()
|
||||
{
|
||||
@@ -168,6 +170,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Entities\User
|
||||
*/
|
||||
protected function getUser()
|
||||
{
|
||||
@@ -176,6 +180,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Core\Acl
|
||||
*/
|
||||
protected function getAcl()
|
||||
{
|
||||
@@ -184,6 +190,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Core\AclManager
|
||||
*/
|
||||
protected function getAclManager()
|
||||
{
|
||||
@@ -192,6 +200,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Core\Utils\Config
|
||||
*/
|
||||
protected function getConfig()
|
||||
{
|
||||
@@ -208,6 +218,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Core\Utils\Metadata
|
||||
*/
|
||||
protected function getMetadata()
|
||||
{
|
||||
@@ -216,6 +228,8 @@ abstract class Base
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @return \Espo\Core\ServiceFactory
|
||||
*/
|
||||
protected function getServiceFactory()
|
||||
{
|
||||
|
||||
@@ -33,15 +33,21 @@ use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Call as Service;
|
||||
|
||||
class Call extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionSendInvitations($params, $data)
|
||||
public function postActionSendInvitations(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$entity = $this->getRecordService()->getEntity($data->id);
|
||||
$entity = $this->getCallService()->getEntity($data->id);
|
||||
|
||||
if (!$entity) {
|
||||
throw new NotFound();
|
||||
@@ -55,33 +61,44 @@ class Call extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->sendInvitations($entity);
|
||||
return $this->getCallService()->sendInvitations($entity);
|
||||
}
|
||||
|
||||
public function postActionMassSetHeld($params, $data)
|
||||
public function postActionMassSetHeld(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->ids) || !is_array($data->ids)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massSetHeld($data->ids);
|
||||
return $this->getCallService()->massSetHeld($data->ids);
|
||||
}
|
||||
|
||||
public function postActionMassSetNotHeld($params, $data)
|
||||
public function postActionMassSetNotHeld(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->ids) || !is_array($data->ids)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massSetNotHeld($data->ids);
|
||||
return $this->getCallService()->massSetNotHeld($data->ids);
|
||||
}
|
||||
|
||||
public function postActionSetAcceptanceStatus($params, $data)
|
||||
public function postActionSetAcceptanceStatus(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id) || empty($data->status)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->setAcceptanceStatus($data->id, $data->status);
|
||||
return $this->getCallService()->setAcceptanceStatus($data->id, $data->status);
|
||||
}
|
||||
|
||||
private function getCallService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,16 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Campaign as Service;
|
||||
|
||||
class Campaign extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionGenerateMailMergePdf($params, $data, $request)
|
||||
public function postActionGenerateMailMergePdf(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->campaignId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -49,7 +55,12 @@ class Campaign extends \Espo\Core\Controllers\Record
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $this->getRecordService()->generateMailMergePdf($data->campaignId, $data->link, true)
|
||||
'id' => $this->getCampaignService()->generateMailMergePdf($data->campaignId, $data->link, true)
|
||||
];
|
||||
}
|
||||
|
||||
private function getCampaignService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,13 +32,17 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\CaseObj as Service;
|
||||
|
||||
class CaseObj extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
protected $name = 'Case';
|
||||
|
||||
public function getActionEmailAddressList($params, $data, $request)
|
||||
public function getActionEmailAddressList(Request $request)
|
||||
{
|
||||
if (!$request->get('id')) {
|
||||
if (!$request->getQueryParam('id')) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
@@ -46,6 +50,11 @@ class CaseObj extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->getEmailAddressList($request->get('id'));
|
||||
return $this->getCaseService()->getEmailAddressList($request->getQueryParam('id'));
|
||||
}
|
||||
|
||||
private function getCaseService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,16 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Document as Service;
|
||||
|
||||
class Document extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionGetAttachmentList($params, $data)
|
||||
public function postActionGetAttachmentList(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -46,6 +52,13 @@ class Document extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->getAttachmentList($id)->getValueMapList();
|
||||
return $this->getDocumentService()
|
||||
->getAttachmentList($id)
|
||||
->getValueMapList();
|
||||
}
|
||||
|
||||
private function getDocumentService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,38 +31,29 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\KnowledgeBaseArticle as Service;
|
||||
|
||||
class KnowledgeBaseArticle extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionGetCopiedAttachments($params, $data, $request)
|
||||
public function postActionGetCopiedAttachments(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$id = $data->id;
|
||||
|
||||
return $this->getRecordService()->getCopiedAttachments($id);
|
||||
return $this->getArticleService()->getCopiedAttachments($id);
|
||||
}
|
||||
|
||||
public function postActionMoveToTop($params, $data, $request)
|
||||
public function postActionMoveToTop(Request $request)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
$where = null;
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (!empty($data->where)) {
|
||||
$where = $data->where;
|
||||
$where = json_decode(json_encode($where), true);
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveToTop($data->id, $where);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveUp($params, $data, $request)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -74,13 +65,15 @@ class KnowledgeBaseArticle extends \Espo\Core\Controllers\Record
|
||||
$where = json_decode(json_encode($where), true);
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveUp($data->id, $where);
|
||||
$this->getArticleService()->moveToTop($data->id, $where);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveDown($params, $data, $request)
|
||||
public function postActionMoveUp(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -92,13 +85,15 @@ class KnowledgeBaseArticle extends \Espo\Core\Controllers\Record
|
||||
$where = json_decode(json_encode($where), true);
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveDown($data->id, $where);
|
||||
$this->getArticleService()->moveUp($data->id, $where);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveToBottom($params, $data, $request)
|
||||
public function postActionMoveDown(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -110,8 +105,33 @@ class KnowledgeBaseArticle extends \Espo\Core\Controllers\Record
|
||||
$where = json_decode(json_encode($where), true);
|
||||
}
|
||||
|
||||
$this->getRecordService()->moveToBottom($data->id, $where);
|
||||
$this->getArticleService()->moveDown($data->id, $where);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function postActionMoveToBottom(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$where = null;
|
||||
|
||||
if (!empty($data->where)) {
|
||||
$where = $data->where;
|
||||
$where = json_decode(json_encode($where), true);
|
||||
}
|
||||
|
||||
$this->getArticleService()->moveToBottom($data->id, $where);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function getArticleService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,16 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Lead as Service;
|
||||
|
||||
class Lead extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionConvert($params, $data, $request)
|
||||
public function postActionConvert(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
@@ -48,21 +54,28 @@ class Lead extends \Espo\Core\Controllers\Record
|
||||
'skipDuplicateCheck' => $data->skipDuplicateCheck ?? false,
|
||||
];
|
||||
|
||||
$entity = $this->getRecordService()->convert($data->id, $data->records, $additionalData);
|
||||
$entity = $this->getLeadService()->convert($data->id, $data->records, $additionalData);
|
||||
|
||||
if (!empty($entity)) {
|
||||
return $entity->toArray();
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
throw new Error();
|
||||
}
|
||||
|
||||
public function postActionGetConvertAttributes($params, $data, $request)
|
||||
public function postActionGetConvertAttributes(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->getConvertAttributes($data->id);
|
||||
return $this->getLeadService()->getConvertAttributes($data->id);
|
||||
}
|
||||
|
||||
private function getLeadService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,21 @@ use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\NotFound;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Meeting as Service;
|
||||
|
||||
class Meeting extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function postActionSendInvitations($params, $data)
|
||||
public function postActionSendInvitations(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$entity = $this->getRecordService()->getEntity($data->id);
|
||||
$entity = $this->getMeetingService()->getEntity($data->id);
|
||||
|
||||
if (!$entity) {
|
||||
throw new NotFound();
|
||||
@@ -55,33 +61,44 @@ class Meeting extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->sendInvitations($entity);
|
||||
return $this->getMeetingService()->sendInvitations($entity);
|
||||
}
|
||||
|
||||
public function postActionMassSetHeld($params, $data)
|
||||
public function postActionMassSetHeld(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->ids) || !is_array($data->ids)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massSetHeld($data->ids);
|
||||
return $this->getMeetingService()->massSetHeld($data->ids);
|
||||
}
|
||||
|
||||
public function postActionMassSetNotHeld($params, $data)
|
||||
public function postActionMassSetNotHeld(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->ids) || !is_array($data->ids)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->massSetNotHeld($data->ids);
|
||||
return $this->getMeetingService()->massSetNotHeld($data->ids);
|
||||
}
|
||||
|
||||
public function postActionSetAcceptanceStatus($params, $data)
|
||||
public function postActionSetAcceptanceStatus(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id) || empty($data->status)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->setAcceptanceStatus($data->id, $data->status);
|
||||
return $this->getMeetingService()->setAcceptanceStatus($data->id, $data->status);
|
||||
}
|
||||
|
||||
private function getMeetingService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,9 +32,13 @@ namespace Espo\Modules\Crm\Controllers;
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
|
||||
use Espo\Core\Api\Request;
|
||||
|
||||
use Espo\Modules\Crm\Services\Opportunity as Service;
|
||||
|
||||
class Opportunity extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionReportByLeadSource($params, $data, $request)
|
||||
public function getActionReportByLeadSource(Request $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
|
||||
@@ -42,14 +46,14 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
$dateFilter = $request->get('dateFilter');
|
||||
$dateFrom = $request->getQueryParam('dateFrom');
|
||||
$dateTo = $request->getQueryParam('dateTo');
|
||||
$dateFilter = $request->getQueryParam('dateFilter');
|
||||
|
||||
return $this->getService('Opportunity')->reportByLeadSource($dateFilter, $dateFrom, $dateTo);
|
||||
return $this->getOpportunityService()->reportByLeadSource($dateFilter, $dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
public function actionReportByStage($params, $data, $request)
|
||||
public function getActionReportByStage(Request $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
|
||||
@@ -57,14 +61,14 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
$dateFilter = $request->get('dateFilter');
|
||||
$dateFrom = $request->getQueryParam('dateFrom');
|
||||
$dateTo = $request->getQueryParam('dateTo');
|
||||
$dateFilter = $request->getQueryParam('dateFilter');
|
||||
|
||||
return $this->getService('Opportunity')->reportByStage($dateFilter, $dateFrom, $dateTo);
|
||||
return $this->getOpportunityService()->reportByStage($dateFilter, $dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
public function actionReportSalesByMonth($params, $data, $request)
|
||||
public function getActionReportSalesByMonth(Request $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
|
||||
@@ -72,14 +76,14 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
$dateFilter = $request->get('dateFilter');
|
||||
$dateFrom = $request->getQueryParam('dateFrom');
|
||||
$dateTo = $request->getQueryParam('dateTo');
|
||||
$dateFilter = $request->getQueryParam('dateFilter');
|
||||
|
||||
return $this->getService('Opportunity')->reportSalesByMonth($dateFilter, $dateFrom, $dateTo);
|
||||
return $this->getOpportunityService()->reportSalesByMonth($dateFilter, $dateFrom, $dateTo);
|
||||
}
|
||||
|
||||
public function actionReportSalesPipeline($params, $data, $request)
|
||||
public function getActionReportSalesPipeline(Request $request)
|
||||
{
|
||||
$level = $this->getAcl()->getLevel('Opportunity', 'read');
|
||||
|
||||
@@ -87,19 +91,19 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
$dateFrom = $request->get('dateFrom');
|
||||
$dateTo = $request->get('dateTo');
|
||||
$dateFilter = $request->get('dateFilter');
|
||||
$useLastStage = $request->get('useLastStage') === 'true';
|
||||
$teamId = $request->get('teamId') ?? null;
|
||||
$dateFrom = $request->getQueryParam('dateFrom');
|
||||
$dateTo = $request->getQueryParam('dateTo');
|
||||
$dateFilter = $request->getQueryParam('dateFilter');
|
||||
$useLastStage = $request->getQueryParam('useLastStage') === 'true';
|
||||
$teamId = $request->getQueryParam('teamId') ?? null;
|
||||
|
||||
return $this->getService('Opportunity')
|
||||
return $this->getOpportunityService()
|
||||
->reportSalesPipeline($dateFilter, $dateFrom, $dateTo, $useLastStage, $teamId);
|
||||
}
|
||||
|
||||
public function getActionEmailAddressList($params, $data, $request)
|
||||
public function getActionEmailAddressList(Request $request)
|
||||
{
|
||||
if (!$request->get('id')) {
|
||||
if (!$request->getQueryParam('id')) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
@@ -107,6 +111,11 @@ class Opportunity extends \Espo\Core\Controllers\Record
|
||||
throw new Forbidden();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->getEmailAddressList($request->get('id'));
|
||||
return $this->getOpportunityService()->getEmailAddressList($request->getQueryParam('id'));
|
||||
}
|
||||
|
||||
private function getOpportunityService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,23 +29,9 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Controllers;
|
||||
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Exceptions\Error;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
class Target extends \Espo\Core\Controllers\Record
|
||||
{
|
||||
public function actionConvert($params, $data)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$entity = $this->getRecordService()->convert($data->id);
|
||||
|
||||
if (!empty($entity)) {
|
||||
return $entity->getValueMap();
|
||||
}
|
||||
|
||||
throw new Error();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,65 +29,74 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Controllers;
|
||||
|
||||
use Espo\Core\Exceptions\Forbidden;
|
||||
use Espo\Core\Exceptions\BadRequest;
|
||||
use Espo\Core\Api\Request;
|
||||
use Espo\Modules\Crm\Services\TargetList as Service;
|
||||
use Espo\Core\Controllers\Record;
|
||||
|
||||
class TargetList extends \Espo\Core\Controllers\Record
|
||||
class TargetList extends Record
|
||||
{
|
||||
public function actionUnlinkAll($params, $data, $request)
|
||||
{
|
||||
if (!$request->isPost()) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
public function postActionUnlinkAll(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (empty($data->link)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data->link)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->unlinkAll($data->id, $data->link);
|
||||
}
|
||||
return $this->getTargetListService()->unlinkAll($data->id, $data->link);
|
||||
}
|
||||
|
||||
public function postActionOptOut($params, $data)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
public function postActionOptOut(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->targetType)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
if (empty($data->targetId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data->targetType)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$data->id = strval($data->id);
|
||||
$data->targetId = strval($data->targetId);
|
||||
if (empty($data->targetId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->optOut($data->id, $data->targetType, $data->targetId);
|
||||
}
|
||||
$data->id = strval($data->id);
|
||||
$data->targetId = strval($data->targetId);
|
||||
|
||||
public function postActionCancelOptOut($params, $data)
|
||||
{
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
return $this->getTargetListService()->optOut($data->id, $data->targetType, $data->targetId);
|
||||
}
|
||||
|
||||
if (empty($data->targetType)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
public function postActionCancelOptOut(Request $request)
|
||||
{
|
||||
$data = $request->getParsedBody();
|
||||
|
||||
if (empty($data->targetId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
if (empty($data->id)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$data->id = strval($data->id);
|
||||
$data->targetId = strval($data->targetId);
|
||||
if (empty($data->targetType)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
return $this->getRecordService()->cancelOptOut($data->id, $data->targetType, $data->targetId);
|
||||
}
|
||||
if (empty($data->targetId)) {
|
||||
throw new BadRequest();
|
||||
}
|
||||
|
||||
$data->id = strval($data->id);
|
||||
$data->targetId = strval($data->targetId);
|
||||
|
||||
return $this->getTargetListService()->cancelOptOut($data->id, $data->targetType, $data->targetId);
|
||||
}
|
||||
|
||||
private function getTargetListService(): Service
|
||||
{
|
||||
return $this->getRecordService();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ class CampaignTrackOpened implements EntryPoint
|
||||
|
||||
public function run(Request $request, Response $response): void
|
||||
{
|
||||
$id = $request->get('id');
|
||||
$id = $request->getQueryParam('id');
|
||||
|
||||
if (!$id) {
|
||||
throw new BadRequest();
|
||||
|
||||
@@ -84,11 +84,11 @@ class CampaignUrl implements EntryPoint
|
||||
|
||||
public function run(Request $request, Response $response): void
|
||||
{
|
||||
$queueItemId = $request->get('queueItemId') ?? null;
|
||||
$trackingUrlId = $request->get('id') ?? null;
|
||||
$emailAddress = $request->get('emailAddress') ?? null;
|
||||
$hash = $request->get('hash') ?? null;
|
||||
$uid = $request->get('uid') ?? null;
|
||||
$queueItemId = $request->getQueryParam('queueItemId') ?? null;
|
||||
$trackingUrlId = $request->getQueryParam('id') ?? null;
|
||||
$emailAddress = $request->getQueryParam('emailAddress') ?? null;
|
||||
$hash = $request->getQueryParam('hash') ?? null;
|
||||
$uid = $request->getQueryParam('uid') ?? null;
|
||||
|
||||
if (!$trackingUrlId) {
|
||||
throw new BadRequest();
|
||||
|
||||
@@ -60,8 +60,8 @@ class EventConfirmation implements EntryPoint
|
||||
|
||||
public function run(Request $request, Response $response): void
|
||||
{
|
||||
$uid = $request->get('uid') ?? null;
|
||||
$action = $request->get('action') ?? null;
|
||||
$uid = $request->getQueryParam('uid') ?? null;
|
||||
$action = $request->getQueryParam('action') ?? null;
|
||||
|
||||
if (empty($uid) || empty($action)) {
|
||||
throw new BadRequest();
|
||||
|
||||
@@ -78,9 +78,9 @@ class SubscribeAgain implements EntryPoint
|
||||
|
||||
public function run(Request $request, Response $response): void
|
||||
{
|
||||
$id = $request->get('id') ?? null;
|
||||
$emailAddress = $request->get('emailAddress') ?? null;
|
||||
$hash = $request->get('hash') ?? null;
|
||||
$id = $request->getQueryParam('id') ?? null;
|
||||
$emailAddress = $request->getQueryParam('emailAddress') ?? null;
|
||||
$hash = $request->getQueryParam('hash') ?? null;
|
||||
|
||||
if ($emailAddress && $hash) {
|
||||
$this->processWithHash($emailAddress, $hash);
|
||||
@@ -103,6 +103,8 @@ class SubscribeAgain implements EntryPoint
|
||||
$campaign = null;
|
||||
$target = null;
|
||||
|
||||
$campaignId = null;
|
||||
|
||||
$massEmailId = $queueItem->get('massEmailId');
|
||||
|
||||
if ($massEmailId) {
|
||||
|
||||
@@ -84,9 +84,9 @@ class Unsubscribe implements EntryPoint
|
||||
|
||||
public function run(Request $request, Response $response): void
|
||||
{
|
||||
$id = $request->get('id') ?? null;
|
||||
$emailAddress = $request->get('emailAddress') ?? null;
|
||||
$hash = $request->get('hash') ?? null;
|
||||
$id = $request->getQueryParam('id') ?? null;
|
||||
$emailAddress = $request->getQueryParam('emailAddress') ?? null;
|
||||
$hash = $request->getQueryParam('hash') ?? null;
|
||||
|
||||
if ($emailAddress && $hash) {
|
||||
$this->processWithHash($emailAddress, $hash);
|
||||
@@ -109,6 +109,8 @@ class Unsubscribe implements EntryPoint
|
||||
$campaign = null;
|
||||
$target = null;
|
||||
|
||||
$campaignId = null;
|
||||
|
||||
$massEmailId = $queueItem->get('massEmailId');
|
||||
|
||||
if ($massEmailId) {
|
||||
|
||||
@@ -50,7 +50,7 @@ class Contacts
|
||||
|
||||
if ($relationName === 'contacts' && $foreignEntity) {
|
||||
if (!$foreignEntity->get('accountId') && $foreignEntity->has('accountId')) {
|
||||
$foreignEntity->set('accountId', $entity->id);
|
||||
$foreignEntity->set('accountId', $entity->getId());
|
||||
|
||||
$this->entityManager->saveEntity($foreignEntity);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ class Contacts
|
||||
$foreignEntity = $data['foreignEntity'] ?? null;
|
||||
|
||||
if ($relationName === 'contacts' && $foreignEntity) {
|
||||
if ($foreignEntity->get('accountId') && $foreignEntity->get('accountId') === $entity->id) {
|
||||
if ($foreignEntity->get('accountId') && $foreignEntity->get('accountId') === $entity->getId()) {
|
||||
$foreignEntity->set('accountId', null);
|
||||
|
||||
$this->entityManager->saveEntity($foreignEntity);
|
||||
|
||||
@@ -63,7 +63,7 @@ class ProcessMassEmail implements JobDataLess
|
||||
public function run(): void
|
||||
{
|
||||
$pendingMassEmailList = $this->entityManager
|
||||
->getRepository('MassEmail')
|
||||
->getRDBRepository('MassEmail')
|
||||
->where([
|
||||
'status' => 'Pending',
|
||||
'startAt<=' => date('Y-m-d H:i:s'),
|
||||
@@ -76,14 +76,14 @@ class ProcessMassEmail implements JobDataLess
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
'Job ProcessMassEmail#createQueue ' . $massEmail->id . ': [' . $e->getCode() . '] ' .
|
||||
'Job ProcessMassEmail#createQueue ' . $massEmail->getId() . ': [' . $e->getCode() . '] ' .
|
||||
$e->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$massEmailList = $this->entityManager
|
||||
->getRepository('MassEmail')
|
||||
->getRDBRepository('MassEmail')
|
||||
->where([
|
||||
'status' => 'In Process',
|
||||
])
|
||||
@@ -95,7 +95,7 @@ class ProcessMassEmail implements JobDataLess
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
'Job ProcessMassEmail#processSending '. $massEmail->id . ': [' . $e->getCode() . '] ' .
|
||||
'Job ProcessMassEmail#processSending '. $massEmail->getId() . ': [' . $e->getCode() . '] ' .
|
||||
$e->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -99,13 +99,13 @@ class SendEmailReminders implements JobDataLess
|
||||
}
|
||||
catch (Throwable $e) {
|
||||
$this->log->error(
|
||||
"Email reminder '{$entity->id}': " . $e->getMessage()
|
||||
"Email reminder '{$entity->getId()}': " . $e->getMessage()
|
||||
);
|
||||
}
|
||||
|
||||
$this->entityManager
|
||||
->getRepository('Reminder')
|
||||
->deleteFromDb($entity->id);
|
||||
->getRDBRepository('Reminder')
|
||||
->deleteFromDb($entity->getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
namespace Espo\Modules\Crm\Jobs;
|
||||
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
use Espo\Core\{
|
||||
ORM\EntityManager,
|
||||
Utils\Config,
|
||||
@@ -78,8 +80,9 @@ class SubmitPopupReminders implements JobDataLess
|
||||
|
||||
$nowShifted = $dt->modify('-' . $pastHours . ' hours')->format('Y-m-d H:i:s');
|
||||
|
||||
/** @var iterable<\Espo\Modules\Crm\Entities\Reminder> $reminderList */
|
||||
$reminderList = $this->entityManager
|
||||
->getRepository('Reminder')
|
||||
->getRDBRepository('Reminder')
|
||||
->where([
|
||||
'type' => 'Popup',
|
||||
'remindAt<=' => $now,
|
||||
@@ -109,7 +112,10 @@ class SubmitPopupReminders implements JobDataLess
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($entity->hasLinkMultipleField('users')) {
|
||||
if (
|
||||
$entity instanceof CoreEntity &&
|
||||
$entity->hasLinkMultipleField('users')
|
||||
) {
|
||||
$entity->loadLinkMultipleField('users', ['status' => 'acceptanceStatus']);
|
||||
|
||||
$status = $entity->getLinkMultipleColumn('users', 'status', $userId);
|
||||
@@ -128,9 +134,9 @@ class SubmitPopupReminders implements JobDataLess
|
||||
}
|
||||
|
||||
$data = [
|
||||
'id' => $reminder->id,
|
||||
'id' => $reminder->getId(),
|
||||
'data' => [
|
||||
'id' => $entity->id,
|
||||
'id' => $entity->getId(),
|
||||
'entityType' => $entityType,
|
||||
$dateAttribute => $entity->get($dateAttribute),
|
||||
'name' => $entity->get('name'),
|
||||
@@ -161,6 +167,6 @@ class SubmitPopupReminders implements JobDataLess
|
||||
|
||||
protected function deleteReminder($reminder)
|
||||
{
|
||||
$this->entityManager->getRepository('Reminder')->deleteFromDb($reminder->id);
|
||||
$this->entityManager->getRDBRepository('Reminder')->deleteFromDb($reminder->id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ class CaseObj extends \Espo\Core\Repositories\Database implements
|
||||
|
||||
if ($fetchedContactId) {
|
||||
$previousPortalUser = $this->entityManager
|
||||
->getRepository('User')
|
||||
->getRDBRepository('User')
|
||||
->select(['id'])
|
||||
->where([
|
||||
'contactId' => $fetchedContactId,
|
||||
@@ -77,7 +77,7 @@ class CaseObj extends \Espo\Core\Repositories\Database implements
|
||||
->findOne();
|
||||
|
||||
if ($previousPortalUser) {
|
||||
$this->getStreamService()->unfollowEntity($entity, $previousPortalUser->id);
|
||||
$this->getStreamService()->unfollowEntity($entity, $previousPortalUser->getId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class CaseObj extends \Espo\Core\Repositories\Database implements
|
||||
}
|
||||
|
||||
$portalUser = $this->entityManager
|
||||
->getRepository('User')
|
||||
->getRDBRepository('User')
|
||||
->select(['id'])
|
||||
->where([
|
||||
'contactId' => $contactId,
|
||||
@@ -100,7 +100,7 @@ class CaseObj extends \Espo\Core\Repositories\Database implements
|
||||
->findOne();
|
||||
|
||||
if ($portalUser) {
|
||||
$this->getStreamService()->followEntity($entity, $portalUser->id, true);
|
||||
$this->getStreamService()->followEntity($entity, $portalUser->getId(), true);
|
||||
}
|
||||
|
||||
if (!in_array($contactId, $contactIdList) && !$this->isRelated($entity, 'contacts', $contactId)) {
|
||||
|
||||
@@ -75,11 +75,12 @@ class Contact extends \Espo\Core\Repositories\Database
|
||||
}
|
||||
|
||||
if ($accountIdChanged || $titleChanged) {
|
||||
$accountContact = $this->entityManager->getRepository('AccountContact')
|
||||
$accountContact = $this->entityManager
|
||||
->getRDBRepository('AccountContact')
|
||||
->select(['role'])
|
||||
->where([
|
||||
'accountId' => $accountId,
|
||||
'contactId' => $entity->id,
|
||||
'contactId' => $entity->getId(),
|
||||
'deleted' => false,
|
||||
])
|
||||
->findOne();
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\Repositories\Event as EventRepository;
|
||||
use Espo\Core\Di;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
class Meeting extends EventRepository implements
|
||||
|
||||
@@ -75,7 +76,7 @@ class Meeting extends EventRepository implements
|
||||
}
|
||||
|
||||
if ($entity->isNew()) {
|
||||
$currentUserId = $this->user->id;
|
||||
$currentUserId = $this->user->getId();
|
||||
if (
|
||||
$entity->hasLinkMultipleId('users', $currentUserId) &&
|
||||
(
|
||||
@@ -111,7 +112,8 @@ class Meeting extends EventRepository implements
|
||||
$columnList[] = 'createdAccountName';
|
||||
}
|
||||
|
||||
$parent = $this->entityManager->getRepository($parentType)
|
||||
$parent = $this->entityManager
|
||||
->getRDBRepository($parentType)
|
||||
->select($columnList)
|
||||
->where(['id' => $parentId])
|
||||
->findOne();
|
||||
@@ -122,7 +124,7 @@ class Meeting extends EventRepository implements
|
||||
|
||||
if ($parent) {
|
||||
if ($parent->getEntityType() == 'Account') {
|
||||
$accountId = $parent->id;
|
||||
$accountId = $parent->getId();
|
||||
$accountName = $parent->get('name');
|
||||
}
|
||||
else if (
|
||||
@@ -136,6 +138,7 @@ class Meeting extends EventRepository implements
|
||||
|
||||
if (
|
||||
!$accountId && $parent->get('accountId') &&
|
||||
$parent instanceof CoreEntity &&
|
||||
$parent->getRelationParam('account', 'entity') == 'Account'
|
||||
) {
|
||||
$accountId = $parent->get('accountId');
|
||||
@@ -152,7 +155,7 @@ class Meeting extends EventRepository implements
|
||||
!$entity->get('accountName')
|
||||
) {
|
||||
$account = $this->entityManager
|
||||
->getRepository('Account')
|
||||
->getRDBRepository('Account')
|
||||
->select(['id', 'name'])
|
||||
->where(['id' => $entity->get('accountId')])
|
||||
->findOne();
|
||||
|
||||
@@ -31,6 +31,7 @@ namespace Espo\Modules\Crm\Repositories;
|
||||
|
||||
use Espo\ORM\Entity;
|
||||
use Espo\Core\Repositories\Event as EventRepository;
|
||||
use Espo\Core\ORM\Entity as CoreEntity;
|
||||
|
||||
class Task extends EventRepository
|
||||
{
|
||||
@@ -91,7 +92,7 @@ class Task extends EventRepository
|
||||
}
|
||||
|
||||
$parent = $this->entityManager
|
||||
->getRepository($parentType)
|
||||
->getRDBRepository($parentType)
|
||||
->select($columnList)
|
||||
->where(['id' => $parentId])
|
||||
->findOne();
|
||||
@@ -104,7 +105,7 @@ class Task extends EventRepository
|
||||
|
||||
if ($parent) {
|
||||
if ($parent->getEntityType() == 'Account') {
|
||||
$accountId = $parent->id;
|
||||
$accountId = $parent->getId();
|
||||
$accountName = $parent->get('name');
|
||||
}
|
||||
else if ($parent->getEntityType() == 'Lead' && $parent->get('status') == 'Converted') {
|
||||
@@ -119,20 +120,24 @@ class Task extends EventRepository
|
||||
}
|
||||
}
|
||||
else if ($parent->getEntityType() == 'Contact') {
|
||||
$contactId = $parent->id;
|
||||
$contactId = $parent->getId();
|
||||
$contactName = $parent->get('name');
|
||||
}
|
||||
|
||||
if (
|
||||
!$accountId &&
|
||||
$parent->get('accountId') && $parent->getRelationParam('account', 'entity') == 'Account'
|
||||
$parent->get('accountId') &&
|
||||
$parent instanceof CoreEntity &&
|
||||
$parent->getRelationParam('account', 'entity') == 'Account'
|
||||
) {
|
||||
$accountId = $parent->get('accountId');
|
||||
}
|
||||
|
||||
if (
|
||||
!$contactId &&
|
||||
$parent->get('contactId') && $parent->getRelationParam('contact', 'entity') == 'Contact'
|
||||
$parent->get('contactId') &&
|
||||
$parent instanceof CoreEntity &&
|
||||
$parent->getRelationParam('contact', 'entity') == 'Contact'
|
||||
) {
|
||||
$contactId = $parent->get('contactId');
|
||||
}
|
||||
@@ -149,7 +154,7 @@ class Task extends EventRepository
|
||||
!$entity->get('accountName')
|
||||
) {
|
||||
$account = $this->entityManager
|
||||
->getRepository('Account')
|
||||
->getRDBRepository('Account')
|
||||
->select(['id', 'name'])
|
||||
->where(['id' => $entity->get('accountId')])
|
||||
->findOne();
|
||||
@@ -164,7 +169,7 @@ class Task extends EventRepository
|
||||
!$entity->get('contactName')
|
||||
) {
|
||||
$contact = $this->entityManager
|
||||
->getRepository('Contact')
|
||||
->getRDBRepository('Contact')
|
||||
->select(['id', 'name'])
|
||||
->where(['id' => $entity->get('contactId')])
|
||||
->findOne();
|
||||
|
||||
@@ -34,10 +34,13 @@ use Espo\Core\Exceptions\NotFound;
|
||||
use Espo\Repositories\Attachment as AttachmentRepository;
|
||||
use Espo\Entities\Attachment;
|
||||
|
||||
use Espo\ORM\Collection;
|
||||
|
||||
class Document extends \Espo\Services\Record
|
||||
{
|
||||
/**
|
||||
* @return iterable
|
||||
* @return Collection
|
||||
* @phpstan-return iterable<Attachment>&Collection
|
||||
*/
|
||||
public function getAttachmentList(string $id)
|
||||
{
|
||||
@@ -48,11 +51,13 @@ class Document extends \Espo\Services\Record
|
||||
}
|
||||
|
||||
$fileId = $entity->get('fileId');
|
||||
|
||||
if (!$fileId) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
$file = $this->getEntityManager()->getEntity('Attachment', $fileId);
|
||||
|
||||
if (!$file) {
|
||||
throw new NotFound();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ use Espo\Core\{
|
||||
use DateTime;
|
||||
use DateInterval;
|
||||
use PDO;
|
||||
use StdClass;
|
||||
use stdClass;
|
||||
|
||||
class Opportunity extends Record
|
||||
{
|
||||
@@ -60,7 +60,7 @@ class Opportunity extends Record
|
||||
?string $dateTo = null,
|
||||
bool $useLastStage = false,
|
||||
?string $teamId = null
|
||||
): StdClass {
|
||||
): stdClass {
|
||||
|
||||
if (in_array('amount', $this->getAcl()->getScopeForbiddenAttributeList(OpportunityEntity::ENTITY_TYPE))) {
|
||||
throw new Forbidden();
|
||||
@@ -158,8 +158,10 @@ class Opportunity extends Record
|
||||
}
|
||||
|
||||
public function reportByLeadSource(
|
||||
string $dateFilter, ?string $dateFrom = null, ?string $dateTo = null
|
||||
): StdClass {
|
||||
string $dateFilter,
|
||||
?string $dateFrom = null,
|
||||
?string $dateTo = null
|
||||
): stdClass {
|
||||
|
||||
if (in_array('amount', $this->getAcl()->getScopeForbiddenAttributeList(OpportunityEntity::ENTITY_TYPE))) {
|
||||
throw new Forbidden();
|
||||
@@ -223,8 +225,10 @@ class Opportunity extends Record
|
||||
}
|
||||
|
||||
public function reportByStage(
|
||||
string $dateFilter, ?string $dateFrom = null, ?string $dateTo = null
|
||||
): StdClass {
|
||||
string $dateFilter,
|
||||
?string $dateFrom = null,
|
||||
?string $dateTo = null
|
||||
): stdClass {
|
||||
|
||||
if (in_array('amount', $this->getAcl()->getScopeForbiddenAttributeList(OpportunityEntity::ENTITY_TYPE))) {
|
||||
throw new Forbidden();
|
||||
@@ -304,7 +308,7 @@ class Opportunity extends Record
|
||||
string $dateFilter,
|
||||
?string $dateFrom = null,
|
||||
?string $dateTo = null
|
||||
): StdClass {
|
||||
): stdClass {
|
||||
|
||||
if (in_array('amount', $this->getAcl()->getScopeForbiddenAttributeList(OpportunityEntity::ENTITY_TYPE))) {
|
||||
throw new Forbidden();
|
||||
@@ -588,7 +592,7 @@ class Opportunity extends Record
|
||||
return $list;
|
||||
}
|
||||
|
||||
protected function getAccountEmailAddress(OpportunityEntity $entity, array $dataList): ?StdClass
|
||||
protected function getAccountEmailAddress(OpportunityEntity $entity, array $dataList): ?stdClass
|
||||
{
|
||||
$account = $this->entityManager->getEntity('Account', $entity->get('accountId'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user