{extends file="admin-layout.tpl"} {block name="page-title"}{intl l='Edit a customer'}{/block} {block name="check-resource"}admin.customer{/block} {block name="check-access"}update{/block} {block name="main-content"}
{loop name="customer_edit" type="customer" current="false" id="$customer_id" backend_context="1" lang="$edit_language_id"}
{intl l="Edit customer %firstname %lastname" firstname=$FIRSTNAME lastname=$LASTNAME}
{form name="thelia.admin.customer.update"}
{include file="includes/inner-form-toolbar.html" hide_flags = true close_url = {url path='/admin/customers'} } {form_hidden_fields form=$form} {form_field form=$form field='success_url'} {/form_field} {if $form_error}
{$form_error_message}
{/if} {loop name="address" type="address" customer="$customer_id" backend_context="1" default="true"}

{intl l="Customer informations"}

{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='email'}
{/form_field} {form_field form=$form field='password'}
{/form_field}

{intl l="Default address"}

{form_field form=$form field='company'}
{/form_field} {form_field form=$form field='address1'}
{/form_field} {form_field form=$form field='address2'}
{/form_field} {form_field form=$form field='address3'}
{/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} {/loop}

{intl l="Other addresses"}

{loop name="address" type="address" customer="$customer_id" backend_context="1" default="0"} {/loop}
{intl l="Address"} {intl l="Actions"}
{$LABEL}
{loop name="address.title" type="title" id=$TITLE}{$SHORT}{/loop} {$FIRSTNAME} {$LASTNAME}
{$ADDRESS1} {if $ADDRESS2}
{$ADDRESS2}{/if} {if $ADDRESS3}
{$ADDRESS3}{/if}
{$ZIPCODE} {$CITY} {loop name="address.country" type="country" id=$COUNTRY}
{$TITLE} {/loop} {if $PHONE}
{intl l="Phone"}: {$PHONE} {/if} {if $CELLPHONE}
{intl l="Cellular phone"}: {$CELLPHONE} {/if}
{/form}
{intl l="orders for this customer"}
{loop type="order" name="order-list" customer="{$customer_id}" backend_context="1" status='*'} {loop type="order-status" name="order-status" id=$STATUS} {assign "orderStatus" $TITLE} {assign "orderStatusLabel" "order_$CODE"} {/loop} {/loop}
{intl l="Order n°"} {intl l="Date & Hour"} {intl l="Amount"} {intl l="Status"}
{$REF} {format_date date=$CREATE_DATE} {$TOTAL_TAXED_AMOUNT} {$orderStatus}
{/loop} {elseloop rel="customer_edit"}
{intl l="Sorry, customer ID=%id was not found." id=$customer_id}
{/elseloop}
{* -- Add an Address -------------------------------------------------------- *} {form name="thelia.admin.address.create"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "address_creation_dialog"} {include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "address_creation_dialog" dialog_title = {intl l="Create a customer address"} dialog_body = {$smarty.capture.address_creation_dialog nofilter} dialog_ok_label = {intl l="Create this address"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path='/admin/address/create'} form_enctype = {form_enctype form=$form} form_error_message = $form_error_message } {/form} {* -- Update an Address ----------------------------------------------------- *} {if $address_id > 0} {form name="thelia.admin.address.update"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "address_update_dialog"} {include file='includes/customer_address_form_fields.html' customer_id=$customer_id page=$page} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "address_update_dialog" dialog_title = {intl l="Edit a customer address"} dialog_body = {$smarty.capture.address_update_dialog nofilter} dialog_ok_label = {intl l="Save this address"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/address/save"} form_enctype = {form_enctype form=$form} form_error_message = $form_error_message } {/form} {/if} {* -- Confirm making an address the default --------------------------------- *} {capture "use_address_dialog"} {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "use_address_dialog" dialog_title = {intl l="Use address by default"} dialog_message = {intl l="Do you really want to use this address by default ?"} form_action = {url path='/admin/address/use'} form_content = {$smarty.capture.use_address_dialog nofilter} } {* -- Delete confirmation dialog -------------------------------------------- *} {capture "delete_address_dialog"} {/capture} {include file = "includes/generic-confirm-dialog.html" dialog_id = "delete_address_dialog" dialog_title = {intl l="Delete address"} dialog_message = {intl l="Do you really want to delete this address ?"} form_action = {url path='/admin/address/delete'} form_content = {$smarty.capture.delete_address_dialog nofilter} } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/main.js'} {/javascripts} {/block}