This commit is contained in:
Martin Müller 2014-05-07 10:51:24 +02:00
parent ec7ae4f599
commit f684517432
2 changed files with 359 additions and 354 deletions

View File

@ -9,7 +9,6 @@ class JobController extends AppController {
*
* @var array
*/
public $uses = array('DreamjobJobOpening', 'DreamjobJobFavority', 'DreamjobJobApplication', 'DreamjobPageText', 'DreamjobPageImage', 'DreamjobJobMsg', 'DreamjobCvEntry', 'DreamjobListCvCategory', 'DreamjobListBranch', 'DreamjobListCity');
/**
@ -20,9 +19,6 @@ class JobController extends AppController {
* @throws NotFoundException When the view file could not be found
* or MissingViewException in debug mode.
*/
public function openingList() {
$this->MiconwareSession->init($this);
@ -58,9 +54,12 @@ 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' => 'openingByOpening','id'=>$this->DreamjobJobOpening->id));
} else {
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
}
}else{
$this->request->data['DreamjobJobOpening']['active']=true;
}
$this->set('kindofjobs', $this->DreamjobJobOpening->DreamjobListKindofjob->find('list'));
$this->set('graducations', $this->DreamjobJobOpening->DreamjobListGraducation->find('list'));
@ -72,6 +71,7 @@ class JobController extends AppController {
$this->render('/Home/error');
}
}
public function openingEdit() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
@ -92,7 +92,7 @@ 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' => 'openingByOpening','id'=>$this->request->params['id']));
} else
$this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger'));
}
@ -142,6 +142,7 @@ class JobController extends AppController {
}
$con = $this->MiconwareSession->getOpeningCondition();
$con['DreamjobJobOpening.id'] = $this->request->params['id'];
var_dump($con);
$opening = $this->DreamjobJobOpening->find('first', array('conditions' => $con));
}
@ -178,6 +179,7 @@ class JobController extends AppController {
$this->render('/Job/favorite');
}
}
public function applicationList() {
$this->MiconwareSession->init($this);
@ -194,6 +196,7 @@ class JobController extends AppController {
$this->render('/Job/applicationWorker_list');
}
}
public function applicationGet() {
$this->MiconwareSession->init($this);
@ -241,7 +244,6 @@ class JobController extends AppController {
$this->DreamjobJobMsg->updateAll(array("saw" => true), array("DreamjobJobMsg.fromcompany" => true, "DreamjobJobMsg.application_id" => $this->request->params['id']));
if (is_array($COMPANY) and count($COMPANY) > 0)
$this->DreamjobJobMsg->updateAll(array("saw" => true), array("DreamjobJobMsg.fromcompany" => false, "DreamjobJobMsg.application_id" => $this->request->params['id']));
}else {
$this->set('msg', false);
// CV
@ -255,12 +257,10 @@ class JobController extends AppController {
/* $this->set('pageInh',$this->DreamjobJobApplication->Page->find('first',
array('conditions' => array("Page.id" => $this->request->params['page']))
)); */
$page = $this->DreamjobJobApplication->PageText->find('first',
array('conditions' => array("PageText.page_ptr_id" => $this->request->params['page']))
$page = $this->DreamjobJobApplication->PageText->find('first', array('conditions' => array("PageText.page_ptr_id" => $this->request->params['page']))
);
if (!is_array($page) or count($page) <= 0)
$page = $this->DreamjobJobApplication->PageImage->find('first',
array('conditions' => array("PageImage.page_ptr_id" => $this->request->params['page']))
$page = $this->DreamjobJobApplication->PageImage->find('first', array('conditions' => array("PageImage.page_ptr_id" => $this->request->params['page']))
);
$this->set('page', $page);
}
@ -270,6 +270,7 @@ class JobController extends AppController {
$this->render('/Job/application');
}
}
public function applicationByOpening() {
$this->MiconwareSession->init($this);
@ -295,6 +296,7 @@ class JobController extends AppController {
$filter_archiv = false;
$condition = array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'], 'DreamjobJobApplication.opening_id' => $this->request->params['id']);
if (isset($this->request->query['filter']) and $this->request->query['filter'] == 'all') {
} elseif (isset($this->request->query['filter']) and $this->request->query['filter'] == 'archiv') {
$condition['closed'] = true;
$filter_archiv = true;
@ -317,6 +319,7 @@ class JobController extends AppController {
$this->render('/Job/applicationCompany_list');
}
}
public function applicationSend() {
$this->MiconwareSession->init($this);
$this->MiconwareSession->initWeb($this);
@ -361,5 +364,7 @@ class JobController extends AppController {
$this->render('/Home/error');
}
}
}
?>

View File

@ -21,7 +21,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form);
</c:choose>
*/
echo $this->Form->hidden("DreamjobJobOpening.company_id");
if(!empty($this->request->data['DreamjobJobOpening']))
if(!empty($this->request->data['DreamjobJobOpening']['title']))
echo $this->request->data['DreamjobJobOpening']['title'];
else
echo __("dreamjob.opening.addForm");