@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | ], |
14 | 14 | ], |
15 | 15 | 'annotation' => [ |
16 | - 'paths' => [ __DIR__ . '/../src/Organizations/Entity'] |
|
16 | + 'paths' => [__DIR__.'/../src/Organizations/Entity'] |
|
17 | 17 | ], |
18 | 18 | ], |
19 | 19 | 'eventmanager' => [ |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'translation_file_patterns' => [ |
41 | 41 | [ |
42 | 42 | 'type' => 'gettext', |
43 | - 'base_dir' => __DIR__ . '/../language', |
|
43 | + 'base_dir' => __DIR__.'/../language', |
|
44 | 44 | 'pattern' => '%s.mo', |
45 | 45 | ], |
46 | 46 | ], |
@@ -66,18 +66,18 @@ discard block |
||
66 | 66 | 'view_manager' => [ |
67 | 67 | // Map template to files. Speeds up the lookup through the template stack. |
68 | 68 | 'template_map' => [ |
69 | - 'organizations/index/edit' => __DIR__ . '/../view/organizations/index/form.phtml', |
|
70 | - 'organizations/form/employees-fieldset' => __DIR__ . '/../view/form/employees-fieldset.phtml', |
|
71 | - 'organizations/form/employee-fieldset' => __DIR__ .'/../view/form/employee-fieldset.phtml', |
|
72 | - 'organizations/form/invite-employee-bar' => __DIR__ . '/../view/form/invite-employee-bar.phtml', |
|
73 | - 'organizations/error/no-parent' => __DIR__ . '/../view/error/no-parent.phtml', |
|
74 | - 'organizations/error/invite' => __DIR__ . '/../view/error/invite.phtml', |
|
75 | - 'organizations/mail/invite-employee' => __DIR__ . '/../view/mail/invite-employee.phtml', |
|
76 | - 'organizations/form/workflow-fieldset' => __DIR__ . '/../view/form/workflow-fieldset.phtml', |
|
69 | + 'organizations/index/edit' => __DIR__.'/../view/organizations/index/form.phtml', |
|
70 | + 'organizations/form/employees-fieldset' => __DIR__.'/../view/form/employees-fieldset.phtml', |
|
71 | + 'organizations/form/employee-fieldset' => __DIR__.'/../view/form/employee-fieldset.phtml', |
|
72 | + 'organizations/form/invite-employee-bar' => __DIR__.'/../view/form/invite-employee-bar.phtml', |
|
73 | + 'organizations/error/no-parent' => __DIR__.'/../view/error/no-parent.phtml', |
|
74 | + 'organizations/error/invite' => __DIR__.'/../view/error/invite.phtml', |
|
75 | + 'organizations/mail/invite-employee' => __DIR__.'/../view/mail/invite-employee.phtml', |
|
76 | + 'organizations/form/workflow-fieldset' => __DIR__.'/../view/form/workflow-fieldset.phtml', |
|
77 | 77 | ], |
78 | 78 | // Where to look for view templates not mapped above |
79 | 79 | 'template_path_stack' => [ |
80 | - __DIR__ . '/../view', |
|
80 | + __DIR__.'/../view', |
|
81 | 81 | ], |
82 | 82 | ], |
83 | 83 | 'form_elements' => [ |
@@ -155,13 +155,13 @@ discard block |
||
155 | 155 | 'allow' => [ |
156 | 156 | 'Entity/OrganizationImage', |
157 | 157 | 'route/lang/organizations/invite', |
158 | - 'Organizations/InviteEmployee' => [ 'accept' ], |
|
158 | + 'Organizations/InviteEmployee' => ['accept'], |
|
159 | 159 | 'route/lang/organizations/profile', |
160 | 160 | 'route/lang/organizations/profileDetail', |
161 | 161 | ], |
162 | 162 | 'deny' => [ |
163 | 163 | 'route/lang/organizations', |
164 | - 'Organizations/InviteEmployee' => [ 'invite' ], |
|
164 | + 'Organizations/InviteEmployee' => ['invite'], |
|
165 | 165 | ], |
166 | 166 | ], |
167 | 167 | // recruiters are allowed to view their companies |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | 'allow' => [ |
170 | 170 | 'route/lang/organizations', |
171 | 171 | 'Organizations/InviteEmployee', |
172 | - 'Entity/Organization' => [ 'edit' => 'Organizations/Write' ], |
|
172 | + 'Entity/Organization' => ['edit' => 'Organizations/Write'], |
|
173 | 173 | 'route/lang/organizations/profile', |
174 | 174 | 'route/lang/organizations/profileDetail' |
175 | 175 | ], |
@@ -187,8 +187,8 @@ discard block |
||
187 | 187 | 'organizations' => [ |
188 | 188 | 'label' => 'Organizations', |
189 | 189 | 'route' => 'lang/organizations', |
190 | - 'order' => 65, // allows to order the menu items |
|
191 | - 'resource' => 'route/lang/organizations', // if a resource is defined, the acl will be applied. |
|
190 | + 'order' => 65, // allows to order the menu items |
|
191 | + 'resource' => 'route/lang/organizations', // if a resource is defined, the acl will be applied. |
|
192 | 192 | |
193 | 193 | 'pages' => [ |
194 | 194 | 'list' => [ |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * |
34 | 34 | * @var String |
35 | 35 | */ |
36 | - protected $repositoryName="Organizations/Organization"; |
|
36 | + protected $repositoryName = "Organizations/Organization"; |
|
37 | 37 | |
38 | 38 | /** |
39 | 39 | * Sortable fields |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | */ |
92 | 92 | $auth = $this->authService; |
93 | 93 | $user = $auth->getUser(); |
94 | - $ignored = [null,'guest',UserInterface::ROLE_USER]; |
|
95 | - if(!in_array($user->getRole(),$ignored)){ |
|
94 | + $ignored = [null, 'guest', UserInterface::ROLE_USER]; |
|
95 | + if (!in_array($user->getRole(), $ignored)) { |
|
96 | 96 | $queryBuilder->field('permissions.view')->equals($user->getId()); |
97 | 97 | } |
98 | 98 | |
99 | - if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile' ) { |
|
99 | + if (isset($params['q']) && $params['q'] && $params['q'] != 'en/organizations/profile') { |
|
100 | 100 | $queryBuilder->text($params['q'])->language('none'); |
101 | 101 | } |
102 | 102 | |
@@ -106,14 +106,14 @@ discard block |
||
106 | 106 | |
107 | 107 | $queryBuilder->sort($this->filterSort($value['sort'])); |
108 | 108 | |
109 | - if(isset($params['type']) && $params['type'] === 'profile'){ |
|
109 | + if (isset($params['type']) && $params['type'] === 'profile') { |
|
110 | 110 | //@TODO: we should use aggregate query here |
111 | 111 | $queryBuilder->field('profileSetting') |
112 | - ->in([Organization::PROFILE_ALWAYS_ENABLE,Organization::PROFILE_ACTIVE_JOBS]) |
|
112 | + ->in([Organization::PROFILE_ALWAYS_ENABLE, Organization::PROFILE_ACTIVE_JOBS]) |
|
113 | 113 | ; |
114 | 114 | |
115 | 115 | $filters = $this->getOrganizationProfileFilters($queryBuilder); |
116 | - if(count($filters) > 0){ |
|
116 | + if (count($filters) > 0) { |
|
117 | 117 | $queryBuilder->field('id')->notIn($filters); |
118 | 118 | } |
119 | 119 | |
@@ -133,8 +133,8 @@ discard block |
||
133 | 133 | $results = $queryBuilder->getQuery()->execute(); |
134 | 134 | |
135 | 135 | $filters = []; |
136 | - foreach($results->toArray() as $organization){ |
|
137 | - if($organization->getProfileSetting()==Organization::PROFILE_ACTIVE_JOBS){ |
|
136 | + foreach ($results->toArray() as $organization) { |
|
137 | + if ($organization->getProfileSetting() == Organization::PROFILE_ACTIVE_JOBS) { |
|
138 | 138 | $qb = $jobRepository->createQueryBuilder(); |
139 | 139 | $qb |
140 | 140 | ->field('organization')->equals($organization->getId()) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | ->field('isDraft')->notEqual(true) |
143 | 143 | ; |
144 | 144 | $count = $qb->getQuery()->execute()->count(); |
145 | - if($count == 0){ |
|
145 | + if ($count == 0) { |
|
146 | 146 | $filters[] = $organization->getId(); |
147 | 147 | } |
148 | 148 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | /* @TODO: $jobRepository should be removed when using aggregation query in filtering profile */ |
38 | 38 | $authService = $container->get('AuthenticationService'); |
39 | 39 | $jobRepository = $container->get('Core/RepositoryService')->get('Jobs/Job'); |
40 | - $filter = new PaginationQuery($jobRepository,$authService); |
|
40 | + $filter = new PaginationQuery($jobRepository, $authService); |
|
41 | 41 | return $filter; |
42 | 42 | } |
43 | 43 | } |
@@ -33,6 +33,6 @@ |
||
33 | 33 | $translator = $container->get('translator'); |
34 | 34 | $imageFileCacheManager = $container->get('Organizations\ImageFileCache\Manager'); |
35 | 35 | $options = $container->get('Jobs/JobboardSearchOptions'); |
36 | - return new ProfileController($repo,$jobRepository,$translator,$imageFileCacheManager,['count' => $options->getPerPage()]); |
|
36 | + return new ProfileController($repo, $jobRepository, $translator, $imageFileCacheManager, ['count' => $options->getPerPage()]); |
|
37 | 37 | } |
38 | 38 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | { |
83 | 83 | |
84 | 84 | $result = $this->pagination([ |
85 | - 'params' => ['Organizations_Profile',[ |
|
85 | + 'params' => ['Organizations_Profile', [ |
|
86 | 86 | 'q', |
87 | 87 | 'count' => $this->options['count'], |
88 | 88 | 'page' => 1, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $repo = $this->repo; |
113 | 113 | $id = $this->params('id'); |
114 | 114 | |
115 | - if(is_null($id)){ |
|
115 | + if (is_null($id)) { |
|
116 | 116 | $this->getResponse()->setStatusCode(Response::STATUS_CODE_404); |
117 | 117 | return [ |
118 | 118 | 'message' => $translator->translate('Can not access profile page without id'), |
@@ -121,20 +121,20 @@ discard block |
||
121 | 121 | } |
122 | 122 | |
123 | 123 | $organization = $repo->find($id); |
124 | - if(!$organization instanceof Organization){ |
|
124 | + if (!$organization instanceof Organization) { |
|
125 | 125 | throw new NotFoundException($id); |
126 | 126 | } |
127 | 127 | |
128 | - if( |
|
128 | + if ( |
|
129 | 129 | Organization::PROFILE_DISABLED == $organization->getProfileSetting() |
130 | 130 | || is_null($organization->getProfileSetting()) |
131 | - ){ |
|
131 | + ) { |
|
132 | 132 | throw new UnauthorizedAccessException(/*@translate*/ 'This Organization Profile is disabled'); |
133 | 133 | } |
134 | 134 | |
135 | 135 | $result = $this->pagination([ |
136 | 136 | 'params' => [ |
137 | - 'Organization_Jobs',[ |
|
137 | + 'Organization_Jobs', [ |
|
138 | 138 | 'q', |
139 | 139 | 'organization_id' => $organization->getId(), |
140 | 140 | 'count' => $this->options['count'], |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | ], |
148 | 148 | ]); |
149 | 149 | |
150 | - if( |
|
150 | + if ( |
|
151 | 151 | Organization::PROFILE_ACTIVE_JOBS == $organization->getProfileSetting() |
152 | - ){ |
|
152 | + ) { |
|
153 | 153 | /* @var \Zend\Paginator\Paginator $paginator */ |
154 | 154 | $paginator = $result['jobs']; |
155 | 155 | $count = $paginator->getTotalItemCount(); |
156 | - if(0===$count){ |
|
156 | + if (0 === $count) { |
|
157 | 157 | throw new UnauthorizedAccessException($this->translator->translate('This Organization Profile is disabled')); |
158 | 158 | } |
159 | 159 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $response = $this->getResponse(); |
74 | 74 | |
75 | 75 | try { |
76 | - $repository = $this->repositories->get($module . '/' . $entityName); |
|
76 | + $repository = $this->repositories->get($module.'/'.$entityName); |
|
77 | 77 | } catch (\Exception $e) { |
78 | 78 | $response->setStatusCode(404); |
79 | 79 | $this->getEvent()->setParam('exception', $e); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | |
108 | 108 | $this->acl($file); |
109 | 109 | |
110 | - $headers=$response->getHeaders(); |
|
110 | + $headers = $response->getHeaders(); |
|
111 | 111 | |
112 | 112 | $headers->addHeaderline('Content-Type', $file->getType()) |
113 | 113 | ->addHeaderline('Content-Length', $file->getLength()); |
@@ -26,6 +26,6 @@ |
||
26 | 26 | $repositories = $container->get('repositories'); |
27 | 27 | $coreFileEvents = $container->get('Core/File/Events'); |
28 | 28 | |
29 | - return new FileController($repositories,$coreFileEvents); |
|
29 | + return new FileController($repositories, $coreFileEvents); |
|
30 | 30 | } |
31 | 31 | } |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | public function iHaveOrganization($name) |
104 | 104 | { |
105 | 105 | $user = $this->getUserContext()->getCurrentUser(); |
106 | - $organization = $this->findOrganizationByName($name,false); |
|
106 | + $organization = $this->findOrganizationByName($name, false); |
|
107 | 107 | $repo = $this->getRepository('Organizations/Organization'); |
108 | - if(!$organization instanceof Organization){ |
|
108 | + if (!$organization instanceof Organization) { |
|
109 | 109 | |
110 | 110 | $organization = new Organization(); |
111 | 111 | $organizationName = new OrganizationName($name); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $organization->setParent($parent); |
119 | 119 | $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE); |
120 | 120 | $permissions = $organization->getPermissions(); |
121 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
121 | + $permissions->grant($user, Permissions::PERMISSION_ALL); |
|
122 | 122 | |
123 | 123 | $repo->store($organization); |
124 | 124 | $repo->getDocumentManager()->refresh($organization); |
@@ -128,19 +128,19 @@ discard block |
||
128 | 128 | /** |
129 | 129 | * @Given organization :name have jobs: |
130 | 130 | */ |
131 | - public function organizationHavePublishedJob($name,TableNode $table) |
|
131 | + public function organizationHavePublishedJob($name, TableNode $table) |
|
132 | 132 | { |
133 | 133 | $user = $this->getUserContext()->getCurrentUser(); |
134 | - if(is_null($user)){ |
|
134 | + if (is_null($user)) { |
|
135 | 135 | throw new FailedExpectationException('Need to login first'); |
136 | 136 | } |
137 | 137 | |
138 | 138 | $organization = $this->findOrganizationByName($name); |
139 | - foreach($table->getColumnsHash() as $index=>$definitions){ |
|
139 | + foreach ($table->getColumnsHash() as $index=>$definitions) { |
|
140 | 140 | $definitions['user'] = $user->getLogin(); |
141 | - $status = isset($definitions['status']) ? $definitions['status']:'draft'; |
|
141 | + $status = isset($definitions['status']) ? $definitions['status'] : 'draft'; |
|
142 | 142 | unset($definitions['status']); |
143 | - $this->jobContext->buildJob($status,$definitions,$organization); |
|
143 | + $this->jobContext->buildJob($status, $definitions, $organization); |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param $name |
150 | 150 | * @param $setting |
151 | 151 | */ |
152 | - public function profileSetting($name,$setting) |
|
152 | + public function profileSetting($name, $setting) |
|
153 | 153 | { |
154 | 154 | $repo = $this->getRepository('Organizations/Organization'); |
155 | 155 | $organization = $this->findOrganizationByName($name); |
@@ -169,12 +169,12 @@ discard block |
||
169 | 169 | $contact = $organization->getContact(); |
170 | 170 | |
171 | 171 | $definitions = $table->getRowsHash(); |
172 | - foreach($definitions as $name=>$value){ |
|
172 | + foreach ($definitions as $name=>$value) { |
|
173 | 173 | $field = Inflector::camelize($name); |
174 | 174 | $method = 'set'.$field; |
175 | - $callback = array($contact,$method); |
|
176 | - if(is_callable($callback)){ |
|
177 | - call_user_func_array($callback,[$value]); |
|
175 | + $callback = array($contact, $method); |
|
176 | + if (is_callable($callback)) { |
|
177 | + call_user_func_array($callback, [$value]); |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | $this->getRepository('Organizations/Organization')->store($organization); |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | * @param string $name |
187 | 187 | * @throws FailedExpectationException |
188 | 188 | */ |
189 | - public function iGoToOrganizationProfilePage($name=null) |
|
189 | + public function iGoToOrganizationProfilePage($name = null) |
|
190 | 190 | { |
191 | - if(is_null($name)){ |
|
191 | + if (is_null($name)) { |
|
192 | 192 | $organization = $this->getUserContext()->getCurrentUser()->getOrganization()->getOrganization(); |
193 | - }else{ |
|
193 | + } else { |
|
194 | 194 | $organization = $this->findOrganizationByName($name); |
195 | 195 | } |
196 | - $url = $this->buildUrl('lang/organizations/profileDetail',[ |
|
196 | + $url = $this->buildUrl('lang/organizations/profileDetail', [ |
|
197 | 197 | 'id' => $organization->getId() |
198 | 198 | ]); |
199 | 199 | |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | /* @var OrganizationRepository $repo */ |
211 | 211 | $repo = $this->getRepository('Organizations/Organization'); |
212 | 212 | $result = $repo->findByName($name); |
213 | - $organization = count($result) > 0 ? $result[0]:null; |
|
214 | - if(!$organization instanceof Organization && $throwException){ |
|
213 | + $organization = count($result) > 0 ? $result[0] : null; |
|
214 | + if (!$organization instanceof Organization && $throwException) { |
|
215 | 215 | throw new FailedExpectationException( |
216 | - sprintf('Organization %s is not found.',$name) |
|
216 | + sprintf('Organization %s is not found.', $name) |
|
217 | 217 | ); |
218 | 218 | } |
219 | 219 | return $organization; |
@@ -232,8 +232,8 @@ discard block |
||
232 | 232 | $jobRepo = $this->getRepository('Jobs/Job'); |
233 | 233 | $result = $jobRepo->findByOrganization($org->getId()); |
234 | 234 | |
235 | - foreach($result as $job){ |
|
236 | - $jobRepo->remove($job,true); |
|
235 | + foreach ($result as $job) { |
|
236 | + $jobRepo->remove($job, true); |
|
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | { |
245 | 245 | $user = $this->getUserContext()->getCurrentUser(); |
246 | 246 | $organization = $user->getOrganization()->getOrganization(); |
247 | - $url = $this->buildUrl('lang/organizations/edit',['id' => $organization->getId()]); |
|
247 | + $url = $this->buildUrl('lang/organizations/edit', ['id' => $organization->getId()]); |
|
248 | 248 | $this->visit($url); |
249 | 249 | } |
250 | 250 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | public function iAttachLogoFromFile($file) |
256 | 256 | { |
257 | 257 | $elementId = 'organizationLogo-original'; |
258 | - $this->minkContext->attachFileToField($elementId,$file); |
|
258 | + $this->minkContext->attachFileToField($elementId, $file); |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | public function iRemoveLogoFromOrganization() |
265 | 265 | { |
266 | 266 | $elementId = '#organizationLogo-original-delete'; |
267 | - $element = $this->minkContext->getSession()->getPage()->find('css',$elementId); |
|
267 | + $element = $this->minkContext->getSession()->getPage()->find('css', $elementId); |
|
268 | 268 | $element->click(); |
269 | 269 | } |
270 | 270 | } |