externe bewerbung Formulat

This commit is contained in:
Martin Müller 2014-08-16 09:11:26 +02:00
parent 615a1b5c0d
commit ab244e193f
2 changed files with 35 additions and 0 deletions

View File

@ -83,6 +83,7 @@
Router::connect('/application/:id/arc:hiv', array('controller' => 'job', 'action' => 'applicationGet'), array("id" => "[0-9]+",'hiv' => '(?i:hiv)')); Router::connect('/application/:id/arc:hiv', array('controller' => 'job', 'action' => 'applicationGet'), array("id" => "[0-9]+",'hiv' => '(?i:hiv)'));
Router::connect('/applicate/:id', array('controller' => 'job', 'action' => 'applicationSend'),array("id" => "[0-9]+")); Router::connect('/applicate/:id', array('controller' => 'job', 'action' => 'applicationSend'),array("id" => "[0-9]+"));
Router::connect('/applicate/extern', array('controller' => 'job', 'action' => 'applicationSendExt'));
Router::connect('/favorite', array('controller' => 'job', 'action' => 'favorite')); Router::connect('/favorite', array('controller' => 'job', 'action' => 'favorite'));

View File

@ -321,6 +321,7 @@ class JobController extends AppController {
} }
} }
public function applicationSend() { public function applicationSend() {
$this->MiconwareSession->init($this); $this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this); $this->MiconwareSession->initWeb($this);
@ -366,6 +367,39 @@ class JobController extends AppController {
$this->render('/Home/error'); $this->render('/Home/error');
} }
} }
public function applicationSendExt() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
$w = $this->MiconwareSession->getWorker();
if (!empty($w)) {
if ($this->request->is('post')) {
if ($this->request->data['DreamjobJobApplication']['agb']) {
unset($this->request->data['DreamjobJobApplication']['agb']);
$this->request->data['DreamjobJobApplication']['worker_id'] = $w['AppUser']['id'];
$pages = $this->request->data['DreamjobJobApplicationPage']['page_id'];
unset($this->request->data['DreamjobJobApplicationPage']['page_id']);
foreach ($pages as $id)
$this->request->data['DreamjobJobApplicationPage'][] = array('page_id' => $id);
//$result = $this->DreamjobJobApplication->sendApplication($this->request->data);
$result = false;
if ($result) {
$this->MiconwareSession->setFlash(__('dreamjob.application.send.success'), 'flash', array('alert' => 'success'));
} else {
$this->MiconwareSession->setFlash(__('dreamjob.application.send.error'), 'flash', array('alert' => 'danger'));
}
} else {
$this->MiconwareSession->setFlash(__('dreamjob.agb.error.notAccept'), 'flash', array('alert' => 'danger'));
}
}
$this->set('pages', $w['DreamjobPageInh']);
$this->render('/Job/application_send_ext');
} else {
$this->set('error', array('title'=>__('dreamjob.error.noWorker.title'),'text'=>__('dreamjob.error.noWorker.text')));
$this->render('/Home/error');
}
}
} }