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 87d60c4..6044523 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/Locale/deu/LC_MESSAGES/default.po b/app/Locale/deu/LC_MESSAGES/default.po index b3790f5..4bcd569 100644 --- a/app/Locale/deu/LC_MESSAGES/default.po +++ b/app/Locale/deu/LC_MESSAGES/default.po @@ -86,6 +86,9 @@ msgstr "Impressum" msgid "dreamjob.agb" msgstr "AGBs" +msgid "dreamjob.cost" +msgstr "Kosten" + #: Controller/HomeController.php:123 #: View/Elements/job_opening_head_extra.ctp:16 #: View/Registration/company.ctp:19 View/User/settings_account.ctp:67 @@ -175,6 +178,11 @@ msgstr "Bewerbung konnte nicht versendet werden" msgid "dreamjob.agb.error.notAccept" msgstr "AGBs wurde nicht akzeptiert " +#: Controller/JobController.php:357 +#: Controller/RegistrationController.php:66;125 +msgid "dreamjob.cost.error.notAccept" +msgstr "Bitte akzeptieren sie unsere aktuelle Kosten!" + #: Controller/JobController.php:365 msgid "dreamjob.error.noWorker.title" msgstr "Zugriff verweigert" @@ -652,6 +660,10 @@ msgstr "Anhänge" msgid "dreamjob.agb.accept" msgstr "AGBs akzeptieren" +#: View/Registration/worker.ctp:41 +msgid "dreamjob.cost.accept" +msgstr "Kosten akzeptieren" + #: View/Job/application_send.ctp:46 msgid "dreamjob.application.send" msgstr "bewerben" diff --git a/app/View/Job/opening_edit.ctp b/app/View/Job/opening_edit.ctp index 99113ba..ff48b32 100644 --- a/app/View/Job/opening_edit.ctp +++ b/app/View/Job/opening_edit.ctp @@ -54,6 +54,20 @@ echo $this->Form->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;