RT# 78019 - Added revenue difference to package churn report
[freeside.git] / httemplate / elements / notify-tickets.html
index 35917c3..083e815 100644 (file)
@@ -14,7 +14,7 @@
 use Class::Load 'load_class';
 
 my $enabled = $FS::TicketSystem::system eq 'RT_Internal';
-$enabled = 0 if $FS::CurrentUser::CurrentUser->option('hide_notify_tickets');
+$enabled = 0 unless $FS::CurrentUser::CurrentUser->access_right('RT activity notification');
 my $UnrepliedTickets;
 if ($enabled) {
   my $class = 'RT::Search::UnrepliedTickets';
@@ -25,7 +25,12 @@ if ($enabled) {
     # 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 );
+      $AnyTickets->RT::SearchBuilder::Limit(
+        FIELD => 'Status',
+        OPERATOR => '!=',
+        ENTRYAGGREGATOR => 'AND',
+        VALUE => $status,
+      );
     }
     $enabled = 0 if $AnyTickets->Count == 0;