// fix refactoring templates in AdminCustomerThreadsController

This commit is contained in:
lLefevre
2011-12-02 11:19:03 +00:00
parent a85c5d4cd2
commit 70fc45a18d
18 changed files with 1138 additions and 520 deletions
@@ -0,0 +1,102 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 9639 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helper/list/list_header.tpl"}
{block name="override_header"}
<div id="CustomerThreadContacts">
{assign var=nb_categories value=count($categories)}
{foreach $categories as $key => $val}
{assign var=total_thread value=0}
{assign var=id_customer_thread value=0}
{foreach $contacts as $tmp => $tmp2}
{if $val.id_contact == $tmp2.id_contact}
{assign var=total_thread value=$tmp2.total}
{assign var=id_customer_thread value=$tmp2.id_customer_thread}
{/if}
{/foreach}
<div style="width:{if $nb_categories > 6}200{else}300{/if}px;">
<h3>&nbsp;{$val.name}</h3>
{if $nb_categories < 6}
<p>{$val.description}</p>
{/if}
{if $total_thread == 0}
<h4>{l s='No new message'}</h4>
{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>
{/foreach}
<div id="MeaningStatus">
<h3>&nbsp;{l s='Meaning of status'}</h3>
<ul>
<li><img src="../img/admin/status_green.png" alt="{l s='Open'}">{l s='Open'}</li>
<li><img src="../img/admin/status_red.png" alt="{l s='Closed'}">{l s='Closed'}</li>
<li><img src="../img/admin/status_orange.png" alt="{l s='Pending 1'}">{l s='Pending 1'}</li>
<li><img src="../img/admin/status_orange.png" alt="{l s='Pending 2'}">{l s='Pending 2'}</li>
</ul>
</div>
<div id="CustomerService">
<table cellspacing="1" class="table">
<thead>
<tr>
<td colspan="2">{l s='Customer service'} : {l s='Statistics'}</td>
</tr>
</thead>
<tbody>
{assign var=count value=0}
{foreach $params as $key => $val}
{assign var=count value=$count+1}
<tr {if $count % 2 == 0}class="alt_row"{/if}>
<td>{$key}</td>
<td>{$val}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
</div>
<p class="clear">&nbsp;</p>
{/block}
@@ -0,0 +1,178 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8897 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if !$email}
<fieldset style="margin-top:10px;{if !empty($message.employee_name)}background: rgb(255,236,242){/if}">
<legend {if !empty($message.employee_name)}style="background:rgb(255,210,225)"{/if}>
{if !empty($message.employee_name)}
<img src="../img/t/AdminCustomers.gif" alt="{$PS_SHOP_NAME}" />
{$PS_SHOP_NAME} - {$message.employee_name}
{else}
<img src="../img/admin/tab-customers.gif" alt="{$PS_SHOP_NAME}" />
{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}
</a>
{else}
{$message.email}
{/if}
{/if}
</legend>
<div style="font-size:11px">
{if !empty($message.id_customer) && empty($message.employee_name)}
<b>{l s='Customer ID:'}</b>
<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><br />
{/if}
<b>{l s='Sent on:'}</b> {$message.date_add}<br />
{if empty($message.employee_name)}
<b>{l s='Browser:'}</b> {$message.user_agent}<br />
{/if}
{if !empty($message.file_name) && $file_name}
<b>{l s='File attachment'}</b>
<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><br />
{/if}
{if !empty($message.id_order) && empty($message.employee_name)}
<b>{l s='Order #'}</b>
<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><br />
{/if}
{if !empty($message.id_product) && empty($message.employee_name)}
<b>{l s='Product #'}</b>
<a href="index.php?tab=AdminOrders&id_order={$id_order_product}&vieworder&token={getAdminToken tab='AdminOrders'}" title="{l s='View order'}">
{$message.id_product} <img src="../img/admin/search.gif" alt="{l s='view'}" />
</a><br />
{/if}
<br />
<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>
{else}
<div style="font-size:11px">
{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>
{if !empty($message.customer_name)}
{$message.customer_name} ({$message.email})
{else}
{$message.email}
{/if}
{if !empty($message.id_customer) && empty($message.employee_name)}
<br /><b>{l s='Customer ID:'}</b> {$message.id_customer}<br />
{/if}
{if !empty($message.id_order) && empty($message.employee_name)}
<br /><b>{l s='Order #'}:</b> {$message.id_order}<br />
{/if}
{if !empty($message.id_product) && empty($message.employee_name)}
<br /><b>{l s='Product #'}:</b> {$message.id_product}<br />
{/if}
<br /><b>{l s='Subject:'}</b> {$message.subject}
{/if}
<br /><br />
<b>{l s='Thread ID:'}</b> {$message.id_customer_thread}<br />
<b>{l s='Message ID:'}</b> {$message.id_customer_message}<br />
<b>{l s='Message:'}</b><br />
{$message.message}
</div>
{if !$email}
{if empty($message.employee_name)}
<p style="text-align:right">
<button style="font-family: Verdana; font-size: 11px; font-weight:bold; height: 65px; width: 120px;"
onclick="$('#reply_to_{$message.id_customer_message}').show(500); $(this).hide();">
<img src="../img/admin/contact.gif" alt="" style="margin-bottom: 5px;" /><br />{l s='Reply to this message'}
</button>
</p>
{/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 style="width: 450px; text-align: center;">
<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>
</fieldset>
{/if}
</div>
</fieldset>
@@ -0,0 +1,171 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision: 8897 $
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helper/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">
<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/msg-forward.png" alt="" style="vertical-align: middle;" />
{l s='Forward this discussion to an employee:'}
<select name="id_employee_forward" style="vertical-align: middle;">
<option value="-1">{l s='-- Choose --'}</option>
{foreach $employees as $employee}
<option value="{$employee.id_employee}"> {$employee.firstname|substr:0:1}. {$employee.lastname}</option>
{/foreach}
<option value="0">{l s='Someone else'}</option>
</select>
</p>
<div id="message_forward_email" style="display:none">
<b>{l s='E-mail'}</b> <input type="text" name="email" />
</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>
</fieldset>
</form>
<div class="clear">&nbsp;</div>
{if $thread->id_customer}
<div style="float:right;margin-left:20px;">
{if $orders && count($orders)}
{if $count_ok}
<div>
<h2>{l s='Orders'}</h2>
<table cellspacing="0" cellpadding="0" class="table float">
<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>
</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'}">
<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" />
</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>
{/if}
{/if}
{if $products && count($products)}
<div>
<h2>{l s='Products'}</h2>
<table cellspacing="0" cellpadding="0" 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>
</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" />
</a>
</td>
</tr>
{/foreach}
</table>
</div>
{/if}
</div>
{/if}
<div style="margin-top:10px">
{foreach $messages as $message}
{$message}
{/foreach}
</div>
<div class="clear">&nbsp;</div>
<script type="text/javascript">
$(document).ready(function(){
$('select[name=id_employee_forward]').change(function(){
if ($(this).val() >= 0)
$('#message_forward').show(400);
else
$('#message_forward').hide(200);
if ($(this).val() == 0)
$('#message_forward_email').show(200);
else
$('#message_forward_email').hide(200);
});
$('teaxtrea[name=message_forward]').click(function(){
if($(this).val() == '{l s='You can add a comment here.'}')
{
$(this).val('');
}
});
});
</script>
{/block}
@@ -25,7 +25,6 @@
*}
{if !$simple_header}
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function() {