From 4b6e0e22dc1410c04bc7c25b7c43b3787fbd650e Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Thu, 12 Jul 2012 00:31:41 +0200 Subject: [PATCH] Register web page for companies --- apps/companyfront/config/routing.yml | 4 +++ .../modules/register/actions/actions.class.php | 3 +- .../modules/register/templates/_form.php | 36 +++++++++++++++++----- .../sfGuardAuth/templates/signinSuccess.php | 2 +- lib/form/doctrine/CompaniesRegisterForm.class.php | 2 ++ web/css/inadminpanel/niceforms-default.css | 2 +- 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/apps/companyfront/config/routing.yml b/apps/companyfront/config/routing.yml index 41a4507..b105651 100644 --- a/apps/companyfront/config/routing.yml +++ b/apps/companyfront/config/routing.yml @@ -48,3 +48,7 @@ sf_guard_signin: sf_guard_signout: url: /logout param: { module: sfGuardAuth, action: signout } + +register_index: + url: /register + param: { module: register, action: index } diff --git a/apps/companyfront/modules/register/actions/actions.class.php b/apps/companyfront/modules/register/actions/actions.class.php index 7afdf37..39e02fe 100644 --- a/apps/companyfront/modules/register/actions/actions.class.php +++ b/apps/companyfront/modules/register/actions/actions.class.php @@ -31,7 +31,8 @@ class registerActions extends sfActions $captcha = array('recaptcha_challenge_field' => $request->getParameter('recaptcha_challenge_field'), 'recaptcha_response_field' => $request->getParameter('recaptcha_response_field'), ); - $this->form->bind(array_merge($request->getParameter($this->form->getName()), array('captcha' => $captcha))); + + $this->form->bind(array_merge($request->getParameter($this->form->getName()), array('captcha' => $captcha)), $request->getFiles($this->form->getName())); if ($this->form->isValid()) { $user = $this->form->save(); diff --git a/apps/companyfront/modules/register/templates/_form.php b/apps/companyfront/modules/register/templates/_form.php index b4f9ba0..5810650 100644 --- a/apps/companyfront/modules/register/templates/_form.php +++ b/apps/companyfront/modules/register/templates/_form.php @@ -1,14 +1,34 @@ -
+isMultipart() and print 'enctype="multipart/form-data" ' ?>> +
+ - - - - + renderGlobalErrors() ?> + renderHiddenFields(false) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'validate-selection')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'required')) ?> + renderRow(array('class' => 'validate-selection')) ?> + renderRow(array('class' => 'required')) ?> + RenderRow() ?> + +
- +
+
+ + + + - - + +
+
diff --git a/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php b/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php index 2161737..58d4ad9 100644 --- a/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php +++ b/apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php @@ -1,4 +1,4 @@ -

+

$form)) ?> diff --git a/lib/form/doctrine/CompaniesRegisterForm.class.php b/lib/form/doctrine/CompaniesRegisterForm.class.php index 049056a..7d8627a 100644 --- a/lib/form/doctrine/CompaniesRegisterForm.class.php +++ b/lib/form/doctrine/CompaniesRegisterForm.class.php @@ -22,6 +22,8 @@ class CompaniesRegisterForm extends UsersRegisterForm $this->embedForm('new', $newCompanyForm); + $this->embedRelation('Company'); + parent::configure(); } } diff --git a/web/css/inadminpanel/niceforms-default.css b/web/css/inadminpanel/niceforms-default.css index d7498c1..b001f6c 100644 --- a/web/css/inadminpanel/niceforms-default.css +++ b/web/css/inadminpanel/niceforms-default.css @@ -1,6 +1,6 @@ .login_form{ width:700px; -height:600px; +height:auto; background: #FFFFFF no-repeat scroll center top; margin:20px 0 0 145px; float:left; -- 2.1.4