276 lines
13 KiB
HTML
276 lines
13 KiB
HTML
|
|
{extends file="admin-layout.tpl"}
|
|
|
|
{block name="page-title"}{intl l='Customer'}{/block}
|
|
|
|
{block name="check-permissions"}admin.customer.view{/block}
|
|
|
|
{block name="main-content"}
|
|
{assign var=customer_page value={$smarty.get.page|default:1}}
|
|
|
|
|
|
<div class="customer">
|
|
<div id="wrapper" class="container">
|
|
|
|
<ul class="breadcrumb">
|
|
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
|
<li><a href="{url path='/admin/customers'}">{intl l="Customers"}</a></li>
|
|
</ul>
|
|
|
|
{module_include location='customer_top'}
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<div class="general-block-decorator">
|
|
<table class="table table-striped table-condensed" id="customer_list">
|
|
<caption>
|
|
{intl l="Customers list"}
|
|
|
|
{module_include location='customer_list_caption'}
|
|
|
|
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.customers.create"}
|
|
<a class="btn btn-default btn-primary action-btn" title="{intl l='Add a new Customer'}" href="#add_customer_dialog" data-toggle="modal">
|
|
<span class="glyphicon glyphicon-plus-sign"></span>
|
|
</a>
|
|
{/loop}
|
|
</caption>
|
|
|
|
{ifloop rel="customer_list"}
|
|
<thead>
|
|
<tr>
|
|
<th class="object-title">
|
|
{intl l="customer ref"}
|
|
</th>
|
|
|
|
<th class="object-title">
|
|
{intl l="company"}
|
|
</th>
|
|
|
|
{module_include location='category_list_header'}
|
|
|
|
<th>
|
|
{intl l="firstname & lastname"}
|
|
</th>
|
|
|
|
<th>
|
|
{intl l="last order"}
|
|
</th>
|
|
|
|
<th>{intl l='order amount'}</th>
|
|
|
|
<th>{intl l='Actions'}</th>
|
|
</tr>
|
|
</thead>
|
|
|
|
<tbody>
|
|
{loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}}
|
|
<tr>
|
|
<td>{$REF}</td>
|
|
|
|
<td>
|
|
{$COMPANY}
|
|
</td>
|
|
|
|
<td class="object-title">
|
|
{$FIRSTNAME} {$LASTNAME}
|
|
</td>
|
|
|
|
{module_include location='customer_list_row'}
|
|
|
|
<td>
|
|
{format_date date=$LASTORDER_DATE}
|
|
</td>
|
|
|
|
<td>
|
|
{format_number number=$LASTORDER_AMOUNT}
|
|
</td>
|
|
<td>
|
|
<div class="btn-group">
|
|
|
|
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.customer.edit"}
|
|
<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>
|
|
{/loop}
|
|
{loop type="auth" name="can_send_mail" roles="ADMIN" permissions="admin.customer.sendMail"}
|
|
<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 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"><span class="glyphicon glyphicon-trash"></span></a>
|
|
{/loop}
|
|
</div>
|
|
</td>
|
|
|
|
</tr>
|
|
{/loop}
|
|
</tbody>
|
|
{/ifloop}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
{module_include location='customer_bottom'}
|
|
<div class="row">
|
|
<div class="col-md-12 text-center">
|
|
|
|
<ul class="pagination pagination-centered">
|
|
{if $customer_page != 1}
|
|
<li><a href="{url path="/admin/customers" page="1"}">«</a></li>
|
|
{else}
|
|
<li class="disabled"><a href="#">«</a></li>
|
|
{/if}
|
|
|
|
{pageloop rel="customer_list"}
|
|
{if $PAGE != $CURRENT}
|
|
<li><a href="{url path="/admin/customers" page="{$PAGE}"}">{$PAGE}</a></li>
|
|
|
|
{else}
|
|
<li class="active"><a href="#">{$PAGE}</a></li>
|
|
{/if}
|
|
|
|
{if $PAGE == $LAST && $LAST != $CURRENT}
|
|
<li><a href="{url path="/admin/customers" page="$PAGE"}">»</a></li>
|
|
{else}
|
|
<li class="disabled"><a href="#">»</a></li>
|
|
{/if}
|
|
{/pageloop}
|
|
</ul>
|
|
|
|
</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='company'}
|
|
<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='Company'}">
|
|
</div>
|
|
{/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} |