diff --git a/.gitignore b/.gitignore
index 8de5039ed..2af71adba 100755
--- a/.gitignore
+++ b/.gitignore
@@ -22,6 +22,6 @@ web/cache/*
web/.htaccess
phpdoc*.log
php-cs
-xhprof
+xhprof/
phpunit.phar
.DS_Store
\ No newline at end of file
diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml
index 09c95d2ff..8eaeb2547 100755
--- a/core/lib/Thelia/Config/Resources/routing/admin.xml
+++ b/core/lib/Thelia/Config/Resources/routing/admin.xml
@@ -37,6 +37,11 @@
Thelia\Controller\Admin\CustomerController::indexAction
+
+ Thelia\Controller\Admin\CustomerController::viewAction
+ \d+
+
+
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/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php
index c53c2b3d3..ddf4681b9 100644
--- a/core/lib/Thelia/Controller/Admin/CustomerController.php
+++ b/core/lib/Thelia/Controller/Admin/CustomerController.php
@@ -35,4 +35,12 @@ class CustomerController extends BaseAdminController
if (null !== $response = $this->checkAuth("admin.customers.view")) return $response;
return $this->render("customers", array("display_customer" => 20));
}
-}
+
+ public function viewAction($customer_id)
+ {
+
+ return $this->render("customer-edit", array(
+ "customer_id" => $customer_id
+ ));
+ }
+}
\ No newline at end of file
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);
diff --git a/core/lib/Thelia/Form/CustomerCreation.php b/core/lib/Thelia/Form/CustomerCreation.php
index 958f781b5..e6f77c0de 100755
--- a/core/lib/Thelia/Form/CustomerCreation.php
+++ b/core/lib/Thelia/Form/CustomerCreation.php
@@ -1,7 +1,7 @@
. */
+/* along with this program. If not, see . */
/* */
/*************************************************************************************/
namespace Thelia\Form;
@@ -217,4 +217,4 @@ class CustomerCreation extends BaseForm
{
return "thelia_customer_creation";
}
-}
+}
\ No newline at end of file
diff --git a/templates/admin/default/assets/img/bg.jpg b/templates/admin/default/assets/img/bg.jpg
index 76304b5cf..e29da1fc5 100644
Binary files a/templates/admin/default/assets/img/bg.jpg and b/templates/admin/default/assets/img/bg.jpg differ
diff --git a/templates/admin/default/assets/less/thelia/scaffolding.less b/templates/admin/default/assets/less/thelia/scaffolding.less
index 1bc1a373c..1309638e4 100755
--- a/templates/admin/default/assets/less/thelia/scaffolding.less
+++ b/templates/admin/default/assets/less/thelia/scaffolding.less
@@ -7,7 +7,8 @@
// -------------------------
body {
- background: url("@{imgDir}/bg.jpg") repeat;
+ background: #FFF url("@{imgDir}/bg.jpg") top left no-repeat;
+ background-size: cover;
}
diff --git a/templates/admin/default/customers.html b/templates/admin/default/customers.html
index a8b248665..570c38bdc 100644
--- a/templates/admin/default/customers.html
+++ b/templates/admin/default/customers.html
@@ -10,99 +10,99 @@
-
+
- {module_include location='customer_top'}
+ {module_include location='customer_top'}
-
-
-
-
-
- {intl l="Customers list"}
+
+
+
+
+
+ {intl l="Customers list"}
- {module_include location='customer_list_caption'}
+ {module_include location='customer_list_caption'}
- {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.customers.create"}
-
-
-
- {/loop}
-
+ {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.customers.create"}
+
+
+
+ {/loop}
+
- {ifloop rel="customer_list"}
-
-
-
- {intl l="customer ref"}
-
+ {ifloop rel="customer_list"}
+
+
+
+ {intl l="customer ref"}
+
-
- {intl l="company"}
-
+
+ {intl l="company"}
+
- {module_include location='category_list_header'}
+ {module_include location='category_list_header'}
-
- {intl l="firstname & lastname"}
-
+
+ {intl l="firstname & lastname"}
+
-
- {intl l="last order"}
-
+
+ {intl l="last order"}
+
- {intl l='order amount'}
+ {intl l='order amount'}
- {intl l='Actions'}
-
-
+ {intl l='Actions'}
+
+
-
- {loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}}
-
- {$REF}
+
+ {loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}}
+
+ {$REF}
-
- {$COMPANY}
-
+
+ {$COMPANY}
+
-
- {$FIRSTNAME} {$LASTNAME}
-
+
+ {$FIRSTNAME} {$LASTNAME}
+
- {module_include location='customer_list_row'}
+ {module_include location='customer_list_row'}
-
- {format_date date=$LASTORDER_DATE}
-
+
+ {format_date date=$LASTORDER_DATE}
+
-
- {format_number number=$LASTORDER_AMOUNT}
-
-
-
+
+ {format_number number=$LASTORDER_AMOUNT}
+
+
+
- {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.customer.edit"}
-
- {/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"}
-
- {/loop}
-
-
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.customer.edit"}
+
+ {/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"}
+
+ {/loop}
+
+
-
- {/loop}
-
- {/ifloop}
-
+
+ {/loop}
+
+ {/ifloop}
+
+
+
-
-
{module_include location='customer_bottom'}
@@ -118,7 +118,8 @@
{pageloop rel="customer_list"}
{if $PAGE != $CURRENT}
-
{$PAGE}
+
{$PAGE}
+
{else}
{$PAGE}
{/if}
@@ -130,10 +131,136 @@
{/if}
{/pageloop}
+
-
-
+ {* Adding a new Category *}
+
+
+ {form name="thelia.customer.creation"}
+
+ {* Capture the dialog body, to pass it to the generic dialog *}
+ {capture "customer_creation_dialog"}
+
+ {form_hidden_fields form=$form}
+
+ {form_field form=$form field='success_url'}
+ {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
+
+ {/form_field}
+
+
+ {form_field form=$form field='title'}
+
+ {intl l="{$label}"} :
+
+
+ {loop type="title" name="title1"}
+ {$LONG}
+ {/loop}
+
+
+ {/form_field}
+
+ {form_field form=$form field='firstname'}
+
+ {intl l="{$label}"} :
+
+
+ {/form_field}
+
+ {form_field form=$form field='lastname'}
+
+ {intl l="{$label}"} :
+
+
+ {/form_field}
+
+ {form_field form=$form field='address1'}
+
+ {intl l="{$label}"} :
+
+
+
+
+ {form_field form=$form field='address2'}
+
+ {/form_field}
+
+
+
+ {form_field form=$form field='address3'}
+
+ {/form_field}
+
+ {/form_field}
+
+ {form_field form=$form field='zipcode'}
+
+ {intl l="{$label}"} :
+
+
+ {/form_field}
+
+ {form_field form=$form field='city'}
+
+ {intl l="{$label}"} :
+
+
+ {/form_field}
+
+ {form_field form=$form field='country'}
+
+ {intl l="{$label}"} :
+
+ {loop type="country" name="country1"}
+ {$TITLE}
+ {/loop}
+
+
+ {/form_field}
+
+ {form_field form=$form field='email'}
+
+ {intl l="{$label}"} :
+
+
+ {/form_field}
+
+ {/capture}
+
+ {include
+ file = "includes/generic-create-dialog.html"
+
+ dialog_id = "add_customer_dialog"
+ dialog_title = {intl l="Create a new customer"}
+ dialog_body = {$smarty.capture.customer_creation_dialog nofilter}
+
+ dialog_ok_label = {intl l="Create this customer"}
+ dialog_cancel_label = {intl l="Cancel"}
+
+ form_action = {url path='/admin/customer/create'}
+ form_enctype = {form_enctype form=$form}
+ form_error_message = $form_error_message
+ }
+ {/form}
+
+ {* Delete confirmation dialog *}
+
+ {capture "delete_customer_dialog"}
+
+ {/capture}
+
+ {include
+ file = "includes/generic-confirm-dialog.html"
+
+ dialog_id = "delete_customer_dialog"
+ dialog_title = {intl l="Delete customer"}
+ dialog_message = {intl l="Do you really want to delete this customer ?"}
+
+ form_action = {url path='/admin/customer/delete'}
+ form_content = {$smarty.capture.delete_dialog nofilter}
+ }
{/block}
\ No newline at end of file
diff --git a/templates/admin/default/product-attributes-edit.html b/templates/admin/default/product-attributes-edit.html
index 30d74d258..e69de29bb 100644
--- a/templates/admin/default/product-attributes-edit.html
+++ b/templates/admin/default/product-attributes-edit.html
@@ -1 +0,0 @@
-test
\ No newline at end of file
diff --git a/templates/default/register.html b/templates/default/register.html
index f8f26e4c1..3a14ce675 100644
--- a/templates/default/register.html
+++ b/templates/default/register.html
@@ -17,8 +17,8 @@
{intl l="Create New Account"}
- {form name=""}
-