Hopeful fix for outstanding issue 766.
gruffen

gruffen commited on 2011-06-17 08:44:02
Showing 1 changed files, with 6 additions and 2 deletions.

... ...
@@ -37,6 +37,10 @@ function shd_notifications_notify_newticket(&$msgOptions, &$ticketOptions, &$pos
37 37
 	// We don't always have this. But it should be available in context because if we're coming from updated ticket, we will have the other...
38 38
 	if (!isset($ticketOptions['private']))
39 39
 		$ticketOptions['private'] = $context['ticket_form']['private']['setting'];
40
+	if (empty($posterOptions['name']))
41
+		$posterOptions['name'] = $context['user']['name'];
42
+	if (empty($ticketOptions['subject']))
43
+		$ticketOptions['subject'] = $context['ticket_form']['subject'];
40 44
 
41 45
 	// So, we're getting the list of people that are being affected by this ticket being posted. Basically, that's a list of staff on new ticket, less people who've set preferences otherwise.
42 46
 	$members = shd_get_visible_list($ticketOptions['dept'], $ticketOptions['private'], false, empty($modSettings['shd_admins_not_assignable']), false);
... ...
@@ -89,10 +93,10 @@ function shd_notifications_notify_newticket(&$msgOptions, &$ticketOptions, &$pos
89 93
 	$notify_data = array(
90 94
 		'members' => $members,
91 95
 		'ticketlink' => $scripturl . '?action=helpdesk;sa=ticket;ticket=' . $ticketOptions['id'],
92
-		'subject' => $new_ticket ? $ticketOptions['subject'] : $context['ticket_form']['subject'],
96
+		'subject' => $ticketOptions['subject'],
93 97
 		'ticket' => $ticketOptions['id'],
94 98
 		'body' => $msgOptions['body'],
95
-		'poster_name' => !empty($posterOptions['name']) ? $posterOptions['name'] : $context['user']['name'],
99
+		'poster_name' => $posterOptions['name'],
96 100
 	);
97 101
 
98 102
 	shd_notify_users($notify_data);
99 103