Date update only if it's a thread
This commit is contained in:
parent
cf142b7071
commit
2cdfbdb833
@ -173,9 +173,15 @@ if (Tools::isSubmit('submitMessage')) {
|
||||
|
||||
if ($contact->customer_service)
|
||||
{
|
||||
$ctStatusLast = false;
|
||||
|
||||
if ((int)$id_customer_thread)
|
||||
{
|
||||
$ct = new CustomerThread($id_customer_thread);
|
||||
|
||||
$ctStatusLast = $ct->status;
|
||||
$ctStatusDate = $ct->date_upd;
|
||||
|
||||
$ct->status = 'open';
|
||||
$ct->id_lang = (int)$cookie->id_lang;
|
||||
$ct->id_contact = (int)($id_contact);
|
||||
@ -213,6 +219,12 @@ if (Tools::isSubmit('submitMessage')) {
|
||||
|
||||
if ($ct->id)
|
||||
{
|
||||
// Update date_upd to the last interesting date
|
||||
if ($ctStatusLast !== false && $ctStatusLast == 'open') {
|
||||
$sql = 'UPDATE `'._DB_PREFIX_.'customer_threads` SET `date_upd` = "'.$ctStatusDate.'" WHERE id_customer_thread='. $ct->id;
|
||||
Db::getInstance()->Execute($sql);
|
||||
}
|
||||
|
||||
// adding (antadis) - linking reason and customer_thread
|
||||
if (Tools::getValue('id_reason')) {
|
||||
$id_reason = (int) Tools::getValue('id_reason');
|
||||
|
Loading…
Reference in New Issue
Block a user