// update customer service page

This commit is contained in:
Sarah Lorenzini
2013-10-07 16:45:48 +02:00
parent e94a32f80e
commit 8f1b19a30b
2 changed files with 230 additions and 153 deletions
@@ -26,21 +26,26 @@
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<form action="{$current}&token={$token}&viewcustomer_thread&id_customer_thread={$id_customer_thread}" method="post" enctype="multipart/form-data">
<fieldset>
<div id="ChangeStatus">
<fieldset>
<h3>
<i class="icon-envelope"></i>
{l s='Message status'}
</h3>
<form action="{$current}&token={$token}&viewcustomer_thread&id_customer_thread={$id_customer_thread}" method="post" enctype="multipart/form-data" class="form-horizontal">
<div id="ChangeStatus" class="row row-margin-bottom">
<label class="control-label col-lg-3">{l s='Change status of message:'}</label>
<div class="col-lg-3">
<select onchange="quickSelect(this);">
<option value="0">{l s='Change status of message:'}</option>
{foreach $actions as $action}
<option value="{$action.href}">&gt; {$action.name}</option>
{/foreach}
</select>
</div>
<p>
<img src="../img/admin/email_go.png" alt="" />
{l s='Forward this discussion to an employee:'}
</div>
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">{l s='Forward this discussion to an employee:'}</label>
<div class="col-lg-3">
<select name="id_employee_forward">
<option value="-1">{l s='-- Choose --'}</option>
{foreach $employees as $employee}
@@ -48,84 +53,126 @@
{/foreach}
<option value="0">{l s='Someone else'}</option>
</select>
</p>
<div id="message_forward_email" style="display:none">
<b>{l s='Email'}</b> <input type="text" name="email" />
</div>
</div>
<div id="message_forward" style="display:none;margin-bottom:10px">
<textarea name="message_forward" style="width:500px;height:80px;margin-top:15px;">{l s='You can add a comment here.'}</textarea><br />
<input type="Submit" name="submitForward" class="button" value="{l s='Forward this discussion.'}" style="margin-top: 10px;" />
<div id="message_forward_email" class="row row-margin-bottom" style="display:none">
<label class="control-label col-lg-3">{l s='Email'}</label>
<div class="col-lg-3">
<input type="text" name="email" />
</div>
</div>
</fieldset>
<div id="message_forward" style="display:none;">
<div class="row row-margin-bottom">
<label class="control-label col-lg-3">{l s='Comment:'}</label>
<div class="col-lg-7">
<textarea name="message_forward" rows="6">{l s='You can add a comment here.'}</textarea>
</div>
</div>
<div class="row row-margin-bottom">
<div class="col-lg-offset-3">
<button type="Submit" name="submitForward" class="btn btn-default">
<i class="icon-mail-forward"></i> {l s='Forward this discussion.'}
</button>
</div>
</div>
</div>
</form>
</fieldset>
{if $thread->id_customer}
<div>
<fieldset>
{if $orders && count($orders)}
{if $count_ok}
<div>
<h2>{l s='Orders'}</h2>
<h3>
<i class="icon-shopping-cart"></i> {l s='Orders'}
</h3>
<div class="table-responsive clearfix">
<table class="table">
<tr>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='Products:'}</th>
<th class="center">{l s='Total paid'}</th>
<th class="center">{l s='Payment: '}</th>
<th class="center">{l s='State'}</th>
<th class="center">{l s='Actions'}</th>
<th class="center">
<span class="title_box">{l s='ID'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Date'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Products:'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Total paid'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Payment: '}</span>
</th>
<th class="center">
<span class="title_box">{l s='State'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Actions'}</span>
</th>
</tr>
{assign var=irow value=0}
{foreach $orders_ok as $order}
<tr {if $irow++ % 2}class="alt_row"{/if} style="cursor: pointer"
onclick="document.location='?tab=AdminOrders&id_order={$order.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}">
<tr onclick="document.location='?tab=AdminOrders&id_order={$order.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}">
<td class="center">{$order.id_order}</td>
<td>{$order.date_add}</td>
<td align="right">{$order.nb_products}</td>
<td align="right">{$order.total_paid_real}</td>
<td>{$order.payment}</td>
<td>{$order.order_state}</td>
<td align="center">
<a href="?tab=AdminOrders&id_order={$order.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}">
<img src="../img/admin/details.gif" />
<td class="center">{$order.date_add}</td>
<td class="center">{$order.nb_products}</td>
<td class="center">{$order.total_paid_real}</td>
<td class="center">{$order.payment}</td>
<td class="center">{$order.order_state}</td>
<td class="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}
</table>
<h3 style="color:green;font-weight:700;margin-top:10px">
{l s='Validated Orders:'} {$count_ok} {l s='for'} {$total_ok}
</h3>
</div>
<p class="pull-right">
{l s='Validated Orders:'} {$count_ok} {l s='for'} <strong>{$total_ok}</strong>
</p>
{/if}
{/if}
</fieldset>
<fieldset>
{if $products && count($products)}
<div>
<h2>{l s='Products:'}</h2>
<table cellspacing="0" cellpadding="0" class="table">
<h3>
<i class="icon-archive"></i> {l s='Products:'}
</h3>
<div class="table-responsive clearfix">
<table class="table">
<tr>
<th class="center">{l s='Date'}</th>
<th class="center">{l s='ID'}</th>
<th class="center">{l s='Name'}</th>
<th class="center">{l s='Quantity'}</th>
<th class="center">{l s='Actions'}</th>
<th class="center">
<span class="title_box">{l s='Date'}</span>
</th>
<th class="center">
<span class="title_box">{l s='ID'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Name'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Quantity'}</span>
</th>
<th class="center">
<span class="title_box">{l s='Actions'}</span>
</th>
</tr>
{assign var=irow value=0}
{foreach $products as $product}
<tr {if $irow++ % 2}class="alt_row"{/if} style="cursor: pointer"
onclick="document.location = '?tab=AdminOrders&id_order={$product.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td>{$product.date_add}</td>
<td>{$product.product_id}</td>
<td>{$product.product_name}</td>
<td align="right">{$product.product_quantity}</td>
<td align="center">
<a href="?tab=AdminOrders&id_order={$product.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}">
<img src="../img/admin/details.gif" />
<tr onclick="document.location = '?tab=AdminOrders&id_order={$product.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}'">
<td class="center">{$product.date_add}</td>
<td class="center">{$product.product_id}</td>
<td class="center">{$product.product_name}</td>
<td class="center">{$product.product_quantity}</td>
<td class="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>
@@ -133,10 +180,10 @@
</table>
</div>
{/if}
</div>
</fieldset>
{/if}
<div>
<div class="row row-margin-bottom">
{foreach $messages as $message}
{$message}
{/foreach}
@@ -27,13 +27,13 @@
{if !$email}
<fieldset style="margin-top:10px;{if !empty($message.id_employee)}background-color:#F0F8E6;border:1px solid #88D254{/if}">
<legend {if !empty($message.id_employee)}style="background-color:#F0F8E6;color:#000;border:1px solid #88D254;"{/if}>
<fieldset>
<h3>
{if !empty($message.employee_name)}
<img src="../img/t/AdminCustomers.gif" alt="{$PS_SHOP_NAME}" />
<i class="icon-user"></i>
{$PS_SHOP_NAME} - {$message.employee_name}
{else}
<img src="../img/admin/tab-customers.gif" alt="{$PS_SHOP_NAME}" />
<i class="icon-user"></i> --
{if !empty($message.id_customer)}
<a href="index.php?tab=AdminCustomers&id_customer={$message.id_customer}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" title="{l s='View customer'}">
{$message.customer_name}
@@ -42,147 +42,177 @@
{$message.email}
{/if}
{/if}
</legend>
</h3>
<div class="infoCustomer">
{if !empty($message.id_customer) && empty($message.id_employee)}
<dl>
<dt>{l s='Customer ID:'}</dd>
<dd><a href="index.php?tab=AdminCustomers&id_customer={$message.id_customer}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" title="{l s='View customer'}">
{$message.id_customer} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a>
<dl class="dl-horizontal">
<dt>{l s='Customer ID:'}</dt>
<dd>
<a href="index.php?tab=AdminCustomers&id_customer={$message.id_customer}&viewcustomer&token={getAdminToken tab='AdminCustomers'}" title="{l s='View customer'}">
{$message.id_customer} <i class="icon-search"></i>
</a>
</dd>
</dl>
{/if}
<dl>
<dl class="dl-horizontal">
<dt>{l s='Sent on:'}</dt>
<dd>{$message.date_add}</dd>
</dl>
{if empty($message.id_employee)}
<dl>
<dl class="dl-horizontal">
<dt>{l s='Browser:'}</dt>
<dd>{$message.user_agent}</dd>
</dl>
{/if}
{if !empty($message.file_name) && $file_name}
<dl>
<dl class="dl-horizontal">
<dt>{l s='File attachment'}</dt>
<dd><a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}&filename={$message.file_name}"
<dd>
<a href="index.php?tab=AdminCustomerThreads&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread&token={getAdminToken tab='AdminCustomerThreads'}&filename={$message.file_name}"
title="{l s='View file'}">
<img src="../img/admin/search.gif" alt="{l s='View'}" />
</a>
<i class="icon-search"></i>
</a>
</dd>
</dl>
{/if}
{if !empty($message.id_order) && empty($message.id_employee)}
<dl>
<dl class="dl-horizontal">
<dt>{l s='Order #'}</dt>
<dd><a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">
{$message.id_order} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a></dd>
<dd>
<a href="index.php?tab=AdminOrders&id_order={$message.id_order}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">
{$message.id_order} <i class="icon-search"></i>
</a>
</dd>
</dl>
{/if}
{if !empty($message.id_product) && empty($message.id_employee)}
<dl>
<dl class="dl-horizontal">
<dt>{l s='Product #'}</dt>
<dd><a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">
{$message.id_product} <img src="../img/admin/search.gif" alt="{l s='View'}" />
</a></dd>
<dd>
<a href="index.php?tab=AdminProducts&id_product={$message.id_product}&updateproduct&token={getAdminToken tab='AdminProducts'}" title="{l s='View order'}">
{$message.id_product} <i class="icon-search"></i>
</a>
</dd>
</dl>
{/if}
<form action="{$current}&token={$token}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post">
<b>{l s='Subject:'}</b>
<input type="hidden" name="id_customer_message" value="{$message.id_customer_message}" />
<select name="id_contact" onchange="this.form.submit();">
{foreach $contacts as $contact}
<option value="{$contact.id_contact}" {if $contact.id_contact == $message.id_contact}selected="selected"{/if}>
{$contact.name}
</option>
{/foreach}
</select>
</form>
<form action="{$current}&token={$token}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post" class="form-horizontal">
<dl class="dl-horizontal">
<dt> {l s='Subject:'}</dt>
<dd>
<input type="hidden" name="id_customer_message" value="{$message.id_customer_message}" />
<select name="id_contact" onchange="this.form.submit();" class="col-lg-3">
{foreach $contacts as $contact}
<option value="{$contact.id_contact}" {if $contact.id_contact == $message.id_contact}selected="selected"{/if}>
{$contact.name}
</option>
{/foreach}
</select>
</dd>
</dl>
</form>
</div>
{else}
<div class="infoEmployee">
{if $id_employee}
<a href="{$current}&token={getAdminToken tab='AdminCustomerThreads'}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread">'.
{l s='View this thread'}
</a><br />
{/if}
<b>{l s='Sent by:'}</b>
<div class="infoEmployee">
{if $id_employee}
<a class="btn btn-default pull-right" href="{$current}&token={getAdminToken tab='AdminCustomerThreads'}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread">
{l s='View this thread'}
</a>
{/if}
<dl class="dl-horizontal">
<dt>{l s='Sent by:'}</dt>
<dd>
{if !empty($message.customer_name)}
{$message.customer_name} ({$message.email})
{else}
{$message.email}
{/if}
</dd>
</dl>
{if !empty($message.customer_name)}
{$message.customer_name} ({$message.email})
{else}
{$message.email}
{/if}
{if !empty($message.id_customer) && empty($message.id_employee)}
<dl class="dl-horizontal">
<dt>{l s='Customer ID:'}</dt>
<dd>{$message.id_customer}</dd>
</dl>
{/if}
{if !empty($message.id_customer) && empty($message.id_employee)}
<br /><b>{l s='Customer ID:'}</b> {$message.id_customer}<br />
{/if}
{if !empty($message.id_order) && empty($message.id_employee)}
<dl class="dl-horizontal">
<dt>{l s='Order #'}:</dt>
<dd>{$message.id_order}</dd>
</dl>
{/if}
{if !empty($message.id_order) && empty($message.id_employee)}
<br /><b>{l s='Order #'}:</b> {$message.id_order}<br />
{/if}
{if !empty($message.id_product) && empty($message.id_employee)}
<dl class="dl-horizontal">
<dt>{l s='Product #'}:</dt>
<dd>{$message.id_product}</dd>
</dl>
{/if}
{if !empty($message.id_product) && empty($message.id_employee)}
<br /><b>{l s='Product #'}:</b> {$message.id_product}<br />
{/if}
<br /><b>{l s='Subject:'}</b> {$message.subject}
<dl class="dl-horizontal">
<dt>{l s='Subject:'}</dt>
<dd>{$message.subject}</dd>
</dl>
{/if}
<dl>
<dt>{l s='Thread ID:'}</dt>
<dd>{$message.id_customer_thread}</dd>
</dl>
<dl>
<dt>{l s='Message ID:'}</dt>
<dd>{$message.id_customer_message}</dd>
</dl>
<dl>
<dt>{l s='Message:'}</dt>
<dd>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</dd>
</dl>
</div>
<dl class="dl-horizontal">
<dt>{l s='Thread ID:'}</dt>
<dd>{$message.id_customer_thread}</dd>
</dl>
<dl class="dl-horizontal">
<dt>{l s='Message ID:'}</dt>
<dd>{$message.id_customer_message}</dd>
</dl>
<dl class="dl-horizontal">
<dt>{l s='Message:'}</dt>
<dd>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</dd>
</dl>
</div>
</fieldset>
{if !$email}
{if empty($message.id_employee)}
<button class="button" style="font-size:12px;"
<fieldset>
<button class="btn btn-default"
onclick="$('#reply_to_{$message.id_customer_message}').show(500); $(this).hide();">
<img src="../img/admin/contact.gif" alt=""/>{l s='Reply to this message'}
<i class="icon-mail-reply"></i> {l s='Reply to this message'}
</button>
</fieldset>
{/if}
<div id="reply_to_{$message.id_customer_message}" style="display: none; margin-top: 20px;">
<form action="{$current}&token={getAdminToken tab='AdminCustomerThreads'}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post" enctype="multipart/form-data">
<p>{l s='Please type your reply below:'}</p>
<textarea style="width: 450px; height: 175px;" name="reply_message">{$PS_CUSTOMER_SERVICE_SIGNATURE}</textarea>
<div style="width: 450px; text-align: right; font-style: italic; font-size: 9px; margin-top: 2px;">
{l s='Your reply will be sent to:'} {$message.email}
</div>
<div style="width: 450px; margin-top: 0px;">
<input type="file" name="joinFile"/>
</div>
<div>
<input type="submit" class="button" name="submitReply" value="{l s='Send my reply'}" style="margin-top:20px;" />
<input type="hidden" name="id_customer_thread" value="{$message.id_customer_thread}" />
<input type="hidden" name="msg_email" value="{$message.email}" />
</div>
</form>
<div id="reply_to_{$message.id_customer_message}" style="display: none;">
<fieldset>
<form action="{$current}&token={getAdminToken tab='AdminCustomerThreads'}&id_customer_thread={$message.id_customer_thread}&viewcustomer_thread" method="post" enctype="multipart/form-data" class="form-horizontal">
<div class="panel-heading">
{l s='Please type your reply below:'}
</div>
<div class="row row-margin-bottom">
<textarea class="col-lg-12" rows="6" name="reply_message">{$PS_CUSTOMER_SERVICE_SIGNATURE}</textarea>
</div>
<div class="row">
<p class="pull-right">{l s='Your reply will be sent to:'} {$message.email}</p>
</div>
<div class="row row-margin-bottom">
<input type="file" name="joinFile"/>
</div>
<div class="row">
<button type="submit" class="btn btn-default" name="submitReply">
<i class="icon-check"></i> {l s='Send my reply'}</button>
<input type="hidden" name="id_customer_thread" value="{$message.id_customer_thread}" />
<input type="hidden" name="msg_email" value="{$message.email}" />
</div>
</form>
</fieldset>
</div>
</fieldset>
{/if}
</fieldset>