From c167e242366ed27b81e3503bc8b0ee953223b679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Tue, 4 Mar 2014 09:07:18 +0100 Subject: [PATCH] opening und application view in company ready --- app/Config/routes.php | 7 ++ app/Controller/JobController.php | 128 +++++++++++++++++++-- app/Model/DreamjobJobApplication.php | 43 ++++++++ app/Model/DreamjobJobApplicationPage.php | 87 +++++++++++++++ app/Model/DreamjobJobMsg.php | 95 ++++++++++++++++ app/Model/DreamjobWorker.php | 4 + app/View/Elements/job_opening_item.ctp | 61 +++++----- app/View/Elements/user_worker_item.ctp | 34 ++++++ app/View/Job/application.ctp | 135 +++++++++++++++++++++++ app/View/Job/applicationCompany_list.ctp | 30 +++++ app/View/Job/applicationWorker_list.ctp | 2 +- app/View/Job/opening.ctp | 21 ++-- app/webroot/css/dreamjob.css | 9 +- 13 files changed, 608 insertions(+), 48 deletions(-) create mode 100644 app/Model/DreamjobJobApplicationPage.php create mode 100644 app/Model/DreamjobJobMsg.php create mode 100644 app/View/Elements/user_worker_item.ctp create mode 100644 app/View/Job/application.ctp create mode 100644 app/View/Job/applicationCompany_list.ctp diff --git a/app/Config/routes.php b/app/Config/routes.php index 27b1307..595aada 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -40,8 +40,15 @@ 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/application', array('controller' => 'job', 'action' => 'applicationByOpening'),array("id" => "[0-9]+")); Router::connect('/application', array('controller' => 'job', 'action' => 'applicationList')); + Router::connect('/application/:id', array('controller' => 'job', 'action' => 'applicationGet'),array("id" => "[0-9]+")); + Router::connect('/application/:id/page/:page', array('controller' => 'job', 'action' => 'applicationGet'),array("id" => "[0-9]+","page" => "[0-9]+")); + Router::connect('/application/:id/mess:ages', array('controller' => 'job', 'action' => 'applicationGet'), array("id" => "[0-9]+",'ages' => '(?i:ages)')); + 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('/favorite', array('controller' => 'job', 'action' => 'favorite')); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index c250c6e..2a48477 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -10,7 +10,7 @@ class JobController extends AppController { * @var array */ - public $uses = array('DreamjobJobOpening','DreamjobJobFavority','DreamjobJobApplication'); + public $uses = array('DreamjobJobOpening','DreamjobJobFavority','DreamjobJobApplication','DreamjobPageText','DreamjobPageImage','DreamjobJobMsg'); /** * Displays a view @@ -25,14 +25,20 @@ class JobController extends AppController { $this->MiconwareSession->initWeb($this); $self = $this->MiconwareSession->getCompany(); - if(!empty($this->request->query['del'])){ - $this->DreamjobJobFavority->delete($this->request->query['del'],false); - $this->MiconwareSession->setFlash('dreamjob.opening.delete','flash',array('alert'=>'success')); - } - if(!is_array($self) and count($self) <= 0){ + + if(!is_array($self) or count($self) <= 0){ $this->set('error', 'dreamjob.error.noPermision'); $this->render('/Home/error'); }else{ + if(!empty($this->request->query['del'])){ + $o =$this->DreamjobJobOpening->findById($this->request->query['del']); + if($o['AppUser']['id']== $self['AppUser']['id']){ + $this->DreamjobJobOpening->delete($this->request->query['del'],false); + $this->MiconwareSession->setFlash('dreamjob.opening.delete','flash',array('alert'=>'success')); + }else{ + $this->MiconwareSession->setFlash('dreamjob.opening.delete.error','flash',array('alert'=>'danger')); + } + } $openings = $this->DreamjobJobOpening->find('all',array('conditions' => array('DreamjobJobOpening.company_id' => $self['AppUser']['id']))); $this->set('openings',$openings); $this->render('/Job/opening_list'); @@ -110,7 +116,7 @@ class JobController extends AppController { if(!empty($this->request->params['id'])){ - if(!empty($this->request->params['favorite']) and count($this->request->params['favorite'])>0){ + if(!empty($this->request->params['favorite']) or count($this->request->params['favorite'])>0){ $WORKER = $this->MiconwareSession->getWorker(); $fav=false; foreach($WORKER['Favority'] as $val){ @@ -135,7 +141,7 @@ class JobController extends AppController { $this->MiconwareSession->refreshCache(); $this->MiconwareSession->initWeb($this); - if(!is_array($opening) and count($opening) <= 0 ){ + if(!is_array($opening) or count($opening) <= 0 ){ $this->set('error', 'dreamjob.error.opening.notFound'); $this->render('/Home/error'); }else{ @@ -149,7 +155,7 @@ class JobController extends AppController { $this->MiconwareSession->initWeb($this); $self = $this->MiconwareSession->getWorker(); - if(!is_array($self) and count($self) <= 0){ + if(!is_array($self) or count($self) <= 0){ $this->set('error', 'dreamjob.error.noPermision'); $this->render('/Home/error'); }else{ @@ -158,6 +164,7 @@ class JobController extends AppController { $fav_id[]=$fav['id']; $openings = $this->DreamjobJobOpening->find('all',array('conditions' => array('DreamjobJobOpening.id' =>$fav_id))); $this->set('openings',$openings); + $this->set('opening_MINI',true); $this->render('/Job/favorite'); } } @@ -167,14 +174,115 @@ class JobController extends AppController { $this->MiconwareSession->initWeb($this); $self = $this->MiconwareSession->getWorker(); - if(!is_array($self) and count($self) <= 0){ + if(!is_array($self) or count($self) <= 0){ $this->set('error', 'dreamjob.error.noPermision'); $this->render('/Home/error'); }else{ $applications = $this->DreamjobJobApplication->find('all',array('conditions' => array('DreamjobJobApplication.worker_id' => $self['AppUser']['id']))); $this->set('applications',$applications); + $this->set('opening_MINI',true); $this->render('/Job/applicationWorker_list'); } } + public function applicationGet() { + $this->MiconwareSession->init($this); + + $this->MiconwareSession->initWeb($this); + $WORKER = $this->MiconwareSession->getWorker(); + $COMPANY = $self = $this->MiconwareSession->getCompany(); + $application = null; + if(isset($this->request->params['id'])){ + if(is_array($WORKER) and count($WORKER) > 0) + $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.worker_id' => $WORKER['AppUser']['id'],'DreamjobJobApplication.id'=> $this->request->params['id'] ))); + if(is_array($COMPANY) and count($COMPANY) > 0) + $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'],'DreamjobJobApplication.id'=> $this->request->params['id'] ))); + } + + if(!is_array($application) or count($application) <= 0){ + $this->set('error', 'dreamjob.error.noPermision'); + $this->render('/Home/error'); + }else{ + $this->set('page',null); + if(!empty($this->request->params['hiv'])){ + $this->DreamjobJobApplication->id = $application['DreamjobJobApplication']['id']; + if ($this->DreamjobJobApplication->saveField('closed',!$application['DreamjobJobApplication']['closed'])) { + $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.id'=> $this->request->params['id'] ))); + $this->MiconwareSession->setFlash('dreamjob.application.archiv','flash',array('alert'=>'success')); + }else{ + $this->MiconwareSession->setFlash('dreamjob.application.archiv.error','flash',array('alert'=>'danger')); + } + } + if(!empty($this->request->params['ages'])){ + $this->set('msg',true); + if ($this->request->is('post')) { + $this->DreamjobJobMsg->create($this->request->data); + $this->DreamjobJobMsg->data['DreamjobJobMsg']['saw'] = false; + $this->DreamjobJobMsg->data['DreamjobJobMsg']['application_id'] = $application['DreamjobJobApplication']['id']; + $this->DreamjobJobMsg->data['DreamjobJobMsg']['fromcompany'] = is_array($COMPANY) and count($COMPANY) > 0; + if ($this->DreamjobJobMsg->save()) { + $application = $this->DreamjobJobApplication->find('first',array('conditions' => array('DreamjobJobApplication.id'=> $this->request->params['id'] ))); + $this->MiconwareSession->setFlash('dreamjob.application.msg.add','flash',array('alert'=>'success')); + }else{ + $this->MiconwareSession->setFlash('dreamjob.application.msg.error','flash',array('alert'=>'danger')); + } + } + }else{ + $this->set('msg',false); + if(!empty($this->request->params['page'])){ + $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'])) + ); + 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'])) + ); + $this->set('page',$page); + } + } + $this->set('application',$application); + $this->render('/Job/application'); + } + } + public function applicationByOpening(){ + $this->MiconwareSession->init($this); + + $this->MiconwareSession->initWeb($this); + $COMPANY = $self = $this->MiconwareSession->getCompany(); + $applications = null; + $opening = null; + if(isset($this->request->params['id'])){ + if(is_array($COMPANY) and count($COMPANY) > 0) + $opening = $this->DreamjobJobOpening->find('first',array('conditions' => array('DreamjobJobOpening.company_id' => $COMPANY['AppUser']['id'],'DreamjobJobOpening.id'=> $this->request->params['id'] ))); + $filter_current = false; + $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; + }else{ + $condition['closed'] = false; + $filter_current = true; + } + + + $applications = $this->DreamjobJobApplication->find('all',array('conditions' =>$condition)); + $this->set("filter_archiv",$filter_archiv); + $this->set("filter_current",$filter_current); + } + if(!is_array($opening) or count($opening) <= 0){ + $this->set('error', 'dreamjob.error.noPermision'); + $this->render('/Home/error'); + }else{ + $this->set('opening',$opening); + $this->set('applications',$applications); + $this->render('/Job/applicationCompany_list'); + } + } + public function applicationSend() { + } } ?> diff --git a/app/Model/DreamjobJobApplication.php b/app/Model/DreamjobJobApplication.php index 62a203a..ca9a092 100644 --- a/app/Model/DreamjobJobApplication.php +++ b/app/Model/DreamjobJobApplication.php @@ -145,6 +145,19 @@ class DreamjobJobApplication extends AppModel { public $hasOne = array( + 'WorkerGraducation' => array( + 'className' => 'DreamjobListGraducation', + 'foreignKey' => false, + 'conditions' => array('DreamjobWorker.graducation_id = WorkerGraducation.id'), + 'limit' => 1 + ), + 'WorkerUser' => array( + 'className' => 'User', + 'foreignKey' => false, + 'conditions' => array('DreamjobJobApplication.worker_id = AppUserWorker.id and WorkerUser.id = AppUserWorker.user_id'), + 'limit' => 1 + ), + //achtung 'DreamjobCompany' => array( 'className' => 'DreamjobCompany', 'foreignKey' => false, @@ -183,4 +196,34 @@ class DreamjobJobApplication extends AppModel { ), ); + public $hasAndBelongsToMany = array( + 'PageText' => + array( + 'className' => 'DreamjobPageText', + 'with' => 'DreamjobJobApplicationPage', + 'foreignKey' => 'application_id', + 'associationForeignKey' => 'page_id' + ), + 'PageImage' => + array( + 'className' => 'DreamjobPageImage', + 'with' => 'DreamjobJobApplicationPage', + 'foreignKey' => 'application_id', + 'associationForeignKey' => 'page_id' + ), + 'Page' => + array( + 'className' => 'DreamjobPageInh', + 'with' => 'DreamjobJobApplicationPage', + 'foreignKey' => 'application_id', + 'associationForeignKey' => 'page_id' + ) + ); + + public $hasMany = array( + 'DreamjobJobMsg' => array( + 'className' => 'DreamjobJobMsg', + 'foreignKey' => 'application_id' + ), + ); } diff --git a/app/Model/DreamjobJobApplicationPage.php b/app/Model/DreamjobJobApplicationPage.php new file mode 100644 index 0000000..7fbcc88 --- /dev/null +++ b/app/Model/DreamjobJobApplicationPage.php @@ -0,0 +1,87 @@ + array( + 'numeric' => array( + 'rule' => array('numeric'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + 'application_id' => array( + 'numeric' => array( + 'rule' => array('numeric'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + 'page_id' => array( + 'numeric' => array( + 'rule' => array('numeric'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + +/** + * belongsTo associations + * + * @var array + */ + public $belongsTo = array( + 'DreamjobJobApplication' => array( + 'className' => 'DreamjobJobApplication', + 'foreignKey' => 'application_id' + ), + 'DreamjobPage' => array( + 'className' => 'DreamjobPageInh', + 'foreignKey' => 'page_id' + ), + ); +} diff --git a/app/Model/DreamjobJobMsg.php b/app/Model/DreamjobJobMsg.php new file mode 100644 index 0000000..cff130a --- /dev/null +++ b/app/Model/DreamjobJobMsg.php @@ -0,0 +1,95 @@ + array( + 'numeric' => array( + 'rule' => array('numeric'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + 'fromcompany' => array( + 'boolean' => array( + 'rule' => array('boolean'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + 'saw' => array( + 'boolean' => array( + 'rule' => array('boolean'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + 'text' => array( + 'notEmpty' => array( + 'rule' => array('notEmpty'), + //'message' => 'Your custom message here', + //'allowEmpty' => false, + //'required' => false, + //'last' => false, // Stop validation after this rule + //'on' => 'create', // Limit validation to 'create' or 'update' operations + ), + ), + ); + + //The Associations below have been created with all possible keys, those that are not needed can be removed + +/** + * belongsTo associations + * + * @var array + */ + public $belongsTo = array( + 'Application' => array( + 'className' => 'Application', + 'foreignKey' => 'application_id', + 'conditions' => '', + 'fields' => '', + 'order' => '' + ) + ); +} diff --git a/app/Model/DreamjobWorker.php b/app/Model/DreamjobWorker.php index 0987af7..be1e053 100755 --- a/app/Model/DreamjobWorker.php +++ b/app/Model/DreamjobWorker.php @@ -164,6 +164,10 @@ class DreamjobWorker extends AppModel { 'DreamjobPageInh' => array( 'className' => 'DreamjobPageInh', 'foreignKey' => 'user_id' + ), + 'DreamjobJobApplication' => array( + 'className' => 'DreamjobJobApplication', + 'foreignKey' => 'worker_id' ) ); } diff --git a/app/View/Elements/job_opening_item.ctp b/app/View/Elements/job_opening_item.ctp index efc27f5..fff0275 100644 --- a/app/View/Elements/job_opening_item.ctp +++ b/app/View/Elements/job_opening_item.ctp @@ -10,6 +10,11 @@ if($val['id'] == $opening['DreamjobJobOpening']['id']) $opening_in_fav=true; } + foreach($WORKER['DreamjobJobApplication'] as $val){ + if($val['opening_id'] == $opening['DreamjobJobOpening']['id']) + $opening_in_app=true; + $opening_inApp=$val; + } } $avatar = false; @@ -21,11 +26,11 @@ if($opening['AppUser']['take_systemwide']){ $avatar = true; } ?> - +

- - + + Html->image($image,array('url' => array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'favorite'=>'favorite'))); ?> - - + +
@@ -70,33 +75,31 @@ if($opening['AppUser']['take_systemwide']){ echo $this->Html->link(__('dreamjob.opening.detail'),array('controller'=>'job', 'action'=>'openingGet', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default")); if( isset($COMPANY['AppUser']['id']) and $COMPANY['AppUser']['id'] == $opening['DreamjobJobOpening']['company_id']){ + echo $this->Html->link(__('dreamjob.application'),array('controller'=>'job', 'action'=>'applicationByOpening', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default")); echo $this->Html->link(__('dreamjob.opening.edit'),array('controller'=>'job', 'action'=>'openingEdit', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default")); echo $this->Html->link(__('dreamjob.opening.delete'),array('controller'=>'job', 'action'=>'openingList', '?' => array('del'=> $opening['DreamjobJobOpening']['id'])),array("class" => "btn btn-default")); - }elseif(false){ ?> - - - - - - - - - - "> - - - ${newcount}/ - ${count} - - - - - - + }elseif($opening_in_app){ + if(!empty($enableMsg)){ + $countstr= count($opening['DreamjobJobMsg']); + $newcount=0; + foreach($opening['DreamjobJobMsg'] as $msg) + if(!$msg['saw']) + $newcount++; + if($newcount>0) + $countstr = $newcount."/".$countstr; + $countstr =__('dreamjob.applicated').''.$countstr.''; + }else + $countstr =__('dreamjob.applicated'); + echo $this->Html->link($countstr,array('controller'=>'job', 'action'=>'applicationGet', 'id' => $opening_inApp['id']),array("class" => "btn btn-default")); + }else{ + $class="btn btn-default"; + if(isset($WORKER) and !is_array($WORKER) and count($WORKER) <= 0) + $class = "btn btn-default disable"; + echo $this->Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'applicationSend', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => $class)); + } + ?>
-
+ diff --git a/app/View/Elements/user_worker_item.ctp b/app/View/Elements/user_worker_item.ctp new file mode 100644 index 0000000..3b7b227 --- /dev/null +++ b/app/View/Elements/user_worker_item.ctp @@ -0,0 +1,34 @@ + +
+
+
+ {{workershow}} + {% trans 'city' %}:{{workershow.city}} + {% trans 'branch' %}:{{workershow.branch}} + {% trans 'graducation' %}:{{workershow.graducation}} + {% if workershow.workexperience %} + {% trans 'workexperience' %}:{{workershow.workexperience}} {% trans 'years' %} + {% endif %} + {{application.created}} +
+ +
diff --git a/app/View/Job/application.ctp b/app/View/Job/application.ctp new file mode 100644 index 0000000..9cd3488 --- /dev/null +++ b/app/View/Job/application.ctp @@ -0,0 +1,135 @@ + + +
+ + Html->link(__('dreamjob.my.application'),array('controller'=>'job','action'=>'applicationList')); + }else{ + echo $this->Html->link(__('dreamjob.application'),array('controller'=>'job','action'=>'applicationByOpening','id'=>$application['DreamjobJobOpening']['id'])); + } ?> + + + Html->link(__('dreamjob.opening'),array('controller'=>'job','action'=>'openingGet','id'=>$application['DreamjobJobOpening']['id'])); ?> + +
+
+
+

+

+
+
+ + +
+ + + + Html->link(__($str),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'hiv'=>'hiv')); ?> + +   + + + Html->link(__('dreamjob.applicated'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'])); + }else{ + echo $this->Html->link(__('dreamjob.message.send'),array('controller'=>'job','action'=>'applicationGet','id'=>$application['DreamjobJobApplication']['id'],'ages'=>'ages')); + } ?> + +
+ + +
+ $application['DreamjobWorker'], + 'DreamjobUser'=>$application["DreamjobUserWorker"], + 'AppUser'=>$application["AppUserWorker"], + 'User'=>$application["WorkerUser"], + 'DreamjobListGraducation'=>$application["WorkerGraducation"]); + echo $this->element('user_worker_header',array('profil'=>$profil)); + ?> +
+ + +
+ + +
+
+ +
+ + +
+ + + + + + + + Time->format('d.m.Y H:i', $msgitem['created']);?> + + +
+ +
+
+ + + $page['PageText'],"DreamjobPageInh"=>$pageInh['Page']); + else + $page = array("DreamjobPageImage"=>$page['PageImage'],"DreamjobPageInh"=>$pageInh['Page']); + echo $this->element('user_page',array("page"=>$page)); + ?> +
+ + + +
+ + +
+ Form->create('DreamjobJobMsg',$default_Form); ?> +
+ + Form->textarea('DreamjobJobMsg.text',array("class"=>'form-control',"rows"=>10)); ?> +
+ Form->button(__('dreamjob.save'),array('div' => false,'class'=>"btn btn-default",'type' => 'submit'));?> +
+
+ Form->end(); ?> +
+ + + diff --git a/app/View/Job/applicationCompany_list.ctp b/app/View/Job/applicationCompany_list.ctp new file mode 100644 index 0000000..265d4de --- /dev/null +++ b/app/View/Job/applicationCompany_list.ctp @@ -0,0 +1,30 @@ + +
+
+

+

+
+
+
+ +
+ +
+

+
+ element('user_worker_item',array('opening' => $opening,'enableOpening'=>true)); + } + ?> +
+ +
diff --git a/app/View/Job/applicationWorker_list.ctp b/app/View/Job/applicationWorker_list.ctp index e3bd961..8e52692 100644 --- a/app/View/Job/applicationWorker_list.ctp +++ b/app/View/Job/applicationWorker_list.ctp @@ -8,7 +8,7 @@
element('job_opening_item',array('opening' => $opening)); + echo $this->element('job_opening_item',array('opening' => $opening,'enableMsg'=>true)); } ?>
diff --git a/app/View/Job/opening.ctp b/app/View/Job/opening.ctp index c32ac91..3b82f9a 100644 --- a/app/View/Job/opening.ctp +++ b/app/View/Job/opening.ctp @@ -3,11 +3,18 @@ * */ $fav=false; - if(isset($WORKER['Favority'])) - foreach($WORKER['Favority'] as $val){ - if($val['id'] == $opening['DreamjobJobOpening']['id']) - $fav=true; - } + $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']));?> @@ -17,8 +24,8 @@ Html->link(__('dreamjob.my.application'),array('controller'=>'job','action'=>'openingGet','id'=>$opening['DreamjobJobOpening']['id'],'favorite'=>'favorite')); + if($opening_in_app) + echo $this->Html->link(__('dreamjob.my.application'),array('controller'=>'job','action'=>'applicationGet','id'=>$opening_inApp['id'])); else{ //TODO isFavority $link='dreamjob.favority.adding'; diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index 9872823..c1c9289 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -322,7 +322,14 @@ body.loading #container{ padding: 40px 0; text-align: center; } - +.msg legend{ + margin:0px 0px 5px 0px; + font-size:14px; +} +.msg .text{ + font-weight:bold; + font-size:16px; +} .infofield{ color:black; }