{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'customer'} {/block} {block name="page-title"}{intl l='Customer'}{/block} {block name="check-resource"}admin.customer{/block} {block name="check-access"}view{/block} {block name="main-content"}
{hook name="customer.top" location="customer_top" }
{if isset($removal_error) && true === $removal_error }
{$error_message}
{/if}
{ifloop rel="customer_list"} {hook name="customers.header" location="customer_list_header" } {* TODO *} {loop name="customer_list" type="customer" current="false" visible="*" order=$customer_order backend_context="1" page=$page limit={config key="number_default_results_per_page.customer_list" default=20} search_term=$search|default:null search_in="ref,firstname,lastname,email"} {$lastOrderDate = ''} {$lastOrderAmount = ''} {$lastOrderCurrency = ''} {$hasOrders = false} {loop type="order" name="last-order" customer=$ID order="create-date-reverse" limit="1"} {$lastOrderDate = {format_date date=$CREATE_DATE}} {$lastOrderAmount = {format_number number=$TOTAL_TAXED_AMOUNT}} {loop type="currency" name="order-currency" id=$CURRENCY} {$lastOrderCurrency = $SYMBOL} {$hasOrders = true} {/loop} {/loop} {hook name="customers.row" location="customer_list_row" customer_id={$ID}} {/loop} {/ifloop} {elseloop rel="customer_list"} {/elseloop}
{intl l="Customers list"} {hook name="customers.caption" location="customer_list_caption" } {include file='renderer/buttons.html' btn_group=false buttons=[ [ 'type' => 'create', 'class' => 'action-btn', 'title' => {intl l='Add a new Customer'}, 'href' => '#add_customer_dialog', 'auth' => ['resource' => 'admin.customer'], 'data' => [ 'toggle' => 'modal' ] ] ]}
{admin_sortable_header current_order=$customer_order order='reference' reverse_order='reference_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Reference'}" } {admin_sortable_header current_order=$customer_order order='lastname' reverse_order='lastname_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Last name'}" } {admin_sortable_header current_order=$customer_order order='firstname' reverse_order='firstname_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='First name'}" } {admin_sortable_header current_order=$customer_order order='registration_date' reverse_order='registration_date_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Registration date'}" } {intl l='Date of last order'} {intl l='Last order amount'} {admin_sortable_header current_order=$customer_order order='last_order' reverse_order='last_order_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Date of last order'}" } {admin_sortable_header current_order=$customer_order order='order_amount' reverse_order='order_amount_reverse' path={url path='/admin/customers'} request_parameter_name='customer_order' label="{intl l='Last order amount'}" } {intl l='Actions'}
{$REF} {$LASTNAME} {$FIRSTNAME} {format_date date=$CREATE_DATE} {$lastOrderDate} {$lastOrderCurrency} {$lastOrderAmount} {if $hasOrders} {$deleteClass = 'disabled'} {$deleteTitle = {intl l='This customer has orders, and can\'t be deleted.'}} {$deleteHref = ''} {else} {$deleteClass = 'customer-delete'} {$deleteTitle = {intl l='Delete this customer and all his orders'}} {$deleteHref = '#delete_customer_dialog'} {/if} {include file='renderer/buttons.html' buttons=[ [ 'type' => 'edit', 'title' => {intl l='Edit this customer'}, 'href' => {url path='/admin/customer/update' customer_id=$ID page=$page}, 'auth' => ['resource' => 'admin.customer'] ], [ 'title' => {intl l="Send a mail to this customer"}, 'href' => "mailto:$EMAIL", 'icon' => ['class' => 'glyphicon glyphicon-envelope'], 'auth' => ['resource' => 'admin.customer'] ], [ 'type' => 'delete', 'class' => $deleteClass, 'title' => $deleteTitle, 'href' => $deleteHref, 'data' => [ 'id' => $ID, 'toggle' => 'modal' ], 'auth' => ['resource' => 'admin.customer'] ] ]}
{include file = "includes/pagination.html" loop_ref = "customer_list" max_page_count = 10 page_url = {url path="/admin/customers" search_term=$search|default:null search_in="ref,firstname,lastname,email" customer_order=$customer_order} }
{intl l='You have no registred customers for the moment.'}
{hook name="customer.bottom" location="customer_bottom" }
{* Adding a new Category *} {form name="thelia.admin.customer.create"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "customer_creation_dialog"} {form_hidden_fields} {form_field field='success_url'} {* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *} {/form_field} {* We use "dummmy-password" here, because the creation form is common to back & front, and that we need a valid password. This is just a workaround. The password will be forced to a more secure value in the CustomerController. *} {form_field field="password"} {/form_field} {form_field field="password_confirm"} {/form_field} {render_form_field field="company"}
{custom_render_form_field field='title'} {/custom_render_form_field}
{render_form_field field="firstname"}
{render_form_field field='lastname'}
{custom_render_form_field field='lang_id'} {/custom_render_form_field}
{render_form_field field='address1'} {render_form_field field='address2' show_label=false} {render_form_field field='address3' show_label=false}
{render_form_field field='zipcode'}
{render_form_field field='city'}
{custom_render_form_field field='country'} {$countryFieldId=$label_attr.for|default:null} {/custom_render_form_field}
{custom_render_form_field field='state'} {/custom_render_form_field}
{if {config key="customer_confirm_email"}}
{render_form_field field="email"}
{render_form_field field="email_confirm"}
{else}
{render_form_field field="email"}
{/if}
{render_form_field field='phone'}
{render_form_field field='cellphone'}
{hook name="customer.create-form" location="customer_create_form" } {/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_error_message = $form_error_message } {/form} {* Delete confirmation dialog *} {capture "delete_customer_dialog"} {hook name="customer.delete-form" location="customer_delete_form" } {/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 = {token_url path='/admin/customer/delete'} form_content = {$smarty.capture.delete_customer_dialog nofilter} form_id = "form_delete_customer" } {/block} {block name="javascript-initialization"} {javascripts file='assets/js/thelia-states.js'} {/javascripts} {/block} {block name="javascript-last-call"} {hook name="customers.js" location="customers-js" } {/block}