-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unapply Incidents Processes class globally
The articles on the Incidents Processes class are intended to be displayed only on the Incident view page, but they were also available at the Include Article field of tickets, because the class was applied globally.
- Loading branch information
1 parent
03f8d24
commit 8c5cb78
Showing
2 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
our @Final = sub { | ||
my $CurrentUser = RT::CurrentUser->new(); | ||
$CurrentUser->LoadByName('RT_System'); | ||
|
||
require RT::Class; | ||
my $incident_processes = RT::Class->new($CurrentUser); | ||
$incident_processes->Load('Incidents Processes'); | ||
die "Could not load 'Incidents Processes' class: $msg" unless $incident_processes->Id; | ||
|
||
if ( $incident_processes->IsApplied( 0 ) ) { | ||
my $empty_queue = RT::Queue->new( RT->SystemUser ); | ||
my ($ok, $msg) = $incident_processes->RemoveFromObject( $empty_queue ); | ||
die "Could not remove 'Incidents Processes' from 'Global' queue: $msg" unless $ok; | ||
} | ||
}; |