diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index c87f7c9..ad717cd 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -24,7 +24,6 @@ class HomeController extends AppController { public function home() { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); - $this->MiconwareSession->setFlash('In Entwicklung','flash',array('alert'=>'info')); $openings = $this->DreamjobJobOpening->find('all',$this->home_opening_condition); $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 7dd1acb..00fe6c6 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -116,7 +116,7 @@ class JobController extends AppController { if(!empty($this->request->params['id'])){ - if(!empty($this->request->params['favorite']) or count($this->request->params['favorite'])>0){ + if(!empty($this->request->params['favorite']) and count($this->request->params['favorite'])>0){ $WORKER = $this->MiconwareSession->getWorker(); $fav=false; foreach($WORKER['Favority'] as $val){ @@ -300,6 +300,41 @@ class JobController extends AppController { } } public function applicationSend() { + $this->MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this); + $w = $this->MiconwareSession->getWorker(); + if(!empty($w)){ + $opening = null; + if(!empty($this->request->params['id'])){ + $opening = $this->DreamjobJobOpening->find('first',array('conditions' => array('DreamjobJobOpening.id' => $this->request->params['id']))); + } + if(!is_array($opening) or count($opening) <= 0 ){ + $this->set('error', 'dreamjob.error.opening.notFound'); + $this->render('/Home/error'); + }else{ + if ($this->request->is('post')) { + echo var_dump($this->request->data); + /*$this->DreamjobJobApplication->create($this->request->data); + $this->DreamjobJobOpening->worker_id = $w['AppUser']['id']; + $this->DreamjobJobOpening->opening_id = $this->request->params['id'];*/ + if ($this->DreamjobJobOpening->saveAssociated($this->request->data)) { + $this->DreamjobJobOpening->worker_id = $w['AppUser']['id']; + $this->DreamjobJobOpening->opening_id = $this->request->params['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('pages', $w['DreamjobPageInh']); + $this->set('opening', $opening); + $this->render('/Job/application_send'); + } + }else{ + $this->set('error', 'dreamjob.error.noCompany'); + $this->render('/Home/error'); + } } } ?> diff --git a/app/View/Job/application.ctp b/app/View/Job/application.ctp index e0b1f12..4719504 100644 --- a/app/View/Job/application.ctp +++ b/app/View/Job/application.ctp @@ -17,10 +17,7 @@
-
-
- =__("dreamjob.address");?>:
- =$opening['DreamjobUser']['street'];?>
- =$opening['DreamjobUser']['postcode']." ".$opening['DreamjobUser']['city'];?>
-