Merge branch 'master' into tax
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -22,6 +22,6 @@ web/cache/*
|
|||||||
web/.htaccess
|
web/.htaccess
|
||||||
phpdoc*.log
|
phpdoc*.log
|
||||||
php-cs
|
php-cs
|
||||||
xhprof
|
xhprof/
|
||||||
phpunit.phar
|
phpunit.phar
|
||||||
.DS_Store
|
.DS_Store
|
||||||
@@ -37,6 +37,11 @@
|
|||||||
<default key="_controller">Thelia\Controller\Admin\CustomerController::indexAction</default>
|
<default key="_controller">Thelia\Controller\Admin\CustomerController::indexAction</default>
|
||||||
</route>
|
</route>
|
||||||
|
|
||||||
|
<route id="admin.customer.update.view" path="/admin/customer/update/{customer_id}">
|
||||||
|
<default key="_controller">Thelia\Controller\Admin\CustomerController::viewAction</default>
|
||||||
|
<requirement key="customer_id">\d+</requirement>
|
||||||
|
</route>
|
||||||
|
|
||||||
<!-- end Customer rule management -->
|
<!-- end Customer rule management -->
|
||||||
|
|
||||||
<!-- Categories management -->
|
<!-- Categories management -->
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ namespace Thelia\Controller\Admin;
|
|||||||
use Symfony\Component\Routing\Exception\InvalidParameterException;
|
use Symfony\Component\Routing\Exception\InvalidParameterException;
|
||||||
use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;
|
use Symfony\Component\Routing\Exception\MissingMandatoryParametersException;
|
||||||
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
use Symfony\Component\Routing\Exception\RouteNotFoundException;
|
||||||
|
use Symfony\Component\Routing\Router;
|
||||||
use Thelia\Controller\BaseController;
|
use Thelia\Controller\BaseController;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Thelia\Core\Security\Exception\AuthorizationException;
|
use Thelia\Core\Security\Exception\AuthorizationException;
|
||||||
@@ -226,7 +227,7 @@ class BaseAdminController extends BaseController
|
|||||||
*
|
*
|
||||||
* @see \Thelia\Controller\BaseController::getRouteFromRouter()
|
* @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(
|
return $this->getRouteFromRouter(
|
||||||
'router.admin',
|
'router.admin',
|
||||||
|
|||||||
@@ -35,4 +35,12 @@ class CustomerController extends BaseAdminController
|
|||||||
if (null !== $response = $this->checkAuth("admin.customers.view")) return $response;
|
if (null !== $response = $this->checkAuth("admin.customers.view")) return $response;
|
||||||
return $this->render("customers", array("display_customer" => 20));
|
return $this->render("customers", array("display_customer" => 20));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function viewAction($customer_id)
|
||||||
|
{
|
||||||
|
|
||||||
|
return $this->render("customer-edit", array(
|
||||||
|
"customer_id" => $customer_id
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -235,7 +235,7 @@ class BaseController extends ContainerAware
|
|||||||
* @throws \InvalidArgumentException When the router doesn't exist
|
* @throws \InvalidArgumentException When the router doesn't exist
|
||||||
* @return string The generated URL
|
* @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 */
|
/** @var Router $router */
|
||||||
$router = $this->container->get($routerName);
|
$router = $this->container->get($routerName);
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 49 KiB |
@@ -7,7 +7,8 @@
|
|||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background: url("@{imgDir}/bg.jpg") repeat;
|
background: #FFF url("@{imgDir}/bg.jpg") top left no-repeat;
|
||||||
|
background-size: cover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{$EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
|
<a class="btn btn-default btn-xs" title="{intl l="Send a mail to this customer"}" href="mailto:{$EMAIL}"><span class="glyphicon glyphicon-envelope"></span></a>
|
||||||
{/loop}
|
{/loop}
|
||||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.customer.delete"}
|
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.customer.delete"}
|
||||||
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_customer_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
<a class="btn btn-default btn-xs customer-delete" title="{intl l='Delete this customer and all his orders'}" href="#delete_customer_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||||
{/loop}
|
{/loop}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@@ -118,7 +118,8 @@
|
|||||||
|
|
||||||
{pageloop rel="customer_list"}
|
{pageloop rel="customer_list"}
|
||||||
{if $PAGE != $CURRENT}
|
{if $PAGE != $CURRENT}
|
||||||
<li><a href="{url path="/admin/customers" page="$PAGE"}">{$PAGE}</a></li>
|
<li><a href="{url path="/admin/customers" page="{$PAGE}"}">{$PAGE}</a></li>
|
||||||
|
|
||||||
{else}
|
{else}
|
||||||
<li class="active"><a href="#">{$PAGE}</a></li>
|
<li class="active"><a href="#">{$PAGE}</a></li>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -130,10 +131,136 @@
|
|||||||
{/if}
|
{/if}
|
||||||
{/pageloop}
|
{/pageloop}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{* 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 *}
|
||||||
|
<input type="hidden" name="{$name}" value="{url path='/admin/customer/update/_ID_'}" />
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
|
||||||
|
{form_field form=$form field='title'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
|
||||||
|
<select name="{$name}" id="{$label_attr.for}" class="form-control">
|
||||||
|
{loop type="title" name="title1"}
|
||||||
|
<option value="{$ID}">{$LONG}</option>
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='firstname'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='lastname'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='address1'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
{form_field form=$form field='address2'}
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
|
||||||
|
{/form_field}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
{form_field form=$form field='address3'}
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
|
||||||
|
{/form_field}
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='zipcode'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}">
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='city'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}">
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='country'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<select name="{$name}" id="{$label_attr.for}" class="form-control">
|
||||||
|
{loop type="country" name="country1"}
|
||||||
|
<option value="{$ID}">{$TITLE}</option>
|
||||||
|
{/loop}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
{/form_field}
|
||||||
|
|
||||||
|
{form_field form=$form field='email'}
|
||||||
|
<div class="form-group {if $error}has-error{/if}">
|
||||||
|
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||||
|
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Email address'}">
|
||||||
|
</div>
|
||||||
|
{/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"}
|
||||||
|
<input type="hidden" name="customer_id" id="customer_delete_id" value="" />
|
||||||
|
{/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}
|
{/block}
|
||||||
@@ -1 +0,0 @@
|
|||||||
test
|
|
||||||
@@ -17,8 +17,8 @@
|
|||||||
<article class="col-main" role="main" aria-labelledby="main-label">
|
<article class="col-main" role="main" aria-labelledby="main-label">
|
||||||
|
|
||||||
<h1 id="main-label" class="page-header">{intl l="Create New Account"}</h1>
|
<h1 id="main-label" class="page-header">{intl l="Create New Account"}</h1>
|
||||||
{form name=""}
|
{form name="thelia.customer.creation"}
|
||||||
<form id="form-register" class="form-horizontal" action="" method="post" role="form">
|
<form id="form-register" class="form-horizontal" action="{url path="/customer/create"}" method="post" role="form">
|
||||||
|
|
||||||
<fieldset id="register-info" class="panel panel">
|
<fieldset id="register-info" class="panel panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
@@ -26,48 +26,78 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="form-group group-firstname has-success">
|
{form_field form=$form field="firstname"}
|
||||||
<label class="control-label" for="firstname">First Name: <span class="required">*</span></label>
|
<div class="form-group group-firstname {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
<input type="text" name="firstname" id="firstname" class="form-control" placeholder="John" autofocus required>
|
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus required>
|
||||||
<span class="help-block"><span class="icon-ok"></span> Available input!</span>
|
{if $error }
|
||||||
|
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||||
|
{elseif $value != "" && !$error}
|
||||||
|
<span class="help-block"><i class="icon-ok"></i></span>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div><!--/.form-group-->
|
</div><!--/.form-group-->
|
||||||
|
{/form_field}
|
||||||
|
{form_field form=$form field="lastname"}
|
||||||
|
<div class="form-group group-lastname {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||||
|
<div class="control-input">
|
||||||
|
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus required>
|
||||||
|
{if $error }
|
||||||
|
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||||
|
{elseif $value != "" && !$error}
|
||||||
|
<span class="help-block"><i class="icon-ok"></i></span>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
</div><!--/.form-group-->
|
||||||
|
{/form_field}
|
||||||
|
{form_field form=$form field="email"}
|
||||||
|
<div class="form-group group-email {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">{$label} <span class="required">*</span></label>
|
||||||
|
|
||||||
<div class="form-group group-lastname has-error">
|
|
||||||
<label class="control-label " for="lastname">Last Name: <span class="required">*</span></label>
|
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
<input type="text" name="lastname" id="lastname" class="form-control" placeholder="Doe" required>
|
<input type="email" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="johndoe@domain.com" required value="{$smarty.get.email|default:$value}">
|
||||||
<span class="help-block"><span class="icon-remove"></span> Invalid input!</span>
|
{if $error }
|
||||||
|
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||||
|
{elseif $value != "" && !$error}
|
||||||
|
<span class="help-block"><i class="icon-ok"></i></span>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div><!--/.form-group-->
|
</div><!--/.form-group-->
|
||||||
|
{/form_field}
|
||||||
<div class="form-group group-email">
|
{form_field form=$form field="phone"}
|
||||||
<label class="control-label" for="email">Email Address: <span class="required">*</span></label>
|
<div class="form-group group-phone {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">{$label}</label>
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
<input type="email" name="email" id="email" class="form-control" placeholder="johndoe@domain.com" required>
|
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
|
||||||
|
{if $error }
|
||||||
|
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||||
|
{elseif $value != "" && !$error}
|
||||||
|
<span class="help-block"><i class="icon-ok"></i></span>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
</div><!--/.form-group-->
|
</div><!--/.form-group-->
|
||||||
|
{/form_field}
|
||||||
<div class="form-group group-phone">
|
{form_field form=$form field="cellphone"}
|
||||||
<label class="control-label" for="phone">Telephone: <span class="required">*</span></label>
|
<div class="form-group group-cellphone {if $error}has-error{elseif $value != "" && !$error}has_success{/if}">
|
||||||
|
<label class="control-label" for="{$label_attr.for}">{$label}</label>
|
||||||
<div class="control-input">
|
<div class="control-input">
|
||||||
<input type="tel" name="phone" id="phone" class="form-control" placeholder="(01) 02 03 04 05 " required>
|
<input type="text" name="{$name}" id="{$label_attr.for}" class="form-control" placeholder="John" value="{$value}" autofocus>
|
||||||
</div>
|
{if $error }
|
||||||
</div><!--/.form-group-->
|
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||||
|
{elseif $value != "" && !$error}
|
||||||
<div class="form-group group-fax">
|
<span class="help-block"><i class="icon-ok"></i></span>
|
||||||
<label class="control-label" for="fax">Fax: </label>
|
{/if}
|
||||||
<div class="control-input">
|
|
||||||
<input type="tel" name="fax" id="fax" class="form-control" placeholder="(01) 02 03 04 05 ">
|
|
||||||
</div>
|
</div>
|
||||||
</div><!--/.form-group-->
|
</div><!--/.form-group-->
|
||||||
|
{/form_field}
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset id="register-delivery" class="panel">
|
<fieldset id="register-delivery" class="panel">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
2. Delivery Informations
|
2. {intl l="Delivery Informations"}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
|
|||||||
@@ -34,7 +34,8 @@ require __DIR__ . '/../core/bootstrap.php';
|
|||||||
// List of allowed IP
|
// List of allowed IP
|
||||||
$trustedIp = array(
|
$trustedIp = array(
|
||||||
'::1',
|
'::1',
|
||||||
'127.0.0.1'
|
'127.0.0.1',
|
||||||
|
'192.168.56.1'
|
||||||
);
|
);
|
||||||
|
|
||||||
$request = Request::createFromGlobals();
|
$request = Request::createFromGlobals();
|
||||||
|
|||||||
Reference in New Issue
Block a user