%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
while ( my $reminder = $reminders->Next ) {
$i++;
my $dueobj = $reminder->DueObj;
-my $overdue = $dueobj->Unix > 0 && $dueobj->Diff < 0 ? 1 : 0;
+my $overdue = $dueobj->IsSet && $dueobj->Diff < 0 ? 1 : 0;
my $targets = RT::Tickets->new($session{'CurrentUser'});
+$targets->{'allow_deleted_search'} = 1;
$targets->FromSQL( "ReferredToBy = " . $reminder->id );
if ( my $ticket= $targets->First ) {
</%PERL>
<tr class="<% $i%2 ? 'oddline' : 'evenline' %>">
<td class="collection-as-table">
-<a href="<% RT->Config->Get('WebPath') %>/Ticket/Reminders.html?id=<% $ticket->id %>"><% $reminder->Subject %></a>
+<a href="<% RT->Config->Get('WebPath') %>/Ticket/Reminders.html?id=<% $ticket->id %>#reminder-<% $reminder->id %>"><% $reminder->Subject %></a>
</td>
<td class="collection-as-table">
<% $overdue ? '<span class="overdue">' : '' |n %><% $dueobj->AgeAsString || loc('Not set') %><% $overdue ? '</span>' : '' |n %>
<a href="<% RT->Config->Get( 'WebPath' ) %>/Ticket/Display.html?id=<% $ticket->id %>">#<% $ticket->Id %>: <% $ticket->Subject %></a>
</td>
% } else {
-<td colspan="3" class="collection-as-table>
+<td colspan="3" class="collection-as-table">
<div class="error"><div class="error">Couldn't find Ticket for reminder <% $reminder->id %>. Please contact administrator.</div></div>
</td>
% }
' AND ( Owner = "Nobody" OR Owner ="' . $session{'CurrentUser'}->id . '")' .
' AND ( Status = "new" OR Status = "open" )';
-$tsql .= ' AND Due < "now"' if $OnlyOverdue;
+$tsql .= ' AND ( Due < "now" OR Due IS NULL )' if $OnlyOverdue;
$reminders->FromSQL($tsql);
$reminders->OrderBy( FIELD => 'Due', ORDER => 'ASC' );