X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fnotify-tickets.html;h=16a04f4d992796c32bc1f93e49c676cc45186e54;hp=e661737bc880d7bfe8815e2936b40a134be0be7b;hb=e42db9683dee82d6991a4205642d5babb3d52f2f;hpb=3676ccddeab727d3d7a929b1fe4fe19d81e0e8c0 diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html index e661737bc..16a04f4d9 100644 --- a/httemplate/elements/notify-tickets.html +++ b/httemplate/elements/notify-tickets.html @@ -14,12 +14,20 @@ 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;