X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fnotify-tickets.html;h=16a04f4d992796c32bc1f93e49c676cc45186e54;hb=e42db9683dee82d6991a4205642d5babb3d52f2f;hp=f7db52e7bc0c6d9b04b65da1bc001fdd8efd231e;hpb=dd82a27357402466390044d001824657f6617626;p=freeside.git diff --git a/httemplate/elements/notify-tickets.html b/httemplate/elements/notify-tickets.html index f7db52e7b..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,15 +14,22 @@ 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); -warn Dumper $search; $search->Prepare; }