#66 Business Logic portion of emails to admins are done.
Still need to add the option to the edit user / profile page
This commit is contained in:
parent
219b722917
commit
3d4c0a99b7
@ -241,14 +241,10 @@ if (isset($_POST['notemsg']) && hesk_token_check('POST'))
|
||||
hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."notes` (`ticket`,`who`,`dt`,`message`) VALUES ('".intval($ticket['id'])."','".intval($_SESSION['id'])."',NOW(),'".hesk_dbEscape($msg)."')");
|
||||
|
||||
/* Notify assigned staff that a note has been added if needed */
|
||||
if ($ticket['owner'] && $ticket['owner'] != $_SESSION['id'])
|
||||
{
|
||||
$res = hesk_dbQuery("SELECT `email`, `notify_note` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE `id`='".intval($ticket['owner'])."' LIMIT 1");
|
||||
$users = hesk_dbQuery("SELECT `email`, `notify_note` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."users` WHERE (`id`='".intval($ticket['owner'])."' OR (`isadmin` = '1' AND `notify_note_unassigned` = '1')) AND `id` <> '".intval($_SESSION['id'])."'");
|
||||
|
||||
if (hesk_dbNumRows($res) == 1)
|
||||
if (hesk_dbNumRows($users) > 0)
|
||||
{
|
||||
$owner = hesk_dbFetchAssoc($res);
|
||||
|
||||
// 1. Generate the array with ticket info that can be used in emails
|
||||
$info = array(
|
||||
'email' => $ticket['email'],
|
||||
@ -282,10 +278,10 @@ if (isset($_POST['notemsg']) && hesk_token_check('POST'))
|
||||
$message = hesk_getEmailMessage('new_note',$ticket,1);
|
||||
|
||||
/* Send email to staff */
|
||||
hesk_mail($owner['email'], $subject, $message);
|
||||
while ($user = hesk_dbFetchAssoc($users)) {
|
||||
hesk_mail($user['email'], $subject, $message);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
header('Location: admin_ticket.php?track='.$trackingID.'&Refresh='.mt_rand(10000,99999));
|
||||
exit();
|
||||
|
Loading…
x
Reference in New Issue
Block a user