9 % if ($IsReminder and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) {
10 <img src="<%$RT::WebImagesURL%>/reminder.png" />
12 % } elsif ($DateTypes->{Resolved}
13 % and RTx::Calendar::LocalDate($Object->ResolvedObj->Unix) eq $today) {
14 <img src="<%$RT::WebImagesURL%>/resolved.png" />
16 % } elsif ($DateTypes->{Starts} and $DateTypes->{Due}
17 % and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today ) {
18 <img src="<%$RT::WebImagesURL%>/starts_due.png" />
20 % } elsif ($DateTypes->{Due} and $DateTypes->{Created}
21 % and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today ) {
22 <img src="<%$RT::WebImagesURL%>/created_due.png" />
24 % } elsif ($DateTypes->{Starts}
25 % and RTx::Calendar::LocalDate($Object->StartsObj->Unix) eq $today) {
26 <img src="<%$RT::WebImagesURL%>/starts.png" />
28 % } elsif ($DateTypes->{Due}
29 % and RTx::Calendar::LocalDate($Object->DueObj->Unix) eq $today) {
30 <img src="<%$RT::WebImagesURL%>/due.png" />
32 % } elsif ($DateTypes->{Created}
33 % and RTx::Calendar::LocalDate($Object->CreatedObj->Unix) eq $today) {
34 <img src="<%$RT::WebImagesURL%>/created.png" />
36 % } elsif ($DateTypes->{Started}
37 % and RTx::Calendar::LocalDate($Object->StartedObj->Unix) eq $today) {
38 <img src="<%$RT::WebImagesURL%>/started.png" />
40 % } elsif ($DateTypes->{LastUpdated}
41 % and RTx::Calendar::LocalDate($Object->LastUpdatedObj->Unix) eq $today) {
42 <img src="<%$RT::WebImagesURL%>/updated.png" />
46 <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>">
47 <% $Object->QueueObj->Name %> #<% $TicketId %>
48 <% $display_owner ? 'by ' . $Object->OwnerObj->Name : '' %>
49 <% length($Object->Subject) > 80 ? substr($Object->Subject, 0, 77) . "..." : $Object->Subject %></a></small><br />
51 <a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$TicketId%>">
52 <% $Object->QueueObj->Name %> #<% $TicketId %>
54 :</strong> <% $subject%><br />
57 %# logic taken from Ticket/Search/Results.tsv
58 % foreach my $attr (@display_fields) {
61 % if ($attr =~ /(.*)->ISO$/ and $Object->$1->Unix <= 0) {
64 % my $method = '$Object->'.$attr.'()';
65 % $method =~ s/->ISO\(\)$/->ISO( Timezone => 'user' )/;
66 % $value = eval $method;
67 % if ($@) {die "<b>Check your CalendarPopupFields config in etc/RT_SiteConfig.pm</b>.<br /><br />Failed to find \"$attr\" - ". $@};
69 <strong><&|/l&><% $label_of{$attr} %></&>:</strong> <% $value %><br />
79 my $today = $Date->strftime("%F");
87 if ($Object->Type eq 'reminder') {
89 if ($Object->RefersTo->First) {
90 $ticket = $Object->RefersTo->First->TargetObj;
91 $TicketId = $ticket->Id;
92 $subject = $Object->Subject . " (" . $ticket->Subject . ")";
95 $TicketId = $Object->Id;
96 $subject = $Object->Subject;
99 my $display_owner = $RT::CalendarDisplayOwner;
100 $display_owner ||= RT->Config->Get('CalendarDisplayOwner')
101 if RT->can('Config');
105 my @display_fields = @RT::CalendarPopupFields;
108 # the if condition is weird but it doesn't work with 3.8.0 without the last part
109 @display_fields = RT->Config->Get('CalendarPopupFields')
110 if 0 == @display_fields and RT->can('Config') and RT->Config->Get('CalendarPopupFields');
113 if (0 == @display_fields) {
114 @display_fields = qw(OwnerObj->Name CreatedObj->ISO StartsObj->ISO
115 StartedObj->ISO LastUpdatedObj->ISO DueObj->ISO
116 ResolvedObj->ISO Status Priority
117 Requestors->MemberEmailAddressesAsString);
122 for my $field (@display_fields) {
124 $label =~ s'Obj-.(?:AsString|Name|ISO)''g;
125 $label =~ s'-\>MemberEmailAddressesAsString''g;
126 $label_of{$field} = $label;