summaryrefslogtreecommitdiff
path: root/httemplate/elements/notify-tickets.html
blob: e661737bc880d7bfe8815e2936b40a134be0be7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% if ($enabled) {
<div style="font-weight: bold; vertical-align: bottom; text-align: left">
%   if ( $UnrepliedTickets->Count > 0 ) {
  <a href="<% $fsurl %>rt/Search/UnrepliedTickets.html">
    <div class="dot" style="background-color: green"></div>
    <% emt('New activity on [quant,_1,ticket]', $UnrepliedTickets->Count) %>
  </a>
%   } else {
  <% emt('No new activity on tickets') %>
%   }
</div>
% }
<%init>
use Class::Load 'load_class';

my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
my $UnrepliedTickets;
if ($enabled) {
  my $class = 'RT::Search::UnrepliedTickets';
  load_class($class);
  my $session = FS::TicketSystem->session;
  my $CurrentUser = $session->{CurrentUser};
  $UnrepliedTickets = RT::Tickets->new($CurrentUser);
  my $search = $class->new(TicketsObj => $UnrepliedTickets);
  $search->Prepare;
}
</%init>