X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fnotify-tickets.html;h=16a04f4d992796c32bc1f93e49c676cc45186e54;hb=e42db9683dee82d6991a4205642d5babb3d52f2f;hp=faf998e2b12d8ea93e2829d62f47c7e7082966e4;hpb=d22baa4e71bfa9e153c1fe1152ff4c748f1d935c;p=freeside.git diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html index faf998e2b..16a04f4d9 100644 --- a/httemplate/elements/notify-tickets.html +++ b/httemplate/elements/notify-tickets.html @@ -1,13 +1,4 @@ % if ($enabled) { -
% if ( $UnrepliedTickets->Count > 0 ) { @@ -23,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;