@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
| 61 | - * @return $this|void |
|
| 61 | + * @return ManageController |
|
| 62 | 62 | */ |
| 63 | 63 | public function attachDefaultListeners() |
| 64 | 64 | { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | /** |
| 121 | 121 | * @TODO edit-Action and save-Action are doing the same, one of them has to quit |
| 122 | 122 | * |
| 123 | - * @return null|ViewModel |
|
| 123 | + * @return ViewModel |
|
| 124 | 124 | */ |
| 125 | 125 | public function editAction() |
| 126 | 126 | { |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * @return null|ViewModel |
|
| 137 | + * @return ViewModel |
|
| 138 | 138 | */ |
| 139 | 139 | public function saveAction() |
| 140 | 140 | { |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * parameter are arbitrary elements for defaults or programming flow |
| 150 | 150 | * |
| 151 | 151 | * @param array $parameter |
| 152 | - * @return null|ViewModel |
|
| 152 | + * @return ViewModel |
|
| 153 | 153 | * @throws \RuntimeException |
| 154 | 154 | */ |
| 155 | 155 | protected function save($parameter = array()) |
@@ -354,8 +354,8 @@ discard block |
||
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | /** |
| 357 | - * @param $job |
|
| 358 | - * @return mixed |
|
| 357 | + * @param \Jobs\Entity\Job $job |
|
| 358 | + * @return \Jobs\Form\Job |
|
| 359 | 359 | */ |
| 360 | 360 | protected function getFormular($job) |
| 361 | 361 | { |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | - * @param $form |
|
| 415 | + * @param \Jobs\Form\Job $form |
|
| 416 | 416 | * @param array $params |
| 417 | 417 | * @return ViewModel |
| 418 | 418 | */ |
@@ -548,7 +548,7 @@ discard block |
||
| 548 | 548 | /** |
| 549 | 549 | * Deactivate a job posting |
| 550 | 550 | * |
| 551 | - * @return null|ViewModel |
|
| 551 | + * @return ViewModel |
|
| 552 | 552 | */ |
| 553 | 553 | public function deactivateAction() |
| 554 | 554 | { |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | /** |
| 587 | - * @param $script |
|
| 587 | + * @param string $script |
|
| 588 | 588 | * @param array $parameter |
| 589 | 589 | * @return ViewModel |
| 590 | 590 | */ |
@@ -492,9 +492,9 @@ discard block |
||
| 492 | 492 | // we want just some Values to be compared |
| 493 | 493 | $diff = null; |
| 494 | 494 | foreach (array('title', 'organization', 'location', |
| 495 | - 'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title', |
|
| 496 | - 'templateValues._freeValues.description', |
|
| 497 | - ) as $prelKey) { |
|
| 495 | + 'templateValues.qualifications', 'templateValues.requirements', 'templateValues.benefits', 'templateValues.title', |
|
| 496 | + 'templateValues._freeValues.description', |
|
| 497 | + ) as $prelKey) { |
|
| 498 | 498 | if (array_key_exists($prelKey, $prelDiff)) { |
| 499 | 499 | $diff[$prelKey] = $prelDiff[$prelKey]; |
| 500 | 500 | } |
@@ -521,28 +521,28 @@ discard block |
||
| 521 | 521 | 'lang/jobs/view', |
| 522 | 522 | array(), |
| 523 | 523 | array('query' => |
| 524 | - array( 'id' => $jobEntity->getId())) |
|
| 524 | + array( 'id' => $jobEntity->getId())) |
|
| 525 | 525 | ); |
| 526 | 526 | |
| 527 | 527 | $approvalLink = $this->url()->fromRoute( |
| 528 | 528 | 'lang/jobs/approval', |
| 529 | 529 | array('state' => 'approved'), |
| 530 | 530 | array('query' => |
| 531 | - array( 'id' => $jobEntity->getId())) |
|
| 531 | + array( 'id' => $jobEntity->getId())) |
|
| 532 | 532 | ); |
| 533 | 533 | |
| 534 | 534 | $declineLink = $this->url()->fromRoute( |
| 535 | 535 | 'lang/jobs/approval', |
| 536 | 536 | array('state' => 'declined'), |
| 537 | 537 | array('query' => |
| 538 | - array( 'id' => $jobEntity->getId())) |
|
| 538 | + array( 'id' => $jobEntity->getId())) |
|
| 539 | 539 | ); |
| 540 | 540 | |
| 541 | 541 | return array('job' => $jobEntity, |
| 542 | - 'diffSnapshot' => $diff, |
|
| 543 | - 'viewLink' => $viewLink, |
|
| 544 | - 'approvalLink' => $approvalLink, |
|
| 545 | - 'declineLink' => $declineLink); |
|
| 542 | + 'diffSnapshot' => $diff, |
|
| 543 | + 'viewLink' => $viewLink, |
|
| 544 | + 'approvalLink' => $approvalLink, |
|
| 545 | + 'declineLink' => $declineLink); |
|
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | /** |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | if (empty($user->info->email)) { |
| 160 | 160 | return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail')); |
| 161 | 161 | } |
| 162 | - $userOrg = $user->getOrganization(); |
|
| 162 | + $userOrg = $user->getOrganization(); |
|
| 163 | 163 | if (!$userOrg->hasAssociation()) { |
| 164 | 164 | return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany')); |
| 165 | 165 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $params = $this->params(); |
| 175 | 175 | $formIdentifier = $params->fromQuery('form'); |
| 176 | - $pageIdentifier = (int) $params->fromQuery('page', array_key_exists('page', $parameter)?$parameter['page']:0); |
|
| 176 | + $pageIdentifier = (int) $params->fromQuery('page', array_key_exists('page', $parameter) ? $parameter['page'] : 0); |
|
| 177 | 177 | $jobEntity = $this->getJob(); |
| 178 | 178 | $viewModel = null; |
| 179 | 179 | $this->acl($jobEntity, 'edit'); |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | $instanceForm = null; |
| 184 | 184 | $formErrorMessages = array(); |
| 185 | 185 | |
| 186 | - if (isset($formIdentifier) && $request->isPost()) { |
|
| 186 | + if (isset($formIdentifier) && $request->isPost()) { |
|
| 187 | 187 | // at this point the form get instantiated and immediately accumulated |
| 188 | 188 | $instanceForm = $form->getForm($formIdentifier); |
| 189 | 189 | if (!isset($instanceForm)) { |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } else { |
| 249 | 249 | $viewHelper = 'form'; |
| 250 | 250 | } |
| 251 | - $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
| 251 | + $viewHelperManager = $serviceLocator->get('ViewHelperManager'); |
|
| 252 | 252 | $content = $viewHelperManager->get($viewHelper)->__invoke($instanceForm); |
| 253 | 253 | $viewModel = new JsonModel( |
| 254 | 254 | array( |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | ); |
| 302 | 302 | } |
| 303 | 303 | if ($pageIdentifier < count($pageToForm) - 1) { |
| 304 | - $pageLinkNext = $this->url()->fromRoute( |
|
| 304 | + $pageLinkNext = $this->url()->fromRoute( |
|
| 305 | 305 | 'lang/jobs/manage', |
| 306 | 306 | [], |
| 307 | 307 | [ |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | } |
| 314 | 314 | $completionLink = $this->url()->fromRoute( |
| 315 | 315 | 'lang/jobs/completion', |
| 316 | - [ 'id' => $jobEntity->getId()] |
|
| 316 | + ['id' => $jobEntity->getId()] |
|
| 317 | 317 | ); |
| 318 | 318 | |
| 319 | 319 | $viewModel = $this->getViewModel($form); |
@@ -383,13 +383,13 @@ discard block |
||
| 383 | 383 | protected function getJob($allowDraft = true) |
| 384 | 384 | { |
| 385 | 385 | /* @var \Jobs\Repository\Job $jobRepository */ |
| 386 | - $jobRepository = $this->repositoryService->get('Jobs/Job'); |
|
| 386 | + $jobRepository = $this->repositoryService->get('Jobs/Job'); |
|
| 387 | 387 | // @TODO three different method to obtain the job-id ?, simplify this |
| 388 | 388 | $id_fromRoute = $this->params('id', 0); |
| 389 | 389 | $id_fromQuery = $this->params()->fromQuery('id', 0); |
| 390 | 390 | $id_fromSubForm = $this->params()->fromPost('job', 0); |
| 391 | 391 | $user = $this->auth->getUser(); |
| 392 | - $id = empty($id_fromRoute)? (empty($id_fromQuery)?$id_fromSubForm:$id_fromQuery) : $id_fromRoute; |
|
| 392 | + $id = empty($id_fromRoute) ? (empty($id_fromQuery) ? $id_fromSubForm : $id_fromQuery) : $id_fromRoute; |
|
| 393 | 393 | |
| 394 | 394 | if (empty($id) && $allowDraft) { |
| 395 | 395 | $this->acl('Jobs/Manage', 'new'); |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | return $job; |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | - $jobEntity = $jobRepository->find($id); |
|
| 407 | + $jobEntity = $jobRepository->find($id); |
|
| 408 | 408 | if (!$jobEntity) { |
| 409 | 409 | throw new \RuntimeException('No job found with id "' . $id . '"'); |
| 410 | 410 | } |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | // array with differences between the last snapshot and the actual entity |
| 486 | 486 | // is remains Null if there is no snapshot |
| 487 | 487 | // it will be an empty array if the snapshot and the actual entity do not differ |
| 488 | - $diff = null; |
|
| 488 | + $diff = null; |
|
| 489 | 489 | // preliminary difference, contain all differences |
| 490 | 490 | $prelDiff = $this->entitySnapshot()->diff($jobEntity); |
| 491 | 491 | if (isset($prelDiff)) { |
@@ -521,21 +521,21 @@ discard block |
||
| 521 | 521 | 'lang/jobs/view', |
| 522 | 522 | array(), |
| 523 | 523 | array('query' => |
| 524 | - array( 'id' => $jobEntity->getId())) |
|
| 524 | + array('id' => $jobEntity->getId())) |
|
| 525 | 525 | ); |
| 526 | 526 | |
| 527 | 527 | $approvalLink = $this->url()->fromRoute( |
| 528 | 528 | 'lang/jobs/approval', |
| 529 | 529 | array('state' => 'approved'), |
| 530 | 530 | array('query' => |
| 531 | - array( 'id' => $jobEntity->getId())) |
|
| 531 | + array('id' => $jobEntity->getId())) |
|
| 532 | 532 | ); |
| 533 | 533 | |
| 534 | 534 | $declineLink = $this->url()->fromRoute( |
| 535 | 535 | 'lang/jobs/approval', |
| 536 | 536 | array('state' => 'declined'), |
| 537 | 537 | array('query' => |
| 538 | - array( 'id' => $jobEntity->getId())) |
|
| 538 | + array('id' => $jobEntity->getId())) |
|
| 539 | 539 | ); |
| 540 | 540 | |
| 541 | 541 | return array('job' => $jobEntity, |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | public function templateAction() |
| 573 | 573 | { |
| 574 | 574 | try { |
| 575 | - $jobEntity = $this->getJob(); |
|
| 575 | + $jobEntity = $this->getJob(); |
|
| 576 | 576 | $jobEntity->setTemplate($this->params('template', 'default')); |
| 577 | 577 | $this->repositoryService->store($jobEntity); |
| 578 | 578 | $this->notification()->success($this->translator->translate('Template changed')); |
@@ -30,9 +30,9 @@ |
||
| 30 | 30 | $serviceLocator = $serviceLocator->getServiceLocator(); |
| 31 | 31 | $auth = $serviceLocator->get('AuthenticationService'); |
| 32 | 32 | /* @var RepositoryService $repositoryService */ |
| 33 | - $repositoryService = $serviceLocator->get('repositories'); |
|
| 33 | + $repositoryService = $serviceLocator->get('repositories'); |
|
| 34 | 34 | |
| 35 | - $translator = $serviceLocator->get('translator'); |
|
| 35 | + $translator = $serviceLocator->get('translator'); |
|
| 36 | 36 | return new ManageController($auth, $repositoryService, $translator); |
| 37 | 37 | } |
| 38 | 38 | } |
| 39 | 39 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * YAWIK |
|
| 4 | - * |
|
| 5 | - * @filesource |
|
| 6 | - * @license MIT |
|
| 7 | - * @copyright 2013 - 2015 Cross Solution <http://cross-solution.de> |
|
| 8 | - */ |
|
| 3 | + * YAWIK |
|
| 4 | + * |
|
| 5 | + * @filesource |
|
| 6 | + * @license MIT |
|
| 7 | + * @copyright 2013 - 2015 Cross Solution <http://cross-solution.de> |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | /** */ |
| 11 | 11 | namespace Jobs\Form; |
@@ -24,19 +24,19 @@ discard block |
||
| 24 | 24 | public function init() |
| 25 | 25 | { |
| 26 | 26 | $this->add( |
| 27 | - array( |
|
| 28 | - 'type' => 'Core/Spinner-Submit', |
|
| 29 | - 'name' => 'calculate', |
|
| 30 | - 'options' => array( |
|
| 31 | - 'label' => /*@translate*/ 'Calculate price', |
|
| 32 | - ), |
|
| 33 | - 'attributes' => array( |
|
| 34 | - 'id' => 'calculate', |
|
| 35 | - 'type' => 'button', |
|
| 36 | - 'value' => 'calculate', |
|
| 37 | - 'class' => 'mps-calculate btn btn-success btn-xs' |
|
| 38 | - ), |
|
| 39 | - ) |
|
| 27 | + array( |
|
| 28 | + 'type' => 'Core/Spinner-Submit', |
|
| 29 | + 'name' => 'calculate', |
|
| 30 | + 'options' => array( |
|
| 31 | + 'label' => /*@translate*/ 'Calculate price', |
|
| 32 | + ), |
|
| 33 | + 'attributes' => array( |
|
| 34 | + 'id' => 'calculate', |
|
| 35 | + 'type' => 'button', |
|
| 36 | + 'value' => 'calculate', |
|
| 37 | + 'class' => 'mps-calculate btn btn-success btn-xs' |
|
| 38 | + ), |
|
| 39 | + ) |
|
| 40 | 40 | ); |
| 41 | 41 | |
| 42 | 42 | parent::init(); |