getParsedBody(); if (empty($data->id)) { throw new BadRequest(); } /** @var \Espo\Modules\Crm\Entities\Call|null */ $entity = $this->getCallService()->getEntity($data->id); if (!$entity) { throw new NotFound(); } if (!$this->getAcl()->check($entity, 'edit')) { throw new Forbidden(); } if (!$this->getAcl()->checkScope('Email', 'create')) { throw new Forbidden(); } return $this->getCallService()->sendInvitations($entity); } public function postActionMassSetHeld(Request $request) { $data = $request->getParsedBody(); if (empty($data->ids) || !is_array($data->ids)) { throw new BadRequest(); } return $this->getCallService()->massSetHeld($data->ids); } public function postActionMassSetNotHeld(Request $request) { $data = $request->getParsedBody(); if (empty($data->ids) || !is_array($data->ids)) { throw new BadRequest(); } return $this->getCallService()->massSetNotHeld($data->ids); } public function postActionSetAcceptanceStatus(Request $request) { $data = $request->getParsedBody(); if (empty($data->id) || empty($data->status)) { throw new BadRequest(); } return $this->getCallService()->setAcceptanceStatus($data->id, $data->status); } private function getCallService(): Service { /** @var Service */ return $this->getRecordService(); } }