summaryrefslogtreecommitdiff
path: root/httemplate/elements/notify-tickets.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/elements/notify-tickets.html')
-rw-r--r--httemplate/elements/notify-tickets.html27
1 files changed, 27 insertions, 0 deletions
diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html
new file mode 100644
index 000000000..e661737bc
--- /dev/null
+++ b/httemplate/elements/notify-tickets.html
@@ -0,0 +1,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>