From 4e4c12ac85d2e5c3c919cad4f28cb46c909ddd71 Mon Sep 17 00:00:00 2001 From: Geno Date: Wed, 11 Feb 2015 20:05:35 +0100 Subject: [PATCH] #169 Checkboxen AGB und Preise --- app/Controller/JobController.php | 88 ++++++++++++++++---------- app/Locale/default.pot | 13 ++++ app/Locale/deu/LC_MESSAGES/default.mo | Bin 18976 -> 19185 bytes app/Locale/deu/LC_MESSAGES/default.po | 12 ++++ app/View/Job/opening_edit.ctp | 14 ++++ app/webroot/css/dreamjob.css | 4 ++ 6 files changed, 97 insertions(+), 34 deletions(-) diff --git a/app/Controller/JobController.php b/app/Controller/JobController.php index 61ea500..a8b066b 100644 --- a/app/Controller/JobController.php +++ b/app/Controller/JobController.php @@ -60,19 +60,29 @@ class JobController extends AppController { $c = $this->MiconwareSession->getCompany(); if (!empty($c)) { if ($this->request->is('post')) { - $this->DreamjobJobOpening->create($this->request->data); - $this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $c['AppUser']['id']; - $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'],3); - $this->request->data['DreamjobJobOpening']['enddate'] = $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate']; - if ($this->DreamjobJobOpening->save()) { - $this->MiconwareSession->setFlash(__('dreamjob.opening.save.success'), 'flash', array('alert' => 'success')); - if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") ) ) - return $this->redirect(array('action' => 'openingGet','id'=>$this->DreamjobJobOpening->id)); - $this->request->data=array(); - $this->request->data['DreamjobJobOpening']['active']=true; - $this->request->data['DreamjobJobOpening']['company_id']=$c['AppUser']['id']; - } else { - $this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger')); + if ($this->request->data['DreamjobJobOpening']['agb']) { + unset($this->request->data['DreamjobJobOpening']['agb']); + if ($this->request->data['DreamjobJobOpening']['cost']) { + unset($this->request->data['DreamjobJobOpening']['cost']); + $this->DreamjobJobOpening->create($this->request->data); + $this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $c['AppUser']['id']; + $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'],3); + $this->request->data['DreamjobJobOpening']['enddate'] = $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate']; + if ($this->DreamjobJobOpening->save()) { + $this->MiconwareSession->setFlash(__('dreamjob.opening.save.success'), 'flash', array('alert' => 'success')); + if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") ) ) + return $this->redirect(array('action' => 'openingGet','id'=>$this->DreamjobJobOpening->id)); + $this->request->data=array(); + $this->request->data['DreamjobJobOpening']['active']=true; + $this->request->data['DreamjobJobOpening']['company_id']=$c['AppUser']['id']; + } else { + $this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger')); + } + }else{ + $this->MiconwareSession->setFlash(__('dreamjob.cost.error.notAccept'), 'flash', array('alert' => 'danger')); + } + }else{ + $this->MiconwareSession->setFlash(__('dreamjob.agb.error.notAccept'), 'flash', array('alert' => 'danger')); } }else{ $this->MiconwareSession->setFlash(__('dreamjob.opening.cost'), 'flash', array('alert' => 'danger')); @@ -113,29 +123,39 @@ class JobController extends AppController { $enddate_no = ($load['DreamjobJobOpening']['startdate']<=date("Y-m-d",strtotime("-1 day"))); $this->set('enddate_no',$enddate_no); if ($this->request->is(array('post', 'put'))) { - $addToEnddate = !empty($this->request->data['DreamjobJobOpening']['addToEnddate']); - $this->DreamjobJobOpening->create($this->request->data); - $this->DreamjobJobOpening->data['DreamjobJobOpening']['id'] = $this->request->params['id']; - $this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $cid; - if($enddate_no){ - $this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'] = $load['DreamjobJobOpening']['startdate']; - if($addToEnddate) - $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($load['DreamjobJobOpening']['enddate'],1); - else - $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = $load['DreamjobJobOpening']['enddate']; + if ($this->request->data['DreamjobJobOpening']['agb']) { + unset($this->request->data['DreamjobJobOpening']['agb']); + if ($this->request->data['DreamjobJobOpening']['cost']) { + unset($this->request->data['DreamjobJobOpening']['cost']); + $addToEnddate = !empty($this->request->data['DreamjobJobOpening']['addToEnddate']); + $this->DreamjobJobOpening->create($this->request->data); + $this->DreamjobJobOpening->data['DreamjobJobOpening']['id'] = $this->request->params['id']; + $this->DreamjobJobOpening->data['DreamjobJobOpening']['company_id'] = $cid; + if($enddate_no){ + $this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'] = $load['DreamjobJobOpening']['startdate']; + if($addToEnddate) + $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($load['DreamjobJobOpening']['enddate'],1); + else + $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = $load['DreamjobJobOpening']['enddate']; + }else{ + $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'],3); + $this->request->data['DreamjobJobOpening']['startdate'] = $this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate']; + } + if ($this->DreamjobJobOpening->save($this->DreamjobJobOpening->data)) { + if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") )) + return $this->redirect(array('action' => 'openingGet','id'=>$this->request->params['id'])); + $load = $this->DreamjobJobOpening->findById($this->request->params['id']); + $enddate_no = ($load['DreamjobJobOpening']['startdate']<=date("Y-m-d",strtotime("-1 day"))); + $this->set('enddate_no',$enddate_no); + $this->MiconwareSession->setFlash(__('dreamjob.opening.save.success'), 'flash', array('alert' => 'success')); + } else + $this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger')); + }else{ + $this->MiconwareSession->setFlash(__('dreamjob.cost.error.notAccept'), 'flash', array('alert' => 'danger')); + } }else{ - $this->DreamjobJobOpening->data['DreamjobJobOpening']['enddate'] = JobController::monthAdd($this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate'],3); - $this->request->data['DreamjobJobOpening']['startdate'] = $this->DreamjobJobOpening->data['DreamjobJobOpening']['startdate']; + $this->MiconwareSession->setFlash(__('dreamjob.agb.error.notAccept'), 'flash', array('alert' => 'danger')); } - if ($this->DreamjobJobOpening->save($this->DreamjobJobOpening->data)) { - if($this->request->data['DreamjobJobOpening']['active'] and $this->request->data['DreamjobJobOpening']['startdate'] <= date("Y-m-d") and $this->request->data['DreamjobJobOpening']['enddate'] >= date("Y-m-d", strtotime("+1 day") )) - return $this->redirect(array('action' => 'openingGet','id'=>$this->request->params['id'])); - $load = $this->DreamjobJobOpening->findById($this->request->params['id']); - $enddate_no = ($load['DreamjobJobOpening']['startdate']<=date("Y-m-d",strtotime("-1 day"))); - $this->set('enddate_no',$enddate_no); - $this->MiconwareSession->setFlash(__('dreamjob.opening.save.success'), 'flash', array('alert' => 'success')); - } else - $this->MiconwareSession->setFlash(__('dreamjob.opening.save.error'), 'flash', array('alert' => 'danger')); }else{ $this->MiconwareSession->setFlash(__('dreamjob.opening.cost'), 'flash', array('alert' => 'danger')); } diff --git a/app/Locale/default.pot b/app/Locale/default.pot index fc9240b..9d7f10c 100644 --- a/app/Locale/default.pot +++ b/app/Locale/default.pot @@ -99,6 +99,10 @@ msgstr "" msgid "dreamjob.agb" msgstr "" +#: View/Registration/worker.ctp:41 +msgid "dreamjob.cost" +msgstr "" + #: Controller/HomeController.php:123 #: View/Elements/job_opening_head_extra.ctp:16 #: View/Registration/company.ctp:19 @@ -189,6 +193,11 @@ msgstr "" msgid "dreamjob.agb.error.notAccept" msgstr "" +#: Controller/JobController.php:357 +#: Controller/RegistrationController.php:66;125 +msgid "dreamjob.cost.error.notAccept" +msgstr "" + #: Controller/JobController.php:365 msgid "dreamjob.error.noWorker.title" msgstr "" @@ -777,6 +786,10 @@ msgstr "" msgid "dreamjob.agb.accept" msgstr "" +#: View/Registration/worker.ctp:41 +msgid "dreamjob.cost.accept" +msgstr "" + #: View/Job/application_send.ctp:46 msgid "dreamjob.application.send" msgstr "" diff --git a/app/Locale/deu/LC_MESSAGES/default.mo b/app/Locale/deu/LC_MESSAGES/default.mo index 87d60c4557d572150fa18092ff8540db6a9911d0..60445239673a967e5c3bb602fde83152cb4c971d 100644 GIT binary patch delta 5567 zcmZA430zfG0>|-#h$spOg3D9nfrAUUCMaa#QlLmWGFc6UmMJi}58#qIJ}sR|GcnCV z&2oWeY%)bm%MDGLW-Rw@ET=KYWe^>6DKchie*bsR`+Vjz_rw2v&pGejdzO3d^W(bL z{cf-H^L!QFaHZj>C+*0+Kx4A}jQKoNt;RHuG^R0zVRLk$zDmFd?1%iB5q#+TJPgAb z7>$+iQ>KPb^h1OE+XgtR3qo5mJL3I$&+L-p(34ey^sP88rf94fF+F%)~!+ofM zo=06*hi+`iNowzlI{yhibe}1xeoC-4{hJC3Ox_$uE$u}N#&1wd`lJ0ml-~4x9BM_9 zP)nSJjNObwT{j20#4N@TEJNL=5_R4o`~3yk8H6x;TN zsPosM9@SpdeNLj5z6LdrW}Kw&U8t4lfx6Ey4ZV3nLLYn zB-2qHFF__{%26wF0M)@6)C9go%`})s-6s}xet*;>dImYgOh*39t9be>4NjsSQ7y(}7%#gUA40wNqxjH_=c77Wi`vAyQP21+a;d4e?d@sQ zfKxC;@BdH=x*!{Mqhi#iTZWqP2HU;^we%;^jki$)3}8R_nZTl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ULmME%%42KkXEM9Xv+vjHcPYj*o%>kBx6EF^z-_c>-JjZ)H#Jm&87 zuDh{5ZMTnEhvL6U8#05OAa9Z_B$#|l8kcAquaTZ4mK-1*h{>5ZecJ4qbF#dR{hdPo RForm->create('DreamjobJobOpening',$default_Form); Form->checkbox('DreamjobJobOpening.active',array("class"=>'form-control',"label"=>__("dreamjob.opening.active")))?> +
+ +
+ Form->checkbox('DreamjobJobOpening.agb',array("class"=>'form-control',"label"=>__("dreamjob.agb")))?> +
+
+
+ +
+ Form->checkbox('DreamjobJobOpening.cost',array("class"=>'form-control',"label"=>__("dreamjob.cost")))?> +
+
Form->input('DreamjobJobOpening.street',array('placeholder'=>__('dreamjob.street.placeholder'),'label'=>array('text'=>__("dreamjob.street"),"class"=>$default_Form['inputDefaults']['label']['class']))); echo $this->Form->input('DreamjobJobOpening.postcode',array('placeholder'=>__('dreamjob.postcode.placeholder'),'label'=>array('text'=>__("dreamjob.postcode"),"class"=>$default_Form['inputDefaults']['label']['class']))); diff --git a/app/webroot/css/dreamjob.css b/app/webroot/css/dreamjob.css index b3d1f53..c4b5b70 100755 --- a/app/webroot/css/dreamjob.css +++ b/app/webroot/css/dreamjob.css @@ -289,6 +289,10 @@ body.loading #container{ vertical-align:middle; display:table-cell; } +.opening-header .logo i img,.company-header .logo i img{ + max-width:150px; + max-height:150px; +} .opening-header .logo{ display:inline-block; position:relative;