@@ -66,8 +66,9 @@ discard block |
||
| 66 | 66 | $mainCompany = $this->getMainCompany(); |
| 67 | 67 | |
| 68 | 68 | $isSuper = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'employee', 1); |
| 69 | - if ($isSuper) |
|
| 70 | - $peopleRole[] = 'super'; |
|
| 69 | + if ($isSuper) { |
|
| 70 | + $peopleRole[] = 'super'; |
|
| 71 | + } |
|
| 71 | 72 | |
| 72 | 73 | $isFranchisee = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'franchisee', 1); |
| 73 | 74 | if ($isFranchisee) { |
@@ -76,13 +77,15 @@ discard block |
||
| 76 | 77 | } |
| 77 | 78 | |
| 78 | 79 | $isClient = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'client', 1); |
| 79 | - if ($isClient) |
|
| 80 | - $peopleRole[] = 'client'; |
|
| 80 | + if ($isClient) { |
|
| 81 | + $peopleRole[] = 'client'; |
|
| 82 | + } |
|
| 81 | 83 | |
| 82 | 84 | |
| 83 | 85 | $isSalesman = $this->manager->getRepository(People::class)->getCompanyPeopleLinks($mainCompany, $people, 'salesman', 1); |
| 84 | - if ($isSalesman) |
|
| 85 | - $peopleRole[] = 'salesman'; |
|
| 86 | + if ($isSalesman) { |
|
| 87 | + $peopleRole[] = 'salesman'; |
|
| 88 | + } |
|
| 86 | 89 | |
| 87 | 90 | |
| 88 | 91 | return array_values(array_unique(empty($peopleRole) ? ['guest'] : $peopleRole)); |
@@ -98,10 +101,11 @@ discard block |
||
| 98 | 101 | $domain = $this->domainService->getMainDomain(); |
| 99 | 102 | $company = $this->manager->getRepository(PeopleDomain::class)->findOneBy(['domain' => $domain]); |
| 100 | 103 | |
| 101 | - if ($company === null) |
|
| 102 | - throw new \Exception( |
|
| 104 | + if ($company === null) { |
|
| 105 | + throw new \Exception( |
|
| 103 | 106 | sprintf('Main company "%s" not found', $domain) |
| 104 | 107 | ); |
| 108 | + } |
|
| 105 | 109 | |
| 106 | 110 | return $company->getPeople(); |
| 107 | 111 | } |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | PeopleRoleService $roles) |
| 32 | 32 | { |
| 33 | 33 | $this->security = $security; |
| 34 | - $this->em = $entityManager; |
|
| 34 | + $this->em = $entityManager; |
|
| 35 | 35 | $this->roles = $roles; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - $peopleemployee = $this->em->getRepository(PeopleLink::class)->findOneBy(['company' => $company, 'employee' => $userPeople]); |
|
| 141 | + $peopleemployee = $this->em->getRepository(PeopleLink::class)->findOneBy(['company' => $company, 'employee' => $userPeople]); |
|
| 142 | 142 | |
| 143 | 143 | $permissions[$company->getId()][] = 'salesman'; |
| 144 | 144 | $myCompanies[$company->getId()] = [ |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | $myCompanies[$key]['permission'] = array_values($permission); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - usort($myCompanies, function ($a, $b) { |
|
| 169 | + usort($myCompanies, function($a, $b) { |
|
| 170 | 170 | |
| 171 | 171 | if ($a['alias'] == $b['alias']) { |
| 172 | 172 | return 0; |
@@ -212,11 +212,11 @@ discard block |
||
| 212 | 212 | $p_m[$package_module->getId()]['module'] = $package_module->getModule()->getName(); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - $packages[$people_package->getId()]['id'] = $people_package->getId(); |
|
| 216 | - $packages[$people_package->getId()]['package']['id'] = $package->getId(); |
|
| 217 | - $packages[$people_package->getId()]['package']['name'] = $package->getName(); |
|
| 218 | - $packages[$people_package->getId()]['package']['active'] = $package->isActive() ? true : false; |
|
| 219 | - $packages[$people_package->getId()]['package']['modules'] = $p_m; |
|
| 215 | + $packages[$people_package->getId()]['id'] = $people_package->getId(); |
|
| 216 | + $packages[$people_package->getId()]['package']['id'] = $package->getId(); |
|
| 217 | + $packages[$people_package->getId()]['package']['name'] = $package->getName(); |
|
| 218 | + $packages[$people_package->getId()]['package']['active'] = $package->isActive() ? true : false; |
|
| 219 | + $packages[$people_package->getId()]['package']['modules'] = $p_m; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | return $packages; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | /** |
| 252 | 252 | * @var \ControleOnline\Entity\Document $document |
| 253 | 253 | */ |
| 254 | - $documents = $documents->filter(function ($document) { |
|
| 254 | + $documents = $documents->filter(function($document) { |
|
| 255 | 255 | return $document->getDocumentType()->getDocumentType() == 'CNPJ'; |
| 256 | 256 | }); |
| 257 | 257 | |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | return [ |
| 265 | 265 | 'id' => $company->getFile()->getId(), |
| 266 | 266 | 'domain' => $this->domainService->getMainDomain(), |
| 267 | - 'url' => '/files/download/' . $company->getFile()->getId() |
|
| 267 | + 'url' => '/files/download/'.$company->getFile()->getId() |
|
| 268 | 268 | ]; |
| 269 | 269 | |
| 270 | 270 | return null; |
@@ -260,12 +260,13 @@ |
||
| 260 | 260 | |
| 261 | 261 | private function getLogo(People $company): ?array |
| 262 | 262 | { |
| 263 | - if ($company->getFile() instanceof File) |
|
| 264 | - return [ |
|
| 263 | + if ($company->getFile() instanceof File) { |
|
| 264 | + return [ |
|
| 265 | 265 | 'id' => $company->getFile()->getId(), |
| 266 | 266 | 'domain' => $this->domainService->getMainDomain(), |
| 267 | 267 | 'url' => '/files/download/' . $company->getFile()->getId() |
| 268 | 268 | ]; |
| 269 | + } |
|
| 269 | 270 | |
| 270 | 271 | return null; |
| 271 | 272 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'logo' => $this->company->getPeople()->getFile() ? [ |
| 72 | 72 | 'id' => $this->company->getPeople()->getFile()->getId(), |
| 73 | 73 | 'domain' => $this->domainService->getMainDomain(), |
| 74 | - 'url' => '/files/download/' . $this->company->getPeople()->getFile()->getId() |
|
| 74 | + 'url' => '/files/download/'.$this->company->getPeople()->getFile()->getId() |
|
| 75 | 75 | ] : null, |
| 76 | 76 | ]; |
| 77 | 77 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | 'background' => $this->company->getTheme()->getBackground() ? [ |
| 110 | 110 | 'id' => $this->company->getTheme()->getBackground(), |
| 111 | 111 | 'domain' => $this->domainService->getMainDomain(), |
| 112 | - 'url' => '/files/download/' . $this->company->getTheme()->getBackground() |
|
| 112 | + 'url' => '/files/download/'.$this->company->getTheme()->getBackground() |
|
| 113 | 113 | ] : null, |
| 114 | 114 | ]; |
| 115 | 115 | } |