[Rt-commit] rtir branch, 2.9-trunk, updated. 2.6.1-422-g4d8feb4

Ruslan Zakirov ruz at bestpractical.com
Thu Sep 29 14:16:16 EDT 2011


The branch, 2.9-trunk has been updated
       via  4d8feb426418a1fcc88ac728b0b02b460df16365 (commit)
       via  2b63520d7ea75aeb48695b16f85e72f0ff7c4e87 (commit)
       via  5f5244b34af265d68de59fc2d8f6a82a679cd21f (commit)
       via  9eeb936af290f569e40436c7fb94bf1b3f939676 (commit)
       via  0480a6167b7ba6fe1cbbd99d6c5e9d416cd4a505 (commit)
       via  1d3df6d677eea1ec86e2295a0668008dde2d7ff2 (commit)
       via  9d59c3fd57c3da9f2c1c97324c02013b54e74c28 (commit)
       via  9a7bd771c3da7ec7b56fcf6630c671fa2ff5cde5 (commit)
       via  bbc89cb89de9c3e6cc8a0e880e9fcbf544a16161 (commit)
       via  53856fe4c73b43c2d866fc58157abea6cf24c0a9 (commit)
       via  eebb60750e84fa471971d0ac7d4c09b780a6a57e (commit)
       via  31b9e95f4b2146fbe0f671e94dc469752d4a9e9d (commit)
       via  a2c3a14e15e8dce1a32960cd29e79f21025ee759 (commit)
       via  0ed8ab947fb18baff2c9b9c927a6e32675a7c9f2 (commit)
       via  ca39484023e6a0c30c0a0fec28a907cc0b0bb2cd (commit)
       via  1b6f3c6b12a8ef017eef67f587839301c6c09dfb (commit)
       via  5afc0aa667b53c6fef34d55c545767b6dd14a9a1 (commit)
       via  fc50b724bf79acafd2462e055509160a84ce3f6f (commit)
       via  c8ffe6079117edf4646a2b2754e9262b0696a940 (commit)
       via  d11c3a15686ad8744791ab64504e6679999b3031 (commit)
       via  92e055e98541bf30dd3019bab0e5a63cb5caec12 (commit)
       via  dda871f46f0266e684ff7272816f5842bc1b4bbd (commit)
       via  2d3e434e43a020649382b875bfbdbdc5e17c100f (commit)
       via  b76d4c4c820d0449364f9915e85cd0adaf4ea562 (commit)
       via  f7fafe88e203f5f4849a8e4399a20103f1946601 (commit)
       via  bfe1253a6ac76bf7fe68007a8dc906441737b9bb (commit)
       via  ca8a913e8df8dce056513c093b06b56bc482dd71 (commit)
       via  a1804eb1af650bc6a455f2a284b0c3c19bc58c19 (commit)
       via  fc04e4ae175cb5a1e0d43d8f510dd98711d5eb43 (commit)
      from  d4c33c4b0620d76d151b0358d1baed16b665b939 (commit)

Summary of changes:
 CHANGES                                            |    2 +
 MANIFEST                                           |   77 +++++------
 META.yml                                           |    2 +-
 etc/RTIR_Config.pm                                 |   16 ++
 .../RTIR/Elements/RT__Ticket/ColumnMap/Once        |   60 ++++++++
 html/RTIR/Elements/ChildSummary                    |  125 -----------------
 html/RTIR/Elements/IncidentSummary                 |  130 -----------------
 html/RTIR/Elements/MakeClicky                      |  148 --------------------
 html/RTIR/Tools/Elements/LookupRelatedTickets      |   63 ++++-----
 html/RTIR/Tools/Elements/LookupSummary             |  129 +++++++++++++++++
 html/RTIR/Tools/Elements/ToolFormIframe            |    6 +-
 html/RTIR/Tools/Elements/ToolFormWhois             |   16 ++-
 html/RTIR/Tools/Elements/ToolResultsWhois          |   16 ++-
 html/RTIR/Tools/Lookup.html                        |   51 +------
 lib/RT/IR.pm                                       |    2 +-
 15 files changed, 305 insertions(+), 538 deletions(-)
 delete mode 100644 html/RTIR/Elements/ChildSummary
 delete mode 100644 html/RTIR/Elements/IncidentSummary
 delete mode 100644 html/RTIR/Elements/MakeClicky
 create mode 100644 html/RTIR/Tools/Elements/LookupSummary

- Log -----------------------------------------------------------------
commit fc50b724bf79acafd2462e055509160a84ce3f6f
Merge: d4c33c4 bfe1253
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 17:09:35 2011 +0400

    Merge branch '2.6-trunk' into 2.9-trunk
    
    Conflicts:
    	Makefile.PL
    	README

diff --cc lib/RT/IR.pm
index 9e4817a,81a5bba..80ac610
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@@ -44,13 -44,13 +44,13 @@@
  # 
  # }}} END BPS TAGGED BLOCK
  #
 -package RT::IR;
 -
  use 5.008003;
 -use warnings;
  use strict;
 +use warnings;
 +
 +package RT::IR;
  
- our $VERSION = '2.6.1rc1';
+ our $VERSION = '2.6.1';
  
  
  use Business::Hours;

commit 5afc0aa667b53c6fef34d55c545767b6dd14a9a1
Merge: fc50b72 c8ffe60
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 17:11:17 2011 +0400

    Merge branch '4.0/RunWhoisRequestByDefault-option' into 2.9-trunk
    
    Conflicts:
    	html/RTIR/Tools/Elements/ToolFormWhois
    	html/RTIR/Tools/Lookup.html

diff --cc html/RTIR/Tools/Elements/ToolFormIframe
index 884dafc,91f8f4d..e78d4a4
--- a/html/RTIR/Tools/Elements/ToolFormIframe
+++ b/html/RTIR/Tools/Elements/ToolFormIframe
@@@ -1,8 -1,10 +1,10 @@@
  <form action="Lookup.html" method="get">
-   <input type="hidden" name="ticket" value="<% $TicketObj->id %>" />
+ % foreach my $arg ( grep exists $ARGS{$_}, @PassArguments ) {
+   <input type="hidden" name="<% $arg %>" value="<% $ARGS{ $arg } %>" />
+ % }
      <span class="label"><%loc('Research Tool')%>:</span>
      <span class="input">
 -      <input size="30" name="q" value="<% $q %>" /> at
 +      <input type="text" size="30" name="q" value="<% $q %>" /> at
        <select name="ResearchTool">
  % for my $tool (grep {defined } keys %$research_tools) {
          <option value="<%$tool%>" <%$tool eq $ResearchTool ? 'SELECTED' : ''%>><% $research_tools->{$tool}->{FriendlyName} %></option>
diff --cc html/RTIR/Tools/Elements/ToolFormWhois
index ffddb54,f7bee3f..7336e69
--- a/html/RTIR/Tools/Elements/ToolFormWhois
+++ b/html/RTIR/Tools/Elements/ToolFormWhois
@@@ -3,8 -5,8 +5,8 @@@
    <tr>
      <span class="label">WHOIS:</span>
      <span class="input">
 -      <input size="30" name="q" value="<% $q %>" /> at 
 +      <input type="text" size="30" name="q" value="<% $q %>" /> at 
-       <select name="server">
+       <select name="WhoisServer">
  <%PERL>
  foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
      my $srv = $servers->{ $s };

commit 1b6f3c6b12a8ef017eef67f587839301c6c09dfb
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 17:15:41 2011 +0400

    move code closer to where it's used

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 4f86592..e964be4 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -57,4 +57,33 @@ $q => undef
 </%args>
 <%init>
 my $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
+
+my $max_age = -60;
+
+if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {
+    $max_age = 0 - $tmp;
+}
+
+my $now = RT::Date->new( $session{'CurrentUser'} );
+$now->SetToNow;
+$now->AddDays( $max_age );
+
+$session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
+
+if ( $q ) {
+    my $query;
+    if ( $type && RT::IR->CustomFields( Field => $type ) ) {
+        $query = "'CF.{$type}' = '$q'"
+    } else {
+        $query = "( ContentType = 'text/plain' OR ContentType = 'text' OR ContentType = 'text/html' )"
+        . " AND Content LIKE '$q'";
+
+        # apply transaction date search only if it's FTS as otherwise
+        # it can ruin performance of mysql optimizer rather than help
+        $query = "( $query ) AND TransactionDate > '". $now->ISO ."'"
+    }
+
+    my ($val, $msg) = $session{'tickets'}->FromSQL( $query );
+    $RT::Logger->warning( $msg ) unless $val;
+}
 </%init>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 8fad15a..0f482ca 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -66,35 +66,6 @@ if ( $ARGS{'InvestigateTo'} ) {
 
 my $title = loc("Lookup '[_1]'", $q);
 
-my $max_age = -60;
-
-if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {
-    $max_age = 0 - $tmp;
-}
-
-my $now = RT::Date->new( $session{'CurrentUser'} );
-$now->SetToNow;
-$now->AddDays( $max_age );
-
-$session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
-
-if ( $q ) {
-    my $query;
-    if ( $type && RT::IR->CustomFields( Field => $type ) ) {
-        $query = "'CF.{$type}' = '$q'"
-    } else {
-        $query = "( ContentType = 'text/plain' OR ContentType = 'text' OR ContentType = 'text/html' )"
-        . " AND Content LIKE '$q'";
-
-        # apply transaction date search only if it's FTS as otherwise
-        # it can ruin performance of mysql optimizer rather than help
-        $query = "( $query ) AND TransactionDate > '". $now->ISO ."'"
-    }
-
-    my ($val, $msg) = $session{'tickets'}->FromSQL( $query );
-    $RT::Logger->warning( $msg ) unless $val;
-}
-
 my $TicketObj = RT::Ticket->new($session{CurrentUser});
 my $TicketType;
 if ( $ticket ) {

commit ca39484023e6a0c30c0a0fec28a907cc0b0bb2cd
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 17:17:37 2011 +0400

    these two components only used in lookup, move them

diff --git a/html/RTIR/Elements/ChildSummary b/html/RTIR/Tools/Elements/ChildSummary
similarity index 100%
rename from html/RTIR/Elements/ChildSummary
rename to html/RTIR/Tools/Elements/ChildSummary
diff --git a/html/RTIR/Elements/IncidentSummary b/html/RTIR/Tools/Elements/IncidentSummary
similarity index 100%
rename from html/RTIR/Elements/IncidentSummary
rename to html/RTIR/Tools/Elements/IncidentSummary

commit 0ed8ab947fb18baff2c9b9c927a6e32675a7c9f2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 22:35:11 2011 +0400

    don't pass ticket type, we can get it

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index e964be4..161e9d5 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -3,7 +3,6 @@
 
 <&| /Widgets/TitleBox, title => loc('Incidents: [_1]', $q), class => 'tickets-list-incident' &>
 <& /RTIR/Elements/IncidentSummary, 
-    Type       => $TicketType, 
     ticket     => $TicketObj->id, 
     lookuptype => $LookupType, 
     q          => $q,
@@ -15,7 +14,6 @@
 <&| /Widgets/TitleBox, title => loc('Investigations: [_1]', $q), class => 'tickets-list-investigation' &>
 <& /RTIR/Elements/ChildSummary, 
     Queue      => 'Investigations', 
-    Type       => $TicketType, 
     ticket     => $TicketObj->id, 
     lookuptype => $LookupType, 
     q          => $q,
@@ -27,7 +25,6 @@
 <&| /Widgets/TitleBox, title => loc('Incident Reports: [_1]', $q), class => 'tickets-list-report' &>
 <& /RTIR/Elements/ChildSummary,
     Queue      => 'Incident Reports',
-    Type       => $TicketType,
     ticket     => $TicketObj->id,
     lookuptype => $LookupType,
     q          => $q,
@@ -40,7 +37,6 @@
 <&| /Widgets/TitleBox, title => loc('Blocks: [_1]', $q), class => 'tickets-list-block' &>
 <& /RTIR/Elements/ChildSummary,
     Queue      => 'Blocks',
-    Type       => $TicketType,
     ticket     => $TicketObj->id,
     lookuptype => $LookupType,
     q          => $q,
@@ -56,8 +52,6 @@ $LookupType => undef
 $q => undef
 </%args>
 <%init>
-my $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
-
 my $max_age = -60;
 
 if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {

commit a2c3a14e15e8dce1a32960cd29e79f21025ee759
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 22:35:55 2011 +0400

    don't use tickets in session, generate a query

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 161e9d5..ac9a46b 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -52,32 +52,23 @@ $LookupType => undef
 $q => undef
 </%args>
 <%init>
-my $max_age = -60;
-
-if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {
-    $max_age = 0 - $tmp;
-}
-
-my $now = RT::Date->new( $session{'CurrentUser'} );
-$now->SetToNow;
-$now->AddDays( $max_age );
-
-$session{'tickets'} = RT::Tickets->new( $session{'CurrentUser'} );
 
+my $query;
 if ( $q ) {
-    my $query;
     if ( $type && RT::IR->CustomFields( Field => $type ) ) {
         $query = "'CF.{$type}' = '$q'"
     } else {
-        $query = "( ContentType = 'text/plain' OR ContentType = 'text' OR ContentType = 'text/html' )"
-        . " AND Content LIKE '$q'";
+        $query = join ' OR ', map "ContentType = '$_'",
+            qw(text/plain text/html text);
+        $query = "( $query ) AND Content LIKE '$q'";
 
         # apply transaction date search only if it's FTS as otherwise
         # it can ruin performance of mysql optimizer rather than help
-        $query = "( $query ) AND TransactionDate > '". $now->ISO ."'"
-    }
+        my $age = RT::Date->new( $session{'CurrentUser'} );
+        $age->SetToNow;
+        $age->AddDays( 0 - (RT->Config->Get('RTIR_OldestRelatedTickets') || 60) );
 
-    my ($val, $msg) = $session{'tickets'}->FromSQL( $query );
-    $RT::Logger->warning( $msg ) unless $val;
+        $query = "$query AND TransactionDate > '". $age->ISO ."'"
+    }
 }
 </%init>

commit 31b9e95f4b2146fbe0f671e94dc469752d4a9e9d
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 22:54:28 2011 +0400

    "if" block is too wide, should'n include </table>

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index ac9a46b..cd4ba4a 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -42,10 +42,11 @@
     q          => $q,
 &>
 </&>
+% }
+
 </td></tr>
 
 </table>
-% }
 <%args>
 $TicketObj
 $LookupType => undef

commit eebb60750e84fa471971d0ac7d4c09b780a6a57e
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 22:56:36 2011 +0400

    adjust what we pass into *Summary and path we call
    
    We moved comps recently, but forgot to change path.
    
    Renaming arguments makes no sense, so just pass %ARGS

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index cd4ba4a..50d0d62 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -2,45 +2,26 @@
 <tr><td valign="top" width="50%">
 
 <&| /Widgets/TitleBox, title => loc('Incidents: [_1]', $q), class => 'tickets-list-incident' &>
-<& /RTIR/Elements/IncidentSummary, 
-    ticket     => $TicketObj->id, 
-    lookuptype => $LookupType, 
-    q          => $q,
-&>
+<& IncidentSummary, %ARGS, Query => $query &>
 </&>
 
 </td><td valign="top" width="50%">
 
 <&| /Widgets/TitleBox, title => loc('Investigations: [_1]', $q), class => 'tickets-list-investigation' &>
-<& /RTIR/Elements/ChildSummary, 
-    Queue      => 'Investigations', 
-    ticket     => $TicketObj->id, 
-    lookuptype => $LookupType, 
-    q          => $q,
-&>
+<& ChildSummary, %ARGS, Queue => 'Investigations', Query => $query &>
 </&>
 
 </td></tr><tr><td valign="top" width="50%">
 
 <&| /Widgets/TitleBox, title => loc('Incident Reports: [_1]', $q), class => 'tickets-list-report' &>
-<& /RTIR/Elements/ChildSummary,
-    Queue      => 'Incident Reports',
-    ticket     => $TicketObj->id,
-    lookuptype => $LookupType,
-    q          => $q,
-&>
+<& ChildSummary, %ARGS, Queue => 'Incident Reports', Query => $query &>
 </&>
 
 </td><td width="50%" valign="top">
 
 % unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
 <&| /Widgets/TitleBox, title => loc('Blocks: [_1]', $q), class => 'tickets-list-block' &>
-<& /RTIR/Elements/ChildSummary,
-    Queue      => 'Blocks',
-    ticket     => $TicketObj->id,
-    lookuptype => $LookupType,
-    q          => $q,
-&>
+<& ChildSummary, %ARGS, Queue => 'Blocks', Query => $query &>
 </&>
 % }
 

commit 53856fe4c73b43c2d866fc58157abea6cf24c0a9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 01:09:02 2011 +0400

    we renamed argument

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 50d0d62..3b4dde2 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -37,8 +37,8 @@ $q => undef
 
 my $query;
 if ( $q ) {
-    if ( $type && RT::IR->CustomFields( Field => $type ) ) {
-        $query = "'CF.{$type}' = '$q'"
+    if ( $LookupType && RT::IR->CustomFields( Field => $LookupType ) ) {
+        $query = "'CF.{$LookupType}' = '$q'"
     } else {
         $query = join ' OR ', map "ContentType = '$_'",
             qw(text/plain text/html text);

commit bbc89cb89de9c3e6cc8a0e880e9fcbf544a16161
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 01:28:09 2011 +0400

    usually we pass loaded ticket or undef

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 3b4dde2..9f4d0cd 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -29,7 +29,6 @@
 
 </table>
 <%args>
-$TicketObj
 $LookupType => undef
 $q => undef
 </%args>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 0f482ca..bd616f0 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -25,7 +25,7 @@
 <& /RTIR/Elements/Header, Title => $title &>
 <& /Elements/Tabs &>
 
-% if ( $TicketObj->id ) {
+% if ( $TicketObj ) {
 <&| /Widgets/TitleBox, title => loc("Current [_1]: #[_2]", $TicketType, $ticket), class => 'ticket-info-basics' &>
 <& /Elements/TicketList, Query => "id = $ticket", Format => RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'}, ShowNavigation => 0 &>
 </&>
@@ -66,8 +66,7 @@ if ( $ARGS{'InvestigateTo'} ) {
 
 my $title = loc("Lookup '[_1]'", $q);
 
-my $TicketObj = RT::Ticket->new($session{CurrentUser});
-my $TicketType;
+my ($TicketObj, $TicketType);
 if ( $ticket ) {
     $TicketObj = LoadTicket( $ticket );
     $ticket = $ARGS{'ticket'} = $TicketObj->id;

commit 9a7bd771c3da7ec7b56fcf6630c671fa2ff5cde5
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 01:33:43 2011 +0400

    no point in showing empty logs if $q is empty

diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 9f4d0cd..81ebd51 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -34,22 +34,22 @@ $q => undef
 </%args>
 <%init>
 
+return unless defined $q && length $q;
+
 my $query;
-if ( $q ) {
-    if ( $LookupType && RT::IR->CustomFields( Field => $LookupType ) ) {
-        $query = "'CF.{$LookupType}' = '$q'"
-    } else {
-        $query = join ' OR ', map "ContentType = '$_'",
-            qw(text/plain text/html text);
-        $query = "( $query ) AND Content LIKE '$q'";
-
-        # apply transaction date search only if it's FTS as otherwise
-        # it can ruin performance of mysql optimizer rather than help
-        my $age = RT::Date->new( $session{'CurrentUser'} );
-        $age->SetToNow;
-        $age->AddDays( 0 - (RT->Config->Get('RTIR_OldestRelatedTickets') || 60) );
-
-        $query = "$query AND TransactionDate > '". $age->ISO ."'"
-    }
+if ( $LookupType && RT::IR->CustomFields( Field => $LookupType ) ) {
+    $query = "'CF.{$LookupType}' = '$q'"
+} else {
+    $query = join ' OR ', map "ContentType = '$_'",
+        qw(text/plain text/html text);
+    $query = "( $query ) AND Content LIKE '$q'";
+
+    # apply transaction date search only if it's FTS as otherwise
+    # it can ruin performance of mysql optimizer rather than help
+    my $age = RT::Date->new( $session{'CurrentUser'} );
+    $age->SetToNow;
+    $age->AddDays( 0 - (RT->Config->Get('RTIR_OldestRelatedTickets') || 60) );
+
+    $query = "$query AND TransactionDate > '". $age->ISO ."'"
 }
 </%init>

commit 9d59c3fd57c3da9f2c1c97324c02013b54e74c28
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 14:50:35 2011 +0400

    switch ChildSummary to collection list

diff --git a/etc/RTIR_Config.pm b/etc/RTIR_Config.pm
index 756edac..9716036 100644
--- a/etc/RTIR_Config.pm
+++ b/etc/RTIR_Config.pm
@@ -392,6 +392,12 @@ Set($RTIRSearchResultFormats, {
           __Status__,
            __DueRelative__},
 
+    LookupTool =>
+        q{'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
+          '<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
+          __Status__,
+          __Priority__},
+
 } );
 
 =item C<$DisplayAfterEdit>
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 63810ce..0f56c92 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -39,6 +39,33 @@ $COLUMN_MAP->{'HasIncident'} = {
         return \$yesno;
     },
 };
+$COLUMN_MAP->{'LookupToolChildrenActions'} = {
+    title => 'Actions',
+    value => sub {
+        my $t = shift;
+        my ($lid, $show) = split /,/, pop(), 2;
+        my %show = map { lc($_) => 1 } split /,/, $show;
+
+        my @res;
+        if ( $show{'link'} ) {
+            push @res, \'<a href="',
+                RT->Config->Get('WebPath') .'/RTIR/Display.html?Child='. $t->id .'&id='. $lid,
+                \'">',
+                '[' . $t->loc("Link") .']',
+                \'</a>'
+            ;
+        }
+        elsif ( $lid != $t->id && $show{'merge'} ) {
+            push @res, \'<a href="',
+                RT->Config->Get('WebPath') .'/RTIR/Merge/?SelectedTicket='. $t->id .'&id='. $lid,
+                \'">',
+                '[' . $t->loc("Merge") .']',
+                \'</a>'
+            ;
+        }
+        return @res;
+    },
+};
 
 </%INIT>
 <%ARGS>
diff --git a/html/RTIR/Tools/Elements/ChildSummary b/html/RTIR/Tools/Elements/ChildSummary
index 67f4e0c..1f0315b 100644
--- a/html/RTIR/Tools/Elements/ChildSummary
+++ b/html/RTIR/Tools/Elements/ChildSummary
@@ -22,104 +22,65 @@
 %# 
 %# 
 %# END LICENSE BLOCK
-<table width="100%" border="0" cellpadding="2" cellspacing="0">
-
-<tr>
-%# XXX: why we don't use TicketList component here?
-<th><b><&|/l&>id<b></&></th>
-<th><b><&|/l&>Subject<b></&></th>
-<th><b><&|/l&>Status<b></&></th>
-<th><b><&|/l&>Priority<b></&></th>
-<th align="right"><b><&|/l&>Actions<b></&></th>
-</tr>
 
 % if ( $lookup_cf_not_applies ) {
-<tr><td colspan="5"><% loc("Custom field '[_1]' doesn't applies to this queue", loc($lookuptype) ) %></td></tr>
-% }
-
-% my $i=0;
-% while (my $Ticket = $session{'tickets'}->Next) {
-% next unless ($Ticket->QueueObj->Name eq $Queue);
-% $i++;
-% my $t = RT::IR::TicketType( Ticket => $Ticket );
-<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
-<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%></a></b></td>
-<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></b></td>
-<td><% loc( $Ticket->Status ) %></td>
-<td><%$Ticket->Priority%></td>
-% if ($Type eq 'Incident') {
-<td align="right"><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?Child=<%$Ticket->Id%>&id=<%$ticket%>">[<%loc("Link")%>]</a></td>
-% } elsif ($Type eq $t) {
-% if ($ticket ne $Ticket->Id) {
-<td align="right"><a href="<%RT->Config->Get('WebPath')%>/RTIR/Merge/?id=<%$ticket%>&SelectedTicket=<%$Ticket->Id%>">[<%loc("Merge")%>]</a></td>
-% } else {
-<td> </td>
-% }
+<i><% loc("Custom field '[_1]' doesn't applies to this queue", loc($LookupType) ) %></i>
 % } else {
-<td> </td>
-% }
-</tr>
-% }
-% if ($i == 0) {
-<tr><td colspan="5"><i><%loc("(no [_1])", $Queue)%></i></td></tr>
+<& /RTIR/Search/Elements/ShowResults,
+    Queue         => $Queue,
+    BaseQuery     => RT::IR->Query( Queue => $Queue ),
+    Query         => $Query,
+    Format        => $Format,
+    AllowSorting  => 0,
+    EmptyLabel    => loc("(no $Queue)"),
+&>
 % }
+
+<table width="100%" border="0" cellpadding="2" cellspacing="0">
 <tr>
 <td colspan="5">
 [<a href="<%RT->Config->Get('WebPath')%>/RTIR/Search/Refine.html?Queue=<% $Queue |uhn %>&<% $QueryString %>"><% loc("Refine Search") %></a>]
-% if ($Type eq 'Incident') {
-% if ($Queue) {
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkChildren.html?Queue=<% $Queue |uhn %>&Query=<% 'Content LIKE "$q"' |uhn %>&id=<% $ticket %>"><%loc("Bulk Link")%></a>]
-% }
-%   if ($Queue eq 'Investigations' && $lookuptype eq 'email') {
-<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$ticket%>&Requestors=<%$q%>&Queue=Investigations"><%loc("Launch new: [_1]", $q)%></a>]
-%   } elsif ( $Queue eq 'Blocks' && $lookuptype eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$ticket%>&Queue=Blocks&IP-Value=<%$q%>"><%loc("New Block: [_1]", $q)%></a>]
+
+% if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
+[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkChildren.html?Queue=<% $Queue |uhn %>&Query=<% 'Content LIKE "$q"' |uhn %>&id=<% $TicketObj->id %>"><%loc("Bulk Link")%></a>]
+%   if ($Queue eq 'Investigations' && $LookupType eq 'email') {
+<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$TicketObj->id%>&Requestors=<%$q%>&Queue=Investigations"><%loc("Launch new: [_1]", $q)%></a>]
+%   } elsif ( $Queue eq 'Blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$TicketObj->id%>&Queue=Blocks&IP-Value=<%$q%>"><%loc("New Block: [_1]", $q)%></a>]
 %   }
 % }
+
 </td>
 </tr>
 </table>
 
 <%INIT>
-my @conditions = ();
 my $lookup_cf_not_applies = 0;
-if ( defined $q && length $q ) {
-    if ( $lookuptype && RT::IR->CustomFields( Field => $lookuptype ) ) {
-        my @this = RT::IR->CustomFields( Field => $lookuptype, Queue => $Queue );
-        if ( @this ) {
-            push @conditions, "'CF.{$lookuptype}' = '$q'";
-        } else {
-            $lookup_cf_not_applies = 1;
-            push @conditions, "id = 0";
-        }
-    } else {
-        push @conditions, "Content LIKE '$q'";
-    }
+if ( $LookupType && RT::IR->CustomFields( Field => $LookupType )
+    && !RT::IR->CustomFields( Field => $LookupType, Queue => $Queue )
+) {
+    $lookup_cf_not_applies = 1;
 }
-my $Query = RT::IR->ActiveQuery( Queue => $Queue, And => \@conditions );
 
 my $QueryString = $m->comp('/Elements/QueryString',
     Query   => $Query,
-    Format  => $Format,
-    Rows    => $Rows,
-    OrderBy => $OrderBy,
-    Order   => $Order,
-    Page    => $Page,
 );
 
+my $Format = RT->Config->Get('RTIRSearchResultFormats')->{'LookupTool'};
+if ( $TicketObj ) {
+    my @show;
+    push @show, 'link' if RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident';
+    push @show, 'merge' if $Queue eq $TicketObj->QueueObj->Name;
+    $Format .= ", '__LookupToolChildrenActions.{". join(',', $TicketObj->id, @show ) ."}__'";
+}
+
 </%INIT>
 
 <%ARGS>
+$Query => undef
 $Queue => undef
-$Type => undef
-$ticket => undef
+$TicketObj => undef
+
 $q => undef
-$lookuptype => undef
-$Format => undef 
-$HideResults => 0
-$Rows => 50
-$Page => 1
-$OrderBy => 'id'
-$Order => 'ASC'
+$LookupType => undef
 </%ARGS>
-

commit 1d3df6d677eea1ec86e2295a0668008dde2d7ff2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 15:08:10 2011 +0400

    extract box's actions into %INIT section

diff --git a/html/RTIR/Tools/Elements/ChildSummary b/html/RTIR/Tools/Elements/ChildSummary
index 1f0315b..f6d6843 100644
--- a/html/RTIR/Tools/Elements/ChildSummary
+++ b/html/RTIR/Tools/Elements/ChildSummary
@@ -35,24 +35,7 @@
     EmptyLabel    => loc("(no $Queue)"),
 &>
 % }
-
-<table width="100%" border="0" cellpadding="2" cellspacing="0">
-<tr>
-<td colspan="5">
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Search/Refine.html?Queue=<% $Queue |uhn %>&<% $QueryString %>"><% loc("Refine Search") %></a>]
-
-% if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Incident/LinkChildren.html?Queue=<% $Queue |uhn %>&Query=<% 'Content LIKE "$q"' |uhn %>&id=<% $TicketObj->id %>"><%loc("Bulk Link")%></a>]
-%   if ($Queue eq 'Investigations' && $LookupType eq 'email') {
-<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$TicketObj->id%>&Requestors=<%$q%>&Queue=Investigations"><%loc("Launch new: [_1]", $q)%></a>]
-%   } elsif ( $Queue eq 'Blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<br />[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$TicketObj->id%>&Queue=Blocks&IP-Value=<%$q%>"><%loc("New Block: [_1]", $q)%></a>]
-%   }
-% }
-
-</td>
-</tr>
-</table>
+<% $box_actions |n %>
 
 <%INIT>
 my $lookup_cf_not_applies = 0;
@@ -74,6 +57,48 @@ if ( $TicketObj ) {
     $Format .= ", '__LookupToolChildrenActions.{". join(',', $TicketObj->id, @show ) ."}__'";
 }
 
+my @box_actions;
+push @box_actions, {
+    title => loc('Search'),
+    path => "/RTIR/Search/Refine.html?". $m->comp('/Elements/QueryString', 
+        Queue => $Queue,
+        Query => $Query,
+    ),
+};
+if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
+    push @box_actions, {
+        title => loc('Link'),
+        path => "/RTIR/Link/ToIncident/?". $m->comp('/Elements/QueryString', 
+            id => $TicketObj->id,
+            Queue => $Queue,
+            Query => $Query,
+        ),
+    };
+    if ($Queue eq 'Investigations' && $LookupType eq 'email') {
+        push @box_actions, {
+            title => loc('Launch Investigation'),
+            path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+                Incident => $TicketObj->id,
+                Queue => $Queue,
+                Requestors => $q,
+            ),
+        };
+    } elsif ( $Queue eq 'Blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
+        push @box_actions, {
+            title => loc('New Block'),
+            path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+                Incident => $TicketObj->id,
+                Queue => $Queue,
+                'IP-Value' => $q,
+            ),
+        };
+    }
+}
+my $box_actions = join ' 'x3,
+    map qq{<a href="}. RT->Config->Get('WebPath') . $_->{'path'} .q{">}
+        . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
+    @box_actions;
+
 </%INIT>
 
 <%ARGS>

commit 0480a6167b7ba6fe1cbbd99d6c5e9d416cd4a505
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 15:37:10 2011 +0400

    move box's actions into top right corner

diff --git a/html/RTIR/Tools/Elements/ChildSummary b/html/RTIR/Tools/Elements/ChildSummary
index f6d6843..463ed9b 100644
--- a/html/RTIR/Tools/Elements/ChildSummary
+++ b/html/RTIR/Tools/Elements/ChildSummary
@@ -23,6 +23,11 @@
 %# 
 %# END LICENSE BLOCK
 
+<&| /Widgets/TitleBox,
+    title => loc($Queue) .': '. $q,
+    class => 'tickets-list-'. lc RT::IR::TicketType( Queue => $Queue ),
+    titleright_raw => $box_actions,
+&>
 % if ( $lookup_cf_not_applies ) {
 <i><% loc("Custom field '[_1]' doesn't applies to this queue", loc($LookupType) ) %></i>
 % } else {
@@ -35,8 +40,7 @@
     EmptyLabel    => loc("(no $Queue)"),
 &>
 % }
-<% $box_actions |n %>
-
+</&>
 <%INIT>
 my $lookup_cf_not_applies = 0;
 if ( $LookupType && RT::IR->CustomFields( Field => $LookupType )
@@ -76,7 +80,7 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
     };
     if ($Queue eq 'Investigations' && $LookupType eq 'email') {
         push @box_actions, {
-            title => loc('Launch Investigation'),
+            title => loc('Launch'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Queue => $Queue,
@@ -85,7 +89,7 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
         };
     } elsif ( $Queue eq 'Blocks' && $LookupType eq 'ip' && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
         push @box_actions, {
-            title => loc('New Block'),
+            title => loc('Create'),
             path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Queue => $Queue,
diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 81ebd51..279ed4f 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -7,22 +7,16 @@
 
 </td><td valign="top" width="50%">
 
-<&| /Widgets/TitleBox, title => loc('Investigations: [_1]', $q), class => 'tickets-list-investigation' &>
 <& ChildSummary, %ARGS, Queue => 'Investigations', Query => $query &>
-</&>
 
 </td></tr><tr><td valign="top" width="50%">
 
-<&| /Widgets/TitleBox, title => loc('Incident Reports: [_1]', $q), class => 'tickets-list-report' &>
 <& ChildSummary, %ARGS, Queue => 'Incident Reports', Query => $query &>
-</&>
 
 </td><td width="50%" valign="top">
 
 % unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<&| /Widgets/TitleBox, title => loc('Blocks: [_1]', $q), class => 'tickets-list-block' &>
 <& ChildSummary, %ARGS, Queue => 'Blocks', Query => $query &>
-</&>
 % }
 
 </td></tr>

commit 9eeb936af290f569e40436c7fb94bf1b3f939676
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 16:53:55 2011 +0400

    implement IncidentSummary in ChildSummary

diff --git a/html/RTIR/Tools/Elements/ChildSummary b/html/RTIR/Tools/Elements/ChildSummary
index 463ed9b..444c843 100644
--- a/html/RTIR/Tools/Elements/ChildSummary
+++ b/html/RTIR/Tools/Elements/ChildSummary
@@ -49,16 +49,17 @@ if ( $LookupType && RT::IR->CustomFields( Field => $LookupType )
     $lookup_cf_not_applies = 1;
 }
 
-my $QueryString = $m->comp('/Elements/QueryString',
-    Query   => $Query,
-);
-
 my $Format = RT->Config->Get('RTIRSearchResultFormats')->{'LookupTool'};
 if ( $TicketObj ) {
+    my $type = RT::IR::TicketType( Ticket => $TicketObj );
+
     my @show;
-    push @show, 'link' if RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident';
+    push @show, 'link' if ($Queue eq 'Incidents' && $type ne 'Incident')
+        || ($Queue ne 'Incidents' && $type eq 'Incident');
     push @show, 'merge' if $Queue eq $TicketObj->QueueObj->Name;
-    $Format .= ", '__LookupToolChildrenActions.{". join(',', $TicketObj->id, @show ) ."}__'";
+
+    my $column = $Queue eq 'Incidents'? 'Incident' : 'Children';
+    $Format .= ", '__LookupTool${column}Actions.{". join(',', $TicketObj->id, @show ) ."}__'";
 }
 
 my @box_actions;
@@ -69,7 +70,9 @@ push @box_actions, {
         Query => $Query,
     ),
 };
-if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
+if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident'
+    && $Queue ne 'Incidents'
+) {
     push @box_actions, {
         title => loc('Link'),
         path => "/RTIR/Link/ToIncident/?". $m->comp('/Elements/QueryString', 
@@ -98,6 +101,17 @@ if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) eq 'Incident' ) {
         };
     }
 }
+elsif ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) ne 'Incident'
+    && $Queue eq 'Incidents'
+) {
+    push @box_actions, {
+        title => loc('Create'),
+        path => "/RTIR/Create.html?". $m->comp('/Elements/QueryString',
+            Child => $TicketObj->id,
+            Queue => $Queue,
+        ),
+    };
+}
 my $box_actions = join ' 'x3,
     map qq{<a href="}. RT->Config->Get('WebPath') . $_->{'path'} .q{">}
         . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},

commit 5f5244b34af265d68de59fc2d8f6a82a679cd21f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 22:02:25 2011 +0400

    replace IncidentSummary and ChildSummary with one comp

diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 0f56c92..03f4d25 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -55,7 +55,7 @@ $COLUMN_MAP->{'LookupToolChildrenActions'} = {
                 \'</a>'
             ;
         }
-        elsif ( $lid != $t->id && $show{'merge'} ) {
+        if ( $lid != $t->id && $show{'merge'} ) {
             push @res, \'<a href="',
                 RT->Config->Get('WebPath') .'/RTIR/Merge/?SelectedTicket='. $t->id .'&id='. $lid,
                 \'">',
@@ -66,6 +66,39 @@ $COLUMN_MAP->{'LookupToolChildrenActions'} = {
         return @res;
     },
 };
+$COLUMN_MAP->{'LookupToolIncidentActions'} = {
+    title => 'Actions',
+    value => sub {
+        my $t = shift;
+        my ($lid, $show) = split /,/, pop(), 2;
+        my %show = map { lc($_) => 1 } split /,/, $show;
+
+        my @res;
+        if ( $show{'link'} ) {
+            push @res, \'<a href="',
+                RT->Config->Get('WebPath') .'/RTIR/Display.html?Child='. $lid .'&id='. $t->id,
+                \'">',
+                '[' . $t->loc("Link") .']',
+                \'</a>'
+            ;
+        }
+        if ( $lid != $t->id && $show{'merge'} ) {
+            push @res, \'<a href="',
+                RT->Config->Get('WebPath') .'/RTIR/Merge/?SelectedTicket='. $lid .'&id='. $t->id,
+                \'">',
+                '[' . $t->loc("Merge") .']',
+                \'</a>'
+            ;
+        }
+        push @res, \'<a href="',
+            RT->Config->Get('WebPath') .'/RTIR/Create.html?Queue=Investigations&Incident='. $t->id,
+            \'">',
+            '[' . $t->loc("Investigate") .']',
+            \'</a>'
+        ;
+        return @res;
+    },
+};
 
 </%INIT>
 <%ARGS>
diff --git a/html/RTIR/Tools/Elements/IncidentSummary b/html/RTIR/Tools/Elements/IncidentSummary
deleted file mode 100644
index 509caf2..0000000
--- a/html/RTIR/Tools/Elements/IncidentSummary
+++ /dev/null
@@ -1,130 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%# Copyright (c) 1996-2002 Jesse Vincent <jesse at bestpractical.com>
-%# 
-%# (Except where explictly superceded by other copyright notices)
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# 
-%# Unless otherwise specified, all modifications, corrections or
-%# extensions to this work which alter its source code become the
-%# property of Best Practical Solutions, LLC when submitted for
-%# inclusion in the work.
-%# 
-%# 
-%# END LICENSE BLOCK
-<table width="100%" border="0" cellpadding="2" cellspacing="0">
-
-<tr>
-<td><b><&|/l&>id<b></&></td>
-<td><b><&|/l&>Subject<b></&></td>
-<td><b><&|/l&>Status<b></&></td>
-<td><b><&|/l&>Priority<b></&></td>
-<td align="right"><b><&|/l&>Actions<b></&></td>
-</tr>
-
-% if ( $lookup_cf_not_applies ) {
-<tr><td colspan="5"><% loc("Custom field '[_1]' doesn't applies to this queue", loc($lookuptype) ) %></td></tr>
-% }
-
-% my $i=0;
-% foreach my $incident (sort keys %{$incidents}) {
-% my $Ticket = $incidents->{$incident}->{'Ticket'};
-% $i++;
-% my $t = RT::IR::TicketType( Ticket => $Ticket );
-<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
-<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%></a></b></td>
-<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></b></td>
-<td><% loc($Ticket->Status) %></td>
-</td>
-<td><%$Ticket->Priority%></td>
-<td align="right">
-% if ($Type eq 'Report' or $Type eq 'Investigation' or $Type eq 'Block') {
-<a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?Child=<%$ticket%>&id=<%$Ticket->Id%>">[<%loc("Link")%>]</a>
-% } elsif ($ticket and $Type eq $t) {
-%   if ($ticket ne $Ticket->Id) {
-<a href="<%RT->Config->Get('WebPath')%>/RTIR/Merge/?id=<%$ticket%>&SelectedTicket=<%$Ticket->Id%>">[<%loc("Merge")%>]</a>
-%   }
-% }
-<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Incident=<%$Ticket->Id%>&Queue=Investigations">[<%loc("Investigate")%>]</a>
-</td>
-</tr>
-% }
-% if ($i == 0) {
-<tr><td colspan="5"><i>(no incidents)</i></td></tr>
-% }
-
-<tr>
-<td colspan="5">
-% if ($Type eq 'Report' or $Type eq 'Investigation' or $Type eq 'Block') {
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Create.html?Child=<% $ticket %>&Queue=Incidents"><b><% loc('Create') %></b></a>]
-% }
-[<a href="<%RT->Config->Get('WebPath')%>/RTIR/Search/Results.html?Queue=Incidents&<% $QueryString %>"><% loc("Refine Search") %></a>]
-</td>
-</tr>
-</table>
-
-<%INIT>
-$session{'tickets'} ||= RT::Tickets->new( $session{'CurrentUser'} );
-$session{'tickets'}->GotoFirstItem;
-
-my $incidents;
-while ( my $Ticket = $session{'tickets'}->Next ) {
-    if ( $Ticket->QueueObj->Name eq "Incidents" ) {
-        $incidents->{ $Ticket->Id } = { Ticket => $Ticket };
-    } elsif ( $Ticket->QueueObj->Name eq "Incident Reports" ) {
-        my $parents = RT::IR->Incidents( $Ticket );
-        while ( my $parent = $parents->Next ) {
-            $incidents->{ $parent->Id } = { Ticket => $parent };
-        }
-    }
-}
-
-my @conditions = ();
-my $lookup_cf_not_applies = 0;
-if ( defined $q && length $q ) {
-    if ( $lookuptype && RT::IR->CustomFields( Field => $lookuptype ) ) {
-        my @this = RT::IR->CustomFields( Field => $lookuptype, Queue => 'Incidents' );
-        if ( @this ) {
-            push @conditions, "'CF.{$lookuptype}' = '$q'";
-        } else {
-            $lookup_cf_not_applies = 1;
-            push @conditions, "id = 0";
-        }
-    } else {
-        push @conditions, "Content LIKE '$q'";
-    }
-}
-my $Query = RT::IR->ActiveQuery( Queue => 'Incidents', And => \@conditions );
-
-my $QueryString = $m->comp('/Elements/QueryString',
-    Query => $Query,
-    Format => $Format,
-    Rows => $Rows,
-    Page => $Page,
-    OrderBy => $OrderBy,
-    Order => $Order,
-);
-</%INIT>
-
-<%ARGS>
-$Type => undef
-$ticket => undef
-$lookuptype => undef
-$q => undef
-
-$Format => undef 
-$Rows => 50
-$Page => 1
-$OrderBy => undef
-$Order => undef
-</%ARGS>
diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
index 279ed4f..99e0aa1 100644
--- a/html/RTIR/Tools/Elements/LookupRelatedTickets
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -1,22 +1,20 @@
 <table width="100%" border="0" cellpadding="2" cellspacing="0">
 <tr><td valign="top" width="50%">
 
-<&| /Widgets/TitleBox, title => loc('Incidents: [_1]', $q), class => 'tickets-list-incident' &>
-<& IncidentSummary, %ARGS, Query => $query &>
-</&>
+<& LookupSummary, %ARGS, Queue => 'Incidents', Query => $query &>
 
 </td><td valign="top" width="50%">
 
-<& ChildSummary, %ARGS, Queue => 'Investigations', Query => $query &>
+<& LookupSummary, %ARGS, Queue => 'Investigations', Query => $query &>
 
 </td></tr><tr><td valign="top" width="50%">
 
-<& ChildSummary, %ARGS, Queue => 'Incident Reports', Query => $query &>
+<& LookupSummary, %ARGS, Queue => 'Incident Reports', Query => $query &>
 
 </td><td width="50%" valign="top">
 
 % unless ( RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-<& ChildSummary, %ARGS, Queue => 'Blocks', Query => $query &>
+<& LookupSummary, %ARGS, Queue => 'Blocks', Query => $query &>
 % }
 
 </td></tr>
diff --git a/html/RTIR/Tools/Elements/ChildSummary b/html/RTIR/Tools/Elements/LookupSummary
similarity index 100%
rename from html/RTIR/Tools/Elements/ChildSummary
rename to html/RTIR/Tools/Elements/LookupSummary

commit 2b63520d7ea75aeb48695b16f85e72f0ff7c4e87
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 22:04:33 2011 +0400

    update manifest

diff --git a/MANIFEST b/MANIFEST
index 8865446..ceaa331 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -35,36 +35,28 @@ etc/upgrade/2.5.1/update_saved_searches.pl
 etc/upgrade/2.9.0/content
 etc/upgrade/upgrade.pl
 html/Callbacks/RTIR/autohandler/Default
-html/Callbacks/RTIR/Elements/ColumnMap/Once
 html/Callbacks/RTIR/Elements/EditCustomField/EditComponentName
 html/Callbacks/RTIR/Elements/Header/Default
 html/Callbacks/RTIR/Elements/Header/Head
-html/Callbacks/RTIR/Elements/ListActions/ModifyRow
 html/Callbacks/RTIR/Elements/MakeClicky/Default
 html/Callbacks/RTIR/Elements/QueueSummary/Filter
 html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
 html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
-html/Callbacks/RTIR/Elements/Tabs/Default
+html/Callbacks/RTIR/Elements/Tabs/Privileged
 html/Callbacks/RTIR/NoAuth/css/3.5-default/titlebox.css/Default
-html/Callbacks/RTIR/RTFM/Elements/Tabs/Default
 html/Callbacks/RTIR/Search/Elements/PickBasics/Default
-html/Callbacks/RTIR/Search/Elements/PickCFs/MassageCustomFields
+html/Callbacks/RTIR/Search/Results.html/Initial
 html/Callbacks/RTIR/Ticket/Create.html/Default
 html/Callbacks/RTIR/Ticket/Display.html/Initial
 html/Callbacks/RTIR/Ticket/Elements/EditCustomFields/MassageCustomFields
 html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
-html/Callbacks/RTIR/User/Elements/Tabs/Default
 html/RTIR/Advanced.html
-html/RTIR/Block/Elements/Tabs
 html/RTIR/Create.html
 html/RTIR/Display.html
 html/RTIR/Edit.html
 html/RTIR/EditUsername
 html/RTIR/Elements/AddWatchers
 html/RTIR/Elements/AttachReports
-html/RTIR/Elements/BaseQuery
-html/RTIR/Elements/ChildrenQuery
-html/RTIR/Elements/ChildSummary
 html/RTIR/Elements/DueIncidents
 html/RTIR/Elements/EditConstituency
 html/RTIR/Elements/EditCustomFields
@@ -72,54 +64,48 @@ html/RTIR/Elements/EditDates
 html/RTIR/Elements/EditPeople
 html/RTIR/Elements/EditRTIRField
 html/RTIR/Elements/Header
-html/RTIR/Elements/IncidentSummary
 html/RTIR/Elements/MakeClicky
 html/RTIR/Elements/MergeWith
-html/RTIR/Elements/NewQuery
 html/RTIR/Elements/NewReports
 html/RTIR/Elements/NobodyDueIncidents
 html/RTIR/Elements/PickRestriction
-html/RTIR/Elements/QueueSummary
-html/RTIR/Elements/QueueTabs
 html/RTIR/Elements/Refresh
+html/RTIR/Elements/ShowArticles
 html/RTIR/Elements/ShowChildren
 html/RTIR/Elements/ShowDates
 html/RTIR/Elements/ShowIncidents
 html/RTIR/Elements/ShowPeople
 html/RTIR/Elements/ShowRTIRField
-html/RTIR/Elements/SimpleSearch
-html/RTIR/Elements/States
-html/RTIR/Elements/Tabs
 html/RTIR/Elements/TransactionData
-html/RTIR/Elements/Type
 html/RTIR/Elements/UpdateData
 html/RTIR/Elements/UserDueIncidents
 html/RTIR/Forward.html
 html/RTIR/GnuPG.html
 html/RTIR/Incident/BulkAbandon.html
+html/RTIR/Incident/Children/index.html
+html/RTIR/Incident/Children/Refine.html
 html/RTIR/Incident/Create.html
 html/RTIR/Incident/Display.html
-html/RTIR/Incident/Edit.html
 html/RTIR/Incident/Elements/Create
 html/RTIR/Incident/Elements/ReplyForm
 html/RTIR/Incident/Elements/ShowChildren
-html/RTIR/Incident/Elements/Tabs
-html/RTIR/Incident/LinkArticles.html
-html/RTIR/Incident/LinkChildren.html
-html/RTIR/Incident/LinkToIncident.html
-html/RTIR/Incident/Reply.html
-html/RTIR/Incident/ShowChildren.html
+html/RTIR/Incident/Reply/index.html
+html/RTIR/Incident/Reply/Refine.html
 html/RTIR/Incident/Split.html
 html/RTIR/index.html
 html/RTIR/Investigation/Elements/Create
-html/RTIR/Investigation/Elements/Tabs
-html/RTIR/Merge.html
+html/RTIR/Link/Articles.html
+html/RTIR/Link/FromIncident/index.html
+html/RTIR/Link/FromIncident/Refine.html
+html/RTIR/Link/ToIncident/index.html
+html/RTIR/Link/ToIncident/Refine.html
+html/RTIR/Merge/index.html
+html/RTIR/Merge/Refine.html
 html/RTIR/NoAuth/images/autohandler
 html/RTIR/NoAuth/images/logo.png
 html/RTIR/NoAuth/webrtir.css
 html/RTIR/Prefs/Home.html
 html/RTIR/Report/BulkReject.html
-html/RTIR/Report/Elements/Tabs
 html/RTIR/Reporting/Elements/SLASummary
 html/RTIR/Reporting/index.html
 html/RTIR/Reporting/Report.html
@@ -127,9 +113,8 @@ html/RTIR/Reporting/Report.tsv
 html/RTIR/Reporting/Report.txt
 html/RTIR/Search/Elements/BuildQuery
 html/RTIR/Search/Elements/ProcessQuery
-html/RTIR/Search/Elements/RefineTabs
+html/RTIR/Search/Elements/RefinePage
 html/RTIR/Search/Elements/ShowResults
-html/RTIR/Search/Elements/Tabs
 html/RTIR/Search/index.html
 html/RTIR/Search/Refine.html
 html/RTIR/Search/Reporting.html
@@ -138,13 +123,14 @@ html/RTIR/ShowUser
 html/RTIR/Split.html
 html/RTIR/Tools/Elements/GetEmailFromIP
 html/RTIR/Tools/Elements/LookupRelatedTickets
-html/RTIR/Tools/Elements/Tabs
+html/RTIR/Tools/Elements/LookupSummary
 html/RTIR/Tools/Elements/ToolFormIframe
 html/RTIR/Tools/Elements/ToolFormTraceroute
 html/RTIR/Tools/Elements/ToolFormWhois
 html/RTIR/Tools/Elements/ToolResultsIframe
 html/RTIR/Tools/Elements/ToolResultsWhois
 html/RTIR/Tools/Elements/Tools
+html/RTIR/Tools/index.html
 html/RTIR/Tools/Lookup.html
 html/RTIR/Tools/ScriptedAction.html
 html/RTIR/Tools/Traceroute.html
@@ -164,13 +150,14 @@ inc/Module/Install/Substitute.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 lib/RT/Action/RTIR.pm
+lib/RT/Action/RTIR_Activate.pm
 lib/RT/Action/RTIR_ChangeChildOwnership.pm
 lib/RT/Action/RTIR_ChangeParentOwnership.pm
 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_SetBlockState.pm
+lib/RT/Action/RTIR_SetBlockStatus.pm
 lib/RT/Action/RTIR_SetConstituency.pm
 lib/RT/Action/RTIR_SetConstituencyGroup.pm
 lib/RT/Action/RTIR_SetDueBySLA.pm
@@ -179,12 +166,9 @@ lib/RT/Action/RTIR_SetDueIncident.pm
 lib/RT/Action/RTIR_SetDueReopen.pm
 lib/RT/Action/RTIR_SetDueToNow.pm
 lib/RT/Action/RTIR_SetHowReported.pm
-lib/RT/Action/RTIR_SetIncidentReportState.pm
 lib/RT/Action/RTIR_SetIncidentResolution.pm
-lib/RT/Action/RTIR_SetStartedToNow.pm
 lib/RT/Action/RTIR_SetStartsByBizHours.pm
 lib/RT/Action/RTIR_SetStartsToNow.pm
-lib/RT/Action/RTIR_SetState.pm
 lib/RT/Action/RTIR_UnsetDue.pm
 lib/RT/Condition/RTIR.pm
 lib/RT/Condition/RTIR_BlockActivation.pm
@@ -196,7 +180,7 @@ lib/RT/Condition/RTIR_ReopenTicket.pm
 lib/RT/Condition/RTIR_RequireConstituencyChange.pm
 lib/RT/Condition/RTIR_RequireConstituencyGroupChange.pm
 lib/RT/Condition/RTIR_RequireDueChange.pm
-lib/RT/Condition/RTIR_RequireStateChange.pm
+lib/RT/Condition/RTIR_RequireReportActivation.pm
 lib/RT/Condition/RTIR_StaffResponse.pm
 lib/RT/IR.pm
 lib/RT/IR/AdministrationTutorial.pod
@@ -218,10 +202,8 @@ t/000-mason-syntax.t
 t/001-basic-RTIR.t
 t/002-test-reject.t
 t/003-resolve-IR-when-all-incidents-resolved.t
-t/004-rtfm-in-rtir.t
 t/005-resolve-investigations.t
 t/006-saved-searches.t
-t/008-workflow-blocks.t
 t/009-attachments-processing.t
 t/010-bulk-reject.t
 t/011-merge.t
@@ -229,11 +211,11 @@ t/015-make-clicky.t
 t/016-date-due.t
 t/016-date-started.t
 t/019-watchers-on-create.t
-t/019-webui-block-fields.t
 t/020-incident-and-investigation.t
-t/021-gnupg-on-create.t
-t/022-gnupg-on-update.t
-t/023-gnupg-on-incident.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/acl.t
 t/constituency/basics.t
 t/constituency/email.t
@@ -244,6 +226,7 @@ t/constituency/propagation-reject.t
 t/custom-fields/defaults-config.t
 t/custom-fields/defaults-on-linking.t
 t/custom-fields/ip.t
+t/custom-fields/on-transactions.t
 t/data/gnupg/keys/general-at-example.com.2.public.key
 t/data/gnupg/keys/general-at-example.com.2.secret.key
 t/data/gnupg/keys/general-at-example.com.public.key
@@ -256,8 +239,18 @@ t/data/gnupg/keys/rt-test-at-example.com.2.public.key
 t/data/gnupg/keys/rt-test-at-example.com.2.secret.key
 t/data/gnupg/keys/rt-test-at-example.com.public.key
 t/data/gnupg/keys/rt-test-at-example.com.secret.key
+t/data/snapshot/mysql/rtir-2.6.after-rt-upgrade.sql
+t/gnupg/on-create.t
+t/gnupg/on-incident.t
+t/gnupg/on-update.t
 t/incident/abandon.t
 t/incident/bulk-abandon.t
 t/incident/split.t
 t/mail/skip_notification.t
+t/report/status.t
+t/rtfm/basics.t
+t/rtfm/on-create.t
+t/rtfm/on-update.t
+t/searches/simple.t
+t/upgrade/2.6.0-to-2.9.0.t
 UPGRADING

commit 4d8feb426418a1fcc88ac728b0b02b460df16365
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 29 22:12:49 2011 +0400

    we use RT's MakeClicky for a long time

diff --git a/html/RTIR/Elements/MakeClicky b/html/RTIR/Elements/MakeClicky
deleted file mode 100644
index 3c673d4..0000000
--- a/html/RTIR/Elements/MakeClicky
+++ /dev/null
@@ -1,148 +0,0 @@
-<%ARGS>
-$url_params => undef
-$content => undef
-$ticket => undef
-</%ARGS>
-<%ONCE>
-use Regexp::Common qw(URI net);
-use URI::URL;
-
-my $web_path = RT->Config->Get('WebPath');
-my $url_params_once;
-my $incident;
-
-my %cb = (
-    default => sub {
-        my ($value) = @_;
-        return qq{<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}q=${value}">$value</a>};
-    },
-    ip => sub {
-        my ($value) = @_;
-        my $result .= qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=ip&q=${value}">}
-                      .loc('lookup IP') .q{</a>]};
-        if ( $incident && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-            $result .= qq{[<a href="$web_path/RTIR/Create.html?Incident=$incident&Queue=Blocks&IP-Value=$value">block</a>]};
-        }
-        return $value . qq{ <span class="clickylink">$result</span>};
-    },
-    ipdecimal => sub {
-        my ($value) = @_;
-        my $i = unpack "L",$value;
-        return $value unless $value > 33554432;
-
-        my $host = do {
-            my $hostnum = sprintf "%lx", $i;
-            my $a = hex( substr( $hostnum, 0, 2 ) );
-            my $b = hex( substr( $hostnum, 2, 2 ) );
-            my $c = hex( substr( $hostnum, 4, 2 ) );
-            my $d = hex( substr( $hostnum, 6, 2 ) );
-            "$a.$b.$c.$d";
-        };
-        my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=ip&q=$host">}
-                     .loc('lookup [_1]', $host) .qq{</a>]};
-        if ( $incident && !RT->Config->Get('RTIR_DisableBlocksQueue') ) {
-            $result .= qq{ [<a href="$web_path/RTIR/Create.html?Incident=$incident&Queue=Blocks&IP-Value=$host">block</a>]};
-        }
-        return $value . qq{ <span class="clickylink">$result</span>};
-    },
-    email => sub {
-        my ($value) = @_;
-        my ($pre, $post) = split /@/, $value, 2;
-        my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=email&q=$value">}
-                      .loc('lookup email') .q{</a>]};
-        if ( $incident ) {
-            if ( $r->uri =~ /Lookup.html$/ ) {
-                $result .= qq{<input type="checkbox" name="Requestorbox-$value" unchecked />};
-            }
-            $result .= qq{[<a href="$web_path/RTIR/Create.html?Incident=$incident&Queue=Investigations&Requestors=$value">}
-                       .loc('Investigate to') .qq{</a>]};
-        }
-        $result .= qq{ [<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=host&q=$post">}
-               .loc('lookup "[_1]"', $post) .qq{</a>]};
-        return $value . qq{ <span class="clickylink">$result</span>};
-    },
-    url => sub {
-        my ($value) = @_;
-        my $uri  = URI::URL->new($value);
-        my $host = $uri->host;
-        my $result = qq{[<a target="new" href="$value">}. loc('open URL') .qq{</a>]}
-            .qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=host&q=$host">}
-            .loc('lookup "[_1]"', $host) .qq{</a>]};
-        return $value . q{ <span class="clickylink">$result</span>};
-    },
-    noc => sub {
-        my ($value) = @_;
-        my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=handle&q=$value">}
-               .loc('lookup') .qq{</a>]};
-        return $value . qq{ <span class="clickylink">$result</span>};
-    },
-    host => sub {
-        my ($value) = @_;
-        my $result = qq{[<a href="$web_path/RTIR/Tools/Lookup.html?${url_params_once}type=host&q=$value">}
-               .loc('lookup host') .qq{</a>]};
-        return $value . qq{ <span class="clickylink">$result</span>};
-    },
-);
-
-# key -> [ regexp, callback, _recache ]
-my %types = (
-    A_httpurl   => [ $RE{URI}{HTTP}{-keep}{-scheme => 'https?'},   $cb{url} ],
-    B_ip        => [ q[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}],        $cb{ip} ],
-    C_ipdecimal => [ q[\d{8,13}(?!=)],                             $cb{ipdecimal} ],
-    D_email     => [ q[(?:mailto:)?[\w\.\+-]+\@[\w\.-]+\.\w{2,3}], $cb{email} ],
-    F_domain    => [ q[(?:[\w-]+\.)+[A-Za-z]{2,3}],                $cb{host} ],
-    G_RIPE      => [ q[(?-i:[A-Z][A-Z0-9-]+)],                     $cb{noc} ],
-);
-my @allowed_types = RT->Config->Get('RTIR_MakeClicky');
-if ( @allowed_types ) {
-    foreach my $t( keys %types ) {
-        delete $types{ $t } unless grep $t =~ /^[a-z]+_\Q$_\E$/i, @allowed_types;
-    }
-}
-
-my @types = sort keys %types;
-
-foreach ( values %types ) {
-    $_->[2] = '^' . $_->[0] . '$';
-    $_->[1] ||= $cb{default};
-}
-
-my $regexp = join "|",
-             map '\b'. $_->[0] .'\b',
-             @types{ @types };
-
-my $handle = sub {
-    my $what = $_[0];
-    for my $rec( @types{ @types } ) {
-        return $rec->[1]->( $what ) if $what =~ $rec->[2];
-    }
-};
-
-</%ONCE>
-<%INIT>
-$url_params_once=$ARGS{url_params};
-
-$incident = undef;
-if ( $ticket && $ticket->QueueObj->Name eq 'Incidents' ) {
-    $incident = $ticket->Id;
-}
-
-if ( $url_params_once && $url_params_once !~ /&$/ ) {
-    $url_params_once .= "&";
-}
-$$content =~ s/($regexp)/$handle->( $1 || '' )/gsieo;
-
-</%INIT>
-<%DOC>
-# Thoughts:
-
-# 1. Regexp::Common doesn't seem to deal with URL's with user:pass in
-# them very well.  Someone send Abigail up a patch.  (Note, we're now
-# doing the HTTP thing first.)
-
-# 2. We're doing a big substitution on the whole content, and then
-# re-matching each little piece.  Does it make sense to make 5 passes
-# over the big text
-
-# 4. Callbacks are cool
-</%DOC>

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


More information about the Rt-commit mailing list