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; + } +} ?> -
-

-

+
+

+ + + Html->image('openingBanner.jpg',array('class'=>'banner'));?> + +

+ +
+ 0){ + ?> + Html->link(__('dreamjob.my.application'),array('controller'=>'job','action'=>'applicationGet','id'=>$opening_inApp['id']),array('class'=>'btn btn-default','style'=>'margin-left:10px;')); + else{ + echo $this->Html->link(($fav)?$this->Html->image('favority_off.png'):$this->Html->image('favority_on.png'),array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'extra'=>'favorite'),array('class'=>'btn btn-default fav','escape'=>false)); + } + ?> + + Html->link(__('dreamjob.company.to'),array('controller'=>'user','action'=>'profil','id'=>$opening['AppUser']['id']),array('class'=>'btn btn-default'));?> + + Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'applicationSend', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-primary")); + ?> + +
+
+ + diff --git a/app/View/Elements/job_opening_head_extra.ctp b/app/View/Elements/job_opening_head_extra.ctp deleted file mode 100644 index b3bbb83..0000000 --- a/app/View/Elements/job_opening_head_extra.ctp +++ /dev/null @@ -1,24 +0,0 @@ - -

-

- :
- :
- :
- strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate">: Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?> -

-
-

-

- :
- :
- : -

-

- :
-
- -

diff --git a/app/View/Elements/job_opening_item.ctp b/app/View/Elements/job_opening_item.ctp index 8ba7631..87f1606 100644 --- a/app/View/Elements/job_opening_item.ctp +++ b/app/View/Elements/job_opening_item.ctp @@ -33,9 +33,9 @@ if($opening['AppUser']['avatar']){ Html->image('favority_off.png',array('url' => array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'favorite'=>'favorite'))); + echo $this->Html->image('favority_off.png',array('url' => array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'extra'=>'favorite'))); else - echo $this->Html->link('',array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'favorite'=>'favorite'),array('style'=>'color:black;font-size:16px;margin-right:5px;','escape'=>false)); + echo $this->Html->link('',array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'extra'=>'favorite'),array('style'=>'color:black;font-size:16px;margin-right:5px;','escape'=>false)); ?> diff --git a/app/View/Job/opening.ctp b/app/View/Job/opening.ctp index 7d3eb53..9a062d1 100644 --- a/app/View/Job/opening.ctp +++ b/app/View/Job/opening.ctp @@ -2,53 +2,37 @@ /* * */ - $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; - } -} ?> -
- Html->link(__('dreamjob.company.to'),array('controller'=>'user','action'=>'profil','id'=>$opening['AppUser']['id']));?> - 0){ - ?> - - Html->link(__('dreamjob.my.application'),array('controller'=>'job','action'=>'applicationGet','id'=>$opening_inApp['id'])); - else{ - //TODO isFavority - $link=__('dreamjob.favority.adding'); - if($fav) - $link=__('dreamjob.favority.removeing'); - echo $this->Html->link($link,array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'favorite'=>'favorite')); - } - ?> - - -
element('job_opening_head');?> - element('job_opening_head_extra');?> -
+
- + +

+ :
+ :
+ :
+ strtotime($opening['DreamjobJobOpening']['enddate'])){ ?> class="opening_outdate">: Time->format('d.m.Y', $opening['DreamjobJobOpening']['enddate']);?> +

+ +

+ :
+ :
+ : +

+

+ :
+
+ +

+
- -
- Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'applicationSend', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-primary")); - ?> -
-
diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index 1997a3e..2c7dbad 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -279,24 +279,53 @@ body.loading #container{ min-height: 250px; vertical-align: top; } - -.box-title{ - background-color: #97c00e; +.opening-header h1 > span{ + display:table-cell; + vertical-align:middle; + text-align:center; +} +.opening-header h1{ + background-color: #3276B1; margin-top:6px; - margin-bottom: 24px; - display:table; + margin-bottom: 10px; + padding:25px 0px; width:100%; + color:white; + display:table; + overflow:hidden; } -.box-title h1{ - text-align: center; - color: white; - font-weight: bolder; - margin-bottom: 20px; +.opening-header img.banner{ + min-height:120px; + min-width:100%; } -.box-title h3{ - text-align: center; - font-weight: bold; - margin-top: 20px; +.opening-header img.logo{ + position:relative; + top:-100px; + left:20px; + background:white; + border:1px solid grey; + border-radius:3px; + height:150px; + margin-bottom:-80px; +} +.opening-header h3{ + display:inline-block; + position:relative; + color:white; + top:-90px; + left:30px; +} +.opening-header img.banner+h3{ + top:-60px; +} +.opening-header div{ + display:inline-block; + position:relative; + top:10px; + float:right; +} +.btn.fav img{ + height:20px; } .buttonrow{ text-align:right; diff --git a/app/webroot/img/openingBanner.jpg b/app/webroot/img/openingBanner.jpg new file mode 100644 index 0000000..01fd676 Binary files /dev/null and b/app/webroot/img/openingBanner.jpg differ