Register web page for companies
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 11 Jul 2012 22:31:41 +0000 (00:31 +0200)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Wed, 11 Jul 2012 22:31:41 +0000 (00:31 +0200)
apps/companyfront/config/routing.yml
apps/companyfront/modules/register/actions/actions.class.php
apps/companyfront/modules/register/templates/_form.php
apps/companyfront/modules/sfGuardAuth/templates/signinSuccess.php
lib/form/doctrine/CompaniesRegisterForm.class.php
web/css/inadminpanel/niceforms-default.css

index 41a4507..b105651 100644 (file)
@@ -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 }
index 7afdf37..39e02fe 100644 (file)
@@ -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();
index b4f9ba0..5810650 100644 (file)
@@ -1,14 +1,34 @@
 <?php use_helper('I18N') ?>
 
-<form action="<?php echo url_for('@register_index') ?>" method="post">
+<form action="<?php echo url_for('@register_index') ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
+  <fieldset>
+  <legend><?php echo __('REGISTER', null, 'sf_guard') ?></legend>
   <table>
-    <?php echo $form ?>
-    <tfoot>
-      <tr>
-        <td colspan="2">
-          <input type="submit" name="register" value="<?php echo __('Register', null, 'sf_guard') ?>" />
+    <tbody>
+        <?php echo $form->renderGlobalErrors() ?>
+        <?php echo $form->renderHiddenFields(false) ?>
+        <?php echo $form['first_name']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['last_name']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['email_address']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['username']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['password']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['password_again']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['language_id']->renderRow(array('class' => 'validate-selection')) ?>
+        <?php echo $form['new']['company_cif']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['new']['company_logo']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['new']['new']['language_id']->renderRow(array('class' => 'validate-selection')) ?>
+        <?php echo $form['new']['new']['company_name']->renderRow(array('class' => 'required')) ?>
+        <?php echo $form['captcha']->RenderRow() ?>
+    </tbody>
+  </table>
+  </fieldset>
+  <table align="right">
+    <tbody>
+        <tr>
+        <td>
+        <input type="submit" name="register" value="<?php echo __('Register', null, 'sf_guard') ?>" class="NFButton"/>
         </td>
-      </tr>
-    </tfoot>
+        <tr>
+    </tbody>
   </table>
 </form>
index 2161737..58d4ad9 100644 (file)
@@ -1,4 +1,4 @@
 <?php use_helper('I18N') ?>
-<h1><?php echo __('Log In', null, 'sf_guard') ?></h1>
+<h1><?php echo __('Log In or Register', null, 'sf_guard') ?></h1>
 
 <?php include_partial('signin_form', array('form' => $form)) ?>
index 049056a..7d8627a 100644 (file)
@@ -22,6 +22,8 @@ class CompaniesRegisterForm extends UsersRegisterForm
 
     $this->embedForm('new', $newCompanyForm);
 
+    $this->embedRelation('Company');
+
     parent::configure();
   }   
 } 
index d7498c1..b001f6c 100644 (file)
@@ -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;