Skip to content

Commit

Permalink
[Jobs] deny create a job if no company to select from is provided
Browse files Browse the repository at this point in the history
(#5806)
  • Loading branch information
mathias-weitz-cross-solutions committed May 11, 2015
1 parent ec40971 commit 745f7c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions module/Jobs/src/Jobs/Controller/ManageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ protected function save($parameter = array())
if (empty($user->info->email)) {
return $this->getErrorViewModel('no-parent', array('cause' => 'noEmail'));
}
$userOrg = $user->getOrganization();
if (!$userOrg->hasAssociation()) {
return $this->getErrorViewModel('no-parent', array('cause' => 'noCompany'));
}
$translator = $serviceLocator->get('translator');
/** @var \Zend\Http\Request $request */
$request = $this->getRequest();
Expand Down
2 changes: 1 addition & 1 deletion module/Jobs/view/error/no-parent.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<p><?php
if ($this->cause == 'noEmail') {
echo sprintf(
$this->translate('Before you are able to create jobs, you have to %screate an email%s first.'),
$this->translate('Before you are able to create jobs, you have to %screate a valid email%s first.'),
'<a href="' . $this->url('lang/my', array('action' => 'profile'), true) . '">',
'</a>'
);
Expand Down

0 comments on commit 745f7c9

Please sign in to comment.