Merge branch 'ticket-12452-SAVMessHistory' into develop
This commit is contained in:
commit
6e1bbf4d95
@ -1150,10 +1150,19 @@ class AdminCustomerThreads extends AdminTab
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div style="float:left;margin-top:10px">';
|
||||
echo '<div style="float:left;margin-top:10px"><div>';
|
||||
foreach ($messages AS $message) {
|
||||
echo $this->displayMsgCustom($message);
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
$conversations = CustomerThread::getCustomerConversations((int)$customer->id,'ASC',(int)Tools::getValue('id_customer_thread'));
|
||||
if(!empty($conversations)){
|
||||
echo '<div>';
|
||||
$this->displayOldMessages($conversations,$customer);
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '<div class="clear"> </div>';
|
||||
|
||||
@ -1237,6 +1246,53 @@ class AdminCustomerThreads extends AdminTab
|
||||
echo '<div class="clear"> </div>';
|
||||
}
|
||||
|
||||
private function displayOldMessages($conversations,$customer)
|
||||
{
|
||||
global $cookie;
|
||||
$output = '<div class="panel-message">';
|
||||
|
||||
foreach($conversations as $key => $conv){
|
||||
$output .= '<div class="panel-head bg-purple">
|
||||
<div class="panel-head-left">
|
||||
<div class="user-info">
|
||||
<span class="anticon anticon-bubbles2"></span>
|
||||
<a href="index.php?tab=AdminCustomerThreads&id_customer_thread='.(int)($conv['id_customer_thread']).'&viewcustomer_thread&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'" title=Voir la conversation"> Conversation #'.(int)($conv['id_customer_thread']).' ('.$conv['status'].')</a>
|
||||
</div>
|
||||
<div class="grey div-date"><span class="anticon anticon-clock"></span> '.Tools::displayDate($conv['date_add'], (int)($cookie->id_lang), true).'</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
$messages = Db::getInstance()->ExecuteS('
|
||||
SELECT ct.*, cm.*, cl.name subject, CONCAT(e.firstname, \' \', e.lastname) employee_name, CONCAT(c.firstname, \' \', c.lastname) customer_name, c.firstname
|
||||
FROM '._DB_PREFIX_.'customer_thread ct
|
||||
LEFT JOIN '._DB_PREFIX_.'customer_message cm ON (ct.id_customer_thread = cm.id_customer_thread)
|
||||
LEFT JOIN '._DB_PREFIX_.'contact_lang cl ON (cl.id_contact = ct.id_contact AND cl.id_lang = '.(int)$cookie->id_lang.')
|
||||
LEFT JOIN '._DB_PREFIX_.'employee e ON e.id_employee = cm.id_employee
|
||||
LEFT JOIN '._DB_PREFIX_.'customer c ON (IFNULL(ct.id_customer, ct.email) = IFNULL(c.id_customer, c.email))
|
||||
WHERE ct.id_customer_thread = '.(int)($conv['id_customer_thread']).' AND ct.id_customer_thread != '.(int)Tools::getValue('id_customer_thread').'
|
||||
ORDER BY cm.date_add DESC'
|
||||
);
|
||||
foreach ($messages as $key => $message) {
|
||||
if(!empty($message['employee_name'])) {
|
||||
$output .= '<p style="margin:0;text-align:right;">Bébé Boutik <span class="anticon anticon-user-tie"></span></p>
|
||||
<div class="panel-content-message bg-rose" style="margin:0 0 10px 0;">
|
||||
<b>Message</b><br>
|
||||
'.$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')).'
|
||||
</div>';
|
||||
} else {
|
||||
$output .= '<p style="margin:0; text-transform: capitalize;"><span class="anticon anticon-user"></span> '.$customer->firstname.' '.$customer->lastname.'</p>
|
||||
<div class="panel-content-message bg-purple" style="margin:0 0 10px 0;">
|
||||
<b>Message</b><br>
|
||||
'.$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')).'
|
||||
</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$output .= '</div>';
|
||||
|
||||
echo $output;
|
||||
}
|
||||
|
||||
private function displayButton($content)
|
||||
{
|
||||
return '
|
||||
|
@ -119,7 +119,7 @@ class Catalog
|
||||
$this->_xml .= '<logo>http://www.bebeboutik.es/img/logo_3.png</logo>';
|
||||
|
||||
$title_sunday = Configuration::get('TITLE_NEWS_DIMANCHE_ES');
|
||||
$link_sale = 'http://www.bebeboutik.es';
|
||||
$link_sale = 'https://www.bebeboutik.es';
|
||||
$all_sales = 'Todas las ventas';
|
||||
} else {
|
||||
$flux = fopen("flux.xml", "w");
|
||||
@ -127,12 +127,12 @@ class Catalog
|
||||
$this->_xml .= '<channel>';
|
||||
//Shop details
|
||||
$this->_xml .= '<title>Bebeboutik.com</title>';
|
||||
$this->_xml .= '<link>www.bebeboutik.com</link>';
|
||||
$this->_xml .= '<link>https://www.bebeboutik.com</link>';
|
||||
$this->_xml .= '<description>Bebeboutik.com</description>';
|
||||
$this->_xml .= '<logo>http://www.bebeboutik.com/img/logo.png</logo>';
|
||||
|
||||
$title_sunday = Configuration::get('TITLE_NEWS_DIMANCHE');
|
||||
$link_sale = 'http://www.bebeboutik.com';
|
||||
$link_sale = 'https://www.bebeboutik.com';
|
||||
$all_sales = 'Toutes les ventes';
|
||||
}
|
||||
|
||||
@ -161,6 +161,7 @@ class Catalog
|
||||
if ($version == 'es') {
|
||||
$sale_link = str_replace('bebeboutik.com', 'bebeboutik.es', $sale_link);
|
||||
}
|
||||
$sale_link = str_replace('http://','https://', $sale_link);
|
||||
$sql = '
|
||||
SELECT `value`
|
||||
FROM `'._DB_PREFIX_.'privatesale_extrafield_sale`
|
||||
@ -211,6 +212,7 @@ class Catalog
|
||||
if ($version == 'es') {
|
||||
$sale_link = str_replace('bebeboutik.com', 'bebeboutik.es', $sale_link);
|
||||
}
|
||||
$sale_link = str_replace('http://','https://', $sale_link);
|
||||
|
||||
$sql = '
|
||||
SELECT `value`
|
||||
@ -264,6 +266,7 @@ class Catalog
|
||||
if ($version == 'es') {
|
||||
$sale_link = str_replace('bebeboutik.com', 'bebeboutik.es', $sale_link);
|
||||
}
|
||||
$sale_link = str_replace('http://','https://', $sale_link);
|
||||
|
||||
$sql = '
|
||||
SELECT `value`
|
||||
@ -316,6 +319,7 @@ class Catalog
|
||||
if ($version == 'es') {
|
||||
$sale_link = str_replace('bebeboutik.com', 'bebeboutik.es', $sale_link);
|
||||
}
|
||||
$sale_link = str_replace('http://','https://', $sale_link);
|
||||
|
||||
$sql = '
|
||||
SELECT `value`
|
||||
|
@ -26,4 +26,16 @@ class CustomerThread extends CustomerThreadCore
|
||||
}
|
||||
return '<img src="/img/flags/'.(int) $flag.'.png" alt="" />';
|
||||
}
|
||||
|
||||
public static function getCustomerConversations($id_customer, $order = 'ASC', $except_id = false)
|
||||
{
|
||||
return Db::getInstance()->ExecuteS('
|
||||
SELECT DISTINCT ct.* FROM '._DB_PREFIX_.'customer_thread ct
|
||||
LEFT JOIN '._DB_PREFIX_.'customer_message cm ON ct.id_customer_thread = cm.id_customer_thread
|
||||
WHERE id_customer = '.(int)($id_customer)
|
||||
.($except_id?' AND ct.id_customer_thread !='.(int)$except_id:'')
|
||||
.' ORDER BY cm.date_add '.$order
|
||||
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user