diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index c87f7c9..ad717cd 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -24,7 +24,6 @@ class HomeController extends AppController { public function home() { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); - $this->MiconwareSession->setFlash('In Entwicklung','flash',array('alert'=>'info')); $openings = $this->DreamjobJobOpening->find('all',$this->home_opening_condition); $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 7dd1acb..00fe6c6 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -116,7 +116,7 @@ class JobController extends AppController { if(!empty($this->request->params['id'])){ - if(!empty($this->request->params['favorite']) or count($this->request->params['favorite'])>0){ + if(!empty($this->request->params['favorite']) and count($this->request->params['favorite'])>0){ $WORKER = $this->MiconwareSession->getWorker(); $fav=false; foreach($WORKER['Favority'] as $val){ @@ -300,6 +300,41 @@ class JobController extends AppController { } } public function applicationSend() { + $this->MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this); + $w = $this->MiconwareSession->getWorker(); + if(!empty($w)){ + $opening = null; + if(!empty($this->request->params['id'])){ + $opening = $this->DreamjobJobOpening->find('first',array('conditions' => array('DreamjobJobOpening.id' => $this->request->params['id']))); + } + if(!is_array($opening) or count($opening) <= 0 ){ + $this->set('error', 'dreamjob.error.opening.notFound'); + $this->render('/Home/error'); + }else{ + if ($this->request->is('post')) { + echo var_dump($this->request->data); + /*$this->DreamjobJobApplication->create($this->request->data); + $this->DreamjobJobOpening->worker_id = $w['AppUser']['id']; + $this->DreamjobJobOpening->opening_id = $this->request->params['id'];*/ + if ($this->DreamjobJobOpening->saveAssociated($this->request->data)) { + $this->DreamjobJobOpening->worker_id = $w['AppUser']['id']; + $this->DreamjobJobOpening->opening_id = $this->request->params['id']; + if($this->DreamjobJobOpening->save()){ + $this->MiconwareSession->setFlash('dreamjob.opening.save.add','flash',array('alert'=>'success')); + }else{ + $this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger')); + } + } + } + $this->set('pages', $w['DreamjobPageInh']); + $this->set('opening', $opening); + $this->render('/Job/application_send'); + } + }else{ + $this->set('error', 'dreamjob.error.noCompany'); + $this->render('/Home/error'); + } } } ?> diff --git a/app/View/Job/application.ctp b/app/View/Job/application.ctp index e0b1f12..4719504 100644 --- a/app/View/Job/application.ctp +++ b/app/View/Job/application.ctp @@ -17,10 +17,7 @@
-
-

-

-
+ element('job_opening_head');?>
@@ -114,18 +111,18 @@ } ?> -
- 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(); ?> + if($msg and !$application['DreamjobJobApplication']['closed']){ + ?> +
+ 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 index 61f8895..9b802f1 100644 --- a/app/View/Job/applicationCompany_list.ctp +++ b/app/View/Job/applicationCompany_list.ctp @@ -4,10 +4,7 @@ */ ?>
-
-

-

-
+ element('job_opening_head');?>
diff --git a/app/View/Job/opening.ctp b/app/View/Job/opening.ctp index 3b82f9a..dc5680e 100644 --- a/app/View/Job/opening.ctp +++ b/app/View/Job/opening.ctp @@ -38,34 +38,13 @@
-
-

-

-
-

-

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

-
-

-

- :
- :
- : -

-

- :
-
- -

+ element('job_opening_head');?> + element('job_opening_head_extra');?>
-
+
Html->link(__('dreamjob.applicate'),array('controller'=>'job', 'action'=>'openingGet', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-default")); ?> diff --git a/app/View/Job/opening_edit.ctp b/app/View/Job/opening_edit.ctp index bae1169..35accd3 100644 --- a/app/View/Job/opening_edit.ctp +++ b/app/View/Job/opening_edit.ctp @@ -37,7 +37,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form);
Form->checkbox('DreamjobJobOpening.active',array("class"=>'form-control',"label"=>__("dreamjob.opening.active")))?> -
+
Form->input('DreamjobJobOpening.street',array('label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class']))); @@ -45,7 +45,7 @@ echo $this->Form->create('DreamjobJobOpening',$default_Form); echo $this->Form->input('DreamjobJobOpening.city',array("label" => array('text'=>__("dreamjob.city"),"class"=>$default_Form['inputDefaults']['label']['class']))); ?> Form->textarea('DreamjobJobOpening.text',array("class"=>'form-control',"rows"=>10)); ?> -
+
Form->button(__('dreamjob.save'),array('div' => false,'class'=>"btn btn-default",'type' => 'submit'));?>
diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index 5db221a..30de57e 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -245,6 +245,10 @@ body.loading #container{ font-weight: bold; margin-top: 20px; } +.buttonrow{ + text-align:right; + margin-top:25px; +} /* * Opening */