From dd620f18b9a9dd01d4a21de9fb4f1194ba6d003d Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Wed, 25 May 2016 16:29:05 -0700 Subject: indicator on the top bar for new activity on tickets, #41670 --- httemplate/elements/header-full.html | 3 +++ httemplate/elements/notify-tickets.html | 37 +++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 httemplate/elements/notify-tickets.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/header-full.html b/httemplate/elements/header-full.html index a67538d11..611da10dc 100644 --- a/httemplate/elements/header-full.html +++ b/httemplate/elements/header-full.html @@ -75,6 +75,9 @@ Example: <% $company_name || 'ExampleCo' %> + + <& notify-tickets.html &> + Logged in as <% getotaker %>  logout
Preferences % if ( $conf->config("ticket_system") % && FS::TicketSystem->access_right(\%session, 'ModifySelf') ) { diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html new file mode 100644 index 000000000..f7db52e7b --- /dev/null +++ b/httemplate/elements/notify-tickets.html @@ -0,0 +1,37 @@ +% if ($enabled) { + +
+% if ( $UnrepliedTickets->Count > 0 ) { + +
+ <% emt('New activity on [quant,_1,ticket]', $UnrepliedTickets->Count) %> +
+% } else { + <% emt('No new activity on tickets') %> +% } +
+% } +<%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); +warn Dumper $search; + $search->Prepare; +} + -- cgit v1.2.1