[Rt-commit] rtir branch, 3.4/countermeasures, created. 3.3.0-94-g6fb2227

Shawn Moore shawn at bestpractical.com
Mon May 16 19:05:30 EDT 2016


The branch, 3.4/countermeasures has been created
        at  6fb2227dc527e51f461acab03d02ff4d3a809988 (commit)

- Log -----------------------------------------------------------------
commit af89baa5174d6a45a1a7f94753d302098c6545aa
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 22:38:46 2016 +0000

    Use RT::IR->lifecycle_* methods instead of hardcoding

diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index 6215b7e..d3757b4 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -293,16 +293,16 @@ sub grant_role_queue_rights {
         debug "Granting role rights to Everyone for queue " . $queue->Name . "\n";
         my @rights;
 
-        if ( $queue->Lifecycle eq 'incident_reports' ) {
+        if ( $queue->Lifecycle eq RT::IR->lifecycle_report ) {
             @rights = RT::IR->EveryoneIncidentReportRights();
-        } elsif ( $queue->Lifecycle eq 'incidents' ) {
+        } elsif ( $queue->Lifecycle eq RT::IR->lifecycle_incident ) {
             @rights = RT::IR->EveryoneIncidentRights();
 
         }
-        if ( $queue->Lifecycle eq 'investigations' ) {
+        if ( $queue->Lifecycle eq RT::IR->lifecycle_investigation ) {
             @rights = RT::IR->EveryoneInvestigationRights();
 
-        } elsif ( $queue->Lifecycle eq 'countermeaures' ) {
+        } elsif ( $queue->Lifecycle eq RT::IR->lifecycle_countermeasure ) {
             @rights = RT::IR->EveryoneBlockRights();
         }
         # grant 'everyone' rights

commit 43b776beeb250db0251bfbb6d17a7e462e030b87
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 22:54:31 2016 +0000

    Rename lifecycle from "blocks" to "countermeasures"
    
    Fixes: I#15657

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index c03f5cf..816df2d 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -69,7 +69,7 @@ RT::IR::Config::Init();
 sub lifecycle_report {'incident_reports'}
 sub lifecycle_incident {'incidents'}
 sub lifecycle_investigation {'investigations'}
-sub lifecycle_countermeasure {'blocks'}
+sub lifecycle_countermeasure {'countermeasures'}
 
 
 my @LIFECYCLES = (RT::IR->lifecycle_incident, RT::IR->lifecycle_report, RT::IR->lifecycle_investigation, RT::IR->lifecycle_countermeasure);

commit 383bb5e601f73b028db2e1a8ec355e47ec1fb5e8
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:30:41 2016 +0000

    Switch lifecycle definition from "blocks" to "countermeasures"

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 34682c6..1136164 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -25,7 +25,7 @@ Set( $rtirname, RT->Config->Get('rtname') );
 =item C<%Lifecycles>
 
 RTIR defines four lifecycles for each its queue: 'incidents',
-'incident_reports', 'investigations' and 'blocks'.
+'incident_reports', 'investigations' and 'countermeasures'.
 
 Note that all four lifecycles are mapped to each other, so
 in theory it's possible to move tickets between queues, but
@@ -135,7 +135,7 @@ Set(
             'resolved -> open' => { label => 'Re-open' },
         ],
     },
-    blocks => {
+    countermeasures => {
         initial         => ['pending activation'],
         active          => [ 'active', 'pending removal' ],
         inactive        => ['removed'],
@@ -174,7 +174,7 @@ Set(
             'resolved'  => 'resolved',
             'abandoned' => 'resolved',
         },
-        'incidents -> blocks' => {
+        'incidents -> countermeasures' => {
             'open'      => 'active',
             'resolved'  => 'removed',
             'abandoned' => 'removed',
@@ -191,7 +191,7 @@ Set(
             'resolved' => 'resolved',
             'rejected' => 'resolved',
         },
-        'incident_reports -> blocks' => {
+        'incident_reports -> countermeasures' => {
             'new'      => 'pending activation',
             'open'     => 'active',
             'resolved' => 'removed',
@@ -205,23 +205,23 @@ Set(
             'open'     => 'open',
             'resolved' => 'resolved',
         },
-        'investigations -> blocks' => {
+        'investigations -> countermeasures' => {
             'open'     => 'active',
             'resolved' => 'removed',
         },
-        'blocks -> incidents' => {
+        'countermeasures -> incidents' => {
             'pending activation' => 'open',
             'active'             => 'open',
             'pending removal'    => 'open',
             'removed'            => 'resolved',
         },
-        'blocks -> incident_reports' => {
+        'countermeasures -> incident_reports' => {
             'pending activation' => 'new',
             'active'             => 'open',
             'pending removal'    => 'open',
             'removed'            => 'resolved',
         },
-        'blocks -> investigations' => {
+        'countermeasures -> investigations' => {
             'pending activation' => 'open',
             'active'             => 'open',
             'pending removal'    => 'open',

commit 36b5bc5dc05bf316231f0478607f7e535c954dae
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:35:20 2016 +0000

    Switch default queue from Blocks to Countermeasures

diff --git a/etc/initialdata b/etc/initialdata
index b09c634..f8a677d 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -115,7 +115,7 @@
     {   Name => 'IP',
         Type => 'IPAddressRangeMultiple',
         Queue =>
-            [ 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ],
+            [ 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ],
         Disabled    => 0,
         Description => 'IP address for RTIR queues',
         LinkValueTo =>
@@ -123,19 +123,19 @@
     },
     {   Name        => 'Netmask',
         Type        => 'FreeformSingle',
-        Queue       => 'Blocks',
+        Queue       => 'Countermeasures',
         Disabled    => 0,
         Description => 'Network mask for Blocks RTIR queue',
     },
     {   Name        => 'Port',
         Type        => 'FreeformSingle',
-        Queue       => 'Blocks',
+        Queue       => 'Countermeasures',
         Disabled    => 0,
         Description => 'Port for Blocks RTIR queue',
     },
     {   Name        => 'Where Blocked',
         Type        => 'FreeformSingle',
-        Queue       => 'Blocks',
+        Queue       => 'Countermeasures',
         Disabled    => 0,
         Description => 'Where the block is placed for Blocks RTIR queue',
     },
@@ -266,7 +266,7 @@
     },
 
     {   Description    => "On Correspond Change Status of the Block",
-        Queue          => 'Blocks',
+        Queue          => 'Countermeasures',
         ScripCondition => 'On Correspond',
         ScripAction    => 'RTIR Set Block Status',
         Template       => 'Blank',
@@ -291,7 +291,7 @@
     },
 
     {   Description    => "Set Due Date On Incident",
-        Queue          => [ 'Incident Reports', 'Investigations', 'Blocks' ],
+        Queue          => [ 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'RTIR Require Due Change',
         ScripAction    => 'RTIR Set Incident Due',
         Template       => 'Blank',
@@ -318,14 +318,14 @@
         Template       => 'Blank',
     },
     {   Description    => "FixOwnership",
-        Queue          => [ 'Incident Reports', 'Investigations', 'Blocks' ],
+        Queue          => [ 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'On Owner Change',
         ScripAction    => 'RTIR Change Parent Ownership',
         Template       => 'Blank',
     },
 
     {   Description    => "ReopenIncident",
-        Queue          => [ 'Incident Reports', 'Investigations', 'Blocks' ],
+        Queue          => [ 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'On Status Change',
         ScripAction    => 'RTIR Open Parent',
         Template       => 'Blank',
@@ -339,7 +339,7 @@
     },
 
     {   Description    => "NotifyOnClose",
-        Queue          => 'Blocks',
+        Queue          => 'Countermeasures',
         ScripCondition => 'RTIR Close Ticket',
         ScripAction    => 'Notify Requestors',
         Template       => 'BlockRemoved'
@@ -347,14 +347,14 @@
 
     {   Description => "SetIPFromContent",
         Queue =>
-            [ 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ],
+            [ 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'On Correspond',
         ScripAction    => 'RTIR parse message for IPs',
         Template       => 'Blank'
     },
     {   Description => "SetIPFromContent",
         Queue =>
-            [ 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ],
+            [ 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'On Create',
         ScripAction    => 'RTIR parse message for IPs',
         Template       => 'Blank'
@@ -362,7 +362,7 @@
 
     {   Description => "MergeIPs",
         Queue =>
-            [ 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ],
+            [ 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ],
         ScripCondition => 'RTIR Merge',
         ScripAction    => 'RTIR merge IPs',
         Template       => 'Blank'
@@ -374,7 +374,7 @@
 # mention it in the UPGRADING file
 
 @Templates = (
-    {   Queue       => 'Blocks',
+    {   Queue       => 'Countermeasures',
         Name        => 'Autoreply',
         Description => 'Sent when a block is created',
         Content     => 'RT-Attach-Message: yes
@@ -408,7 +408,7 @@ you may reply to this message.
                         Thank you,
                         { $Ticket->QueueObj->CorrespondAddress }',
     },
-    {   Queue       => 'Blocks',
+    {   Queue       => 'Countermeasures',
         Name        => 'BlockRemoved',
         Description => 'Sent when a block is removed',
         Content     => 'Subject: {$Ticket->Subject}
@@ -526,7 +526,7 @@ push @ACL, map {
 push @ACL, map {
     {   GroupType   => 'Everyone',
         GroupDomain => 'SystemInternal',
-        Queue       => 'Blocks',
+        Queue       => 'Countermeasures',
         Right       => $_
     }
 } RT::IR->EveryoneBlockRights();
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 816df2d..1354915 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -82,11 +82,12 @@ my %TYPE = (
     'blocks'           => 'Block',
 );
 
+# these are used by initialdata to form the default queue names
 my %FRIENDLY_LIFECYCLE = (
-    RT::IR->lifecycle_incident        => 'Incidents',
-    RT::IR->lifecycle_report => 'Incident Reports',
-    RT::IR->lifecycle_investigation   => 'Investigations',
-    RT::IR->lifecycle_countermeasure           => 'Blocks',
+    RT::IR->lifecycle_incident       => 'Incidents',
+    RT::IR->lifecycle_report         => 'Incident Reports',
+    RT::IR->lifecycle_investigation  => 'Investigations',
+    RT::IR->lifecycle_countermeasure => 'Countermeasures',
 
 );
 

commit 8c7de771408b6389da48a020b97cfbe5c865bbe8
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:40:33 2016 +0000

    Rename Blocks menu at top to Countermeasures

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 5fa558f..8280831 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -128,7 +128,7 @@ $root->child(
 );
 unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
     $root->child(
-        blocks => title => loc('Blocks'),
+        blocks => title => loc('Countermeasures'),
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),

commit 99ef2bfd513c27636b9cf48f96b5d103be49d866
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:43:12 2016 +0000

    Switch %TYPE to use lifecycle methods (and Countermeasures)

diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 1354915..b95d5ce 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -75,11 +75,12 @@ sub lifecycle_countermeasure {'countermeasures'}
 my @LIFECYCLES = (RT::IR->lifecycle_incident, RT::IR->lifecycle_report, RT::IR->lifecycle_investigation, RT::IR->lifecycle_countermeasure);
 
 my %TYPE = (
-    'incidents'        => 'Incident',
+    RT::IR->lifecycle_incident       => 'Incident',
+    RT::IR->lifecycle_report         => 'Report',
+    RT::IR->lifecycle_investigation  => 'Investigation',
+    RT::IR->lifecycle_countermeasure => 'Countermeasure',
+
     'incident reports' => 'Report',
-    'incident_reports' => 'Report',
-    'investigations'   => 'Investigation',
-    'blocks'           => 'Block',
 );
 
 # these are used by initialdata to form the default queue names

commit af6e5ae6e4f9f33ceb524c9ade62aee548b931fd
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:46:26 2016 +0000

    Fix error to mention plural Countermeasure queues rather than Block queue

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 6c14392..cf69421 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -379,7 +379,7 @@ my $ticket = RT::Ticket->new($session{'CurrentUser'}); # empty ticket object
 
 if (RT::IR->IsCountermeasureQueue($QueueObj) 
     && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-    Abort(loc("Blocks queue is disabled via config file"));
+    Abort(loc("Countermeasure queues are disabled via config file"));
 }
 
 
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index f84e103..0f36dbd 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -187,7 +187,7 @@ RT::Interface::Web::Redirect(RT->Config->Get('WebURL')
     . $m->comp('/Elements/QueryString', %ARGS )) unless $Type;
 
 if (RT::IR->IsCountermeasureQueue($QueueObj) && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-    Abort(loc("Blocks queue is disabled via config file"));
+    Abort(loc("Countermeasure queues are disabled via config file"));
     }
 
 # If there's an RTIR specific display page for this kind of ticket, show that
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 6d9baf6..e0735cb 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -175,7 +175,7 @@ RT::Interface::Web::Redirect(RT->Config->Get('WebURL').'Ticket/Display.html?'.
 
 if (RT::IR->IsCountermeasureQueue($Ticket->QueueObj)
     && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-    Abort(loc("Blocks queue is disabled via config file"));
+    Abort(loc("Countermeasure queues are disabled via config file"));
 }
 
 # If there's an RTIR specific display page for this kind of ticket, show that

commit 287b968756f44ea3176b075827770c27db156200
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:48:05 2016 +0000

    Rename SelectedBlocks to SelectedCountermeasures

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 1136164..2eae48a 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -62,7 +62,7 @@ Set(
             'open -> resolved'  => {
                 label => 'Resolve', update => 'Comment',
                 All => 1,
-                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedBlocksAll => 1,
+                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedCountermeasuresAll => 1,
             },
             'open -> resolved'  => {
                 label => 'Quick Resolve',
@@ -70,12 +70,12 @@ Set(
             'open -> abandoned' => {
                 label => 'Abandon', update => 'Comment',
                 All => 1,
-                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedBlocksAll => 1,
+                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedCountermeasuresAll => 1,
             },
             '* -> open'  => {
                 label => 'Re-open',
                 All => 1,
-                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedBlocksAll => 1,
+                SelectedReportsAll => 1, SelectedInvestigationsAll => 1, SelectedCountermeasuresAll => 1,
             },
         ],
     },
diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 8280831..94ad101 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -242,7 +242,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
             );
             $actions_tab->child(
                 reply_all => title => loc('Reply to All'),
-                path  => RT::IR->HREFTo("Incident/Reply/?id=$id&All=1&SelectedReportsAll=1&SelectedInvestigationsAll=1&SelectedBlocksAll=1", IncludeWebPath => 0),
+                path  => RT::IR->HREFTo("Incident/Reply/?id=$id&All=1&SelectedReportsAll=1&SelectedInvestigationsAll=1&SelectedCountermeasuresAll=1", IncludeWebPath => 0),
             );
         } else {
             $actions_tab->child(
diff --git a/html/RTIR/Incident/Reply/Refine.html b/html/RTIR/Incident/Reply/Refine.html
index e98d120..0c458dd 100644
--- a/html/RTIR/Incident/Reply/Refine.html
+++ b/html/RTIR/Incident/Reply/Refine.html
@@ -58,14 +58,14 @@ return $m->comp(
         Status => $ARGS{'Status'}, Action => $ARGS{'Action'},
         SelectedReportsAll => $ARGS{'SelectedReportsAll'},
         SelectedInvestigationsAll => $ARGS{'SelectedInvestigationsAll'},
-        SelectedBlocksAll => $ARGS{'SelectedBlocksAll'},
+        SelectedCountermeasuresAll => $ARGS{'SelectedCountermeasuresAll'},
     ),
     BaseQuery => RT::IR->Query(
     Lifecycle    => \@lifecycles,
         MemberOf => $ARGS{'id'},
     ),
     ExtraQueryParams => [qw(SelectedReportsAll SelectedInvestigationsAll
-                            All Status Action SelectedBlocksAll)],
+                            All Status Action SelectedCountermeasuresAll)],
 
 );
 </%INIT>
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index c7cabd1..af037d1 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -97,7 +97,7 @@
     BaseURL       => $BaseURL,
     BaseQuery     => RT::IR->Query(Lifecycle => RT::IR->lifecycle_countermeasure, MemberOf => $id),
     Query         => $Query,
-    DisplayFormat => "__CheckBox.{SelectedBlocks}__, $Format",
+    DisplayFormat => "__CheckBox.{SelectedCountermeasures}__, $Format",
     Format        => $Format,
     Rows          => $Rows,
     Page          => $Page,
@@ -149,7 +149,7 @@ $m->comp( '/Elements/Crypt/SignEncryptWidget:Process',
 );
 
 my @selected_children;
-foreach my $id( @SelectedReports, @SelectedInvestigations, @SelectedBlocks ) {
+foreach my $id( @SelectedReports, @SelectedInvestigations, @SelectedCountermeasures ) {
     my $ticket = RT::Ticket->new( $session{'CurrentUser'} );
     $ticket->Load( $id );
     unless( $ticket->id ) {
@@ -271,8 +271,8 @@ $Page            => 1
 $OrderBy         => RT->Config->Get('DefaultSearchResultOrderBy')
 $Order           => RT->Config->Get('DefaultSearchResultOrder')
 
- at SelectedReports        => ()
- at SelectedInvestigations => ()
- at SelectedBlocks         => ()
-$SubmitTicket           => 0
+ at SelectedReports         => ()
+ at SelectedInvestigations  => ()
+ at SelectedCountermeasures => ()
+$SubmitTicket            => 0
 </%ARGS>
diff --git a/t/searches/menu.t b/t/searches/menu.t
index b5c3177..b2e0ef3 100644
--- a/t/searches/menu.t
+++ b/t/searches/menu.t
@@ -199,7 +199,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
     ($checkbox) = $m->find_all_inputs( name => 'SelectedInvestigations' );
     is( $checkbox->value, $ticket{investigation}[0], '$ticket{investigation}[0] is checked' );
 
-    ($checkbox) = $m->find_all_inputs( name => 'SelectedBlocks' );
+    ($checkbox) = $m->find_all_inputs( name => 'SelectedCountermeasures' );
     is( $checkbox->value, $ticket{block}[0], '$ticket{block}[0] is checked' );
 
     $m->follow_link_ok( { text => "Edit Search", n => 2 } );

commit b97f1655e22754537237a798d2852a248b926e68
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:48:54 2016 +0000

    Fix one instance of hardcoded name Blocks in UI to be Countermeasure

diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index af037d1..e92d7db 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -92,7 +92,7 @@
     Order         => $Order,
 &>
 % unless( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<h2><&|/l&>Blocks Correspondents</&></h2>
+<h2><&|/l&>Countermeasure Correspondents</&></h2>
 <& /RTIR/Search/Elements/ShowResults,
     BaseURL       => $BaseURL,
     BaseQuery     => RT::IR->Query(Lifecycle => RT::IR->lifecycle_countermeasure, MemberOf => $id),

commit 1073c9b17b9f11a5db9c728f6e1bf7407754e5eb
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:51:27 2016 +0000

    Rename create_block and goto_edit_block test functions

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 93da117..b81211c 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -66,9 +66,9 @@ sub create_investigation {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
     return (shift)->create_rtir_ticket_ok( 'Investigations', @_ );
 }
-sub create_block {
+sub create_countermeasure {
     local $Test::Builder::Level = $Test::Builder::Level + 1;
-    return (shift)->create_rtir_ticket_ok( 'Blocks', @_ );
+    return (shift)->create_rtir_ticket_ok( 'Countermeasures', @_ );
 }
 
 sub goto_create_rtir_ticket {
@@ -308,14 +308,14 @@ qr{<td class="labeltop">Correspondents:</td>\s*<td class="value">\s*<span class=
     );
 }
 
-sub goto_edit_block {
+sub goto_edit_countermeasure {
     my $self = shift;
     my $id   = shift;
 
     $self->display_ticket($id);
 
     return $self->follow_link_ok( { text => 'Edit', n => '1' },
-        "Followed 'Edit' (block) link" );
+        "Followed 'Edit' (countermeasure) link" );
 }
 
 sub resolve_rtir_ticket {
diff --git a/t/block/pending-no-regexp.t b/t/block/pending-no-regexp.t
index d385b00..50f80fb 100644
--- a/t/block/pending-no-regexp.t
+++ b/t/block/pending-no-regexp.t
@@ -12,7 +12,7 @@ my $agent = default_agent();
 
 my $inc_id   = $agent->create_incident( {Subject => "incident with block"});
 my $rtname = RT->Config->Get('rtname');
-my $block_id = $agent->create_block( {
+my $block_id = $agent->create_countermeasure( {
     Subject => "block",
     Incident => $inc_id,
     Requestors => 'rt-test at example.com',
diff --git a/t/block/pending-regexp.t b/t/block/pending-regexp.t
index ef9c4ff..730294d 100644
--- a/t/block/pending-regexp.t
+++ b/t/block/pending-regexp.t
@@ -13,7 +13,7 @@ my $agent = default_agent();
 my $rtname = RT->Config->Get('rtname');
 
 my $inc_id   = $agent->create_incident( {Subject => "incident with block"});
-my $block_id = $agent->create_block( {
+my $block_id = $agent->create_countermeasure( {
     Subject => "block",
     Incident => $inc_id,
     Requestors => 'rt-test at example.com',
diff --git a/t/block/status-basics.t b/t/block/status-basics.t
index 12cfd15..7489460 100644
--- a/t/block/status-basics.t
+++ b/t/block/status-basics.t
@@ -9,7 +9,7 @@ RT::Test->started_ok;
 my $agent = default_agent();
 
 my $inc_id   = $agent->create_incident( {Subject => "incident with block"});
-my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
+my $block_id = $agent->create_countermeasure( {Subject => "block", Incident => $inc_id});
 
 $agent->ticket_status_is( $block_id, 'pending activation');
 
@@ -62,7 +62,7 @@ diag "prepare for removing using the link";
 
 diag "test activation after reply using 'Activate' link";
 {
-    my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
+    my $block_id = $agent->create_countermeasure( {Subject => "block", Incident => $inc_id});
     $agent->ticket_status_is( $block_id, 'pending activation');
 
     $agent->follow_link_ok({ text => 'Reply' }, "Go to reply page");
@@ -83,7 +83,7 @@ diag "test activation after reply using 'Activate' link";
 
 diag "test activation after reply using Edit page";
 {
-    my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
+    my $block_id = $agent->create_countermeasure( {Subject => "block", Incident => $inc_id});
     $agent->ticket_status_is( $block_id, 'pending activation');
 
     $agent->follow_link_ok({ text => 'Reply' }, "Go to reply page");
diff --git a/t/block/status-editor-regression.t b/t/block/status-editor-regression.t
index e0137b9..80eb97c 100644
--- a/t/block/status-editor-regression.t
+++ b/t/block/status-editor-regression.t
@@ -9,9 +9,9 @@ RT::Test->started_ok;
 my $agent = default_agent();
 
 my $incident = $agent->create_incident( {Subject => 'Incident to test Block editing'});
-my $block = $agent->create_block( {Incident => $incident});
+my $block = $agent->create_countermeasure( {Incident => $incident});
 
-$agent->goto_edit_block( $block);
+$agent->goto_edit_countermeasure( $block);
 
 $agent->content_unlike(qr{<option (?:value=.*)?>Use system default\(\)</option>}, "The option 'Use system default()' does not exist.");
 
diff --git a/t/custom-fields/ip.t b/t/custom-fields/ip.t
index 82ad500..d78256b 100644
--- a/t/custom-fields/ip.t
+++ b/t/custom-fields/ip.t
@@ -550,14 +550,14 @@ diag "merge ticket, IPs should be merged";
         'Incidents',
         { Subject => "test" },
     );
-    my $b1_id = $agent->create_block(
+    my $b1_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
         },
         { IP => '172.16.0.1' },
     );
-    my $b2_id = $agent->create_block(
+    my $b2_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
@@ -590,14 +590,14 @@ diag "merge ticket with the same IP";
         'Incidents',
         { Subject => "test" },
     );
-    my $b1_id = $agent->create_block(
+    my $b1_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
         },
         { IP => '172.16.0.1' },
     );
-    my $b2_id = $agent->create_block(
+    my $b2_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
diff --git a/t/custom-fields/ipv6.t b/t/custom-fields/ipv6.t
index cf464a2..b3394f9 100644
--- a/t/custom-fields/ipv6.t
+++ b/t/custom-fields/ipv6.t
@@ -505,14 +505,14 @@ diag "merge ticket, IPs should be merged";
         'Incidents',
         { Subject => "test" },
     );
-    my $b1_id = $agent->create_block(
+    my $b1_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
         },
         { IP => '::172.16.0.1' },
     );
-    my $b2_id = $agent->create_block(
+    my $b2_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
@@ -545,14 +545,14 @@ diag "merge ticket with the same IP";
         'Incidents',
         { Subject => "test" },
     );
-    my $b1_id = $agent->create_block(
+    my $b1_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
         },
         { IP => '::172.16.0.1' },
     );
-    my $b2_id = $agent->create_block(
+    my $b2_id = $agent->create_countermeasure(
         {
             Subject => "test ip",
             Incident => $incident_id,
diff --git a/t/dates/started.t b/t/dates/started.t
index 376fa4b..a34ebc0 100644
--- a/t/dates/started.t
+++ b/t/dates/started.t
@@ -85,7 +85,7 @@ diag "started date of an IR" if $ENV{'TEST_VERBOSE'};
 diag "started date of a block" if $ENV{'TEST_VERBOSE'};
 {
     my $inc_id = $agent->create_incident( {Subject => "started date"});
-    my $block_id = $agent->create_block( {Subject => "started date", Incident => $inc_id});
+    my $block_id = $agent->create_countermeasure( {Subject => "started date", Incident => $inc_id});
 
     my $block = RT::Ticket->new( $RT::SystemUser );
     $block->Load( $block_id );
diff --git a/t/walk-web.t b/t/walk-web.t
index d14ca3f..eb0a454 100644
--- a/t/walk-web.t
+++ b/t/walk-web.t
@@ -16,7 +16,7 @@ my @tickets;
 push @tickets, $m->create_incident({ Subject => "test Incident" });
 push @tickets, $m->create_ir({ Subject => "test IR" });
 push @tickets, $m->create_investigation({ Subject => "test Inv", Requestor => 'root at example.com' });
-push @tickets, $m->create_block({ Subject => "test Block", Incident => $tickets[0] });
+push @tickets, $m->create_countermeasure({ Subject => "test Block", Incident => $tickets[0] });
 
 my @links = (
     '/RTIR/',

commit a35a8855302ccbab9daac64881fb4d7151d01a0f
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:54:31 2016 +0000

    Switch hardcoded "Blocks" queue name in tests to "Countermeasures"

diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
index 1d38144..676ce58 100644
--- a/t/009-attachments-processing.t
+++ b/t/009-attachments-processing.t
@@ -149,7 +149,7 @@ $agent->goto_create_rtir_ticket('Investigations');
     unlink $filename or die "couldn't delete file '$filename': $!";
 }
 
-$agent->goto_create_rtir_ticket('Blocks');
+$agent->goto_create_rtir_ticket('Countermeasures');
 
 {
     my $content = "this is test";
diff --git a/t/articles/on-create.t b/t/articles/on-create.t
index e1092d8..17b2f13 100644
--- a/t/articles/on-create.t
+++ b/t/articles/on-create.t
@@ -35,7 +35,7 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
     is($agent->status, 200, "attempt to create succeeded");
 }
 
-foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
     my $queue = RT::Queue->new(RT->SystemUser);
     $queue->Load( $_ );
     ok $agent->goto_create_ticket( $queue ), "UI -> create ticket";
diff --git a/t/articles/on-update.t b/t/articles/on-update.t
index a2dc340..b47c066 100644
--- a/t/articles/on-update.t
+++ b/t/articles/on-update.t
@@ -34,12 +34,12 @@ diag "create an article" if $ENV{'TEST_VERBOSE'};
 }
 
 my $incident_id;
-foreach my $queue ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+foreach my $queue ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
     my $id = $agent->create_rtir_ticket_ok(
         $queue,
         {
             Subject => "test",
-            ( $queue eq 'Blocks' ? ( Incident => $incident_id ) : () ),
+            ( $queue eq 'Countermeasures' ? ( Incident => $incident_id ) : () ),
         },
     );
     $incident_id = $id if $queue eq 'Incidents';
diff --git a/t/block/pending-no-regexp.t b/t/block/pending-no-regexp.t
index 50f80fb..56cb621 100644
--- a/t/block/pending-no-regexp.t
+++ b/t/block/pending-no-regexp.t
@@ -27,7 +27,7 @@ Subject: [$rtname #$block_id] This is a test
 
 test
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'active');
@@ -50,7 +50,7 @@ Subject: [$rtname #$block_id] This is a test
 
 some text
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'removed');
diff --git a/t/block/pending-regexp.t b/t/block/pending-regexp.t
index 730294d..6f2a102 100644
--- a/t/block/pending-regexp.t
+++ b/t/block/pending-regexp.t
@@ -28,7 +28,7 @@ Subject: [$rtname #$block_id] This is a test
 
 some text
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'pending activation');
@@ -43,7 +43,7 @@ Subject: [$rtname #$block_id] This is a test
 TestPendingBlock
 
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'active');
@@ -66,7 +66,7 @@ Subject: [$rtname #$block_id] This is a test
 
 some text
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'pending removal');
@@ -81,7 +81,7 @@ Subject: [$rtname #$block_id] This is a test
 TestPendingBlock
 
 EOF
-    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
+    my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Countermeasures');
     is $status >> 8, 0, "The mail gateway exited ok";
     is $id, $block_id, "replied to the ticket";
     $agent->ticket_status_is( $block_id, 'removed');
diff --git a/t/constituency/basics.t b/t/constituency/basics.t
index c309df8..38a57e2 100644
--- a/t/constituency/basics.t
+++ b/t/constituency/basics.t
@@ -25,7 +25,7 @@ diag "load and check basic properties of the CF" if $ENV{'TEST_VERBOSE'};
 
 diag "check that CF applies to all RTIR's queues" if $ENV{'TEST_VERBOSE'};
 {
-    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         my $queue = RT::Queue->new( $RT::SystemUser );
         $queue->Load( $_ );
         ok( $queue->id, 'loaded queue '. $_ );
@@ -50,7 +50,7 @@ diag "fetch list of constituencies and check that groups exist" if $ENV{'TEST_VE
 diag "check that there is no option to set 'no value' on create" if $ENV{'TEST_VERBOSE'};
 {
     my $default = RT->Config->Get('RTIR_CustomFieldsDefaults')->{'Constituency'};
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "'$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         $agent->goto_create_rtir_ticket( $queue );
@@ -121,7 +121,7 @@ ok( RT::Test->add_rights(
     { Principal => 'Privileged', Right => [qw(ModifyCustomField SeeCustomField)], },
 ), 'set rights');
 
-foreach my $name('Incident Reports', 'Incidents', 'Investigations', 'Blocks' ) {
+foreach my $name('Incident Reports', 'Incidents', 'Investigations', 'Countermeasures' ) {
     my $queue = RT::Test->load_or_create_queue(
         Name => "$name",
         CorrespondAddress => 'rt at example.com',
diff --git a/t/constituency/email.t b/t/constituency/email.t
index 49cd172..14135eb 100644
--- a/t/constituency/email.t
+++ b/t/constituency/email.t
@@ -58,7 +58,7 @@ diag "create a ticket via gate" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
     my $val = RT->Config->Get('RTIR_CustomFieldsDefaults')->{'Constituency'}; # we have one default
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $text = <<EOF;
@@ -92,7 +92,7 @@ diag "create a ticket via gate using Extension header" if $ENV{'TEST_VERBOSE'};
     ok $val, 'find not default value';
 
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $text = <<EOF;
diff --git a/t/constituency/propagation-inherit.t b/t/constituency/propagation-inherit.t
index 6256b49..da3f8ff 100644
--- a/t/constituency/propagation-inherit.t
+++ b/t/constituency/propagation-inherit.t
@@ -105,7 +105,7 @@ diag "create an incident with EDUNET, then create children using Incident input
             'EDUNET', 'correct value';
     }
 
-    foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
@@ -139,7 +139,7 @@ diag "create an incident with EDUNET, then create children using Incident input
 diag "check that constituency propagates from a child to a parent after 'Edit', and back"
     if $ENV{'TEST_VERBOSE'};
 {
-    foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create an incident for linking" if $ENV{'TEST_VERBOSE'};
 
         my $incident_id = $agent->create_rtir_ticket_ok(
diff --git a/t/constituency/propagation-no.t b/t/constituency/propagation-no.t
index defba31..b5b6b39 100644
--- a/t/constituency/propagation-no.t
+++ b/t/constituency/propagation-no.t
@@ -40,7 +40,7 @@ diag "create an incident with EDUNET and then linked tickets with GOVNET,"
             'EDUNET', 'correct value';
     }
 
-    foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
diff --git a/t/constituency/propagation-reject.t b/t/constituency/propagation-reject.t
index d4605d7..c468ee4 100644
--- a/t/constituency/propagation-reject.t
+++ b/t/constituency/propagation-reject.t
@@ -112,7 +112,7 @@ diag "create an incident with EDUNET, then try to create children using"
             'correct value';
     }
 
-    foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue - GOVNET' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket(
@@ -145,7 +145,7 @@ diag "create an incident with EDUNET and check that we can create children"
             'Incidents - EDUNET', 'correct value';
     }
 
-    foreach my $queue( 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue - EDUNET' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
@@ -271,7 +271,7 @@ diag "check that we can change constituency of an unlinked ticket using 'Edit' p
             'EDUNET', 'correct value';
     }
 
-    foreach my $queue( 'Blocks', 'Incident Reports', 'Investigations' ) {
+    foreach my $queue( 'Countermeasures', 'Incident Reports', 'Investigations' ) {
         my $id = $agent->create_rtir_ticket_ok(
             $queue." - EDUNET",
             {
diff --git a/t/custom-fields/defaults-config.t b/t/custom-fields/defaults-config.t
index 3557bbe..d8b330b 100644
--- a/t/custom-fields/defaults-config.t
+++ b/t/custom-fields/defaults-config.t
@@ -9,13 +9,13 @@ my $defaults = RT->Config->Get('RTIR_CustomFieldsDefaults');
 $defaults->{'How Reported'}  = 'Telephone';   # IRs
 $defaults->{'Description'}   = 'Bloody mess'; # Incs
 $defaults->{'IP'}            = '127.0.0.1';   # Invs and all
-$defaults->{'Where Blocked'} = 'On the Moon'; # Blocks
+$defaults->{'Where Blocked'} = 'On the Moon'; # Countermeasures
 
 my %test_on = (
     'Incident Reports' => 'How Reported',
     'Incidents'        => 'Description',
     'Investigations'   => 'IP',
-    'Blocks'           => 'Where Blocked',
+    'Countermeasures'  => 'Where Blocked',
 );
 
 my %replace_with = (
@@ -30,7 +30,7 @@ my $agent = default_agent();
 
 {
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         my $cf_name = $test_on{ $queue };
         my $cf_default = $defaults->{ $cf_name };
         my $cf_replace = $replace_with{ $cf_name };
@@ -49,7 +49,7 @@ my $agent = default_agent();
                 $queue,
                 {
                     Subject => "test",
-                    ( $queue eq 'Blocks' ? ( Incident => $incident_id ) : () ),
+                    ( $queue eq 'Countermeasures' ? ( Incident => $incident_id ) : () ),
                 },
             );
             $incident_id = $id if $queue eq 'Incidents';
@@ -66,7 +66,7 @@ my $agent = default_agent();
                 $queue,
                 {
                     Subject => "test",
-                    ( $queue eq 'Blocks' ? ( Incident => $incident_id ) : () ),
+                    ( $queue eq 'Countermeasures' ? ( Incident => $incident_id ) : () ),
                 },
                 { $cf_name => $cf_replace }
             );
diff --git a/t/custom-fields/defaults-on-linking.t b/t/custom-fields/defaults-on-linking.t
index c5fc932..5392643 100644
--- a/t/custom-fields/defaults-on-linking.t
+++ b/t/custom-fields/defaults-on-linking.t
@@ -15,7 +15,7 @@ my $cf_name = 'test';
     );
     ok( $id, "created custom field" ) or diag "error: $msg";
 
-    for my $q ('Incident Reports', 'Investigations', 'Incidents', 'Blocks') {
+    for my $q ('Incident Reports', 'Investigations', 'Incidents', 'Countermeasures') {
         my $q_obj = RT::Queue->new($RT::SystemUser);
         $q_obj->Load($q);
         ok( $q_obj->id, "Loaded queue '$q'" );
diff --git a/t/custom-fields/ip.t b/t/custom-fields/ip.t
index d78256b..45097ce 100644
--- a/t/custom-fields/ip.t
+++ b/t/custom-fields/ip.t
@@ -26,7 +26,7 @@ diag "load and check basic properties of the IP CF" if $ENV{'TEST_VERBOSE'};
 
 diag "check that CF applies to all RTIR's queues" if $ENV{'TEST_VERBOSE'};
 {
-    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         my $queue = RT::Queue->new( $RT::SystemUser );
         $queue->Load( $_ );
         ok( $queue->id, 'loaded queue '. $_ );
@@ -41,7 +41,7 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $val = '192.168.20.'. ++$i;
@@ -49,7 +49,7 @@ diag "create a ticket via web and set IP" if $ENV{'TEST_VERBOSE'};
             $queue,
             {
                 Subject => "test ip",
-                ( $queue eq 'Blocks' ? ( Incident => $incident_id ) : () ),
+                ( $queue eq 'Countermeasures' ? ( Incident => $incident_id ) : () ),
             },
             { IP => $val },
         );
@@ -68,7 +68,7 @@ diag "create a ticket via web with IP in message" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $val = '192.168.20.'. ++$i;
@@ -76,7 +76,7 @@ diag "create a ticket via web with IP in message" if $ENV{'TEST_VERBOSE'};
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
                 Content => "$val",
             },
         );
@@ -95,7 +95,7 @@ diag "create a ticket via web with CIDR" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $val = '172.16.'. ++$i .'/31'; # add two hosts
@@ -103,7 +103,7 @@ diag "create a ticket via web with CIDR" if $ENV{'TEST_VERBOSE'};
             $queue,
             {
                 Subject => "test ip",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
             },
             { IP => $val },
         );
@@ -125,7 +125,7 @@ diag "create a ticket via web with CIDR in message" if $ENV{'TEST_VERBOSE'};
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $val = '172.16.'. ++$i .'/31'; # add two hosts
@@ -133,7 +133,7 @@ diag "create a ticket via web with CIDR in message" if $ENV{'TEST_VERBOSE'};
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
                 Content => "$val",
             },
         );
@@ -155,14 +155,14 @@ diag "create a ticket and edit IP field using Edit page" if $ENV{'TEST_VERBOSE'}
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
             },
         );
         $incident_id = $id if $queue eq 'Incidents';
diff --git a/t/custom-fields/ipv6.t b/t/custom-fields/ipv6.t
index b3394f9..3ffd335 100644
--- a/t/custom-fields/ipv6.t
+++ b/t/custom-fields/ipv6.t
@@ -62,7 +62,7 @@ diag "load and check basic properties of the IP CF" if $ENV{'TEST_VERBOSE'};
 
 diag "check that CF applies to all RTIR's queues" if $ENV{'TEST_VERBOSE'};
 {
-    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach ( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         my $queue = RT::Queue->new( $RT::SystemUser );
         $queue->Load( $_ );
         ok( $queue->id, 'loaded queue '. $_ );
@@ -78,14 +78,14 @@ for my $short (sort keys %valid) {
     my $full = $valid{$short};
     my $abbrev = $abbrev_of{$short};
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip",
-                ( $queue eq 'Blocks' ? ( Incident => $incident_id ) : () ),
+                ( $queue eq 'Countermeasures' ? ( Incident => $incident_id ) : () ),
             },
             { IP => $short },
         );
@@ -105,14 +105,14 @@ for my $short (sort keys %test_set) {
     my $full = $valid{$short};
     my $abbrev = $abbrev_of{$short};
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
                 Content => "$short",
             },
         );
@@ -132,14 +132,14 @@ for my $short (sort keys %test_cidr) {
     my $full = $test_cidr{$short};
     my $abbrev = $abbrev_of{$short};
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
             },
             { IP => $short },
         );
@@ -163,14 +163,14 @@ for my $short (sort keys %test_cidr) {
     my $abbrev = $abbrev_of{$short};
 
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
                 Content => "$short",
             },
         );
@@ -192,14 +192,14 @@ diag "create a ticket and edit IP field using Edit page" if $ENV{'TEST_VERBOSE'}
 {
     my $i = 0;
     my $incident_id; # block couldn't be created without incident id
-    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Blocks' ) {
+    foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 
         my $id = $agent->create_rtir_ticket_ok(
             $queue,
             {
                 Subject => "test ip in message",
-                ($queue eq 'Blocks'? (Incident => $incident_id): ()),
+                ($queue eq 'Countermeasures'? (Incident => $incident_id): ()),
             },
         );
         $incident_id = $id if $queue eq 'Incidents';
diff --git a/t/custom-fields/on-transactions.t b/t/custom-fields/on-transactions.t
index 1cc04dc..3e8dd31 100644
--- a/t/custom-fields/on-transactions.t
+++ b/t/custom-fields/on-transactions.t
@@ -17,7 +17,7 @@ my $cf;
     );
     ok( $id, "created custom field" ) or diag "error: $msg";
 
-    for my $q ('Incident Reports', 'Investigations', 'Incidents', 'Blocks') {
+    for my $q ('Incident Reports', 'Investigations', 'Incidents', 'Countermeasures') {
         my $q_obj = RT::Queue->new($RT::SystemUser);
         $q_obj->Load($q);
         ok( $q_obj->id, "Loaded queue '$q'" );
@@ -41,7 +41,7 @@ my $inc_id = $agent->create_incident( { Subject => "incident" } );
 ok $inc_id, "created an incident";
 
 my @tickets;
-foreach my $qname ('Incident Reports', 'Investigations', 'Blocks') {
+foreach my $qname ('Incident Reports', 'Investigations', 'Countermeasures') {
     $agent->goto_create_rtir_ticket( $qname );
     my $form = $agent->form_name('TicketCreate');
 

commit 2b52712f0987fb5c940ae15326d6fcae62cc29b0
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:56:51 2016 +0000

    Fix some references in RTIR_Config to Countermeasures

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 2eae48a..55eda07 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -255,7 +255,7 @@ an Incident on creation in UI or it's optional.
 By default IRs can be linked to many incident and
 it's not required to link them right away.
 Investigations can be linked only to one incident
-and it can be done later. Blocks can not be created
+and it can be done later. Countermeasures can not be created
 without incident, however can be linked to many of
 them.
 
@@ -270,7 +270,7 @@ Set(%RTIR_IncidentChildren,
         Multiple => 0,
         Required => 0,
     },
-    Block => {
+    Countermeasure => {
         Multiple => 1,
         Required => 1,
     },
@@ -595,13 +595,13 @@ Set(%CustomFieldGroupings,
 
 =back
 
-=head1 Blocks
+=head1 Countermeasures
 
 =over 4
 
 =item C<$RTIR_DisableBlocksQueue>
 
-If true then Blocks queue functionality inactive and disabled.
+If true then Countermeasure queue functionality inactive and disabled.
 
 =cut
 

commit f09061f32d5fa5a3bdbc067f06d98c5b1db168c9
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Wed Feb 24 23:59:58 2016 +0000

    Rename RTIR_DisableBlocksQueue to RTIR_DisableCountermeasures

diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index 0858b64..358b378 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -22,7 +22,7 @@ your custom configuration values there.
 You may disable the Blocks queue by putting the following into your
 F<RTIR_SiteConfig.pm> config:
 
-    Set($RTIR_DisableBlocksQueue, 1);
+    Set($RTIR_DisableCountermeasures, 1);
 
 You will probably also want to disable the Queue using the RT
 Administrative interface.  Tools -> Configuration -> Queues -> Blocks,
diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 55eda07..33351a2 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -599,13 +599,13 @@ Set(%CustomFieldGroupings,
 
 =over 4
 
-=item C<$RTIR_DisableBlocksQueue>
+=item C<$RTIR_DisableCountermeasures>
 
 If true then Countermeasure queue functionality inactive and disabled.
 
 =cut
 
-Set($RTIR_DisableBlocksQueue, 0);
+Set($RTIR_DisableCountermeasures, 0);
 
 =item C<$RTIR_BlockAproveActionRegexp>
 
diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index daf9553..1ab36f5 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -104,7 +104,7 @@ my %actions;
         my $escaped_host = $escaper->($args{host});
         my $result .= qq{<a class="button" href="}. RT::IR->HREFTo("Tools/Lookup.html?".$args{lookup_params}."type=ip&q=".$escaped_host).qq{">}
                       .loc('Lookup IP') .q{</a>};
-        if ( $args{incident} && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+        if ( $args{incident} && !RT->Config->Get('RTIR_DisableCountermeasures') ) {
             $result .= qq{<a class="button" href="} .
             RT::IR->HREFTo("Create.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
             .qq{">block</a>};
diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 94ad101..2672ec2 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -126,7 +126,7 @@ $root->child(
     launch => title => loc('Launch'),
     path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
 );
-unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
     $root->child(
         blocks => title => loc('Countermeasures'),
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index cf69421..dbc0412 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -378,7 +378,7 @@ my $ticket = RT::Ticket->new($session{'CurrentUser'}); # empty ticket object
 
 
 if (RT::IR->IsCountermeasureQueue($QueueObj) 
-    && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+    && RT->Config->Get('RTIR_DisableCountermeasures') ) {
     Abort(loc("Countermeasure queues are disabled via config file"));
 }
 
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 0f36dbd..fdf26f4 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -186,7 +186,7 @@ RT::Interface::Web::Redirect(RT->Config->Get('WebURL')
     . 'Ticket/Display.html?'
     . $m->comp('/Elements/QueryString', %ARGS )) unless $Type;
 
-if (RT::IR->IsCountermeasureQueue($QueueObj) && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+if (RT::IR->IsCountermeasureQueue($QueueObj) && RT->Config->Get('RTIR_DisableCountermeasures') ) {
     Abort(loc("Countermeasure queues are disabled via config file"));
     }
 
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index e0735cb..c75d0b1 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -174,7 +174,7 @@ RT::Interface::Web::Redirect(RT->Config->Get('WebURL').'Ticket/Display.html?'.
     $m->comp('/Elements/QueryString', %ARGS )) unless $Type;
 
 if (RT::IR->IsCountermeasureQueue($Ticket->QueueObj)
-    && RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+    && RT->Config->Get('RTIR_DisableCountermeasures') ) {
     Abort(loc("Countermeasure queues are disabled via config file"));
 }
 
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index 6402c72..7e23ab4 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -82,7 +82,7 @@ $Rows  => 8
 <%INIT>
 
 
-return if $Lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get('RTIR_DisableBlocksQueue');
+return if $Lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get('RTIR_DisableCountermeasures');
 
 
 my $FriendlyLifecycle = RT::IR::FriendlyLifecycle($Lifecycle);
diff --git a/html/RTIR/Incident/Reply/Refine.html b/html/RTIR/Incident/Reply/Refine.html
index 0c458dd..e5b8590 100644
--- a/html/RTIR/Incident/Reply/Refine.html
+++ b/html/RTIR/Incident/Reply/Refine.html
@@ -48,7 +48,7 @@
 <%INIT>
 my @lifecycles = (RT::IR->lifecycle_report);
 push @lifecycles, RT::IR->lifecycle_investigation if $ARGS{'All'};
-push @lifecycles, RT::IR->lifecycle_countermeasure if $ARGS{'All'} && !RT->Config->Get('RTIR_DisableBlocksQueue');
+push @lifecycles, RT::IR->lifecycle_countermeasure if $ARGS{'All'} && !RT->Config->Get('RTIR_DisableCountermeasures');
 
 return $m->comp(
     '/RTIR/Search/Elements/RefinePage',
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index e92d7db..cec521e 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -91,7 +91,7 @@
     OrderBy       => $OrderBy,
     Order         => $Order,
 &>
-% unless( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+% unless( RT->Config->Get('RTIR_DisableCountermeasures') ) {
 <h2><&|/l&>Countermeasure Correspondents</&></h2>
 <& /RTIR/Search/Elements/ShowResults,
     BaseURL       => $BaseURL,
@@ -242,7 +242,7 @@ if ($Status eq 'resolved') {
 
 my @lifecycles = (RT::IR->lifecycle_report);
 push @lifecycles, RT::IR->lifecycle_investigation if $All;
-push @lifecycles, RT::IR->lifecycle_countermeasure unless RT->Config->Get('RTIR_DisableBlocksQueue');
+push @lifecycles, RT::IR->lifecycle_countermeasure unless RT->Config->Get('RTIR_DisableCountermeasures');
 
 $Query ||= RT::IR->ActiveQuery( Lifecycle => \@lifecycles );
 
diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index b485ec7..63ea242 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -60,7 +60,7 @@
 
 </td><td width="50%" valign="top">
 
-% unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+% unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
 <& LookupSummary, %ARGS, Lifecycle => RT::IR->lifecycle_countermeasure, Query => $query &>
 % }
 
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index 36a3418..33d2ff6 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -115,7 +115,7 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
                 Requestors => $q,
             )),
         };
-    } elsif ( $Lifecycle eq RT::IR->lifecycle_countermeasure && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+    } elsif ( $Lifecycle eq RT::IR->lifecycle_countermeasure && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableCountermeasures') ) {
         push @box_actions, {
             title => loc('Create'),
             path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
diff --git a/lib/RT/Action/RTIR_ResolveChildren.pm b/lib/RT/Action/RTIR_ResolveChildren.pm
index 29ef016..418346f 100644
--- a/lib/RT/Action/RTIR_ResolveChildren.pm
+++ b/lib/RT/Action/RTIR_ResolveChildren.pm
@@ -78,7 +78,7 @@ sub Commit {
     my $id = $incident->Id;
 
     foreach my $lifecycle ( RT::IR->lifecycle_report, RT::IR->lifecycle_investigation, RT::IR->lifecycle_countermeasure ) {
-        next if $lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get('RTIR_DisableBlocksQueue');
+        next if $lifecycle eq RT::IR->lifecycle_countermeasure && RT->Config->Get('RTIR_DisableCountermeasures');
 
         my $members = RT::IR->IncidentChildren(
             $incident, Lifecycle => $lifecycle,

commit d1478c85ac83d50803473faa68a10e8901d54388
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:00:40 2016 +0000

    Fix the tab name from blocks to countermeasures

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 2672ec2..5ba7222 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -128,7 +128,7 @@ $root->child(
 );
 unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
     $root->child(
-        blocks => title => loc('Countermeasures'),
+        countermeasures => title => loc('Countermeasures'),
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),

commit 60d0745465dfb635f45e12af67dd67f90693dd4a
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:03:00 2016 +0000

    Change blocks to countermeasures in comments and internal documentation

diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 33cc35a..461436f 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -203,7 +203,7 @@ my $DoLinks = sub {
         }
     }
 
-    # Blocks or Incedent Reports can have multiple incidents
+    # Countermeasure or Incident Reports can have multiple incidents
     my $Type = RT::IR::TicketType( Ticket => $child );
     my $config = RT->Config->Get('RTIR_IncidentChildren')->{$Type};
     unless( $config->{'Multiple'} ) {
diff --git a/lib/RT/Action/RTIR_ChangeChildOwnership.pm b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
index 9ce4b41..b24af09 100644
--- a/lib/RT/Action/RTIR_ChangeChildOwnership.pm
+++ b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
@@ -73,7 +73,7 @@ sub Commit {
         $action_cb = sub { return $_[0]->SetOwner( $transaction->NewValue ) }
     }
 
-    # change owner of child Incident Reports, Investigations, Blocks
+    # change owner of child Incident Reports, Investigations, Countermeasures
     my $query =  "(Lifecycle = '".RT::IR->lifecycle_report."'"
                 ." OR Lifecycle ='". RT::IR->lifecycle_investigation."'"
                 ." OR Lifecycle = '".RT::IR->lifecycle_countermeasure."'"
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index b95d5ce..991bc69 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -569,7 +569,7 @@ sub IncidentHasActiveChildren {
 =head2 IsLinkedToActiveIncidents $ChildObj [$IncidentObj]
 
 Returns number of active incidents linked to child ticket
-(IR, Investigation, Block or other). If second argument provided
+(IR, Investigation, Countermeasure or other). If second argument provided
 then it's excluded from count.
 
 When function return zero that means that object has no active
@@ -774,7 +774,7 @@ sub FilterRTAddresses {
     return $found;
 }
 
-# Skip the global AutoOpen and AutoOpenInactive scrip on Blocks and Incident Reports
+# Skip the global AutoOpen and AutoOpenInactive scrip on Countermeasures and Incident Reports
 # This points to RTIR wanting to muck with the global scrips using the 4.2 scrips
 # organization, although it possibly messes with Admins expectations of 'contained Queues'
 # We have to hit both because the first is installed on upgraded RTs while the latter is
diff --git a/t/constituency/basics.t b/t/constituency/basics.t
index 38a57e2..1d8f697 100644
--- a/t/constituency/basics.t
+++ b/t/constituency/basics.t
@@ -65,7 +65,7 @@ diag "check that there is no option to set 'no value' on create" if $ENV{'TEST_V
 
 diag "create a ticket via web and set field" if $ENV{'TEST_VERBOSE'};
 {
-    # we skip blocks here, as they are always connected to
+    # we skip countermeasures here, as they are always connected to
     # an incident and constituency inheritance comes into game
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
diff --git a/t/constituency/propagation-inherit.t b/t/constituency/propagation-inherit.t
index da3f8ff..c82a6fc 100644
--- a/t/constituency/propagation-inherit.t
+++ b/t/constituency/propagation-inherit.t
@@ -224,7 +224,7 @@ diag "check that constituency propagates from a child to a parent after 'Edit',
 diag "check that constituency propagates from a child to a parent after 'Edit', and back"
     if $ENV{'TEST_VERBOSE'};
 {
-    # can not test this for blocks as those require incident on create
+    # can not test this for countermeasures as those require incident on create
     foreach my $queue( 'Incident Reports', 'Investigations' ) {
         diag "create an incident for linking" if $ENV{'TEST_VERBOSE'};
 
diff --git a/t/constituency/propagation-reject.t b/t/constituency/propagation-reject.t
index c468ee4..08c5b06 100644
--- a/t/constituency/propagation-reject.t
+++ b/t/constituency/propagation-reject.t
@@ -222,7 +222,7 @@ diag "create an IR create an Incident with different constituency"
 diag "check that we can change constituency of an unlinked ticket using 'Edit' page"
     if $ENV{'TEST_VERBOSE'};
 {
-    # blocks are always linked to an incident
+    # countermeasures are always linked to an incident
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations' ) {
         my $id = $agent->create_rtir_ticket_ok(
             $queue .' - GOVNET',
diff --git a/t/custom-fields/on-transactions.t b/t/custom-fields/on-transactions.t
index 3e8dd31..b05bb13 100644
--- a/t/custom-fields/on-transactions.t
+++ b/t/custom-fields/on-transactions.t
@@ -49,7 +49,7 @@ foreach my $qname ('Incident Reports', 'Investigations', 'Countermeasures') {
     my $input = $form->find_input( $input_name );
     ok $input, 'input for the field is on the page';
 
-    $agent->field( Incident => $inc_id ); # for blocks
+    $agent->field( Incident => $inc_id ); # for countermeasures
     $agent->field( Requestors => 'rt-test at example.com' ); # for invs
     $agent->field( $input_name => 'magic' );
     $agent->click('Create');

commit a512a216db42a29665ff8e7b0833bcb2f40daef9
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:04:17 2016 +0000

    Fix references to Blocks in README

diff --git a/README b/README
index 53f9b9c..630af89 100644
--- a/README
+++ b/README
@@ -60,8 +60,8 @@ Installation instructions:
 Additional Extensions:
 ----------------------
 
-o  To maintain Due date for Reports, Investigations and Blocks, install
-   RT::Extension::SLA following the installation instructions in that
+o  To maintain Due date for Reports, Investigations and Countermeasures,
+   install RT::Extension::SLA following the installation instructions in that
    extension's README file.
 
 Configuring RTIR
@@ -69,11 +69,12 @@ Configuring RTIR
 
 1) Using RT's configuration interface, add the email address
    of the Network Operations Team (the people who will handle
-   activating and removing Blocks) as AdminCC on the Blocks queue.
-   RT -> Queues -> Blocks -> Watchers
+   activating and removing network blocks) as AdminCC on the
+   Countermeasures queue.
+   RT -> Queues -> Countermeasures -> Watchers
 
 2) You may want to modify the email messages that are automatically
-   sent on the creation of Investigations and Blocks.
+   sent on the creation of Investigations and Countermeasures.
    RT -> Queues -> <Select RTIR's Queue> -> Templates.
    RT -> Global -> Templates.
 

commit 835c5399cce44c94b3084ac6e0cc708cc005e663
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:12:06 2016 +0000

    Update documentation to refer to Countermeasures not Blocks

diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index 358b378..dc09b88 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -17,21 +17,21 @@ To change a configuration value, copy the Set code from F<RT_Config.pm>
 or F<RTIR_Config.pm> and add it to the relevant Site Config. Then set
 your custom configuration values there.
 
-=head2 Blocks Queue
+=head2 Countermeasures Queue
 
-You may disable the Blocks queue by putting the following into your
+You may disable the Countermeasures queue by putting the following into your
 F<RTIR_SiteConfig.pm> config:
 
     Set($RTIR_DisableCountermeasures, 1);
 
 You will probably also want to disable the Queue using the RT
-Administrative interface.  Tools -> Configuration -> Queues -> Blocks,
+Administrative interface.  Tools -> Configuration -> Queues -> Countermeasures,
 uncheck Enabled and click Save Changes.
 
 =head2 Status
 
-The various states an incident, IR, investigation, or block can be in, such as
-'open', 'stalled', 'abandoned', etc.
+The various states an incident, IR, investigation, or countermeasure can be in,
+such as 'open', 'stalled', 'abandoned', etc.
 
 This field contains custom statuses for tickets, and values are different in
 different queues. The status values are set via the C<%Lifecycles> option in
@@ -54,7 +54,7 @@ but other fields can be.
 
 =item Constituency
 
-The constituency of an incident, IR, investigation, or block.
+The constituency of an incident, IR, investigation, or countermeasure.
 
 Additional quite heavy automation is tied to this field. This
 is described in L<Constituencies> doc. Don't rename this field
@@ -87,7 +87,7 @@ or external individual.
 
 =item IP
 
-IP addresses related to the incident, IR, investigation, or block.
+IP addresses related to the incident, IR, investigation, or countermeasure.
 
 Don't rename this custom field or it will lose all associated features.
 It's possible to change this CF from multiple values to single value.
@@ -98,15 +98,15 @@ See also L</SetIPFromContent> below.
 
 =item Netmask
 
-Network mask for a Block.
+Network mask for a block countermeasure.
 
 =item Port
 
-Port for a Block.
+Port for a network block.
 
 =item Where Blocked
 
-Where the block is placed.
+Where the network block is placed.
 
 =item Customer
 
@@ -181,12 +181,12 @@ Applies to the Incident Reports queue.
 On ticket creation, sets the HowReported custom field to a default
 value of Email if it isn't otherwise specified.
 
-=item On Correspond Change Status of the Block
+=item On Correspond Change Status of the Countermeasure
 
-On replies, changes the status of blocks according to a few rules
+On replies, changes the status of countermeasures according to a few rules
 that are described in L<RT::Action::RTIR_SetBlockStatus/DESCRIPTION>.
 
-RT's default L<RT::Action::AutoOpen> is disabled for blocks to
+RT's default L<RT::Action::AutoOpen> is disabled for countermeasures to
 avoid unwanted changes of status from 'pending activation'
 to 'active'.
 
@@ -223,10 +223,10 @@ not copied down to Children).
 
 Applies to the Incidents queue.
 
-If an incident is changed to an inactive status,
-looks for linked tickets in the Incident Reports, Investigations or Blocks
-queues and resolves them.  If any of these linked tickets are linked
-to other ongoing incidents, a comment is added and they remain unresolved.
+If an incident is changed to an inactive status, looks for linked tickets in
+the Incident Reports, Investigations or Countermeasures queues and resolves
+them.  If any of these linked tickets are linked to other ongoing incidents, a
+comment is added and they remain unresolved.
 
 =item FixOwnership
 
@@ -235,14 +235,14 @@ Applies to the Incidents queue.
 When the Owner of an incident is changed, the Owner of linked children
 tickets are changed to the same owner.
 
-Applies to the Incident Reports, Blocks and Investigations queues.
+Applies to the Incident Reports, Countermeasures and Investigations queues.
 
 When the Owner of a ticket in these queues is changed, that change
 is also applied to the linked incident.
 
 =item ReopenIncident
 
-Applies to the Incident Reports, Blocks and Investigations queues.
+Applies to the Incident Reports, Countermeasures and Investigations queues.
 
 If the status of a ticket in these queues is changed from rejected or
 resolved, the linked parent incident ticket status is set to open.
@@ -260,15 +260,16 @@ F<RTIR_Config.pm>.
 
 =item NotifyOnClose
 
-Applies to the Blocks queue.
+Applies to the Countermeasures queue.
 
-When a block ticket is moved from an active status to an inactive
-status (closed), the requestors on the block are notified using the
-L<Templates/BlockRemoved in Blocks queue> template.
+When a countermeasure ticket is moved from an active status to an inactive
+status (closed), the requestors on the countermeasure are notified using the
+L<Templates/BlockRemoved in Countermeasure queue> template.
 
 =item SetIPFromContent
 
-Applies to the Incident Reports, Blocks, Incidents and Investigations queues.
+Applies to the Incident Reports, Countermeasures, Incidents and Investigations
+queues.
 
 Updates the ticket custom field IP to have a list of all IPs and IP ranges
 found in the body of the ticket during Create and Correspond.
@@ -280,7 +281,7 @@ It's OK to disable this scrip.
 
 =item SetConstituency
 
-Applies to the Incident Reports, Blocks, Incidents and Investigations queues.
+Applies to the Incident Reports, Countermeasures, Incidents and Investigations queues.
 
 Uses the Constituency algorithms discussed in F<docs/Constituencies.pod> to
 set and propagate changes to the Constituency custom field.  On ticket
@@ -294,7 +295,7 @@ _RTIR_Constituency_Propagation in your F<RTIR_Config.pm>
 
 =item SetConstituencyGroup
 
-Applies to the Incident Reports, Blocks, Incidents and Investigations queues.
+Applies to the Incident Reports, Countermeasures, Incidents and Investigations queues.
 
 When tickets are created, or the Constituency custom field is updated,
 this scrip manages the assignment of DutyTeam groups as AdminCcs.
@@ -309,13 +310,13 @@ how to use these groups.
 
 =over 4
 
-=item Autoreply in Blocks queue
+=item Autoreply in Countermeasures queue
 
-This template is sent when a block is created.
+This template is sent when a countermeasure is created.
 
-=item BlockRemoved in Blocks queue
+=item BlockRemoved in Countermeasure queue
 
-This template is sent when a block is removed.
+This template is sent when a countermeasure is removed.
 
 =item Autoreply in Investigations queue
 
diff --git a/docs/Constituencies.pod b/docs/Constituencies.pod
index 3cb2650..8004ba2 100644
--- a/docs/Constituencies.pod
+++ b/docs/Constituencies.pod
@@ -48,7 +48,7 @@ Its correspondence email address.
 =item *
 
 Its queues--typically a set with one each of Incident Reports,
-Incidents, Investigations, and Blocks--each with the same
+Incidents, Investigations, and Countermeasures--each with the same
 RTIR Constituency value defined.
 
 =item *
@@ -70,7 +70,7 @@ creates tickets.
 
 =item *
 
-Any new incidents created from incident reports, or blocks and
+Any new incidents created from incident reports, or countermeasures and
 investigations created from incidents, inherit the constituency
 from the launching ticket.
 
@@ -132,7 +132,7 @@ the constituency 'EDUNET':
 
 =item * Queue 'Inestigations - EDUNET'
 
-=item * Queue 'Blocks - EDUNET'
+=item * Queue 'Countermeasures - EDUNET'
 
 =item * Group 'DutyTeam EDUNET'
 
@@ -256,7 +256,7 @@ the EDUNET constituency on the Incidents queue, for example).
 
 For example, assume you have two constituencies "EDUNET" and "GOVNET".
 Your RTIR instance consists of four queues for each constituency: Incident Reports - EDUNET,
-Incidents - EDUNET, Investigations - EDUNET and Blocks - EDUNET. To grant the user Edward
+Incidents - EDUNET, Investigations - EDUNET and Countermeasures - EDUNET. To grant the user Edward
 the right to work with EDUNET Incident Reports, make Edward an
 AdminCc of the new queue, either directly or as a member of a group
 like "DutyTeam EDUNET".
diff --git a/docs/DocIndex.pod b/docs/DocIndex.pod
index 06fb11a..c776f71 100644
--- a/docs/DocIndex.pod
+++ b/docs/DocIndex.pod
@@ -23,9 +23,9 @@ Mailgate help: rt/bin/rt-mailgate --help
 
 See L<RT::Crypt::GnuPG> and L<AdministrationTutorial/GnuPG Encryption>
 
-=head3 Create new block via web-interface
+=head3 Create new countermeasure via web-interface
 
-L<Tutorial/Creating a Block>
+L<Tutorial/Creating a Countermeasure>
 
 =head2 Managing Incident Responses
 
@@ -75,11 +75,11 @@ L<Tutorial/Linking Incidents to IRs, Investigations, etc.>
 
 L<Tutorial/Linking Incidents to IRs, Investigations, etc.>
 
-=head2 Link Incident with new Block
+=head2 Link Incident with new Countermeasure
 
 L<Tutorial/Linking Incidents to IRs, Investigations, etc.>
 
-=head2 Link Incident with existing Block
+=head2 Link Incident with existing Countermeasure
 
 L<Tutorial/Linking Incidents to IRs, Investigations, etc.>
 
@@ -111,19 +111,19 @@ L<Tutorial/Linking Incidents to IRs, Investigations, etc.>
 
 L<Tutorial/Correspond with Correspondent>
 
-=head2 Remove Blocks
+=head2 Remove Countermeasures
 
-L<Tutorial/Blocks>
+L<Tutorial/Countermeasures>
 
-=head2 Activate Blocks
+=head2 Activate Countermeasures
 
-L<Tutorial/Blocks>
+L<Tutorial/Countermeasures>
 
-=head2 Split Blocks, Split Investigation, Split Incident
+=head2 Split Countermeasures, Split Investigation, Split Incident
 
 L<Tutorial/Merging Tickets>
 
-=head2 Merge Blocks, Split Investigation, Split Incident
+=head2 Merge Countermeasures, Split Investigation, Split Incident
 
 L<Tutorial/Merging Tickets>
 
@@ -137,9 +137,9 @@ L<Tutorial/Merging Tickets>
 
 =item Reopen Incident
 
-=item Comment Blocks via web-interface
+=item Comment Countermeasures via web-interface
 
-=item Steal Blocks
+=item Steal Countermeasures
 
 =item Reply IR via web-interface
 
@@ -147,7 +147,7 @@ L<Tutorial/Merging Tickets>
 
 =item Reply from correspondent on Investigation via e-mail
 
-=item Reply from correspondent on Blocks via e-mail
+=item Reply from correspondent on Countermeasures via e-mail
 
 =item Comment on Investigation via web-interface
 
diff --git a/docs/Tutorial.pod b/docs/Tutorial.pod
index 1eddadd..1d50084 100644
--- a/docs/Tutorial.pod
+++ b/docs/Tutorial.pod
@@ -3,7 +3,7 @@
 =head2 Incident Response Workflow
 
 RTIR automatically creates four RT queues for tracking incidents: Incident
-Reports, Incidents, Investigations and Blocks.
+Reports, Incidents, Investigations and Countermeasures.
 
 =head3 Incident Reports
 
@@ -27,13 +27,14 @@ asking them to look into and/or fix a problem. Once again, relevant
 information from the Incident is filled in when you create the new
 Investigation, so there's no need to cut-and-paste.
 
-=head3 Blocks
+=head3 Countermeasures
 
-Blocks are used to track any blocks placed on the borders of the network. You
-can create them from an existing Incident. Some sites don't require blocks, so
-they may be disabled by your Administrator. Blocks have several states: pending
-activation, active, pending removal, removed. These states can be set from
-sub-menu items on ticket display pages.
+Countermeasures are used to track any blocks placed on the borders of the
+network. You can create them from an existing Incident. Some sites don't
+require countermeasures, so they may be disabled by your Administrator.
+Countermeasures have several states: pending activation, active, pending
+removal, removed. These states can be set from sub-menu items on ticket display
+pages.
 
 =head2 Operations with Tickets
 
@@ -187,7 +188,7 @@ IRs owned by others will be skipped with a warning even if you selected them.
 
 This operation is quite similar to rejecting an IR, but when you're
 abandoning an Incident you also reject IRs, resolve Investigations and
-remove Blocks linked to it.
+remove Countermeasures linked to it.
 
 Once you open the Abandon page under the Incidents tab you see a list of its
 children grouped by queue. You can select children with checkboxes and only
@@ -262,10 +263,9 @@ their name.
 
 =head4 Reply to All
 
-This operation lets you send a message to all of the parties who created
-IRs, those involved in the Investigation, and those involved in the
-Blocks. You may exclude individual recipients by removing the check next
-to their name.
+This operation lets you send a message to all of the parties who created IRs,
+those involved in the Investigation, and those involved in the Countermeasures.
+You may exclude individual recipients by removing the check next to their name.
 
 =head4 Correspond with Correspondent
 
@@ -287,8 +287,8 @@ and link them to the IR by clicking the "[New]" button next to the
 =head4 Linking Incidents to IRs, Investigations, etc.
 
 You may link Incidents with existing Incident Reports, Investigations,
-Blocks, and Articles. On the Incident display page there are sections for
-each of these, each with a C<Link> button and the list of already-linked
+Countermeasures, and Articles. On the Incident display page there are sections
+for each of these, each with a C<Link> button and the list of already-linked
 tickets. Clicking on C<Link> lets you link one or more tickets of that type to
 the Incident.
 
@@ -327,12 +327,12 @@ attach files, etc.
 To launch a new Investigation, create a new ticket in the Investigations queue.
 You will be required to provide one or more correspondents.
 
-=head3 Blocks
+=head3 Countermeasures
 
-=head4 Creating a Block
+=head4 Creating a Countermeasure
 
-To create a new Block, create a new ticket in the Blocks queue. You will be
-required to link the Block to an Incident.
+To create a new Countermeasure, create a new ticket in the Countermeasures
+queue. You will be required to link the Countermeasure to an Incident.
 
 =head2 Managing 'RT at glance' and 'RTIR at a glance' Pages
 
@@ -402,12 +402,12 @@ An active ticket in RTIR is a ticket with a status that indicates work will
 still be done on it. RTIR uses this to determine what tickets should be shown
 by default in various searches and pages in the user interface.
 
-The available active statuses are defined as part of the
-RTIR configuration and differ for each queue (see C<%Lifecycles> in
-F<RTIR_Config.pm> and F<RT_Config.pm> for more information). Active tickets
-in the incidents queue, for example, are those with a status of C<open>. In
-the blocks queue, tickets can be C<active> or C<pending removal>. These values
-are configurable and may be different on your system.
+The available active statuses are defined as part of the RTIR configuration and
+differ for each queue (see C<%Lifecycles> in F<RTIR_Config.pm> and
+F<RT_Config.pm> for more information). Active tickets in the incidents queue,
+for example, are those with a status of C<open>. In the Countermeasures queue,
+tickets can be C<active> or C<pending removal>. These values are configurable
+and may be different on your system.
 
 =item inactive ticket
 
@@ -415,12 +415,12 @@ An inactive ticket in RTIR is a ticket with a status that indicates work on it
 is complete. RTIR uses this to filter tickets out of various searches and pages
 in the user interface, although the tickets can still be found with searches.
 
-Inactive statuses are defined as part of the
-RTIR configuration and differ for each queue (see C<%Lifecycles> in
-F<RTIR_Config.pm> and F<RT_Config.pm> for more information). Inactive tickets
-in the incidents queue, for example, can be C<resolved> or C<abandoned>. In
-the blocks queue, tickets can have a status of C<removed>. These values
-are configurable and may be different on your system.
+Inactive statuses are defined as part of the RTIR configuration and differ for
+each queue (see C<%Lifecycles> in F<RTIR_Config.pm> and F<RT_Config.pm> for
+more information). Inactive tickets in the incidents queue, for example, can be
+C<resolved> or C<abandoned>. In the Countermeasures queue, tickets can have a
+status of C<removed>. These values are configurable and may be different on
+your system.
 
 =back
 

commit 87b40a0a382841d1de2674a4e8b22eaaf9e31f3f
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:20:33 2016 +0000

    Fix some CSS class names to match 3.4 spelling

diff --git a/static/css/rtir-styles.css b/static/css/rtir-styles.css
index 7c38acb..7e28e81 100644
--- a/static/css/rtir-styles.css
+++ b/static/css/rtir-styles.css
@@ -69,10 +69,10 @@ body.rtir #topactions { min-width: 44em; white-space: no-wrap; }
 }
 
 body.rtir .titlebox.ticket-info-articles            .titlebox-title .left { background-color: #316531; color: #fff; }
-body.rtir .titlebox.tickets-list-incident_reports   .titlebox-title .left { background-color: #316531; color: #fff; }
-body.rtir .titlebox.tickets-list-incidents          .titlebox-title .left { background-color: #316531; color: #fff; }
-body.rtir .titlebox.tickets-list-investigations     .titlebox-title .left { background-color: #316531; color: #fff; }
-body.rtir .titlebox.tickets-list-blocks             .titlebox-title .left { background-color: #316531; color: #fff; }
+body.rtir .titlebox.tickets-list-report             .titlebox-title .left { background-color: #316531; color: #fff; }
+body.rtir .titlebox.tickets-list-incident           .titlebox-title .left { background-color: #316531; color: #fff; }
+body.rtir .titlebox.tickets-list-investigation      .titlebox-title .left { background-color: #316531; color: #fff; }
+body.rtir .titlebox.tickets-list-countermeasure     .titlebox-title .left { background-color: #316531; color: #fff; }
 
 
 body.rtir #comp-RTIR-Search #body {

commit fdc75b4eb5f49c12da28d30b53b7a9c714759e58
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:38:11 2016 +0000

    Fix stray references of blocks to be countermeasures

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 33351a2..edf3fd7 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -234,10 +234,10 @@ Set(
 =item C<%RTIR_IncidentChildren>
 
 Option controls relations between an incident and
-reports, investigations and blocks. Each entry
-of the hash is a pair where key is type of child
-and value is hash with Multiple and Required keys
-and boolean values, for example:
+reports, investigations and countermeasures. Each
+entry of the hash is a pair where key is type of
+child and value is hash with Multiple and Required
+keys and boolean values, for example:
 
     Set(%RTIR_IncidentChildren,
         Report => {
diff --git a/lib/RT/Action/RTIR_SetBlockStatus.pm b/lib/RT/Action/RTIR_SetBlockStatus.pm
index 7be5a18..7484384 100644
--- a/lib/RT/Action/RTIR_SetBlockStatus.pm
+++ b/lib/RT/Action/RTIR_SetBlockStatus.pm
@@ -65,9 +65,9 @@ option. Content of the transaction should match the regexp
 if it's defined. Statuses are hardcoded and can not be
 changed or this will not work properly.
 
-If block is in an inactive status (by default 'removed')
+If countermeasure is in an inactive status (by default 'removed')
 then status changed to first possible active status
-for blocks' lifecycle (by default 'active').
+for countermeasures's lifecycle (by default 'active').
 
 In all other cases status left unchanged.
 
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 991bc69..4cf8fdb 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -335,8 +335,8 @@ lifecycles.
 Examples:
 
     RT::IR->Statuses()
-    RT::IR->Statuses( Lifecycle => 'blocks' );
-    RT::IR->Statuses( Lifecycle => [ 'blocks', 'incident_reports' ] );
+    RT::IR->Statuses( Lifecycle => 'countermeasures' );
+    RT::IR->Statuses( Lifecycle => [ 'countermeasures', 'incident_reports' ] );
     RT::IR->Statuses( Active => 0, Inactive => 1 );
 
 =cut
diff --git a/t/constituency/email.t b/t/constituency/email.t
index 14135eb..1d20933 100644
--- a/t/constituency/email.t
+++ b/t/constituency/email.t
@@ -91,7 +91,7 @@ diag "create a ticket via gate using Extension header" if $ENV{'TEST_VERBOSE'};
     my $val = (grep lc($_) ne lc($default), @values)[0];
     ok $val, 'find not default value';
 
-    my $incident_id; # block couldn't be created without incident id
+    my $incident_id; # countermeasure can't be created without incident id
     foreach my $queue( 'Incidents', 'Incident Reports', 'Investigations', 'Countermeasures' ) {
         diag "create a ticket in the '$queue' queue" if $ENV{'TEST_VERBOSE'};
 

commit ce554cf0c4965fad99ae741474c08cf95b55f5dd
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:39:50 2016 +0000

    Fix uses of block with countermeasure in t/searches/menu.t

diff --git a/t/searches/menu.t b/t/searches/menu.t
index b2e0ef3..8605553 100644
--- a/t/searches/menu.t
+++ b/t/searches/menu.t
@@ -9,7 +9,7 @@ my $m = default_agent();
 my %ticket;
 
 for my $subject (qw/foo bar baz/) {
-    for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
+    for my $type ( 'incident', 'ir', 'investigation', 'countermeasure' ) {
         my $create_sub = "create_$type";
         push @{ $ticket{$type} },
             $m->$create_sub(
@@ -22,7 +22,7 @@ for my $subject (qw/foo bar baz/) {
 }
 
 # Merge
-for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
+for my $type ( 'incident', 'ir', 'investigation', 'countermeasure' ) {
     $m->display_ticket( $ticket{$type}[0] );
     $m->follow_link_ok( { text => 'Merge' } );
     $m->title_like(qr/Merge .+ #$ticket{$type}[0]:/);
@@ -148,7 +148,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
     ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{ir}[0]$} ),
         "found link to incident report $ticket{ir}[0]" );
 
-    for my $type (qw/investigation block/) {
+    for my $type (qw/investigation countermeasure/) {
         ok( !$m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
             "didn't find link to $type $ticket{$type}[0]" );
     }
@@ -176,7 +176,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
         "didn't find link to incident report $ticket{ir}[0]"
     );
 
-    for my $type (qw/investigation block/) {
+    for my $type (qw/investigation countermeasure/) {
         ok( !$m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
             "didn't find link to $type $ticket{$type}[0]" );
     }
@@ -188,7 +188,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
     $m->follow_link_ok( { text => 'Reply to All' } );
     $m->title_like(qr/#$ticket{incident}[0]: Reply to All/);
 
-    for my $type (qw/ir investigation block/) {
+    for my $type (qw/ir investigation countermeasure/) {
         ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
             "found link to $type $ticket{$type}[0]" );
     }
@@ -200,7 +200,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
     is( $checkbox->value, $ticket{investigation}[0], '$ticket{investigation}[0] is checked' );
 
     ($checkbox) = $m->find_all_inputs( name => 'SelectedCountermeasures' );
-    is( $checkbox->value, $ticket{block}[0], '$ticket{block}[0] is checked' );
+    is( $checkbox->value, $ticket{countermeasure}[0], '$ticket{countermeasure}[0] is checked' );
 
     $m->follow_link_ok( { text => "Edit Search", n => 2 } );
     $m->form_name('BuildQuery');
@@ -221,7 +221,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'block' ) {
         "didn't find link to incident report $ticket{ir}[0]"
     );
 
-    for my $type (qw/investigation block/) {
+    for my $type (qw/investigation countermeasure/) {
         ok( $m->find_link( url_regex => qr{/RTIR/Display.html\?id=$ticket{$type}[0]$} ),
             "found link to $type $ticket{$type}[0]" );
     }

commit bb8fa78f17b482b96cbd16f1ebf0cf38db03fd22
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:40:58 2016 +0000

    Fix test filenames to be countermeasure/ not block/

diff --git a/t/block/pending-no-regexp.t b/t/countermeasure/pending-no-regexp.t
similarity index 100%
rename from t/block/pending-no-regexp.t
rename to t/countermeasure/pending-no-regexp.t
diff --git a/t/block/pending-regexp.t b/t/countermeasure/pending-regexp.t
similarity index 100%
rename from t/block/pending-regexp.t
rename to t/countermeasure/pending-regexp.t
diff --git a/t/block/status-basics.t b/t/countermeasure/status-basics.t
similarity index 100%
rename from t/block/status-basics.t
rename to t/countermeasure/status-basics.t
diff --git a/t/block/status-editor-regression.t b/t/countermeasure/status-editor-regression.t
similarity index 100%
rename from t/block/status-editor-regression.t
rename to t/countermeasure/status-editor-regression.t

commit f108563c5cf1f650627511943f1bc00ae03aab42
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:43:50 2016 +0000

    Rename RTIR_SetBlockStatus to RTIR_SetCountermeasureStatus

diff --git a/MANIFEST b/MANIFEST
index 312cc3d..eb90953 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -179,7 +179,7 @@ lib/RT/Action/RTIR_FindIP.pm
 lib/RT/Action/RTIR_MergeIPs.pm
 lib/RT/Action/RTIR_OpenParent.pm
 lib/RT/Action/RTIR_ResolveChildren.pm
-lib/RT/Action/RTIR_SetBlockStatus.pm
+lib/RT/Action/RTIR_SetCountermeasureStatus.pm
 lib/RT/Action/RTIR_SetDueIncident.pm
 lib/RT/Action/RTIR_SetHowReported.pm
 lib/RT/Action/RTIR_SetIncidentResolution.pm
diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index dc09b88..8132c1a 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -184,7 +184,7 @@ value of Email if it isn't otherwise specified.
 =item On Correspond Change Status of the Countermeasure
 
 On replies, changes the status of countermeasures according to a few rules
-that are described in L<RT::Action::RTIR_SetBlockStatus/DESCRIPTION>.
+that are described in L<RT::Action::RTIR_SetCountermeasureStatus/DESCRIPTION>.
 
 RT's default L<RT::Action::AutoOpen> is disabled for countermeasures to
 avoid unwanted changes of status from 'pending activation'
diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index edf3fd7..8a53111 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -613,7 +613,7 @@ When requestor replies on the block in pending state RTIR
 changes state, you can set regular expresion so state would
 be changed only when content matches the regexp.
 
-See also L<RT::Action::RTIR_SetBlockStatus/DESCRIPTION>.
+See also L<RT::Action::RTIR_SetCountermeasureStatus/DESCRIPTION>.
 
 =cut
 
diff --git a/etc/initialdata b/etc/initialdata
index f8a677d..a03c0d5 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -181,9 +181,9 @@
         Description => 'Open the parent Incident when a child reopens',  # loc
         ExecModule  => 'RTIR_OpenParent',
     },
-    {   Name        => 'RTIR Set Block Status',                          # loc
-        Description => 'Set the status of a Block',                      # loc
-        ExecModule  => 'RTIR_SetBlockStatus',
+    {   Name        => 'RTIR Set Countermeasure Status',                 # loc
+        Description => 'Set the status of a Countermeasure',             # loc
+        ExecModule  => 'RTIR_SetCountermeasureStatus',
     },
     {   Name        => 'RTIR Set Incident Resolution',                   # loc
         Description => 'Set the default resolution of an Incident',      # loc
diff --git a/lib/RT/Action/RTIR_SetBlockStatus.pm b/lib/RT/Action/RTIR_SetCountermeasureStatus.pm
similarity index 96%
rename from lib/RT/Action/RTIR_SetBlockStatus.pm
rename to lib/RT/Action/RTIR_SetCountermeasureStatus.pm
index 7484384..5410602 100644
--- a/lib/RT/Action/RTIR_SetBlockStatus.pm
+++ b/lib/RT/Action/RTIR_SetCountermeasureStatus.pm
@@ -49,12 +49,12 @@
 use strict;
 use warnings;
 
-package RT::Action::RTIR_SetBlockStatus;
+package RT::Action::RTIR_SetCountermeasureStatus;
 use base 'RT::Action::RTIR';
 
 =head1 NAME
 
-RT::Action::RTIR_SetBlockStatus - sets status of the block acording to a few rules
+RT::Action::RTIR_SetCountermeasureStatus - sets status of the countermeasure according to a few rules
 
 =head1 DESCRIPTION
 

commit 0ac4c7a60349bffae83e3fd299f374f1377036cb
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:49:12 2016 +0000

    Rename $RTIR_BlockAproveActionRegexp to $RTIR_CountermeasureApproveActionRegexp

diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index 8132c1a..31b418a 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -190,7 +190,7 @@ RT's default L<RT::Action::AutoOpen> is disabled for countermeasures to
 avoid unwanted changes of status from 'pending activation'
 to 'active'.
 
-See also the C<$RTIR_BlockAproveActionRegexp> option
+See also the C<$RTIR_CountermeasureApproveActionRegexp> option
 in the config.
 
 =item On Linking To Incident Activate Report
diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 8a53111..85fa3bc 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -607,7 +607,7 @@ If true then Countermeasure queue functionality inactive and disabled.
 
 Set($RTIR_DisableCountermeasures, 0);
 
-=item C<$RTIR_BlockAproveActionRegexp>
+=item C<$RTIR_CountermeasureApproveActionRegexp>
 
 When requestor replies on the block in pending state RTIR
 changes state, you can set regular expresion so state would
@@ -617,7 +617,7 @@ See also L<RT::Action::RTIR_SetCountermeasureStatus/DESCRIPTION>.
 
 =cut
 
-Set($RTIR_BlockAproveActionRegexp, undef);
+Set($RTIR_CountermeasureApproveActionRegexp, undef);
 
 =back
 
diff --git a/lib/RT/Action/RTIR_SetCountermeasureStatus.pm b/lib/RT/Action/RTIR_SetCountermeasureStatus.pm
index 5410602..f1dc9ca 100644
--- a/lib/RT/Action/RTIR_SetCountermeasureStatus.pm
+++ b/lib/RT/Action/RTIR_SetCountermeasureStatus.pm
@@ -60,7 +60,7 @@ RT::Action::RTIR_SetCountermeasureStatus - sets status of the countermeasure acc
 
 If transaction is inbound and status is pending then
 change it to corresponding not pending status. This
-rule can be protected with C<$RTIR_BlockAproveActionRegexp>
+rule can be protected with C<$RTIR_CountermeasureApproveActionRegexp>
 option. Content of the transaction should match the regexp
 if it's defined. Statuses are hardcoded and can not be
 changed or this will not work properly.
@@ -89,7 +89,7 @@ sub Commit {
 
     my $current = lc $t->Status;
     if ( $current =~ /^pending / && $txn->IsInbound ) {
-        if ( my $re = RT->Config->Get('RTIR_BlockAproveActionRegexp') ) {
+        if ( my $re = RT->Config->Get('RTIR_CountermeasureApproveActionRegexp') ) {
             my $content = $txn->Content;
             return 1 if !$content || $content !~ /$re/;
         }
diff --git a/t/countermeasure/pending-no-regexp.t b/t/countermeasure/pending-no-regexp.t
index 56cb621..c08718d 100644
--- a/t/countermeasure/pending-no-regexp.t
+++ b/t/countermeasure/pending-no-regexp.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::IR::Test tests => undef;
 
-RT->Config->Set('RTIR_BlockAproveActionRegexp', undef);
+RT->Config->Set('RTIR_CountermeasureApproveActionRegexp', undef);
 
 RT::Test->started_ok;
 my $agent = default_agent();
diff --git a/t/countermeasure/pending-regexp.t b/t/countermeasure/pending-regexp.t
index 6f2a102..2c2b022 100644
--- a/t/countermeasure/pending-regexp.t
+++ b/t/countermeasure/pending-regexp.t
@@ -5,7 +5,7 @@ use warnings;
 
 use RT::IR::Test tests => undef;
 
-RT->Config->Set('RTIR_BlockAproveActionRegexp', qr/TestPendingBlock/);
+RT->Config->Set('RTIR_CountermeasureApproveActionRegexp', qr/TestPendingBlock/);
 
 RT::Test->started_ok;
 my $agent = default_agent();

commit cbad0541187aecd85635df0eae24d05cf0dbebc1
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:51:57 2016 +0000

    MANIFEST update for t/block -> t/countermeasure

diff --git a/MANIFEST b/MANIFEST
index eb90953..8426991 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -222,16 +222,16 @@ t/030-redirect-on-login.t
 t/articles/basics.t
 t/articles/on-create.t
 t/articles/on-update.t
-t/block/pending-no-regexp.t
-t/block/pending-regexp.t
-t/block/status-basics.t
-t/block/status-editor-regression.t
 t/constituency/basics.t
 t/constituency/email.t
 t/constituency/email_outgoing.t
 t/constituency/propagation-inherit.t
 t/constituency/propagation-no.t
 t/constituency/propagation-reject.t
+t/countermeasure/pending-no-regexp.t
+t/countermeasure/pending-regexp.t
+t/countermeasure/status-basics.t
+t/countermeasure/status-editor-regression.t
 t/custom-fields/defaults-config.t
 t/custom-fields/defaults-on-linking.t
 t/custom-fields/ip.t

commit 575bc451e65b40f2e64be65a03994e57f9d46c47
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:53:56 2016 +0000

    Rename BlockRemoved template to CountermeasureRemoved

diff --git a/docs/AdministrationTutorial.pod b/docs/AdministrationTutorial.pod
index 31b418a..74e874b 100644
--- a/docs/AdministrationTutorial.pod
+++ b/docs/AdministrationTutorial.pod
@@ -264,7 +264,7 @@ Applies to the Countermeasures queue.
 
 When a countermeasure ticket is moved from an active status to an inactive
 status (closed), the requestors on the countermeasure are notified using the
-L<Templates/BlockRemoved in Countermeasure queue> template.
+L<Templates/CountermeasureRemoved in Countermeasure queue> template.
 
 =item SetIPFromContent
 
@@ -314,7 +314,7 @@ how to use these groups.
 
 This template is sent when a countermeasure is created.
 
-=item BlockRemoved in Countermeasure queue
+=item CountermeasureRemoved in Countermeasure queue
 
 This template is sent when a countermeasure is removed.
 
diff --git a/etc/initialdata b/etc/initialdata
index a03c0d5..ab82d1f 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -342,7 +342,7 @@
         Queue          => 'Countermeasures',
         ScripCondition => 'RTIR Close Ticket',
         ScripAction    => 'Notify Requestors',
-        Template       => 'BlockRemoved'
+        Template       => 'CountermeasureRemoved'
     },
 
     {   Description => "SetIPFromContent",
@@ -409,11 +409,11 @@ you may reply to this message.
                         { $Ticket->QueueObj->CorrespondAddress }',
     },
     {   Queue       => 'Countermeasures',
-        Name        => 'BlockRemoved',
-        Description => 'Sent when a block is removed',
+        Name        => 'CountermeasureRemoved',
+        Description => 'Sent when a countermeasure is removed',
         Content     => 'Subject: {$Ticket->Subject}
 
-Block #{$Ticket->id} was removed.
+Countermeasure #{$Ticket->id} was removed.
 
 { my $output = "";
   my @mailfields = ( "IP", "Netmask", "Port", "Where Blocked" );

commit 78b96a11be5ec62198e9c664cd99c0e8d90f3408
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:54:45 2016 +0000

    Finish renaming "set block status" to countermeasure

diff --git a/etc/initialdata b/etc/initialdata
index ab82d1f..9596d32 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -265,10 +265,10 @@
         Template       => 'Blank'
     },
 
-    {   Description    => "On Correspond Change Status of the Block",
+    {   Description    => "On Correspond Change Status of the Countermeasure",
         Queue          => 'Countermeasures',
         ScripCondition => 'On Correspond',
-        ScripAction    => 'RTIR Set Block Status',
+        ScripAction    => 'RTIR Set Countermeasure Status',
         Template       => 'Blank',
     },
     {   Description    => "On Linking To Incident Activate Report",

commit ab2b15e5bbd31f0c2cd1c54a54937bb7e7831322
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:55:54 2016 +0000

    Rename EveryoneBlockRights to EveryoneCountermeasureRights

diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index d3757b4..7204f1d 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -303,7 +303,7 @@ sub grant_role_queue_rights {
             @rights = RT::IR->EveryoneInvestigationRights();
 
         } elsif ( $queue->Lifecycle eq RT::IR->lifecycle_countermeasure ) {
-            @rights = RT::IR->EveryoneBlockRights();
+            @rights = RT::IR->EveryoneCountermeasureRights();
         }
         # grant 'everyone' rights
         for my $right (@rights) {
diff --git a/etc/initialdata b/etc/initialdata
index 9596d32..ee34d03 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -529,7 +529,7 @@ push @ACL, map {
         Queue       => 'Countermeasures',
         Right       => $_
     }
-} RT::IR->EveryoneBlockRights();
+} RT::IR->EveryoneCountermeasureRights();
 
 push @ACL, (
     {   GroupId     => 'DutyTeam',      # - principalId
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 4cf8fdb..f43c90d 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -122,7 +122,7 @@ sub EveryoneIncidentRights {
     return ();
 }
 
-sub EveryoneBlockRights {
+sub EveryoneCountermeasureRights {
     return (qw(ReplyToTicket));
 }
 

commit 6cdb8d043e668b31e34dc5ca468cf48a9a1b9926
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Feb 25 00:57:33 2016 +0000

    Fix names of search result format keys to countermeasure

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 85fa3bc..37532e7 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -404,7 +404,7 @@ Set(%RTIRSearchResultFormats,
         q{Status,TimeLeft,DueRelative,CreatedRelative,__NEWLINE__,}.
         q{'',Requestors,QueueName,OwnerName,ToldRelative,LastUpdatedRelative },
 
-    BlockDefault =>
+    CountermeasureDefault =>
         q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',}.
         q{'<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',}.
         q{Status,TimeLeft,DueRelative,CreatedRelative,__NEWLINE__,}.
@@ -469,7 +469,7 @@ Set(%RTIRSearchResultFormats,
         q{'<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',}.
         q{Status,DueRelative},
 
-    ChildBlock =>
+    ChildCountermeasure =>
         q{'<b><a href="__RTIRTicketURI__">__id__</a></b>/TITLE:#',}.
         q{'<b><a href="__RTIRTicketURI__">__Subject__</a></b>/TITLE:Subject',}.
         q{Status,DueRelative},

commit 09c99042ad6c9f8503fdca76d8a1ed85fcc349f9
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu May 12 23:50:07 2016 +0000

    Upgrade old "blocks" lifecycles to countermeasures

diff --git a/etc/upgrade/3.3.0/content b/etc/upgrade/3.3.0/content
index 424956e..02eb690 100644
--- a/etc/upgrade/3.3.0/content
+++ b/etc/upgrade/3.3.0/content
@@ -50,6 +50,15 @@ our @Final = (
               for ( 'RTIR_RequireConstituencyChange', 'RTIR_RequireConstituencyGroupChange' );
         }
 
+        # rename blocks to countermeasures
+        {
+            my $queues = RT::Queues->new(RT->SystemUser);
+            $queues->Limit(FIELD => 'Lifecycle', VALUE => 'blocks');
+            while (my $queue = $queues->Next) {
+                $queue->SetLifecycle(RT::IR->lifecycle_countermeasure);
+            }
+        }
+
         # update values of rtir constituency
         my @constituencies;
         {
diff --git a/etc/upgrade/3.3.4/content b/etc/upgrade/3.3.4/content
index c45f25d..2009a08 100644
--- a/etc/upgrade/3.3.4/content
+++ b/etc/upgrade/3.3.4/content
@@ -18,7 +18,7 @@ our @Initial = (
             elsif ($name =~ /^Investigations - /) {
                 $lifecycle = RT::IR->lifecycle_investigation;
             }
-            elsif ($name =~ /^Blocks - /) {
+            elsif ($name =~ /^(Blocks|Countermeasures) - /) {
                 $lifecycle = RT::IR->lifecycle_countermeasure;
             }
             else {

commit f888baa471501c37892389f62ed920ed62bb7ab6
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri May 13 23:48:17 2016 +0000

    Bail out if unable to load the "base" queue in add_constituency
    
        Also adds a fallback for trying to load the queue named Blocks
        if the queue named Countermeasures is unavailable

diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index 7204f1d..81ca00b 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -473,7 +473,14 @@ sub create_or_load_queue {
 
     my $basequeue = RT::Queue->new( RT->SystemUser );
 
-    $basequeue->LoadByCols( Name => RT::IR::FriendlyLifecycle($lifecycle) );
+    my $basequeue_name = RT::IR::FriendlyLifecycle($lifecycle);
+    my ($ok, $msg) = $basequeue->LoadByCols( Name => $basequeue_name );
+
+    # support old name for Countermeasures
+    ($ok, $msg) = $basequeue->LoadByCols( Name => 'Blocks' )
+        if !$ok && $basequeue_name eq 'Countermeasures';
+
+    die "Unable to load queue named '$basequeue_name': $msg" if !$ok;
 
     my $queue = RT::Queue->new($RT::SystemUser);
     $queue->LoadByCols( Name => $name );

commit 34f7966e171c9bd9cde1e6c2604fb71c7ac41887
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Sat May 14 00:01:55 2016 +0000

    Load base lifecycle queue by finding the queue with lowest ID

diff --git a/bin/add_constituency.in b/bin/add_constituency.in
index 81ca00b..ec71307 100755
--- a/bin/add_constituency.in
+++ b/bin/add_constituency.in
@@ -146,8 +146,6 @@ unless ( defined $constituency && length $constituency ) {
 
 my @lifecycles = RT::IR->Lifecycles;
 
-my @queue_prefixes = map { RT::IR::FriendlyLifecycle($_) } @lifecycles;
-
 if ( exists $opt{'rename'} ) {
     exit rename_value( $constituency => sanitize_value( $opt{'rename'} ) );
 }
@@ -390,8 +388,8 @@ sub grant_group_cf_rights {
     my @rights = (@_);
 
     my $cfs = RT::CustomFields->new($RT::SystemUser);
-    for my $queue (@queue_prefixes) {
-        my $q = load_queue($queue);
+    for my $lifecycle (@lifecycles) {
+        my $q = base_queue_for_lifecycle($lifecycle);
         $cfs->LimitToObjectId( $q->Id );
     }
     while ( my $cf = $cfs->Next ) {
@@ -466,21 +464,30 @@ sub load_queue {
     return $queue;
 }
 
+# load the first queue with the lifecycle we're after, which is meant
+# a proxy for the "original" RTIR queue of that lifecycle. we can't rely
+# on the name because the base countermeasures queue may be named Blocks
+# due to historical reasons
+sub base_queue_for_lifecycle {
+    my $lifecycle = shift;
+
+    my $queues = RT::Queues->new(RT->SystemUser);
+    $queues->Limit(FIELD => 'Lifecycle', VALUE => $lifecycle);
+    $queues->OrderByCols({
+        ALIAS => 'main',
+        FIELD => 'id',
+        ORDER => 'ASC',
+    });
+
+    return $queues->First;
+}
+
 sub create_or_load_queue {
     my $name            = shift;
     my $lifecycle       = shift;
     my $constituency_cf = shift;
 
-    my $basequeue = RT::Queue->new( RT->SystemUser );
-
-    my $basequeue_name = RT::IR::FriendlyLifecycle($lifecycle);
-    my ($ok, $msg) = $basequeue->LoadByCols( Name => $basequeue_name );
-
-    # support old name for Countermeasures
-    ($ok, $msg) = $basequeue->LoadByCols( Name => 'Blocks' )
-        if !$ok && $basequeue_name eq 'Countermeasures';
-
-    die "Unable to load queue named '$basequeue_name': $msg" if !$ok;
+    my $basequeue = base_queue_for_lifecycle($lifecycle);
 
     my $queue = RT::Queue->new($RT::SystemUser);
     $queue->LoadByCols( Name => $name );
@@ -612,8 +619,6 @@ sub rename_value {
         debug "* rename queue '$oldname' to '$newname'.\n";
     }
 
-    foreach my $basename (@queue_prefixes) {
-    }
     debug <<END;
 * rename group 'DutyTeam $old' if it exists into 'DutyTeam $new'
 * rename group 'ReadOnly $old' if it exists into 'ReadOnly $new'

commit 154238bd0c37b743dd48f0ff64647ed45c2ffc67
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Sat May 14 00:19:43 2016 +0000

    Fix queues to be named Countermeasures

diff --git a/etc/upgrade/3.3.0/content b/etc/upgrade/3.3.0/content
index 02eb690..9d8321d 100644
--- a/etc/upgrade/3.3.0/content
+++ b/etc/upgrade/3.3.0/content
@@ -50,7 +50,7 @@ our @Final = (
               for ( 'RTIR_RequireConstituencyChange', 'RTIR_RequireConstituencyGroupChange' );
         }
 
-        # rename blocks to countermeasures
+        # fix lifecycle from blocks to countermeasures
         {
             my $queues = RT::Queues->new(RT->SystemUser);
             $queues->Limit(FIELD => 'Lifecycle', VALUE => 'blocks');
@@ -59,6 +59,26 @@ our @Final = (
             }
         }
 
+        # fix queue name from Blocks to Countermeasures
+        {
+            my $queues = RT::Queues->new(RT->SystemUser);
+            $queues->Limit(
+                  FIELD    => 'Name',
+                  OPERATOR => 'STARTSWITH',
+                  VALUE    => 'Blocks',
+            );
+
+            while (my $queue = $queues->Next) {
+                next unless $queue->Name eq 'Blocks'
+                         || $queue->Name =~ /^Blocks - /;
+
+                my $new = $queue->Name;
+                $new =~ s/^Blocks/Countermeasures/;
+
+                $queue->SetName($new);
+            }
+        }
+
         # update values of rtir constituency
         my @constituencies;
         {
diff --git a/etc/upgrade/3.3.4/content b/etc/upgrade/3.3.4/content
index 2009a08..d303765 100644
--- a/etc/upgrade/3.3.4/content
+++ b/etc/upgrade/3.3.4/content
@@ -18,7 +18,7 @@ our @Initial = (
             elsif ($name =~ /^Investigations - /) {
                 $lifecycle = RT::IR->lifecycle_investigation;
             }
-            elsif ($name =~ /^(Blocks|Countermeasures) - /) {
+            elsif ($name =~ /^Countermeasures - /) {
                 $lifecycle = RT::IR->lifecycle_countermeasure;
             }
             else {

commit 6fb2227dc527e51f461acab03d02ff4d3a809988
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Sat May 14 00:20:07 2016 +0000

    Switch Blocks to Countermeasures for CF descriptions

diff --git a/etc/initialdata b/etc/initialdata
index ee34d03..b978553 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -125,19 +125,19 @@
         Type        => 'FreeformSingle',
         Queue       => 'Countermeasures',
         Disabled    => 0,
-        Description => 'Network mask for Blocks RTIR queue',
+        Description => 'Network mask for Countermeasures',
     },
     {   Name        => 'Port',
         Type        => 'FreeformSingle',
         Queue       => 'Countermeasures',
         Disabled    => 0,
-        Description => 'Port for Blocks RTIR queue',
+        Description => 'Port for Countermeasures',
     },
     {   Name        => 'Where Blocked',
         Type        => 'FreeformSingle',
         Queue       => 'Countermeasures',
         Disabled    => 0,
-        Description => 'Where the block is placed for Blocks RTIR queue',
+        Description => 'Where the block is placed for Countermeasures',
     },
     {   Name        => 'Customer',
         Type        => 'SelectMultiple',

-----------------------------------------------------------------------


More information about the rt-commit mailing list