From 4b79bf45e42029301a36b4a2ccb898019f992672 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20M=C3=BCller?= Date: Fri, 27 Feb 2015 14:59:50 +0100 Subject: [PATCH] Iframe Button --- app/Config/routes.php | 30 ++++++++++------ app/Controller/ExternController.php | 42 +++++++++++++++++++++++ app/View/Extern/button_company.ctp | 1 + app/View/Extern/button_opening.ctp | 1 + app/View/Extern/button_opening_extern.ctp | 1 + app/View/Layouts/extern_mini.ctp | 26 ++++++++++++++ 6 files changed, 90 insertions(+), 11 deletions(-) create mode 100644 app/Controller/ExternController.php create mode 100644 app/View/Extern/button_company.ctp create mode 100644 app/View/Extern/button_opening.ctp create mode 100644 app/View/Extern/button_opening_extern.ctp create mode 100644 app/View/Layouts/extern_mini.ctp diff --git a/app/Config/routes.php b/app/Config/routes.php index 9fd8bd9..b4dfe1f 100755 --- a/app/Config/routes.php +++ b/app/Config/routes.php @@ -32,26 +32,26 @@ Router::connect('/contact', array('controller' => 'extra', 'action' => 'contact')); Router::connect('/cooperators', array('controller' => 'extra', 'action' => 'cooperators')); - Router::connect('/team', array('controller' => 'extra', 'action' => 'team')); - Router::connect('/premium', array('controller' => 'extra', 'action' => 'premium')); - Router::connect('/advertise', array('controller' => 'extra', 'action' => 'advertise')); - Router::connect('/adv/company', array('controller' => 'extra', 'action' => 'company')); - Router::connect('/adv/worker', array('controller' => 'extra', 'action' => 'worker')); + Router::connect('/team', array('controller' => 'extra', 'action' => 'team')); + Router::connect('/premium', array('controller' => 'extra', 'action' => 'premium')); + Router::connect('/advertise', array('controller' => 'extra', 'action' => 'advertise')); + Router::connect('/adv/company', array('controller' => 'extra', 'action' => 'company')); + Router::connect('/adv/worker', array('controller' => 'extra', 'action' => 'worker')); Router::connect('/plus', array('controller' => 'service', 'action' => 'index')); - Router::connect('/plus/:list', array('controller' => 'service','action'=>'index'),array("list"=>"[a-z0-9]+")); - Router::connect('/plus/show/:item', array('controller' => 'service','action'=>'show'),array("item"=>"[a-z0-9]+")); - Router::connect('/plus/:list/:item', array('controller' => 'service','action'=>'show'),array("list"=>"[a-z0-9]+","item"=>"[a-z0-9]+")); + Router::connect('/plus/:list', array('controller' => 'service','action'=>'index'),array("list"=>"[a-z0-9]+")); + Router::connect('/plus/show/:item', array('controller' => 'service','action'=>'show'),array("item"=>"[a-z0-9]+")); + Router::connect('/plus/:list/:item', array('controller' => 'service','action'=>'show'),array("list"=>"[a-z0-9]+","item"=>"[a-z0-9]+")); Router::connect('/company', array('controller' => 'home', 'action' => 'company')); - Router::connect('/company/registration', array('controller' => 'registration', 'action' => 'company')); + Router::connect('/company/registration', array('controller' => 'registration', 'action' => 'company')); Router::connect('/registration', array('controller' => 'registration', 'action' => 'worker')); Router::connect('/registration/active/:code', array('controller' => 'registration', 'action' => 'active'),array("code" => ".+")); - Router::connect('/password/reset', array('controller' => 'registration', 'action' => 'password_reset')); - Router::connect('/password/replace/:code', array('controller' => 'registration', 'action' => 'password_replace'),array("code" => ".+")); + Router::connect('/password/reset', array('controller' => 'registration', 'action' => 'password_reset')); + Router::connect('/password/replace/:code', array('controller' => 'registration', 'action' => 'password_replace'),array("code" => ".+")); Router::connect('/profil', array('controller' => 'user', 'action' => 'profil')); Router::connect('/profil/page/:page', array('controller' => 'user', 'action' => 'profil'),array("page" => "[0-9]+")); @@ -98,6 +98,14 @@ Router::connect('/search/academy', array('controller' => 'search', 'action' => 'academy')); Router::connect('/search/internship', array('controller' => 'search', 'action' => 'internship')); + /***** + * Extern + * + */ + Router::connect('/extern/button/company/:id', array('controller' => 'extern', 'action' => 'button_company'),array("id" => "[0-9]+")); + Router::connect('/extern/button/opening/extern', array('controller' => 'extern', 'action' => 'button_opening_extern'),array("id" => "[0-9]+")); + Router::connect('/extern/button/opening/:id', array('controller' => 'extern', 'action' => 'button_opening'),array("id" => "[0-9]+")); + Router::parseExtensions('pdf'); Router::connect('/application/:id.pdf', array('controller' => 'pdf', 'action' => 'applicationGetPdf'),array("id" => "[0-9]+")); diff --git a/app/Controller/ExternController.php b/app/Controller/ExternController.php new file mode 100644 index 0000000..a1b5ca1 --- /dev/null +++ b/app/Controller/ExternController.php @@ -0,0 +1,42 @@ +MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this); + if(!empty($this->request->params['id'])){ + $this->set("company",$this->DreamjobCompany->find('first',array('conditions' => array('AppUser.id' => $this->request->params['id'])))); + } + $this->layout = 'extern_mini'; + $this->render('/Extern/button_company'); + } + public function button_opening() { + $this->MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this); + if(!empty($this->request->params['id'])){ + $con = $this->MiconwareSession->getOpeningCondition(); + $con['DreamjobJobOpening.id'] = $this->request->params['id']; + $this->set("opening",$this->DreamjobJobOpening->find('first', array('conditions' => $con))); + } + $this->layout = 'extern_mini'; + $this->render('/Extern/button_opening'); + } + public function button_opening_extern() { + $this->MiconwareSession->init($this); + $this->MiconwareSession->initWeb($this);/* + $this->request->data['DreamjobUser']['mail'] = $this->request->query('mail'); + $this->request->data['AppUser']['nickname'] = $this->request->query('company'); + $this->request->data['DreamjobUser']['street'] = $this->request->query('street'); + $this->request->data['DreamjobUser']['postcode'] = $this->request->query('postcode'); + $this->request->data['DreamjobListCity']['name'] = $this->request->query('city');*/ + $this->set("content",array()); + $this->layout = 'extern_mini'; + $this->render('/Extern/button_opening_extern'); + } +} diff --git a/app/View/Extern/button_company.ctp b/app/View/Extern/button_company.ctp new file mode 100644 index 0000000..96bd39e --- /dev/null +++ b/app/View/Extern/button_company.ctp @@ -0,0 +1 @@ +Html->link($company['AppUser']['nickname'],array('controller'=>'user', 'action'=>'profil', 'id'=> $company['AppUser']['id']),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?> diff --git a/app/View/Extern/button_opening.ctp b/app/View/Extern/button_opening.ctp new file mode 100644 index 0000000..0aac492 --- /dev/null +++ b/app/View/Extern/button_opening.ctp @@ -0,0 +1 @@ +Html->link($opening['DreamjobJobOpening']['title'],array('controller'=>'job', 'action'=>'openingGet', 'id'=> $opening['DreamjobJobOpening']['id']),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?> diff --git a/app/View/Extern/button_opening_extern.ctp b/app/View/Extern/button_opening_extern.ctp new file mode 100644 index 0000000..1a0c598 --- /dev/null +++ b/app/View/Extern/button_opening_extern.ctp @@ -0,0 +1 @@ +Html->link(__('dreamjob.application.extern'),array('controller'=>'job', 'action'=>'applicationSendExt', '?'=> $content),array("class" => "btn btn-primary","target"=>"_blank",'rel'=>'external'));?> diff --git a/app/View/Layouts/extern_mini.ctp b/app/View/Layouts/extern_mini.ctp new file mode 100644 index 0000000..25eb407 --- /dev/null +++ b/app/View/Layouts/extern_mini.ctp @@ -0,0 +1,26 @@ + + + + <?=((isset($title))?$title:$title_for_layout);?> - <?=__('dreamjob');?> + + + Html->charset(); + echo $this->Html->css(array('bootstrap.min','bootstrap-wysihtml5','wysiwyg-color','select2','select2-bootstrap')); + echo $this->Html->meta('icon', $this->Html->url('/favicon.ico')); + ?> + + + + Session->flash(); ?> + + + + fetch('content'); ?> + + +