[Rt-commit] rtir branch, 5.0/fix-disablecountermeasures-config, created. 5.0.0-17-g3d5e233b
Craig Kaiser
craig at bestpractical.com
Thu Nov 12 07:05:20 EST 2020
The branch, 5.0/fix-disablecountermeasures-config has been created
at 3d5e233ba6ab01040d4bc7275a29db3fc5e0b809 (commit)
- Log -----------------------------------------------------------------
commit 3d5e233ba6ab01040d4bc7275a29db3fc5e0b809
Author: craig kaiser <craig at bestpractical.com>
Date: Tue Nov 10 17:37:48 2020 -0500
If $RTIR_DisableCountermeasures is true remove countermeasures portlet
Now that we use the LinkedQueuePortlets config option to render RTIR
linked tickets we need to massage the LinkedQueuePortlets to remove
Countermeasures if $RTIR_DisableCountermeasures is set to true.
diff --git a/lib/RT/IR/Config.pm b/lib/RT/IR/Config.pm
index 5047499a..a283bc1c 100644
--- a/lib/RT/IR/Config.pm
+++ b/lib/RT/IR/Config.pm
@@ -113,6 +113,33 @@ sub Init {
}
};
+ my %LinkedQueuePortlets = %{RT->Config->Get('LinkedQueuePortlets')};
+ my $RTIR_DisableCountermeasures = RT->Config->Get('RTIR_DisableCountermeasures');
+
+ if ( $RTIR_DisableCountermeasures && %LinkedQueuePortlets ) {
+ my %linked_queue_portlets;
+
+ foreach my $top_level_queue ( keys %LinkedQueuePortlets ) {
+ foreach my $queue_config ( $LinkedQueuePortlets{$top_level_queue} ) {
+ my $i = 0;
+ my @linked_queues;
+ foreach my $linked_queue ( @{$queue_config} ) {
+ my $key = (keys %{$linked_queue})[0];
+ my $out = (@{$LinkedQueuePortlets{$top_level_queue}})[$i];
+
+ if ( $key eq 'Countermeasures' ) {
+ last;
+ }
+ else {
+ push @linked_queues, $out;
+ }
+ $i++;
+ }
+ $LinkedQueuePortlets{$top_level_queue} = \@linked_queues;
+ }
+ }
+ }
+
my @homepage_components = @{RT->Config->Get('HomepageComponents')};
foreach my $component (RT->Config->Get('RTIR_HomepageComponents')){
-----------------------------------------------------------------------
More information about the rt-commit
mailing list