! Replies column now links to the last active post in a ticket. (For normal tickets it's not a problem but for deleted tickets, we don't explicitly store the last deleted reply, only the last undeleted one, which is where the link goes to.)
gruffen

gruffen commited on 2011-06-06 01:02:59
Showing 2 changed files, with 3 additions and 2 deletions.

... ...
@@ -977,6 +977,7 @@ function shd_helpdesk_listing()
977 977
 					'movedept' => !empty($context['shd_multi_dept']) && (shd_allowed_to('shd_move_dept_any', $context['shd_department']) || ($is_own && shd_allowed_to('shd_move_dept_own', $context['shd_department']))) ? '<a href="' . $scripturl . '?action=helpdesk;sa=movedept;ticket=' . $row['id_ticket'] . ';home;' . $context['session_var'] . '=' . $context['session_id'] . '" title="' . $txt['shd_move_dept'] . '"><img src="' . $settings['default_images_url'] . '/simpledesk/movedept.png" alt="' . $txt['shd_move_dept'] . '" /></a>' : '',
978 978
 				),
979 979
 				'num_replies' => $row['num_replies'],
980
+				'replies_href' => $scripturl . '?action=helpdesk;sa=ticket;ticket=' . $row['id_ticket'] . '.msg' . $row['id_last_msg'] . '#msg' . $row['id_last_msg'] . ($_REQUEST['sa'] == 'recyclebin' ? ';recycle' : ''),
980 981
 				'all_replies' => (int) $row['num_replies'] + (int) $row['deleted_replies'],
981 982
 			);
982 983
 
... ...
@@ -531,11 +531,11 @@ function template_ticket_block()
531 531
 						break;
532 532
 					case 'replies':
533 533
 						echo '
534
-							<td class="smalltext">', $ticket['num_replies'], '</td>';
534
+							<td class="smalltext"><a href="', $ticket['replies_href'], '">', $ticket['num_replies'], '</a></td>';
535 535
 						break;
536 536
 					case 'allreplies':
537 537
 						echo '
538
-							<td class="smalltext">', $ticket['all_replies'], '</td>';
538
+							<td class="smalltext"><a href="', $ticket['replies_href'], '">', $ticket['all_replies'], '</a></td>';
539 539
 						break;
540 540
 					case 'actions':
541 541
 						echo '
542 542