// I'm not sure as I've never had a look at how that works before ;)

This commit is contained in:
Kevin Granger
2013-07-31 21:17:03 +02:00
parent 50bdfb9a1a
commit e4878ba393
26 changed files with 769 additions and 648 deletions
@@ -25,49 +25,62 @@
{extends file="helpers/list/list_header.tpl"}
{block name=leadin}
<ul class="breadcrumb cat_bar2">
{assign var=i value=0}
{foreach $categories_tree key=key item=category}
{if $i++ == 0}
<li><i class="icon-home"></i>
{assign var=params_url value=""}
{else}
{assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"}
{/if}
{if $category.id_category == $categories_tree_current_id}
{$category.name}</li>
{else}
<a href="{$currentIndex}{$params_url}&token={$token}">{$category.name}</a></li>
{/if}
{/foreach}
</ul>
{block name=override_header}
<ul class="breadcrumb cat_bar2">
{assign var=i value=0}
{foreach $categories_tree key=key item=category}
{if $i++ == 0}
<li>
<i class="icon-home"></i>
{assign var=params_url value=""}
{else}
{assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"}
{/if}
{if $category.id_category == $categories_tree_current_id}
{$category.name}</li>
{else}
<a href="{$currentIndex}{$params_url}&token={$token}">{$category.name}</a></li>
{/if}
{/foreach}
</ul>
{/block}
{block name=leadin}
{if isset($delete_category) && $delete_category}
<form action="{$REQUEST_URI}" method="post">
<div class="alert alert-block">
<h2>
{if $need_delete_mode}
{l s='Do you want to delete the products too?'}
{else}
{l s='Deleting this category will remove products linked only within this category and no others. Are you sure you want to continue?'}
{/if}
</h2>
<div class="panel panel-danger">
<div class="panel-heading">
{if $need_delete_mode}
<ul class="listForm">
<li>
<input type="radio" name="deleteMode" value="linkanddisable" id="deleteMode_linkanddisable" />
<label for="deleteMode_linkanddisable" style="float:none;">{l s='No. I want to link products without other categories -- within the parent category -- and then disable them.'}</label>
</li>
<li>
<input type="radio" name="deleteMode" value="link" id="deleteMode_link" />
<label for="deleteMode_link" style="float:none;">{l s='No. I want to link products without other categories and within the parent category.'}</label>
</li>
<li>
<input type="radio" name="deleteMode" value="delete" id="deleteMode_delete" />
<label for="deleteMode_delete" style="float:none">{l s='Yes. I want to remove products linked only within this category and no others.'}</label>
</li>
</ul>
{l s='Do you want to delete the products too?'}
{else}
{l s='Deleting this category will remove products linked only within this category and no others. Are you sure you want to continue?'}
{/if}
</div>
{if $need_delete_mode}
<form action="{$REQUEST_URI}" method="post">
<div class="radio">
<label for="deleteMode_linkanddisable">
<input type="radio" name="deleteMode" value="linkanddisable" id="deleteMode_linkanddisable" />
{l s='No. I want to link products without other categories -- within the parent category -- and then disable them.'}
</label>
</div>
<div class="radio">
<label for="deleteMode_link">
<input type="radio" name="deleteMode" value="link" id="deleteMode_link" />
{l s='No. I want to link products without other categories and within the parent category.'}
</label>
</div>
<div class="radio">
<label for="deleteMode_delete">
<input type="radio" name="deleteMode" value="delete" id="deleteMode_delete" />
{l s='Yes. I want to remove products linked only within this category and no others.'}
</label>
</div>
{else}
<input type="hidden" name="deleteMode" value="delete" id="deleteMode_delete" />
{/if}
@@ -82,11 +95,10 @@
{/if}
{/if}
{/foreach}
<br />
<input type="submit" name="cancel" class="button" value="{l s='Cancel'}" />
<input type="submit" class="button" value="{l s='Validate'}" />
<hr>
<input type="submit" name="cancel" class="btn btn-default" value="{l s='Cancel'}" />
<input type="submit" class="btn btn-primary" value="{l s='Validate'}" />
</form>
</div>
</form>
<div class="clear">&nbsp;</div>
{/if}
{/block}
@@ -25,12 +25,11 @@
{extends file="helpers/list/list_header.tpl"}
{block name="override_header"}
{block name="leadin"}
<div id="CustomerThreadContacts" class="row">
{assign var=nb_categories value=count($categories)}
{foreach $categories as $key => $val}
{assign var=total_thread value=0}
@@ -44,42 +43,52 @@
{/foreach}
<div class="col-lg-3">
<h3>{$val.name}</h3>
{if $nb_categories < 6}
<p>{$val.description}</p>
{/if}
{if $total_thread == 0}
<span class="message-mail">{l s='No new messages'}</span>
{else}
<a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button">
{$total_thread}
{if $total_thread > 1}{l s='New messages'}{else}{l s='New message'}{/if}
</a>
{/if}
<div class="panel">
<div class="panel-heading">
{$val.name}
</div>
{if $nb_categories < 6}
<p>{$val.description}</p>
{/if}
{if $total_thread == 0}
<span class="message-mail">{l s='No new messages'}</span>
{else}
<a href="{$currentIndex}&token={$token}&id_customer_thread={$id_customer_thread}&viewcustomer_thread" class="button">
{$total_thread}
{if $total_thread > 1}{l s='New messages'}{else}{l s='New message'}{/if}
</a>
{/if}
</div>
</div>
{/foreach}
<div id="MeaningStatus" class="col-lg-3">
<h3>{l s='Meaning of status'}</h3>
<ul>
<li class="label label-success">{l s='Open'}</li>
<li class="label label-danger">{l s='Closed'}</li>
<li class="label label-warning">{l s='Pending 1'}</li>
<li class="label label-warning">{l s='Pending 2'}</li>
</ul>
<div class="col-lg-3">
<div id="MeaningStatus" class="panel">
<div class="panel-heading">
{l s='Meaning of status'}
</div>
<ul class="list-unstyled">
<li class="label label-success">{l s='Open'}</li>
<li class="label label-danger">{l s='Closed'}</li>
<li class="label label-warning">{l s='Pending 1'}</li>
<li class="label label-warning">{l s='Pending 2'}</li>
</ul>
</div>
</div>
<div id="CustomerService" class="col-lg-3">
<h3>{l s='Statistics'}</h3>
<ul>
{assign var=count value=0}
{foreach $params as $key => $val}
{assign var=count value=$count+1}
<li>{$key} <span class="badge">{$val}</span></li>
{/foreach}
</ul>
<div class="col-lg-3">
<div id="CustomerService" class="panel">
<div class="panel-heading">
{l s='Statistics'}
</div>
<ul class="list-unstyled">
{assign var=count value=0}
{foreach $params as $key => $val}
{assign var=count value=$count+1}
<li>{$key} <span class="badge">{$val}</span></li>
{/foreach}
</ul>
</div>
</div>
</div>
<hr/>
{/block}
@@ -142,9 +142,6 @@
{/foreach}
</div>
<script type="text/javascript">
var timer;
$(document).ready(function(){
@@ -26,108 +26,274 @@
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<script type="text/javascript">
function saveCustomerNote()
{
$('#note_feedback').html('<img src="../img/loader.gif" alt="" />').show();
var noteContent = $('#noteContent').val();
$.ajax({
type: "POST",
url: "index.php",
data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}&note="+noteContent,
async : true,
success: function(r) {
$('#note_feedback').html('').hide();
if (r == 'ok')
{
$('#note_feedback').html("<b style='color:green'>{l s='Your note has been saved.'}</b>").fadeIn(400);
$('#submitCustomerNote').attr('disabled', true);
}
else if (r == 'error:validation')
$('#note_feedback').html("<b style='color:red'>({l s='Error: Your note is not valid.'}</b>").fadeIn(400);
else if (r == 'error:update')
$('#note_feedback').html("<b style='color:red'>{l s='Error: Your note cannot be saved.'}</b>").fadeIn(400);
$('#note_feedback').fadeOut(3000);
<script type="text/javascript">
function saveCustomerNote()
{
$('#note_feedback').html('<img src="../img/loader.gif" alt="" />').show();
var noteContent = $('#noteContent').val();
$.ajax({
type: "POST",
url: "index.php",
data: "token={getAdminToken tab='AdminCustomers'}&tab=AdminCustomers&ajax=1&action=updateCustomerNote&id_customer={$customer->id}&note="+noteContent,
async : true,
success: function(r) {
$('#note_feedback').html('').hide();
if (r == 'ok')
{
$('#note_feedback').html("<b style='color:green'>{l s='Your note has been saved.'}</b>").fadeIn(400);
$('#submitCustomerNote').attr('disabled', true);
}
});
}
</script>
else if (r == 'error:validation')
$('#note_feedback').html("<b style='color:red'>({l s='Error: Your note is not valid.'}</b>").fadeIn(400);
else if (r == 'error:update')
$('#note_feedback').html("<b style='color:red'>{l s='Error: Your note cannot be saved.'}</b>").fadeIn(400);
$('#note_feedback').fadeOut(3000);
}
});
}
</script>
<div id="container-customer" class="row">
<div id="container-customer"></div>
{*left*}
<div class="col-lg-6">
<div class="panel">
<div class="panel-heading panel-heading-big">
<i class="icon-user"></i> {$customer->firstname} {$customer->lastname}
</div>
<ul class="list-unstyled col-lg-6">
<li>{l s='Gender:'} <span class="label"><img src="{$gender_image}"/></span></li>
<li><i class="icon-envelope-alt"></i> {l s='Email:'} <a class="label" href="mailto:{$customer->email}">{$customer->email}</a></li>
<li>{l s='ID:'} <span class="label">{$customer->id|string_format:"%06d"}</span></li>
<li>{l s='Registration date:'} <span class="label">{$registration_date}</span></li>
<li>{l s='Last visit:'} <span class="label">{if $customer_stats['last_visit']}{$last_visit}{else}{l s='Never'}{/if}</span></li>
<li>{if $count_better_customers != '-'}{l s='Rank:'} <span class="label"># {$count_better_customers}</span>{/if}</li>
<li>{if $shop_is_feature_active}{l s='Shop:'} <span class="label">{$name_shop}</span>{/if}</li>
</ul>
<ul class="list-unstyled col-lg-6">
<li>{l s='Language:'} <span class="label">{if isset($customerLanguage)}{$customerLanguage->name}{else}{l s='undefined'}{/if}</span></li>
<li>{l s='Newsletter:'} {if $customer->newsletter}<span class="label label-success"><i class="icon-check-sign"></i> {l s='Yes'}</span>{else}<span class="label label-warning"><i class="icon-ban-circle"></i> {l s='No'}</span>{/if}</li>
<li>{l s='Opt in:'} {if $customer->optin}<span class="label label-success"><i class="icon-check-sign"></i> {l s='Yes'}</span>{else}<span class="label label-warning"><i class="icon-ban-circle"></i> {l s='No'}</span>{/if}</li>
<li>{l s='Age:'} {$customer_stats['age']} {if isset($customer->birthday['age'])}({$customer_birthday}){else}{l s='Unknown'}{/if}</li>
<li>{l s='Last update:'} <span class="label">{$last_update}</span></li>
<li>{l s='Status:'} {if $customer->active}<span class="label label-success"><i class="icon-check-sign"></i> {l s='Yes'}</span>{else}<span class="label label-warning"><i class="icon-ban-circle"></i> {l s='No'}</span>{/if}</li>
</ul>
<div class="row">
<div class="col-lg-6">
<fieldset>
<a class="btn btn-default pull-right" href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<i class="icon-edit"></i> {l s='Edit'}
</a>
<h2>
{$customer->firstname} {$customer->lastname} <img src="{$gender_image}"/>
</h2>
<ul>
<li><a href="mailto:{$customer->email}">{$customer->email}</a></li>
<li>{l s='ID:'} {$customer->id|string_format:"%06d"}</li>
<li>{l s='Registration date:'} {$registration_date}</li>
<li>{l s='Last visit:'} {if $customer_stats['last_visit']}{$last_visit}{else}{l s='Never'}{/if}</li>
<li>{if $count_better_customers != '-'}{l s='Rank: #'} {$count_better_customers}{/if}</li>
<li>{if $shop_is_feature_active}{l s='Shop:'} {$name_shop}{/if}</li>
<li>{l s='Language:'} {if isset($customerLanguage)}{$customerLanguage->name}{else}{l s='undefined'}{/if}</li>
<li>{l s='Newsletter:'} {if $customer->newsletter}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}</li>
<li>{l s='Opt in:'} {if $customer->optin}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}</li>
<li>{l s='Age:'} {$customer_stats['age']} {if isset($customer->birthday['age'])}({$customer_birthday}){else}{l s='Unknown'}{/if}</li>
<li>{l s='Last update:'} {$last_update}</li>
<li>{l s='Status:'} {if $customer->active}<img src="../img/admin/enabled.gif" />{else}<img src="../img/admin/disabled.gif" />{/if}</li>
</ul>
{if $customer->isGuest()}
<div>
{l s='This customer is registered as.'} <b>{l s='Guest'}</b>
{if !$customer_exists}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$id_lang}" />
<p class="center">
<input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform to a customer account'}" />
</p>
{l s='This feature generates a random password before sending an email to your customer.'}
</form>
{else}
</div>
<div>
{l s='A registered customer account using the defined email address already exists. '}
{/if}
</div>
{if $customer->isGuest()}
<div>
{l s='This customer is registered as.'} <b>{l s='Guest'}</b>
{if !$customer_exists}
<form method="post" action="index.php?tab=AdminCustomers&id_customer={$customer->id}&token={getAdminToken tab='AdminCustomers'}">
<input type="hidden" name="id_lang" value="{$id_lang}" />
<p class="center">
<input class="button" type="submit" name="submitGuestToCustomer" value="{l s='Transform to a customer account'}" />
</p>
{l s='This feature generates a random password before sending an email to your customer.'}
</form>
{else}
</div>
<div>
{l s='A registered customer account using the defined email address already exists. '}
{/if}
</fieldset>
</div>
<div class="col-lg-6">
<fieldset>
<h3>
</div>
{/if}
<a class="btn btn-default" href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<i class="icon-edit"></i> {l s='Edit'}
</a>
</div>
<div class="panel">
<div class="panel-heading">
<i class="icon-file"></i> {l s='Orders'} <span class="badge">{count($orders)}</span>
</div>
{if $orders AND count($orders)}
{assign var=count_ok value=count($orders_ok)}
{assign var=count_ko value=count($orders_ko)}
<div class="panel">
<div class="row">
<div class="col-lg-6">
<i class="icon-ok-circle icon-big"></i>
{l s='Valid orders:'} <span class="badge badge-success">{$count_ok}</span> {l s='for'} {$total_ok}
</div>
<div class="col-lg-6">
<i class="icon-exclamation-sign icon-big"></i>
{l s='Invalid orders:'} <span class="badge badge-warning">{$count_ko}</span>
</div>
</div>
</div>
{if $count_ok}
<table class="table">
<thead>
<tr>
<th class="center">{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Payment: '}</th>
<th>{l s='State'}</th>
<th>{l s='Products'}</th>
<th>{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $orders_ok AS $key => $order}
<tr onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$order['id_order']}</td>
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{if $count_ko}
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Payment: '}</th>
<th>{l s='State'}</th>
<th>{l s='Products'}</th>
<th>{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $orders_ko AS $key => $order}
<tr onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$order['id_order']}</td>
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{else}
{l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
<div class="panel">
<div class="panel-heading">
<i class="icon-shopping-cart"></i> {l s='Carts'} <span class="badge">{count($carts)}</span>
</div>
{if $carts AND count($carts)}
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Carrier'}</th>
<th>{l s='Total'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $carts AS $key => $cart}
<tr onclick="document.location = '?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}'">
<td>{$cart['id_cart']}</td>
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$cart['name']}</td>
<td align="right">{$cart['total_price']}</td>
<td align="center">
<a class="btn btn-default" href="index.php?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='No cart is available'}.
{/if}
</div>
{if $products AND count($products)}
<div class="panel">
<div class="panel-heading">
<i class="icon-archive"></i> {l s='Products:'} <span class="badge">{count($products)}</span>
</div>
<table class="table">
<thead>
<tr>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Name'}</th>
<th class="center">{l s='Quantity'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $products AS $key => $product}
<tr onclick="document.location = '?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$product['product_name']}</td>
<td align="right">{$product['product_quantity']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
</div>
{*right*}
<div class="col-lg-6">
<div class="panel">
<div class="panel-heading">
<i class="icon-eye-close"></i> {l s='Add a private note'}
</h3>
</div>
<div class="alert alert-info">{l s='This note will be displayed to all employees but not to customers.'}</div>
<form action="ajax.php" method="post" onsubmit="saveCustomerNote();return false;" id="customer_note">
<textarea name="note" id="noteContent" onkeydown="$('#submitCustomerNote').removeAttr('disabled');">{$customer_note}</textarea>
<button type="submit" id="submitCustomerNote" class="btn btn-primary" disabled="disabled" />{l s='Save'}</button>
<form id="customer_note" class="form-horizontal" action="ajax.php" method="post" onsubmit="saveCustomerNote();return false;" >
<div class="row">
<div class="col-lg-12">
<textarea name="note" id="noteContent" onkeydown="$('#submitCustomerNote').removeAttr('disabled');">{$customer_note}</textarea>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<button type="submit" id="submitCustomerNote" class="btn btn-primary pull-right" disabled="disabled" /><i class="icon-save"></i> {l s='Save'}</button>
</div>
</div>
<span id="note_feedback"></span>
</form>
</fieldset>
</div>
</div>
</div>
<fieldset>
<div class="col col-lg-12">
<h3><i class="icon-envelope-alt"></i> {l s='Messages'} <span class="badge">{count($messages)}</span></h3>
<div class="panel">
<div class="panel-heading">
<i class="icon-envelope"></i> {l s='Messages'} <span class="badge">{count($messages)}</span>
</div>
{if count($messages)}
<table class="table">
<thead>
@@ -151,12 +317,11 @@
{l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
</fieldset>
<fieldset>
<div class="col col-lg-12">
<h3><i class="icon-gift"></i> {l s='Vouchers'} <span class="badge">{count($discounts)}</span></h3>
<div class="panel">
<div class="panel-heading">
<i class="icon-ticket"></i> {l s='Vouchers'} <span class="badge">{count($discounts)}</span>
</div>
{if count($discounts)}
<table class="table">
<thead>
@@ -193,286 +358,14 @@
{l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}.
{/if}
</div>
</fieldset>
<fieldset>
{* display hook specified to this page : AdminCustomers *}
<div>{hook h="displayAdminCustomers" id_customer=$customer->id}</div>
</fieldset>
<fieldset>
<div class="col col-lg-12">
<h3>{l s='Orders'} <span class="badge">{count($orders)}</span></h3>
{if $orders AND count($orders)}
{assign var=count_ok value=count($orders_ok)}
{if $count_ok}
<h3>
<i class="icon-ok-circle"></i> {l s='Valid orders:'} {$count_ok} {l s='for'} {$total_ok}
</h3>
<table class="table">
<thead>
<tr>
<th class="center">{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Payment: '}</th>
<th>{l s='State'}</th>
<th class="right">{l s='Products'}</th>
<th class="right">{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $orders_ok AS $key => $order}
<tr onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$order['id_order']}</td>
<td>{$order['date_add']}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{assign var=count_ko value=count($orders_ko)}
{if $count_ko}
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Payment: '}</th>
<th>{l s='State'}</th>
<th class="right">{l s='Products'}</th>
<th class="right">{l s='Total spent'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $orders_ko AS $key => $order}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$order['id_order']}</td>
<td>{$order['date_add']}</td>
<td>{$order['payment']}</td>
<td>{$order['order_state']}</td>
<td align="right">{$order['nb_products']}</td>
<td align="right">{$order['total_paid_real']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$order['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="alert alert-info">{l s='Invalid orders:'} <span class="badge">{$count_ko}</span></div>
{/if}
{else}
{l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
</fieldset>
<fieldset>
<div class="col-lg-12">
<h3><i class="icon-shopping-cart"></i> {l s='Carts'} <span class="badge">{count($carts)}</span></h3>
{if $carts AND count($carts)}
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Date'}</th>
<th>{l s='Carrier'}</th>
<th class="right">{l s='Total'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $carts AS $key => $cart}
<tr onclick="document.location = '?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}'">
<td>{$cart['id_cart']}</td>
<td>{$cart['date_add']}</td>
<td>{$cart['name']}</td>
<td align="right">{$cart['total_price']}</td>
<td align="center">
<a class="btn btn-default" href="index.php?tab=AdminCarts&id_cart={$cart['id_cart']}&viewcart&token={getAdminToken tab='AdminCarts'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='No cart is available'}.
{/if}
</div>
</fieldset>
<fieldset>
{if $products AND count($products)}
<div class="col-lg-12">
<h3><i class="icon-archive"></i> {l s='Products:'} <span class="badge">{count($products)}</span></h3>
<table class="table">
<thead>
<tr>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Name'}</th>
<th class="center">{l s='Quantity'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $products AS $key => $product}
<tr onclick="document.location = '?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$product['date_add']}</td>
<td>{$product['product_name']}</td>
<td align="right">{$product['product_quantity']}</td>
<td align="center">
<a class="btn btn-default" href="?tab=AdminOrders&id_order={$product['id_order']}&vieworder&token={getAdminToken tab='AdminOrders'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
</fieldset>
<fieldset>
<div class="col-lg-12">
<h3><i class="icon-building"></i> {l s='Addresses'} <span class="badge">{count($addresses)}</span></h3>
{if count($addresses)}
<table class="table">
<thead>
<tr>
<th>{l s='Company'}</th>
<th>{l s='Name'}</th>
<th>{l s='Address'}</th>
<th>{l s='Country'}</th>
<th class="right">{l s='Phone number(s)'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $addresses AS $key => $address}
<tr {if $key %2}class="alt_row"{/if}>
<td>{if $address['company']}{$address['company']}{else}--{/if}</td>
<td>{$address['firstname']} {$address['lastname']}</td>
<td>{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}</td>
<td>{$address['country']}</td>
<td class="right">
{if $address['phone']}
{$address['phone']}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{/if}
{else}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{else}--{/if}
{/if}
</td>
<td class="center">
<a href="?tab=AdminAddresses&id_address={$address['id_address']}&addaddress&token={getAdminToken tab='AdminAddresses'}">
<img src="../img/admin/edit.gif" />
</a>
<a href="?tab=AdminAddresses&id_address={$address['id_address']}&deleteaddress&token={getAdminToken tab='AdminAddresses'}">
<img src="../img/admin/delete.gif" />
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
</fieldset>
<fieldset>
<div class="col-lg-12">
<h3>
<i class="icon-group"></i> {l s='Groups'} <span class="badge">{count($groups)}</span>
<a class="btn btn-default pull-right" href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<i class="icon-edit"></i> {l s='Edit'}
</a>
</h3>
{if $groups AND count($groups)}
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $groups AS $key => $group}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}'">
<td>{$group['id_group']}</td>
<td>{$group['name']}</td>
<td class="center">
<a class="btn btn-default" href="?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
</div>
</fieldset>
<fieldset>
{if count($interested)}
<div class="col-lg-12">
<h3><i class="icon-archive"></i> {l s='Products:'} <span class="badge">{count($interested)}</span></h3>
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $interested as $key => $p}
<tr {if $key %2}class="alt_row"{/if} style="cursor: pointer" onclick="document.location = '{$p['url']}'">
<td>{$p['id']}</td>
<td>{$p['name']}</td>
<td align="center">
<a class="btn btn-default" href="{$p['url']}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div >
{/if}
</fieldset>
<fieldset>
{if count($connections)}
<div class="col-lg-12">
<h3><i class="icon-time"></i> {l s='Last connections'}</h3>
<div class="panel">
<div class="panel-heading">
<i class="icon-time"></i> {l s='Last connections'}
</div>
<table class="table">
<thead>
<tr>
@@ -486,7 +379,7 @@
<tbody>
{foreach $connections as $connection}
<tr>
<td>{$connection['date_add']}</td>
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$connection['pages']}</td>
<td>{$connection['time']}</td>
<td>{$connection['http_referer']}</td>
@@ -497,34 +390,158 @@
</table>
</div>
{/if}
</fieldset>
<fieldset>
<div class="col-lg-12">
{if count($referrers)}
<h3><i class="icon-share-alt"></i> {l s='Referrers'}</h3>
<div class="panel">
<div class="panel-heading">
<i class="icon-group"></i> {l s='Groups'} <span class="badge">{count($groups)}</span>
</div>
{if $groups AND count($groups)}
<table class="table">
<thead>
<tr>
<th>{l s='Date'}</th>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
{if $shop_is_feature_active}<th>{l s='Shop'}</th>{/if}
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $referrers as $referrer}
<tr>
<td>{$referrer['date_add']}</td>
<td>{$referrer['name']}</td>
{if $shop_is_feature_active}<td>{$referrer['shop_name']}</td>{/if}
{foreach $groups AS $key => $group}
<tr onclick="document.location = '?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}'">
<td>{$group['id_group']}</td>
<td>{$group['name']}</td>
<td class="center">
<a class="btn btn-default" href="?tab=AdminGroups&id_group={$group['id_group']}&viewgroup&token={getAdminToken tab='AdminGroups'}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
{/if}
<a class="btn btn-default" href="{$current}&updatecustomer&id_customer={$customer->id}&token={$token}">
<i class="icon-edit"></i> {l s='Edit'}
</a>
</div>
</fieldset>
</div>
{*todo add next elements*}
{if count($interested)}
<div class="panel">
<div class="panel-heading">
<i class="icon-archive"></i> {l s='Products:'} <span class="badge">{count($interested)}</span>
</div>
<table class="table">
<thead>
<tr>
<th>{l s='ID'}</th>
<th>{l s='Name'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $interested as $key => $p}
<tr onclick="document.location = '{$p['url']}'">
<td>{$p['id']}</td>
<td>{$p['name']}</td>
<td align="center">
<a class="btn btn-default" href="{$p['url']}">
<i class='icon-eye-open'></i> {l s='View'}
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{if count($referrers)}
<div class="panel">
<div class="panel-heading">
<i class="icon-share-alt"></i> {l s='Referrers'}
</div>
<table class="table">
<thead>
<tr>
<th>{l s='Date'}</th>
<th>{l s='Name'}</th>
{if $shop_is_feature_active}<th>{l s='Shop'}</th>{/if}
</tr>
</thead>
<tbody>
{foreach $referrers as $referrer}
<tr>
<td>{dateFormat date=$order['date_add'] full=0}</td>
<td>{$referrer['name']}</td>
{if $shop_is_feature_active}<td>{$referrer['shop_name']}</td>{/if}
</tr>
{/foreach}
</tbody>
</table>
</div>
{/if}
{* display hook specified to this page : AdminCustomers *}
{hook h="displayAdminCustomers" id_customer=$customer->id}
<div class="col-lg-12">
<div class="panel">
<div class="panel-heading">
<i class="icon-map-marker"></i> {l s='Addresses'} <span class="badge">{count($addresses)}</span>
</div>
{if count($addresses)}
<table class="table">
<thead>
<tr>
<th>{l s='Company'}</th>
<th>{l s='Name'}</th>
<th>{l s='Address'}</th>
<th>{l s='Country'}</th>
<th>{l s='Phone number(s)'}</th>
<th class="center">{l s='Actions'}</th>
</tr>
</thead>
<tbody>
{foreach $addresses AS $key => $address}
<tr>
<td>{if $address['company']}{$address['company']}{else}--{/if}</td>
<td>{$address['firstname']} {$address['lastname']}</td>
<td>{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}</td>
<td>{$address['country']}</td>
<td>
{if $address['phone']}
{$address['phone']}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{/if}
{else}
{if $address['phone_mobile']}<br />{$address['phone_mobile']}{else}--{/if}
{/if}
</td>
<td>
<div class="btn-group">
<a class="btn btn-default" data-toggle="dropdown" href="?tab=AdminAddresses&id_address={$address['id_address']}&addaddress&token={getAdminToken tab='AdminAddresses'}">
<i class="icon-edit"></i> {l s='Edit'}
</a>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="?tab=AdminAddresses&id_address={$address['id_address']}&deleteaddress&token={getAdminToken tab='AdminAddresses'}">
<i class="icon-trash"></i> {l s='Delete'}
</a></li>
</ul>
</div>
</td>
</tr>
{/foreach}
</tbody>
</table>
{else}
{l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]}
{/if}
</div>
</div>
</div>
{/block}
@@ -26,7 +26,7 @@
<input type="hidden" name="submitted_tabs[]" value="Associations" />
<div class="Associations">
<legend>{l s='Associations'}</legend>
<h3>{l s='Associations'}</h3>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Associations"}
<div id="no_default_category" class="alert alert-info">
@@ -25,7 +25,7 @@
{if isset($obj->id)}
<input type="hidden" name="submitted_tabs[]" value="Attachments" />
<legend>{l s='Attachment'}</legend>
<h3>{l s='Attachment'}</h3>
<div class="row">
<label class="control-label col-lg-3 required" for="attachment_name_{$id_lang}">
@@ -47,7 +47,7 @@
{/foreach}
</script>
<legend>{l s='Add or modify combinations for this product.'}</legend>
<h3>{l s='Add or modify combinations for this product.'}</h3>
<div class="alert alert-info">
{l s='Or use the'}&nbsp;<a class="btn btn-link bt-icon confirm_leave" href="index.php?tab=AdminAttributeGenerator&id_product={$product->id}&attributegenerator&token={$token_generator}"><i class="icon-magic"></i> {l s='Product combinations generator'} <i class="icon-external-link-sign"></i></a> {l s='in order to automatically create a set of combinations.'}
</div>
@@ -25,7 +25,7 @@
{if isset($obj->id)}
<input type="hidden" name="submitted_tabs[]" value="Customization" />
<legend>{l s='Add or modify customizable properties.'}</legend>
<h3>{l s='Add or modify customizable properties.'}</h3>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Customization"}
@@ -25,7 +25,7 @@
{if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Features" />
<legend>{l s='Assign features to this product:'}</legend>
<h3>{l s='Assign features to this product:'}</h3>
<div class="alert alert-info">
{l s='You can specify a value for each relevant feature regarding this product. Empty fields will not be displayed.'}<br/>
@@ -26,10 +26,10 @@
{if isset($id_product) && isset($product)}
<input type="hidden" name="submitted_tabs[]" value="Images" />
<legend class="tab" >
<h3 class="tab" >
{l s='Images'}
<span class="badge" id="countImage">{$countImages}</span>
</legend>
</h3>
<div class="row">
<label class="control-label col-lg-5 file_upload_label">
@@ -29,7 +29,7 @@
{/if}
<input type="hidden" name="submitted_tabs[]" value="Informations" />
<legend class="tab">{l s='Info.'}</legend>
<h3 class="tab">{l s='Info.'}</h3>
<div class="alert alert-info">{l s='Product global information'}</div>
<script type="text/javascript">
{if isset($PS_ALLOW_ACCENTED_CHARS_URL) && $PS_ALLOW_ACCENTED_CHARS_URL}
@@ -28,7 +28,7 @@
var msg_set_quantity = "{l s="Please set a quantity to add a product." js=1}";
</script>
<input type="hidden" name="submitted_tabs[]" value="Pack" />
<legend>{l s='Pack'}</legend>
<h3>{l s='Pack'}</h3>
<div class="alert alert-info">{l s='You cannot add combinations to a pack.'}</div>
<div class="ppack">
@@ -105,7 +105,8 @@ $(document).ready(function () {
</script>
<input type="hidden" name="submitted_tabs[]" value="Prices" />
<legend>{l s='Product price'}</legend>
<h3>{l s='Product price'}</h3>
<div class="alert alert-info">
{l s='You must enter either the pre-tax retail price, or the retail price with tax. The input field will be automatically calculated.'}
</div>
@@ -279,9 +280,11 @@ $(document).ready(function () {
</div>
{*todo separate fieldset*}
{if isset($specificPriceModificationForm)}
<legend>{l s='Specific prices'}</legend>
<h3>{l s='Specific prices'}</h3>
<div class="alert alert-info">
{l s='You can set specific prices for clients belonging to different groups, different countries, etc...'}
</div>
@@ -25,7 +25,7 @@
{if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Quantities" />
<legend>{l s='Available quantities for sale'}</legend>
<h3>{l s='Available quantities for sale'}</h3>
{if !$ps_stock_management}
<div class="alert alert-info">{l s='The stock management is disabled'}</div>
{else}
@@ -174,7 +174,7 @@
{/if}
{/if}
<legend>{l s='Availability settings'}</legend>
<h3>{l s='Availability settings'}</h3>
{if !$has_attribute}
<div class="row">
@@ -23,7 +23,7 @@
* International Registered Trademark & Property of PrestaShop SA
*}
<input type="hidden" name="submitted_tabs[]" value="Seo" />
<legend>{l s='SEO'}</legend>
<h3>{l s='SEO'}</h3>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Seo"}
@@ -24,7 +24,7 @@
*}
<input type="hidden" name="submitted_tabs[]" value="Shipping" />
<legend>{l s='Shipping'}</legend>
<h3>{l s='Shipping'}</h3>
{if isset($display_common_field) && $display_common_field}
<div class="alert alert-info">{l s='Warning, if you change the value of fields with an orange bullet %s, the value will be changed for all other shops for this product' sprintf=$bullet_common_field}</div>
@@ -26,7 +26,7 @@
<input type="hidden" name="supplier_loaded" value="1">
{if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Suppliers" />
<legend>{l s='Suppliers of the current product'}</legend>
<h3>{l s='Suppliers of the current product'}</h3>
<div class="alert alert-info">
{l s='This interface allows you to specify the suppliers of the current product and eventually its combinations.'}<br />
{l s='It is also possible to specify supplier references according to previously associated suppliers.'}<br />
@@ -61,7 +61,7 @@
<i class="icon-plus"></i> {l s='Create a new supplier'} <i class="icon-external-link-sign"></i>
</a>
<legend>{l s='Product reference(s)'}</legend>
<h3>{l s='Product reference(s)'}</h3>
<div class="alert alert-info">
{if $associated_suppliers|@count == 0}
@@ -26,5 +26,5 @@
{extends file="helpers/list/list_header.tpl"}
{block name="override_header"}
<legend>{$sub_title}</legend>
<h3>{$sub_title}</h3>
{/block}