Fixed customer edit routes

This commit is contained in:
Franck Allimant
2013-11-09 19:38:38 +01:00
parent f6fc886d06
commit d2087b994a
4 changed files with 18 additions and 17 deletions

View File

@@ -107,18 +107,20 @@ class CustomerController extends AbstractCrudController
'lastname' => $object->getLastname(), 'lastname' => $object->getLastname(),
'email' => $object->getEmail(), 'email' => $object->getEmail(),
'title' => $object->getTitleId(), 'title' => $object->getTitleId(),
'company' => $address->getCompany(),
'address1' => $address->getAddress1(),
'address2' => $address->getAddress2(),
'address3' => $address->getAddress3(),
'phone' => $address->getPhone(),
'cellphone' => $address->getCellphone(),
'zipcode' => $address->getZipcode(),
'city' => $address->getCity(),
'country' => $address->getCountryId(),
); );
if ($address !== null) {
$data['company'] = $address->getCompany();
$data['address1'] = $address->getAddress1();
$data['address2'] = $address->getAddress2();
$data['address3'] = $address->getAddress3();
$data['phone'] = $address->getPhone();
$data['cellphone'] = $address->getCellphone();
$data['zipcode'] = $address->getZipcode();
$data['city'] = $address->getCity();
$data['country'] = $address->getCountryId();
}
// A loop is used in the template // A loop is used in the template
return new CustomerUpdateForm($this->getRequest(), 'form', $data); return new CustomerUpdateForm($this->getRequest(), 'form', $data);
} }

View File

@@ -9,7 +9,6 @@
<div class="customers edit-customer"> <div class="customers edit-customer">
<div id="wrapper" class="container"> <div id="wrapper" class="container">
{loop name="customer_edit" type="customer" current="false" id="$customer_id" backend_context="1" lang="$edit_language_id"} {loop name="customer_edit" type="customer" current="false" id="$customer_id" backend_context="1" lang="$edit_language_id"}
<ul class="breadcrumb"> <ul class="breadcrumb">

View File

@@ -65,7 +65,7 @@
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td> <td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
<td>{format_date date=$CREATE_DATE}</td> <td>{format_date date=$CREATE_DATE}</td>
<td>{$orderInvoiceCompany}</td> <td>{$orderInvoiceCompany}</td>
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td> <td><a href="{url path='/admin/customer/update' customer_id=$CUSTOMER}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td>{$TOTAL_TAXED_AMOUNT}</td> <td>{$TOTAL_TAXED_AMOUNT}</td>
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td> <td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>

View File

@@ -68,7 +68,7 @@
{/loop} {/loop}
<tr> <tr>
<td><a href="{url path="/admin/customer/update/{$ID}"}">{$REF}</a></td> <td><a href="{url path='/admin/customer/update' customer_id=$ID}">{$REF}</a></td>
<td> <td>
{$COMPANY} {$COMPANY}
@@ -91,7 +91,7 @@
<div class="btn-group"> <div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" resource="admin.customer" access="UPDATE"} {loop type="auth" name="can_change" role="ADMIN" resource="admin.customer" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path="/admin/customer/update/{$ID}" }"><i class="glyphicon glyphicon-edit"></i></a> <a class="btn btn-default btn-xs" title="{intl l='Edit this customer'}" href="{url path='/admin/customer/update' customer_id=$ID }"><i class="glyphicon glyphicon-edit"></i></a>
{/loop} {/loop}
{loop type="auth" name="can_send_mail" role="ADMIN" resource="admin.customer" access="VIEW"} {loop type="auth" name="can_send_mail" role="ADMIN" resource="admin.customer" access="VIEW"}
<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>
@@ -148,7 +148,7 @@
<td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td> <td><a href="{url path="/admin/order/update/$ID"}">{$REF}</a></td>
<td>{format_date date=$CREATE_DATE}</td> <td>{format_date date=$CREATE_DATE}</td>
<td>{$orderInvoiceCompany}</td> <td>{$orderInvoiceCompany}</td>
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td> <td><a href="{url path='/admin/customer/update' customer_id=$CUSTOMER}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td>{$TOTAL_TAXED_AMOUNT}</td> <td>{$TOTAL_TAXED_AMOUNT}</td>
<td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td> <td><span class="label label-{#$orderStatusLabel#}">{$orderStatus}</span></td>