{intl l="Create New Account"}

- {form name=""} + {form name="thelia.customer.creation"}
@@ -41,13 +41,14 @@ Invalid input! - + {form_field form=$form field="email"}
- +
- +
+ {/form_field}
From c7544faf6575572d4ce15f4ba8b7dd340fd6ae99 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 10 Sep 2013 15:17:55 +0200 Subject: [PATCH 2/5] change variable identifier in customer template --- templates/admin/default/customers.html | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/templates/admin/default/customers.html b/templates/admin/default/customers.html index ea498f72c..35c67f076 100644 --- a/templates/admin/default/customers.html +++ b/templates/admin/default/customers.html @@ -61,14 +61,14 @@ {loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}} - {#REF} + {$REF} - {#COMPANY} + {$COMPANY} - {#FIRSTNAME} {#LASTNAME} + {$FIRSTNAME} {$LASTNAME} {module_include location='customer_list_row'} @@ -87,7 +87,7 @@ {/loop} {loop type="auth" name="can_send_mail" roles="ADMIN" permissions="admin.customer.sendMail"} - + {/loop} {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.customer.delete"} @@ -110,21 +110,21 @@
    - {if #customer_page != 1} + {if $customer_page != 1}
  • «
  • {else}
  • «
  • {/if} {pageloop rel="customer_list"} - {if #PAGE != #CURRENT} -
  • #PAGE
  • + {if $PAGE != $CURRENT} +
  • {$PAGE}
  • {else} -
  • #PAGE
  • +
  • {$PAGE}
  • {/if} - {if #PAGE == #LAST && #LAST != #CURRENT} -
  • »
  • + {if $PAGE == $LAST && $LAST != $CURRENT} +
  • »
  • {else}
  • »
  • {/if} From 3c67903bd772624792558290ea1d2a169d79c8fa Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Tue, 10 Sep 2013 15:46:19 +0200 Subject: [PATCH 3/5] add part of customer form in customer admin template --- core/lib/Thelia/Form/CustomerCreation.php | 13 +++- templates/default/register.html | 90 +++++++++++++++-------- 2 files changed, 70 insertions(+), 33 deletions(-) diff --git a/core/lib/Thelia/Form/CustomerCreation.php b/core/lib/Thelia/Form/CustomerCreation.php index 0627e770a..958f781b5 100755 --- a/core/lib/Thelia/Form/CustomerCreation.php +++ b/core/lib/Thelia/Form/CustomerCreation.php @@ -62,7 +62,7 @@ class CustomerCreation extends BaseForm "constraints" => array( new Constraints\NotBlank() ), - "label_for" => array( + "label_attr" => array( "for" => "address" ), "label" => Translator::getInstance()->trans("Street Address") @@ -79,6 +79,12 @@ class CustomerCreation extends BaseForm "for" => "address3" ) )) + ->add("company", "text", array( + "label" => Translator::getInstance()->trans("Company name"), + "label_attr" => array( + "for" => "company" + ) + )) ->add("phone", "text", array( "label" => Translator::getInstance()->trans("Phone"), "label_attr" => array( @@ -172,7 +178,10 @@ class CustomerCreation extends BaseForm array($this, "verifyPasswordField") ))) ), - "label" => "password confirmation" + "label" => "Password confirmation", + "label_attr" => array( + "for" => "password_confirmation" + ) )) ; diff --git a/templates/default/register.html b/templates/default/register.html index faa780674..7eea94239 100644 --- a/templates/default/register.html +++ b/templates/default/register.html @@ -18,7 +18,7 @@

    {intl l="Create New Account"}

    {form name="thelia.customer.creation"} - +
    @@ -26,49 +26,77 @@
    -
    - -
    - - Available input! -
    -
    - -
    - -
    - - Invalid input! -
    -
    - {form_field form=$form field="email"} -
    + {form_field form=$form field="firstname"} +
    - + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if}
    {/form_field} - -
    - + {form_field form=$form field="lastname"} +
    + +
    + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
    +
    + {/form_field} + {form_field form=$form field="email"} +
    +
    - -
    -
    - -
    - -
    - + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if}
    + {/form_field} + {form_field form=$form field="phone"} +
    + +
    + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
    +
    + {/form_field} + {form_field form=$form field="cellphone"} +
    + +
    + + {if $error } + {$message} + {elseif $value != "" && !$error} + + {/if} +
    +
    + {/form_field}
    - 2. Delivery Informations + 2. {intl l="Delivery Informations"}
    From 3582ae4cf9805df29ff50143fd9328733a0844b1 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 11 Sep 2013 08:51:34 +0200 Subject: [PATCH 4/5] save register template --- templates/default/register.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/default/register.html b/templates/default/register.html index 04d8ca595..3a14ce675 100644 --- a/templates/default/register.html +++ b/templates/default/register.html @@ -68,7 +68,7 @@ {/form_field} {form_field form=$form field="phone"}
    - +
    {if $error } @@ -81,7 +81,7 @@ {/form_field} {form_field form=$form field="cellphone"}
    - +
    {if $error } From 557940c5cf84a17d051ef3a1d1000f21a7b1505e Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 11 Sep 2013 09:48:41 +0200 Subject: [PATCH 5/5] searching route return relative path --- core/lib/Thelia/Controller/Admin/BaseAdminController.php | 3 ++- core/lib/Thelia/Controller/BaseController.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 21fffd3d9..30d6dd9df 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -25,6 +25,7 @@ namespace Thelia\Controller\Admin; use Symfony\Component\Routing\Exception\InvalidParameterException; use Symfony\Component\Routing\Exception\MissingMandatoryParametersException; use Symfony\Component\Routing\Exception\RouteNotFoundException; +use Symfony\Component\Routing\Router; use Thelia\Controller\BaseController; use Symfony\Component\HttpFoundation\Response; use Thelia\Core\Security\Exception\AuthorizationException; @@ -226,7 +227,7 @@ class BaseAdminController extends BaseController * * @see \Thelia\Controller\BaseController::getRouteFromRouter() */ - protected function getRoute($routeId, $parameters = array(), $referenceType = Router::ABSOLUTE_PATH) + protected function getRoute($routeId, $parameters = array(), $referenceType = Router::RELATIVE_PATH) { return $this->getRouteFromRouter( 'router.admin', diff --git a/core/lib/Thelia/Controller/BaseController.php b/core/lib/Thelia/Controller/BaseController.php index 36a03529b..c55dd1258 100755 --- a/core/lib/Thelia/Controller/BaseController.php +++ b/core/lib/Thelia/Controller/BaseController.php @@ -235,7 +235,7 @@ class BaseController extends ContainerAware * @throws \InvalidArgumentException When the router doesn't exist * @return string The generated URL */ - protected function getRouteFromRouter($routerName, $routeId, $parameters = array(), $referenceType = Router::ABSOLUTE_PATH) + protected function getRouteFromRouter($routerName, $routeId, $parameters = array(), $referenceType = Router::RELATIVE_PATH) { /** @var Router $router */ $router = $this->container->get($routerName);