jobController Test

This commit is contained in:
Martin Müller 2014-03-02 12:29:41 +01:00
parent 397934001b
commit 841e2ffe12
1 changed files with 8 additions and 9 deletions

View File

@ -42,24 +42,23 @@ class JobController extends AppController {
public function openingAdd() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
/*
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
*/
if(empty($this->MiconwareSession->getCompany())){
$this->set('error', 'dreamjob.error.noCompany');
$this->render('/Home/error');
}else{
$c = $this->MiconwareSession->getCompany();
if(!empty($c)){
if ($this->request->is('post')) {
$this->DreamjobJobOpening->create($this->request->data);
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $this->MiconwareSession->getCompany()['AppUser']['id'];
$this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $c['AppUser']['id'];
if ($this->DreamjobJobOpening->save()) {
$this->MiconwareSession->setFlash('dreamjob.opening.save.add','flash',array('alert'=>'success'));
}else{
$this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger'));
}
}
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
$this->render('/Job/opening_edit');
}else{
$this->set('error', 'dreamjob.error.noCompany');
$this->render('/Home/error');
}
}
public function openingEdit() {