diff --git a/app/Config/routes.php b/app/Config/routes.php index 886f1e6..96084e8 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -72,7 +72,7 @@ Router::connect('/opening/add', array('controller' => 'job', 'action' => 'openingAdd')); Router::connect('/opening/edit/:id', array('controller' => 'job', 'action' => 'openingEdit'),array("id" => "[0-9]+")); Router::connect('/opening/:id', array('controller' => 'job', 'action' => 'openingGet'),array("id" => "[0-9]+")); - Router::connect('/opening/:id/:favorite', array('controller' => 'job', 'action' => 'openingGet'), array("id" => "[0-9]+",'favorite' => '(?i:favorite)')); + Router::connect('/opening/:id/:extra', array('controller' => 'job', 'action' => 'openingGet'), array("id" => "[0-9]+")); Router::connect('/opening/:id/application', array('controller' => 'job', 'action' => 'applicationByOpening'),array("id" => "[0-9]+")); Router::connect('/application', array('controller' => 'job', 'action' => 'applicationList')); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 9cc4c9c..61ea500 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -168,24 +168,34 @@ class JobController extends AppController { if (!empty($this->request->params['id'])) { - if (!empty($this->request->params['favorite']) and count($this->request->params['favorite']) > 0) { - $WORKER = $this->MiconwareSession->getWorker(); - $fav = false; - foreach ($WORKER['Favority'] as $val) { - if ($val['id'] == $this->request->params['id']) - $fav = true; - } - $data = array('DreamjobJobFavority' => array('opening_id' => $this->request->params['id'], 'worker_id' => $WORKER['AppUser']['id']), 'modified' => false); - $data2 = array('DreamjobJobFavority.opening_id' => $this->request->params['id'], 'DreamjobJobFavority.worker_id' => $WORKER['AppUser']['id']); - if ($fav) { - $this->MiconwareSession->setFlash(__('dreamjob.opening.fav.delete.success'), 'flash', array('alert' => 'success')); - $this->DreamjobJobFavority->deleteAll($data2, false); - } else { - $this->DreamjobJobFavority->create(); - $this->DreamjobJobFavority->save($data); - $this->MiconwareSession->setFlash(__('dreamjob.opening.fav.add.success'), 'flash', array('alert' => 'success')); + if (!empty($this->request->params['extra'])){ + if ($this->request->params['extra'] == 'favorite') { + $WORKER = $this->MiconwareSession->getWorker(); + $fav = false; + foreach ($WORKER['Favority'] as $val) { + if ($val['id'] == $this->request->params['id']) + $fav = true; + } + $data = array('DreamjobJobFavority' => array('opening_id' => $this->request->params['id'], 'worker_id' => $WORKER['AppUser']['id']), 'modified' => false); + $data2 = array('DreamjobJobFavority.opening_id' => $this->request->params['id'], 'DreamjobJobFavority.worker_id' => $WORKER['AppUser']['id']); + if ($fav) { + $this->MiconwareSession->setFlash(__('dreamjob.opening.fav.delete.success'), 'flash', array('alert' => 'success')); + $this->DreamjobJobFavority->deleteAll($data2, false); + } else { + $this->DreamjobJobFavority->create(); + $this->DreamjobJobFavority->save($data); + $this->MiconwareSession->setFlash(__('dreamjob.opening.fav.add.success'), 'flash', array('alert' => 'success')); } + $this->set('OPP_NORMAL',true); + }elseif ($this->request->params['extra'] == 'openinginfo') { + $this->set('OPP_OPENING',true); + }elseif ($this->request->params['extra'] == 'companyinfo') { + $this->set('OPP_COMPANY',true); + }else{ + $this->set('OPP_NORMAL',true); } + }else + $this->set('OPP_NORMAL',true); $con = $this->MiconwareSession->getOpeningCondition(); $con['DreamjobJobOpening.id'] = $this->request->params['id']; $opening = $this->DreamjobJobOpening->find('first', array('conditions' => $con)); diff --git a/app/Locale/deu/LC_MESSAGES/default.mo b/app/Locale/deu/LC_MESSAGES/default.mo index 72fe613..530a937 100644 Binary files a/app/Locale/deu/LC_MESSAGES/default.mo and b/app/Locale/deu/LC_MESSAGES/default.mo differ diff --git a/app/View/Elements/job_opening_head.ctp b/app/View/Elements/job_opening_head.ctp index 400750c..439127f 100644 --- a/app/View/Elements/job_opening_head.ctp +++ b/app/View/Elements/job_opening_head.ctp @@ -2,8 +2,60 @@ /* * */ + +$avatar = false; +$url = ''; +if($opening['AppUser']['avatar']){ + $url = $MEDIA.DS.$opening['AppUser']['avatar']; + $avatar = true; +} + $fav=false; + $opening_in_app=false; + if(isset($WORKER['Favority'])){ + foreach($WORKER['Favority'] as $val){ + if($val['id'] == $opening['DreamjobJobOpening']['id']) + $fav=true; + } + foreach($WORKER['DreamjobJobApplication'] as $val){ + if($val['opening_id'] == $opening['DreamjobJobOpening']['id']) + $opening_in_app=true; + $opening_inApp=$val; + } +} ?> -
-
-
- =__("dreamjob.address");?>:
- =$opening['DreamjobUser']['street'];?>
- =$opening['DreamjobUser']['postcode']." ".$opening['DreamjobListCity']['name'];?>
-
+ =__("dreamjob.graducation.company");?>: =$opening['DreamjobListGraducation']['name'];?>
+ =__("dreamjob.branch");?>: =$opening['DreamjobListBranch']['name'];?>
+ =__("dreamjob.kindofjob");?>: =$opening['DreamjobListKindofjob']['name'];?>
+ strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate">=__("dreamjob.opening.enddate");?>: =$this->Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?>
+
+ =__("dreamjob.company");?>: =$opening['AppUser']['nickname'];?>
+ =__("dreamjob.headcount");?>: =$opening['DreamjobCompany']['headcount'];?>
+ =__("dreamjob.owner");?>: =$opening['DreamjobCompany']['owner'];?>
+
+ =__("dreamjob.address");?>:
+ =$opening['DreamjobUser']['street'];?>
+ =$opening['DreamjobUser']['postcode']." ".$opening['DreamjobListCity']['name'];?>
+