use Class::Load 'load_class';
my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
+$enabled = 0 if $FS::CurrentUser::CurrentUser->option('hide_notify_tickets');
my $UnrepliedTickets;
if ($enabled) {
my $class = 'RT::Search::UnrepliedTickets';
load_class($class);
my $session = FS::TicketSystem->session;
my $CurrentUser = $session->{CurrentUser};
+ # if there are no tickets the current user could see, always hide it
+ my $AnyTickets = RT::Tickets->new($CurrentUser);
+ foreach my $status (qw(resolved rejected deleted)) {
+ $AnyTickets->LimitStatus( OPERATOR => '!=', VALUE => $status );
+ }
+ $enabled = 0 if $AnyTickets->Count == 0;
+
$UnrepliedTickets = RT::Tickets->new($CurrentUser);
my $search = $class->new(TicketsObj => $UnrepliedTickets);
$search->Prepare;
</TR>
<TR>
+ <TH ALIGN="right"><% emt('Hide notification of new ticket activity') %></TH>
+ <TD ALIGN="left">
+ <INPUT TYPE="checkbox" NAME="hide_notify_tickets" VALUE="1" <% $curuser->option('hide_notify_tickets') ? 'CHECKED' : '' %>>
+ </TD>
+ </TR>
+
+ <TR>
<TH ALIGN="right"><% emt("How many recently-modified customers displayed on dashboard") %></TH>
<TD ALIGN="left" COLSPAN=2>
<INPUT TYPE="text" NAME="dashboard_customers" VALUE="<% $curuser->option('dashboard_customers') %>"></TD>