From f138ce8a22861c6e44fab505e3fabdf27d0277f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Mon, 10 Mar 2014 23:53:06 +0100 Subject: [PATCH] application fertig (send) + startseite --- app/Controller/JobController.php | 25 +++++++++++++++---------- app/Model/DreamjobJobApplication.php | 6 +++++- app/View/Elements/barleft.ctp | 19 ++++++++++++++++++- app/View/Home/home.ctp | 13 +++++++++++-- app/View/Job/application.ctp | 2 +- app/View/Job/application_send.ctp | 7 ++++--- app/webroot/css/dreamjob.css | 10 +++++++++- 7 files changed, 63 insertions(+), 19 deletions(-) diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 285ba0c..f97fd45 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -312,20 +312,25 @@ class JobController extends AppController { $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->request->data['DreamjobJobOpening']['worker_id'] = $w['AppUser']['id']; - $this->request->data['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()){ + if ($this->request->is('post')){ + if($this->request->data['DreamjobJobApplication']['agb']) { + unset($this->request->data['DreamjobJobApplication']['agb']); + + $this->request->data['DreamjobJobApplication']['worker_id'] = $w['AppUser']['id']; + $this->request->data['DreamjobJobApplication']['opening_id'] = $this->request->params['id']; + $pages = $this->request->data['DreamjobJobApplicationPage']['page_id']; + unset($this->request->data['DreamjobJobApplicationPage']['page_id']); + foreach($pages as $id) + $this->request->data['DreamjobJobApplicationPage'][]=array('page_id'=> $id); + echo var_dump($this->request->data); + $result = $this->DreamjobJobApplication->saveAssociated($this->request->data); + if ($result) { $this->MiconwareSession->setFlash('dreamjob.opening.save.add','flash',array('alert'=>'success')); }else{ $this->MiconwareSession->setFlash('dreamjob.opening.save.error','flash',array('alert'=>'danger')); } + }else{ + $this->MiconwareSession->setFlash('dreamjob.agb.error.notAccept','flash',array('alert'=>'danger')); } } $this->set('pages', $w['DreamjobPageInh']); diff --git a/app/Model/DreamjobJobApplication.php b/app/Model/DreamjobJobApplication.php index ca9a092..a50264d 100644 --- a/app/Model/DreamjobJobApplication.php +++ b/app/Model/DreamjobJobApplication.php @@ -43,7 +43,7 @@ class DreamjobJobApplication extends AppModel { //'required' => false, //'last' => false, // Stop validation after this rule //'on' => 'create', // Limit validation to 'create' or 'update' operations - ), + ) ), 'stars' => array( 'numeric' => array( @@ -225,5 +225,9 @@ class DreamjobJobApplication extends AppModel { 'className' => 'DreamjobJobMsg', 'foreignKey' => 'application_id' ), + 'DreamjobJobApplicationPage' => array( + 'className' => 'DreamjobJobApplicationPage', + 'foreignKey' => 'application_id' + ), ); } diff --git a/app/View/Elements/barleft.ctp b/app/View/Elements/barleft.ctp index f13456a..0c66a3c 100755 --- a/app/View/Elements/barleft.ctp +++ b/app/View/Elements/barleft.ctp @@ -30,6 +30,23 @@ if($isLoggedin){ class="active">"/> - + + Html->link(__('dreamjob.company.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); } ?> diff --git a/app/View/Home/home.ctp b/app/View/Home/home.ctp index e2b8319..572f437 100755 --- a/app/View/Home/home.ctp +++ b/app/View/Home/home.ctp @@ -8,14 +8,23 @@

- Form->create(null,array('inputDefaults'=> array('div' => false,'label'=>false,'class' => 'form-control'))); ?> + Form->create(null,array('inputDefaults'=> array('div' => false,'label'=>false,'class' => 'form-control'),'url'=>array('controller'=>'home', 'action'=>'home'))); ?>
Form->input('textsearch');?> Form->button('',array('div' => false,'class'=>"btn btn-default",'type' => 'submit')); ?>
- Form->end(); ?> + Form->end(); + echo "
"; + if(!$isLoggedin){ + echo $this->Html->link(__('dreamjob.registration.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); + echo "
"; + echo "
"; + } + echo $this->Html->link(__('dreamjob.search.to'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); + ?>
diff --git a/app/View/Job/application.ctp b/app/View/Job/application.ctp index 4719504..82e59c5 100644 --- a/app/View/Job/application.ctp +++ b/app/View/Job/application.ctp @@ -17,7 +17,7 @@
- element('job_opening_head');?> + element('job_opening_head',array("opening"=>$application));?>
diff --git a/app/View/Job/application_send.ctp b/app/View/Job/application_send.ctp index 390e626..ff28655 100644 --- a/app/View/Job/application_send.ctp +++ b/app/View/Job/application_send.ctp @@ -12,7 +12,9 @@
Form->hidden('DreamjobJobApplication.id'); + echo $this->Form->hidden('DreamjobJobApplication.opening_id'); + echo $this->Form->hidden('DreamjobJobApplication.worker_id'); echo $this->Form->textarea('DreamjobJobApplication.text',array("class"=>'form-control',"rows"=>10)); ?> @@ -24,11 +26,10 @@ } echo $this->Form->select('DreamjobJobApplicationPage.page_id', $page_options, array( 'multiple' => 'checkbox')); - echo $this->element('sql_dump'); ?>
- + Form->checkbox('agb').__("dreamjob.agb.accept");?>

Form->button(__('dreamjob.application.send'),array('div' => false,'class'=>"btn btn-default ",'type' => 'submit'));?> diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index f0181c7..4dae575 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -341,7 +341,7 @@ body.loading #container{ width:465px; height:282px; background-color:#9d1c16; - padding-top:40px; + padding-top:20px; } .start-search-box .box h1{ color:white; @@ -363,6 +363,10 @@ body.loading #container{ line-height:1.42857; color:white; } + .start-search-box .box .searchform .btn.btn-primary{ + background-color:red; + border-color:red; + } /* * Messages */ @@ -377,3 +381,7 @@ body.loading #container{ .infofield{ color:black; } +.btn.btn-primary{ + background-color:red; + border-color:orange; +}