diff --git a/app/Config/routes.php b/app/Config/routes.php index 4589182..deb7815 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -31,6 +31,8 @@ Router::connect('/agb', array('controller' => 'home', 'action' => 'agb')); Router::connect('/contact', array('controller' => 'home', 'action' => 'contact')); + Router::connect('/company', array('controller' => 'home', 'action' => 'company')); + Router::connect('/registration', array('controller' => 'registration', 'action' => 'main')); Router::connect('/registration/user', array('controller' => 'registration', 'action' => 'worker')); Router::connect('/registration/company', array('controller' => 'registration', 'action' => 'company')); diff --git a/app/Controller/HomeController.php b/app/Controller/HomeController.php index 4f38eba..b696bc0 100755 --- a/app/Controller/HomeController.php +++ b/app/Controller/HomeController.php @@ -21,13 +21,18 @@ class HomeController extends AppController { * or MissingViewException in debug mode. */ - private $opening_limit = 3; + private static $opening_limit = 3; + + function beforeFilter(){ + $this->Security->unlockedActions[]="login"; + parent::beforeFilter(); + } public function home() { $this->MiconwareSession->init($this); $this->MiconwareSession->initWeb($this); $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(), - 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); + 'order'=>'DreamjobJobOpening.id DESC','limit'=> self::$opening_limit)); $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); $this->set('MENU_START', true); @@ -55,7 +60,7 @@ class HomeController extends AppController { $this->MiconwareSession->initWeb($this); $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(), - 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); + 'order'=>'DreamjobJobOpening.id DESC','limit'=> self::$opening_limit)); $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); $this->set('MENU_START', true); @@ -72,7 +77,7 @@ class HomeController extends AppController { $this->MiconwareSession->initWeb($this); $openings = $this->DreamjobJobOpening->find('all',array('conditions'=>$this->MiconwareSession->getOpeningCondition(), - 'order'=>'DreamjobJobOpening.id DESC','limit'=> $this->opening_limit)); + 'order'=>'DreamjobJobOpening.id DESC','limit'=> self::$opening_limit)); $this->set('openings',$openings); $this->set('title', 'dreamjob.startpage'); $this->set('MENU_START', true); @@ -102,4 +107,24 @@ class HomeController extends AppController { $this->set('title', 'dreamjob.agb'); $this->render('/Home/agb'); } + + public function company() { + if(false){ + $Email = new CakeEmail('dreamjobMain'); + $Email->to('service@dream-job.eu'); + $Email->from(array($this->request->data['mail']['adresse'] => $this->request->data['mail']['first_name'].' '.$this->request->data['mail']['last_name'])); + $Email->subject('[Dreamjob-Kontakt-Firma]'.$this->request->data['mail']['subject']); + $Email->template('contact'); + $Email->viewVars(array('text'=>$this->request->data)); + if($Email->send()) + $this->MiconwareSession->setFlash(__('dreamjob.contactSend'),'flash',array('alert'=>'success')); + else + $this->MiconwareSession->setFlash(__('dreamjob.contactSend.error'),'flash',array('alert'=>'danger')); + } + $this->MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this); + $this->set('MENU_START_company', true); + $this->set('title', 'dreamjob.company'); + $this->render('/Home/company'); + } } diff --git a/app/Locale/default.pot b/app/Locale/default.pot index 2027f0c..2f09e84 100644 --- a/app/Locale/default.pot +++ b/app/Locale/default.pot @@ -1115,6 +1115,16 @@ msgstr "" msgid "dreamjob.favority.removeing" msgstr "" +# +msgid "dreamjob.contactSend" +msgstr "" + +# +msgid "dreamjob.contactSend.error" +msgstr "" + + + # # Generierte Fehlermeldungen eigenarbeit! # diff --git a/app/View/Elements/barleft.ctp b/app/View/Elements/barleft.ctp index 3e2e22e..a618873 100755 --- a/app/View/Elements/barleft.ctp +++ b/app/View/Elements/barleft.ctp @@ -57,6 +57,30 @@ if($isLoggedin){ --> Html->link(__('dreamjob.company.startpage'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); + echo $this->Html->link(__('dreamjob.company.startpage'),array('controller'=>'home', 'action'=>'company'),array("class" => "btn btn-primary")); +}elseif(!empty($MENU_START_company)){ + ?> + + Html->link(__('dreamjob.startpage'),array('controller'=>'home', 'action'=>'home'),array("class" => "btn btn-primary")); } ?> diff --git a/app/View/Emails/html/contact.ctp b/app/View/Emails/html/contact.ctp new file mode 100644 index 0000000..e12ccbd --- /dev/null +++ b/app/View/Emails/html/contact.ctp @@ -0,0 +1,12 @@ +
=$data['mail']['adresse'];?> | +=$data['mail']['last_name'].', '.$data['mail']['first_name'];> | +
=$this->request->data['mail']['subject']);?> | +|
=strip_tags($data['mail']['text'],$strip_tags);?> | +