One more small mod from my side, helpful for situation, when merging tickets and they have different customer emails (so no email will be lost due to merge).
File needed to modify is> /inc/admin_functions.inc.php.
Working on HESK: 3.4.6.
1) Find "/* Set some variables for later */" (~line 156) and add>
Code: Select all
$merged_mail = $ticket['email'];
Code: Select all
/* Get required ticket information */
$res = hesk_dbQuery("SELECT `id`,`trackid`,`category`,`name`,`message`,`message_html`,`dt`,`time_worked`,`attachments` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `id`='".intval($this_id)."' LIMIT 1");
Code: Select all
/* Get required ticket information */
$res = hesk_dbQuery("SELECT `id`,`trackid`,`category`,`name`,`message`,`message_html`,`dt`,`time_worked`,`attachments`,`email` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `id`='".intval($this_id)."' LIMIT 1");
Code: Select all
/* Has this user access to the ticket category? */
if ( ! hesk_okCategory($row['category'], 0) )
{
continue;
}
Code: Select all
// Mod: Add email and customer name
$customer_name = $row['name'];
$customer_email = $row['email'];
if ($merged_mail != $customer_email)
{
hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` SET `email`='".hesk_dbEscape($ticket['email']).",".hesk_dbEscape($customer_email)."' WHERE `id`='".intval($merge_into)."'");
}
// end mod
Code: Select all
/* Log that ticket has been merged */
$history .= sprintf($hesklang['thist13'],hesk_date(),$row['trackid'],addslashes($_SESSION['name']).' ('.$_SESSION['user'].')');
Code: Select all
// Mod: add history note with old name/mail also for all merged tickets.
$history .= '<li class="smaller"> | '. $hesklang['customer']. ': ' . addslashes($customer_name) . ' ' . addslashes($customer_email) .'</li>';