weiterleitung für deaktive Stellen deaktivieren

This commit is contained in:
Martin Müller 2014-05-11 09:35:33 +02:00
parent 7dd83a0b4b
commit 2b175ffba1
1 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,8 @@ class JobController extends AppController {
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $c['AppUser']['id'];
if ($this->DreamjobJobOpening->save()) {
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.add'), 'flash', array('alert' => 'success'));
return $this->redirect(array('action' => 'openingGet','id'=>$this->DreamjobJobOpening->id));
if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") ) )
return $this->redirect(array('action' => 'openingGet','id'=>$this->DreamjobJobOpening->id));
} else {
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
}
@ -92,7 +93,8 @@ class JobController extends AppController {
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $cid;
if ($this->DreamjobJobOpening->save($this->DreamjobJobOpening->data)) {
$this->MiconwareSession->setFlash(__('dreamjob.opening.save'), 'flash', array('alert' => 'success'));
return $this->redirect(array('action' => 'openingGet','id'=>$this->request->params['id']));
if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") ) )
return $this->redirect(array('action' => 'openingGet','id'=>$this->request->params['id']));
} else
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
}