<%args>
$Date => undef
$Object => undef
$DateTypes => undef
</%args>
<div class="tooltip">
<small>

% if ($IsReminder and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) {
     <img src="<%$RT::WebImagesURL%>/reminder.png" />

% } elsif ($DateTypes->{Resolved}
%           and RTx::Calendar::LocalDate($Object->ResolvedObj->Unix) eq $today) {
         <img src="<%$RT::WebImagesURL%>/resolved.png" />

% } elsif ($DateTypes->{Starts} and $DateTypes->{Due} 
%           and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today ) {
    <img src="<%$RT::WebImagesURL%>/starts_due.png" />

% } elsif ($DateTypes->{Due} and $DateTypes->{Created} 
%           and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today ) {
    <img src="<%$RT::WebImagesURL%>/created_due.png" />

% } elsif ($DateTypes->{Starts}
%           and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today) {
    <img src="<%$RT::WebImagesURL%>/starts.png" />

% } elsif ($DateTypes->{Due} 
%           and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) {
    <img src="<%$RT::WebImagesURL%>/due.png" />

% } elsif ($DateTypes->{Created}
%           and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today) {
    <img src="<%$RT::WebImagesURL%>/created.png" />

% } elsif ($DateTypes->{Started}
%           and RTx::Calendar::LocalDate($Object->StartedObj->Unix) eq $today) {
    <img src="<%$RT::WebImagesURL%>/started.png" />

% } elsif ($DateTypes->{LastUpdated}
%           and RTx::Calendar::LocalDate($Object->LastUpdatedObj->Unix) eq $today) {
    <img src="<%$RT::WebImagesURL%>/updated.png" />

% }

	<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>">
           <% $Object->QueueObj->Name %> #<% $TicketId %>
           <% length($Object->Subject) > 80 ? substr($Object->Subject, 0, 77) . "..." : $Object->Subject %></a></small><br />
	<span class="tip">
	<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>">
           <% $Object->QueueObj->Name %> #<% $TicketId %>
        </a>
	:</strong> <% $subject%><br />
	<br />
	<strong><&|/l&>Owner</&>:</strong> <%$Object->OwnerObj->Name %><br />
	<strong><&|/l&>Created</&>:</strong> <%$Object->CreatedObj->AsString %><br />

% # Shoud we keep thoses dates ?
        <strong><&|/l&>Starts</&>:</strong> <% $Object->StartsObj->Unix > 0 ? $Object->StartsObj->AsString : '-' %><br />
        <strong><&|/l&>Started</&>:</strong> <% $Object->StartedObj->Unix > 0 ? $Object->StartedObj->AsString : '-' %><br />
        <strong><&|/l&>LastUpdated</&>:</strong> <% $Object->LastUpdatedObj->Unix > 0 ? $Object->LastUpdatedObj->AsString : '-' %><br />

        <strong><&|/l&>Due</&>:</strong> <% $Object->DueObj->Unix > 0 ? $Object->DueObj->AsString : '-' %><br />

% # and those one
        <strong><&|/l&>Resolved</&>:</strong> <% $Object->ResolvedObj->Unix > 0 ? $Object->ResolvedObj->AsString : '-' %><br />

% unless ($IsReminder) {
	<strong><&|/l&>Status</&>:</strong> <%loc($Object->Status) %><br />
	<strong><&|/l&>Priority</&>:</strong> <%$Object->Priority %><br />
	<strong><&|/l&>Requestors</&>:</strong> 

%   my $members = $Object->Requestors->MembersObj;
%   if ($members->Count == 0) {
<&|/l&>none</&>
%   } else {
%     my @requestors;
%     while (my $watcher = $members->Next) {
%       push @requestors, $watcher->MemberObj->Object->Name;
%     }
<% join ", ", @requestors %>
%   }
<br />
% }
	</span>
</div>

<%init>
use RTx::Calendar;

my $today = $Date->strftime("%F");

my $TicketId;

my $ticket;
my $subject;
my $IsReminder;

if ($Object->Type eq 'reminder') {
    $IsReminder = 1;
    if ($Object->RefersTo->First) {
	$ticket   = $Object->RefersTo->First->TargetObj;
	$TicketId = $ticket->Id;
	$subject = $Object->Subject . " (" . $ticket->Subject . ")";
    }
} else {
    $TicketId = $Object->Id;
    $subject = $Object->Subject;
}
</%init>
