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/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/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 1ccacd4db..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"} +
+
+
+ + + {loop type="auth" name="can_create" roles="ADMIN" permissions="admin.customers.create"} + + + + {/loop} + - {ifloop rel="customer_list"} - - - + {ifloop rel="customer_list"} + + + - + - {module_include location='category_list_header'} + {module_include location='category_list_header'} - + - + - + - - - + + + - - {loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}} - - + + {loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}} + + - + - + - {module_include location='customer_list_row'} + {module_include location='customer_list_row'} - + - - + + {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} -
+ {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} -
- {intl l="customer ref"} -
+ {intl l="customer ref"} + - {intl l="company"} - + {intl l="company"} + - {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'}
{$REF}
{$REF} - {$COMPANY} - + {$COMPANY} + - {$FIRSTNAME} {$LASTNAME} - + {$FIRSTNAME} {$LASTNAME} + - {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} + + {/ifloop} +
+
+
-
-
{module_include location='customer_bottom'} @@ -131,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'} +
+ + + +
+ {/form_field} + + {form_field form=$form field='firstname'} +
+ + +
+ {/form_field} + + {form_field form=$form field='lastname'} +
+ + +
+ {/form_field} + + {form_field form=$form field='address1'} +
+ + +
+ +
+ {form_field form=$form field='address2'} + + {/form_field} +
+ +
+ {form_field form=$form field='address3'} + + {/form_field} +
+ {/form_field} + + {form_field form=$form field='zipcode'} +
+ + +
+ {/form_field} + + {form_field form=$form field='city'} +
+ + +
+ {/form_field} + + {form_field form=$form field='country'} +
+ + +
+ {/form_field} + + {form_field form=$form field='email'} +
+ + +
+ {/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/web/index_dev.php b/web/index_dev.php index 4d0063268..bb90e6ab0 100755 --- a/web/index_dev.php +++ b/web/index_dev.php @@ -34,7 +34,8 @@ require __DIR__ . '/../core/bootstrap.php'; // List of allowed IP $trustedIp = array( '::1', - '127.0.0.1' + '127.0.0.1', + '192.168.56.1' ); $request = Request::createFromGlobals();