continuation sav

This commit is contained in:
Marion Muszynski 2016-10-18 12:12:06 +02:00
parent 6e0cfd7635
commit 84f2643e53
4 changed files with 236 additions and 28 deletions

View File

@ -313,7 +313,6 @@ class AdminCustomerThreads extends AdminTab
$contacts = Contact::getContacts($cookie->id_lang);
$output = '<div class="panel-message">';
if (!$email)
{
if (!empty($message['id_product']) AND empty($message['employee_name']))
@ -326,7 +325,7 @@ class AdminCustomerThreads extends AdminTab
ORDER BY o.date_add DESC');
$output .= '
<div class="panel-head">
<div class="panel-head '.(!empty($message['employee_name'])?'bg-rose':'').'">
<div class="panel-head-left">
<div class="user-info">
'.(!empty($message['employee_name'])
@ -344,10 +343,13 @@ class AdminCustomerThreads extends AdminTab
(!empty($message['file_name']) AND file_exists(_PS_UPLOAD_DIR_.$message['file_name']))
? '<a href="index.php?tab=AdminCustomerThreads&id_customer_thread='.$message['id_customer_thread'].'&viewcustomer_thread&token='.Tools::getAdminToken('AdminCustomerThreads'.(int)(Tab::getIdFromClassName('AdminCustomerThreads')).(int)($cookie->id_employee)).'&filename='.$message['file_name'].'" title="'.$this->l('View file').'"><span class="anticon anticon-attachment"></span></a>'
: ''
).'
<a onclick="$(\'#info_'.(int)$message['id_customer_message'].'\').toggle();"><span class="anticon anticon-info"></span></a>
)
.(empty($message['employee_name'])
?'<a onclick="$(\'#info_'.(int)$message['id_customer_message'].'\').toggle();"><span class="anticon anticon-info"></span></a>'
:'').'
</div>
</div>
'.(empty($message['employee_name'])?'
<div class="more-info" id="info_'.(int)$message['id_customer_message'].'"" style="font-size:11px">
<h4><span class="anticon anticon-info"></span> '.$this->l('Informations').'</h4>
<ul>'.(empty($message['employee_name'])
@ -355,14 +357,18 @@ class AdminCustomerThreads extends AdminTab
: ''
).(
(!empty($message['id_order']) AND empty($message['employee_name']))
? '<li><b>'.$this->l('Order #').'</b> <a href="index.php?tab=AdminOrders&id_order='.(int)($message['id_order']).'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)).'" title="'.$this->l('View order').'">'.(int)($message['id_order']).' <img src="../img/admin/search.gif" alt="'.$this->l('view').'" /></a></li>'
? '<li><b>'.$this->l('Order #').'</b> <a href="index.php?tab=AdminOrders&id_order='.(int)($message['id_order']).'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)).'" title="'.$this->l('View order').'">'.(int)($message['id_order']).' <span class="anticon anticon-eye"></span></a></li>'
: ''
).(
(!empty($message['id_product']) AND empty($message['employee_name']))
? '<li><b>'.$this->l('Product #').'</b> <a href="index.php?tab=AdminOrders&id_order='.(int)($id_order_product).'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)).'" title="'.$this->l('View order').'">'.(int)($message['id_product']).' <img src="../img/admin/search.gif" alt="'.$this->l('view').'" /></a></li>'
? '<li><b>'.$this->l('Product #').'</b> <a href="index.php?tab=AdminOrders&id_order='.(int)($id_order_product).'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee)).'" title="'.$this->l('View order').'">'.(int)($message['id_product']).' <span class="anticon anticon-eye"></span></a></li>'
: ''
).'</ul>
</div>
).'
<li><b>'.$this->l('Thread ID:').'</b> '.(int)$message['id_customer_thread'].'</li>
<li><b>'.$this->l('Message ID:').'</b> '.(int)$message['id_customer_message'].'</li>
</ul>
</div>'
:'').'
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post">
<b>'.$this->l('Subject:').'</b>
<input type="hidden" name="id_customer_message" value="'.$message['id_customer_message'].'" />
@ -374,13 +380,13 @@ class AdminCustomerThreads extends AdminTab
}
else
{
$output = '<div style="font-size:11px">
$output .= '
'.($id_employee ? '<a href="'.Tools::getHttpHost(true).$currentIndex.'&token='.Tools::getAdminToken('AdminCustomerThreads'.(int)(Tab::getIdFromClassName('AdminCustomerThreads')).(int)($id_employee)).'&id_customer_thread='.(int)$message['id_customer_thread'].'&viewcustomer_thread">'.$this->l('View this thread').'</a><br />' : '').'
<b>'.$this->l('Sent by:').'</b> '.(!empty($message['customer_name']) ? $message['customer_name'].' ('.$message['email'].')' : $message['email'])
.((!empty($message['id_customer']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Customer ID:').'</b> '.(int)($message['id_customer']).'<br />' : '')
.((!empty($message['id_order']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Order #').':</b> '.(int)($message['id_order']).'<br />' : '')
.((!empty($message['id_product']) AND empty($message['employee_name'])) ? '<br /><b>'.$this->l('Product #').':</b> '.(int)($message['id_product']).'<br />' : '')
.'</div><b>'.$this->l('Subject:').'</b> '.$message['subject'];
.'<b>'.$this->l('Subject:').'</b> '.$message['subject'];
}
// Adding Antadis - linking with ant_support_form module
@ -401,10 +407,7 @@ class AdminCustomerThreads extends AdminTab
// end adding
$message['message'] = preg_replace('/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui', '<a href="\1">\1</a>\2', html_entity_decode($message['message'], ENT_NOQUOTES, 'UTF-8'));
$output .= '
<div class="panel-content-message">
<b>'.$this->l('Thread ID:').'</b> '.(int)$message['id_customer_thread'].'<br />
<b>'.$this->l('Message ID:').'</b> '.(int)$message['id_customer_message'].'<br />
$output .= '<div class="panel-content-message '.(!empty($message['employee_name'])?'bg-rose':'bg-purple').'">
<b>'.$this->l('Message:').'</b><br />
'.$message['message'].'
</div>';
@ -413,22 +416,23 @@ class AdminCustomerThreads extends AdminTab
{
if (empty($message['employee_name']))
$output .= '
<p style="text-align:right">
<button style="font-family: Verdana; font-size: 11px; font-weight:bold; height: 65px; width: 120px;" onclick="$(\'#reply_to_'.(int)($message['id_customer_message']).'\').show(500); $(this).hide();">
<img src="'.__PS_BASE_URI__.'img/admin/contact.gif" alt="" style="margin-bottom: 5px;" /><br />'.$this->l('Reply to this message').'
<p class="btn-answer" style="text-align:right">
<button class="button" onclick="$(\'#reply_to_'.(int)($message['id_customer_message']).'\').show(500); $(this).hide();">
<span class="anticon anticon-bubbles3"></span> '.$this->l('Reply to this message').'
</button>
</p>
<div id="reply_to_'.(int)($message['id_customer_message']).'" style="display: none; margin-top: 20px;"">
<p class="clear">&nbsp;</p>
<div id="reply_to_'.(int)($message['id_customer_message']).'" style="display: none; margin-top: 10px;" class="panel-answer">
<form action="'.Tools::htmlentitiesutf8($_SERVER['REQUEST_URI']).'" method="post" enctype="multipart/form-data">
<p>'.$this->l('Please type your reply below:').'</p>
<textarea style="width: 450px; height: 175px;" name="reply_message">'.str_replace('\r\n', "\n", Configuration::get('PS_CUSTOMER_SERVICE_SIGNATURE', $message['id_lang'])).'</textarea>
<div style="width: 450px; text-align: right; font-style: italic; font-size: 9px; margin-top: 2px;">
<div style="width: 450px; margin-top: 0px;margin-bottom:5px;">
<input type="file" name="joinFile"/>
</div>
<textarea name="reply_message">'.str_replace('\r\n', "\n", Configuration::get('PS_CUSTOMER_SERVICE_SIGNATURE', $message['id_lang'])).'</textarea>
<div style="text-align: right; font-style: italic; font-size: 9px; margin-top: 2px;">
'.$this->l('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;">
<div style="text-align: right;">
<input type="submit" class="button" name="submitReply" value="'.$this->l('Send my reply').'" style="margin-top:20px;" />
<input type="hidden" name="id_customer_thread" value="'.(int)($message['id_customer_thread']).'" />
<input type="hidden" name="msg_email" value="'.$message['email'].'" />
@ -704,9 +708,11 @@ class AdminCustomerThreads extends AdminTab
echo '</div>';
echo '<div style="float:left;margin-top:10px">';
foreach ($messages AS $message)
foreach ($messages AS $message) {
echo $this->displayMsgCustom($message);
}
echo '</div>';
echo '<div class="clear">&nbsp;</div>';
if ($thread->id_customer)
{
@ -779,7 +785,8 @@ class AdminCustomerThreads extends AdminTab
<td align="right">'.$product['product_quantity'].'</td>
<td align="center"><a href="?tab=AdminOrders&id_order='.$product['id_order'].'&vieworder&token='.$tokenOrders.'"><img src="../img/admin/details.gif" /></a></td>
</tr>';
echo '</table></div>';
echo '</table>
</div>';
}
echo '</div>';
}

View File

@ -3345,6 +3345,7 @@ span.anticon{
}
.panel-message{
box-sizing: border-box;
float: left;
width: 700px;
margin-top: 10px;
background: #fff;
@ -3376,6 +3377,9 @@ span.anticon{
border-bottom: 1px solid #f1F1F1;
margin-bottom: 10px;
}
.panel-head.bg-rose{
background: rgba(226,110,162,0.2);
}
.panel-head .panel-head-left,
.panel-head .panel-head-left p,
.panel-head .panel-head-left div{
@ -3393,6 +3397,9 @@ span.anticon{
margin-right: 5px;
font-size: 16px;
}
.panel-message .panel-head.bg-rose div.user-info{
color:#e36ea2;
}
.panel-message .panel-head div.user-info .anticon{
font-size: 20px;
}
@ -3400,7 +3407,7 @@ span.anticon{
color: #796dc7;
}
.panel-message .panel-head div.div-date{
color: #ccc;
color:rgba(0,0,0,0.5);
font-size: 12px;
line-height: 20px;
}
@ -3420,4 +3427,59 @@ span.anticon{
.panel-message .more-info ul li{
line-height: 16px;
}
.panel-content-message{
border-radius: 4px;
margin: 10px 0 0 0;
padding: 5px 10px 10px;
}
.panel-content-message.bg-rose{
border: 1px solid #e36ea2;
background: rgba(226,110,162,0.2);
}
.panel-content-message.bg-purple{
display: inline-block;
width: 80%;
border: 1px solid #796dc7;
background: rgba(121,109,199,0.2);
}
.panel-message .btn-answer{
display: inline-block;
vertical-align: top;
margin-top: 10px;
}
.panel-message .button {
font-size: 14px;
background-color: rgba(86,84,133,0.7);
border: 1px solid #565485;
border-left: 1px solid rgba(86,84,133,0.6);
border-top: 1px solid rgba(86,84,133,0.6);
color: rgba(255,255,255,0.9);
padding: 5px 10px;
}
.panel-message .btn-answer .button{
padding: 13px 10px;
}
.panel-message .button:hover {
background-color: #565485;
border: 1px solid rgba(86,84,133,0.6);
border-left: 1px solid #565485;
border-top: 1px solid #565485;
color: #fff;
}
.panel-message .button:focus{
background-color: rgba(86,84,133,0.6);
}
.panel-message textarea {
border: 1px solid #000;
}
.panel-message input[type="file"] {
border :0px;
}
.panel-answer,
.panel-answer div {
width: 100%;
}
.panel-answer textarea{
width: 670px;
height: 120px;
}

BIN
css/fonts/IcoMoon-Free.ttf Executable file

Binary file not shown.

View File

@ -0,0 +1,139 @@
<?php
if (!defined('_PS_VERSION_'))
exit;
class Ant_Infocustomer extends Module
{
public function __construct()
{
$this->name = 'ant_infocustomer';
$this->tab = 'administration';
$this->author = 'Antadis';
$this->version = '1.0';
$this->need_instance = 0;
parent::__construct();
$this->displayName = $this->l('Information about customer');
$this->description = $this->l('Block of information about customer in BO');
}
private $hooks = array(
'rightColumnSav' => array('BO SAV right column', 'Allow to add information in right column of SAV message thread'),
);
public function install() {
foreach($this->hooks as $k => $v) {
if(count(Db::getInstance()->ExecuteS('
SELECT `id_hook`
FROM `'._DB_PREFIX_.'hook`
WHERE `name` = "'.$k.'"
LIMIT 1
')) == 0) {
Db::getInstance()->ExecuteS('
INSERT INTO `'._DB_PREFIX_.'hook`
VALUES (DEFAULT, "'.$k.'", "'.$v[0].'", "'.$v[1].'", 0, 0)
');
}
}
$install_success = parent::install();
if ($install_success) {
foreach($this->hooks as $k => $v) {
$install_success = $this->registerHook($k);
if (!$install_success) {
break;
}
}
}
return $install_success;
}
public function hookRightColumnSav($params) {
if(isset($params['customer'])) {
global $cookie;
echo "<style type='text/css'>
#blockinfocustomer {
width: 300px;
background: #fff;
padding-bottom: 5px;
margin-bottom: 20px;
-moz-box-shadow: 1px 1px 2px 2px #cccccc;
-webkit-box-shadow: 1px 1px 2px 2px #ccc;
-ms-box-shadow: 1px 1px 2px 2px #cccccc;
-o-box-shadow: 1px 1px 2px 2px #cccccc;
box-shadow: 1px 1px 2px 2px #ccc;
clear: both;
}
#blockinfocustomer .content {
padding: 5px;
position: relative;
}
#blockinfocustomer .content div{
color: #1e1633;
margin: 0px 5px;
font-size: 12px;
padding: 8px 0px 5px;
border-top: 1px dashed #ccc;
line-height: 1.4em;
}
#blockinfocustomer .content div.first-div{
border-top: 1px solid #ccc;
}
#blockinfocustomer h4{
display: block;
font-size: 18px;
color: #796dc7;
font-weight: normal;
margin: 0px 5px 2px;
padding: 12px 0px 10px;
border-bottom: 1px solid #ccc;
}
#blockinfocustomer h5 {
color: #444d52;
font-family: georgia, times new roman, serif;
margin-bottom: 10px;
font-weight: 600;
font-size: 13px;
}
#blockinfocustomer .content span.anticon-user{
position: absolute;
font-size: 80px;
right: 10px;
opacity: 0.3;
}
#blockinfocustomer ul {
margin: 0px 0px 7px;
padding: 0px;
list-style: none;
border-bottom: 1px solid #999;
}
#blockinfocustomer li {
padding-bottom: 5px;
}
#blockinfocustomer p {
margin-bottom: 5px;
}
#blockinfocustomer p span.anticon{
font-size:14px;
}
</style>";
$customersToken = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)($cookie->id_employee));
echo '<div id="blockinfocustomer">
<div class="content">
<h4>'.$this->l('Customer Information' ).'</h4>
<div class="first-div">
<span class="anticon anticon-user"></span>
<h5>'.ucfirst($params['customer']->firstname).' '.ucfirst($params['customer']->lastname).' <a target="_blank" href="index.php?tab=AdminCustomers&id_customer='.(int)$params['customer']->id.'&viewcustomer&token='.$customersToken.'">('.$params['customer']->id.')</a></h5>
<p><span class="anticon anticon-envelop"></span> '.$params['customer']->email.'</p>
<p><span class="anticon anticon-cart"></span> '.$params['customer_info']['nb_orders'].' '.$this->l('valid orders').'</p>
</div>
</div>
</div>';
}
}
}