[Rt-commit] rtir branch, 2.9-trunk, updated. 2.6.1-445-g76d2564

Ruslan Zakirov ruz at bestpractical.com
Fri Oct 7 15:43:38 EDT 2011


The branch, 2.9-trunk has been updated
       via  76d25648f7112ec5df97d5b4156f8eee5530c49c (commit)
       via  f084932814e62fe7f47135ae7123cdbfef42d8c5 (commit)
       via  0dd9b35da25057541e90b7aff4f9a6700e0c1c8a (commit)
       via  bac54ba27ab2fb488ab46bcd74f203e6476edcec (commit)
       via  1d7cdfd1693c0206c7a19046304f2ebc0bdc76d1 (commit)
       via  cec31bb52feb77acbd90bfcbbe3b7ba0b17f6281 (commit)
       via  4c869bbea73dee97cc942f85a1aba8f135a334af (commit)
       via  3596735a6d815a1529df9fc22f6b5c0d935558f9 (commit)
       via  8948d85135c742d21d1d5c4af87ef9d23851e88a (commit)
       via  40e8c4720344b05f9b2602d152e068872c3dc654 (commit)
       via  a60f167a6257783c5215a0d7069c1b4865d00899 (commit)
       via  542366319581e16e27d574c991de67cf05a7c957 (commit)
       via  a003eacae585c5c9a41cc1b126e24747139090df (commit)
       via  5380d26319af1687bfec5d00028731d6e5d9155c (commit)
       via  a8afc40dfdfe951c7e0f6e71c3f62524cddb3346 (commit)
       via  88e57e8a92336b330b38f003d15ff4dad9deacb8 (commit)
       via  f10afe9f34668cf0916c212930a01590cac494ae (commit)
       via  b3264ba829a840ff87f64b8b012318c8fe571baf (commit)
       via  9e41707e2a3365e1eb37da0cc796723e91819582 (commit)
       via  0b496e0e885313dcc44a3fd184754bf0a2563c75 (commit)
       via  73564e0ff8f1438297f7b33b83eefc8a0659be1f (commit)
       via  d5d18d3170f45f8336c7b0974d6d9811a9a42217 (commit)
       via  19fdecb21fa3b490da728264b5056d4c4cd60517 (commit)
      from  4d8feb426418a1fcc88ac728b0b02b460df16365 (commit)

Summary of changes:
 TODO.porting_over_RT4                              |   18 +----
 .../Elements/EditCustomField/EditComponentName     |    2 +-
 html/Callbacks/RTIR/Elements/Header/Head           |   21 -----
 html/Callbacks/RTIR/Elements/MakeClicky/Default    |    2 +-
 .../RTIR/Elements/SelectOwner/UpdateObjectList     |    2 +-
 html/Callbacks/RTIR/Elements/Tabs/Privileged       |   58 ++++++++------
 .../NoAuth/css/3.5-default/titlebox.css/Default    |    6 --
 html/Callbacks/RTIR/NoAuth/css/base/main.css/End   |    1 +
 html/Callbacks/RTIR/Ticket/Display.html/Initial    |    6 +-
 .../Ticket/Elements/ShowHistory/SkipTransaction    |    2 +-
 html/Callbacks/RTIR/autohandler/Default            |    2 +-
 html/NoAuth/css/RTIR/base/main.css                 |    1 +
 .../webrtir.css => NoAuth/css/RTIR/base/misc.css}  |    5 -
 .../NoAuth/images => NoAuth/images/RTIR}/logo.png  |  Bin 1146 -> 1146 bytes
 html/RTIR/Create.html                              |    4 +-
 html/RTIR/Display.html                             |    4 +-
 html/RTIR/Elements/AddWatchers                     |    2 +-
 html/RTIR/Elements/Header                          |    2 +-
 html/RTIR/Elements/ShowChildren                    |    2 +-
 html/RTIR/Incident/Display.html                    |    2 +-
 html/RTIR/Incident/Elements/ReplyForm              |    9 ++-
 html/RTIR/Investigation/Elements/Create            |    4 +-
 html/RTIR/NoAuth/images/autohandler                |   27 -------
 html/RTIR/Prefs/Home.html                          |    2 +-
 html/RTIR/Reporting/Report.html                    |    4 +-
 html/RTIR/Reporting/index.html                     |   15 +---
 html/RTIR/Search/Elements/ProcessQuery             |    2 +-
 html/RTIR/Search/Reporting.html                    |   24 +-----
 html/RTIR/Search/Results.html                      |    5 +-
 html/RTIR/Tools/Elements/GetEmailFromIP            |   19 ++---
 html/RTIR/Tools/Elements/SelectWhoisServer         |   16 ++++
 html/RTIR/Tools/Elements/ToolFormIframe            |    2 +-
 html/RTIR/Tools/Elements/ToolFormWhois             |   23 ++----
 html/RTIR/Tools/Elements/ToolResultsWhois          |   22 ++----
 html/RTIR/Tools/ScriptedAction.html                |   81 +++++---------------
 html/RTIR/Tools/Traceroute.html                    |    2 +-
 html/RTIR/Update.html                              |    4 +-
 html/RTIR/index.html                               |    2 +-
 lib/RT/Action/RTIR.pm                              |    2 +-
 lib/RT/Action/RTIR_Activate.pm                     |    2 +-
 lib/RT/Action/RTIR_ChangeChildOwnership.pm         |    4 +-
 lib/RT/Action/RTIR_ChangeParentOwnership.pm        |    4 +-
 lib/RT/Action/RTIR_FindIP.pm                       |    4 +-
 lib/RT/Action/RTIR_MergeIPs.pm                     |    4 +-
 lib/RT/Action/RTIR_OpenParent.pm                   |    2 +-
 lib/RT/Action/RTIR_SetBlockStatus.pm               |    2 +-
 lib/RT/Action/RTIR_SetConstituency.pm              |   26 +++---
 lib/RT/Action/RTIR_SetConstituencyGroup.pm         |   14 ++--
 lib/RT/Action/RTIR_SetDueBySLA.pm                  |    2 +-
 lib/RT/Action/RTIR_SetDueCorrespond.pm             |    2 +-
 lib/RT/Action/RTIR_SetDueIncident.pm               |    4 +-
 lib/RT/Action/RTIR_SetDueReopen.pm                 |    2 +-
 lib/RT/Action/RTIR_SetDueToNow.pm                  |    6 +-
 lib/RT/Action/RTIR_SetIncidentResolution.pm        |    2 +-
 lib/RT/Action/RTIR_SetStartsByBizHours.pm          |    2 +-
 lib/RT/Action/RTIR_SetStartsToNow.pm               |    2 +-
 lib/RT/Action/RTIR_UnsetDue.pm                     |    2 +-
 lib/RT/Condition/RTIR.pm                           |    2 +-
 lib/RT/Condition/RTIR_LinkingToIncident.pm         |    2 +-
 lib/RT/IR.pm                                       |   74 +++++++++++++-----
 t/walk-web.t                                       |   53 +++++++++++++
 61 files changed, 292 insertions(+), 332 deletions(-)
 delete mode 100644 html/Callbacks/RTIR/Elements/Header/Head
 delete mode 100644 html/Callbacks/RTIR/NoAuth/css/3.5-default/titlebox.css/Default
 create mode 100644 html/Callbacks/RTIR/NoAuth/css/base/main.css/End
 create mode 100644 html/NoAuth/css/RTIR/base/main.css
 rename html/{RTIR/NoAuth/webrtir.css => NoAuth/css/RTIR/base/misc.css} (96%)
 rename html/{RTIR/NoAuth/images => NoAuth/images/RTIR}/logo.png (100%)
 delete mode 100644 html/RTIR/NoAuth/images/autohandler
 create mode 100644 html/RTIR/Tools/Elements/SelectWhoisServer
 create mode 100644 t/walk-web.t

- Log -----------------------------------------------------------------
commit 19fdecb21fa3b490da728264b5056d4c4cd60517
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Oct 3 23:26:26 2011 +0200

    switch Reporting.html over new tabs

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 05f28e7..ef891ac 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -24,8 +24,6 @@
 
 === FIX
 
-* html/RTIR/Search/Reporting.html still uses old tabs
-
 * html/RTIR/Search/Results.html has results argument
   that is passed into ListActions, get rid of it
 
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 575c234..1d5670c 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -1,10 +1,5 @@
 <& /Elements/Header, Title => $title &>
-<& '/RTIR/'.$Type.'/Elements/Tabs',
-    Title       => $title,
-    QueryString => $QueryString,
-
-    current_tab => $current_tab,
-&>
+<& /Elements/Tabs &>
 <& /Elements/ListActions, actions => \@results &>
 
 <form method="get" action="<% RT->Config->Get('WebPath') %>/RTIR/Search/Reporting.html">
@@ -29,20 +24,8 @@
 <%INIT>
 my $title = loc('Reporting');
 
-my $Type = RT::IR::TicketType( Queue => $Queue );
-
 my $FullQuery = join ' AND ', map "( $_ )", grep $_, $BaseQuery, $Query;
 
-my $QueryString = $m->comp( '/Elements/QueryString',
-                            Query     => $Query,
-                            Format    => $Format,
-                            Rows      => $Rows,
-                            Page      => $Page,
-                            OrderBy   => $OrderBy,
-                            Order     => $Order,
-                          );
-my $BaseURL = "RTIR/Search/Reporting.html?". $m->comp( '/Elements/QueryString', Queue => $Queue );
-my $current_tab = "$BaseURL&$QueryString";
 </%INIT>
 
 <%ARGS>

commit d5d18d3170f45f8336c7b0974d6d9811a9a42217
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Mon Oct 3 23:30:31 2011 +0200

    switch Reporting/index.html over new Tabs

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index ef891ac..e366e2e 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -41,4 +41,4 @@
 There is no single test for:
     .../Link/FromIncident/index.html
     .../Search/Reporting.html
-
+    .../Reporting/index.html
diff --git a/html/RTIR/Reporting/index.html b/html/RTIR/Reporting/index.html
index 89d5055..638b975 100644
--- a/html/RTIR/Reporting/index.html
+++ b/html/RTIR/Reporting/index.html
@@ -23,12 +23,7 @@
 %# 
 %# END LICENSE BLOCK
 <& /RTIR/Elements/Header, Title => $title &>
-<& /RTIR/Tools/Elements/Tabs,
-    current_toptab => 'RTIR/Tools/Lookup.html',
-    current_tab    => 'RTIR/Reporting/index.html',
-    current_subtab => 'RTIR/Reporting/index.html',
-    Title          => $title,
-&>
+<& /Elements/Tabs &>
 
 <form action="index.html" method="post">
 <table>

commit 73564e0ff8f1438297f7b33b83eefc8a0659be1f
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Tue Oct 4 13:46:06 2011 +0200

    we don't need @results argument in *.html
    
    ListActions takes care of $results argument

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index e366e2e..ce3c411 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -22,11 +22,6 @@
    be deleted, we create new investigations and incidents with First
    available status
 
-=== FIX
-
-* html/RTIR/Search/Results.html has results argument
-  that is passed into ListActions, get rid of it
-
 === CLEANUP && REFACTORING
 
 * re-use CSS squishing
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 1d5670c..c4518ad 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -1,6 +1,6 @@
 <& /Elements/Header, Title => $title &>
 <& /Elements/Tabs &>
-<& /Elements/ListActions, actions => \@results &>
+<& /Elements/ListActions &>
 
 <form method="get" action="<% RT->Config->Get('WebPath') %>/RTIR/Search/Reporting.html">
 % my %hiddens = (Queue => $Queue, Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order);
@@ -42,7 +42,4 @@ $Rows      => 50
 $Page      => 1
 $OrderBy   => 'id'
 $Order     => 'ASC'
-
- at results   => ()
-
 </%ARGS>
diff --git a/html/RTIR/Search/Results.html b/html/RTIR/Search/Results.html
index 6fa21af..235a8d7 100644
--- a/html/RTIR/Search/Results.html
+++ b/html/RTIR/Search/Results.html
@@ -45,8 +45,7 @@
 %# }}} END BPS TAGGED BLOCK
 <& /Elements/Header, Title => $title, Refresh => $session{'tickets_refresh_interval'} || 0 &>
 <& /Elements/Tabs &>
-
-<& /Elements/ListActions, actions => \@results &>
+<& /Elements/ListActions &>
 
 <& Elements/ShowResults,
     %ARGS,
@@ -88,6 +87,4 @@ $Rows      => 50
 $Page      => 1
 $OrderBy   => 'id'
 $Order     => 'ASC'
-
- at results   => ()
 </%ARGS>
diff --git a/html/RTIR/index.html b/html/RTIR/index.html
index 7660088..e85a40f 100644
--- a/html/RTIR/index.html
+++ b/html/RTIR/index.html
@@ -49,6 +49,7 @@ if ( defined $q && length $q ) {
     );
 }
 
+my @results;
 if ( $HomeRefreshInterval ) {
     $session{'home_refresh_interval'} = $HomeRefreshInterval;
     push @results, loc( 'Updated refresh interval.');
@@ -56,7 +57,6 @@ if ( $HomeRefreshInterval ) {
 
 </%INIT>
 <%ARGS>
- at results => ()
 $HomeRefreshInterval => undef
 $q => undef
 </%ARGS>

commit 0b496e0e885313dcc44a3fd184754bf0a2563c75
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 09:22:52 2011 +0200

    reporting link is incidents special
    
    link should point to .../Reporting/

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index ca4ebbe..889399b 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -414,13 +414,13 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update)\.html$}
         ),
     );
 
-    PageMenu()->child(
-        report => title => loc('Report'),
-        path => "/RTIR/Report/Reporting.html?". $query_string->( %args ),
-    );
-
     if ( $type eq 'Incident' ) {
         PageMenu()->child(
+            report => title => loc('Report'),
+            path => "/RTIR/Reporting/",
+        );
+
+        PageMenu()->child(
             abandon => title => loc('Bulk Abandon'),
             path => "/RTIR/Incident/BulkAbandon.html?". $query_string->( %args ),
         );

commit 9e41707e2a3365e1eb37da0cc796723e91819582
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 09:24:34 2011 +0200

    RTIR has its own charting page

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 889399b..b917e72 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -433,7 +433,7 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update)\.html$}
     }
     PageMenu()->child(
         chart => title => loc('Chart'),
-        path => "/Search/Chart.html?". $query_string->( %args ),
+        path => "/RTIR/Search/Reporting.html?". $query_string->( %args ),
     );
 
     my $more = PageMenu->child( more => title => loc('Feeds') );

commit b3264ba829a840ff87f64b8b012318c8fe571baf
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:09:27 2011 +0200

    if queue is there query is defined, otherwise skip some tabs

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index b917e72..7387d7e 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -442,27 +442,35 @@ if ( $request_path =~ m{^/RTIR/(?:$re_rtir_types/)?(Display|Edit|Update)\.html$}
         path => "/Search/Results.tsv?". $query_string->( %args ),
     );
 
-    my $RSSPath = join '/', map $m->interp->apply_escapes( $_, 'u' ),
-        $session{'CurrentUser'}->UserObj->Name,
-        $session{'CurrentUser'}->UserObj->GenerateAuthString(
-            join '', map $args{$_}, qw(Query Order OrderBy)
-        )
-    ;
-    $more->child(
-        rss => title => loc('RSS'),
-        path => "/NoAuth/rss/$RSSPath/?". $query_string->(
-            Query => $args{Query}, Order => $args{Order}, OrderBy => $args{OrderBy}
-        ),
-    );
+    # other paths need query defined
+    $args{'Query'} = RT::IR->Query( Queue => $args{'Queue'} )
+        if !$args{'Query'} && $args{'Queue'};
+
+    if ( $args{'Query'} ) {
+        my $RSSPath = join '/', map $m->interp->apply_escapes( $_, 'u' ),
+            $session{'CurrentUser'}->UserObj->Name,
+            $session{'CurrentUser'}->UserObj->GenerateAuthString(
+                join '', map $args{$_}, qw(Query Order OrderBy)
+            )
+        ;
+        $more->child(
+            rss => title => loc('RSS'),
+            path => "/NoAuth/rss/$RSSPath/?". $query_string->(
+                Query => $args{Query}, Order => $args{Order}, OrderBy => $args{OrderBy}
+            ),
+        );
 
-    my $ical_path = join '/', map $m->interp->apply_escapes($_, 'u'),
-        $session{'CurrentUser'}->UserObj->Name,
-        $session{'CurrentUser'}->UserObj->GenerateAuthString( $args{Query} ),
-        $args{Query}
-    ;
-    $more->child( ical => title => loc('iCal') => path => '/NoAuth/iCal/'.$ical_path);
+        my $ical_path = join '/', map $m->interp->apply_escapes($_, 'u'),
+            $session{'CurrentUser'}->UserObj->Name,
+            $session{'CurrentUser'}->UserObj->GenerateAuthString( $args{Query} ),
+            $args{Query}
+        ;
+        $more->child( ical => title => loc('iCal') => path => '/NoAuth/iCal/'.$ical_path);
+    }
 
-    if ( $session{'CurrentUser'}->HasRight( Right => 'SuperUser', Object => RT->System ) ) {
+    if ( $args{'Query'} && $session{'CurrentUser'}->HasRight(
+        Right => 'SuperUser', Object => RT->System
+    ) ) {
         my $shred_args = $query_string->(
             search          => 1,
             plugin          => 'Tickets',

commit f10afe9f34668cf0916c212930a01590cac494ae
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:10:26 2011 +0200

    pass queue object so RTFM can properly load articles

diff --git a/html/RTIR/Incident/Elements/ReplyForm b/html/RTIR/Incident/Elements/ReplyForm
index b0b15f6..7125b42 100644
--- a/html/RTIR/Incident/Elements/ReplyForm
+++ b/html/RTIR/Incident/Elements/ReplyForm
@@ -44,7 +44,7 @@
 &>
 </td></tr>
 
-<& /RTIR/Elements/UpdateData, %ARGS, Ticket => $TicketObj &>
+<& /RTIR/Elements/UpdateData, %ARGS, Ticket => $TicketObj, QueueObj => $queue &>
 
 </table>
 
@@ -60,6 +60,13 @@ if ( $Action eq 'Comment' || $UpdateType eq 'private' ) {
     $ResponseDefault = "selected";
 }
 
+my $queue;
+$queue = $TicketObj->QueueObj if $TicketObj;
+unless ( $queue ) {
+    $queue = RT::Queue->new( $session{'CurrentUser'} );
+    $queue->Load('Incidents');
+}
+
 </%INIT>
 <%ARGS>
 $Title         => loc('Reply to selected tickets'),

commit 88e57e8a92336b330b38f003d15ff4dad9deacb8
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:22:54 2011 +0200

    ->_PrivacyObjects on RT::SavedSearches is deprecated

diff --git a/html/RTIR/Prefs/Home.html b/html/RTIR/Prefs/Home.html
index 18122b2..f1d273b 100644
--- a/html/RTIR/Prefs/Home.html
+++ b/html/RTIR/Prefs/Home.html
@@ -41,7 +41,7 @@ foreach my $comp ( grep !$seen{$_}++, (RT->Config->Get('RTIR_HomepageComponents'
 my $sys = RT::System->new($session{'CurrentUser'});
 my @objs = ($sys);
 
-push @objs, RT::SavedSearches->new( $session{'CurrentUser'} )->_PrivacyObjects
+push @objs, RT::SavedSearch->new( $session{'CurrentUser'} )->_PrivacyObjects
     if $session{'CurrentUser'}->HasRight( Right  => 'LoadSavedSearch',
                                           Object => $RT::System );
 

commit a8afc40dfdfe951c7e0f6e71c3f62524cddb3346
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:23:34 2011 +0200

    id of the ticket in $Split, not SplitObj

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index ce3c411..c60bcfe 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -37,3 +37,4 @@ There is no single test for:
     .../Link/FromIncident/index.html
     .../Search/Reporting.html
     .../Reporting/index.html
+    .../Split.html
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index d5376ab..abaaee4 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -377,7 +377,7 @@ $Incident = $ARGS{'Incident'} = $IncidentObj->id if $IncidentObj;
 
 my $SplitObj;
 if ( $Split ) {
-    $SplitObj = LoadTicket( $SplitObj );
+    $SplitObj = LoadTicket( $Split );
     $ARGS{'Split'} = $Split = $SplitObj->id;
 }
 

commit 5380d26319af1687bfec5d00028731d6e5d9155c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:37:05 2011 +0200

    walk the web in tests like we do in RT

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index c60bcfe..4a2af12 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -33,7 +33,7 @@
 
 === TESTS
 
-There is no single test for:
+We walk the web, but there is no single functionality test for:
     .../Link/FromIncident/index.html
     .../Search/Reporting.html
     .../Reporting/index.html
diff --git a/t/walk-web.t b/t/walk-web.t
new file mode 100644
index 0000000..4730303
--- /dev/null
+++ b/t/walk-web.t
@@ -0,0 +1,53 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use HTML::TreeBuilder;
+
+use RT::IR::Test tests => 609;
+
+RT::Test->started_ok;
+my $m = default_agent();
+
+my %viewed = ( '/NoAuth/Logout.html' => 1 );    # in case logout
+
+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] });
+
+my @links = (
+    '/RTIR/',
+    (map "/RTIR/Display.html?id=$_", @tickets),
+);
+
+for my $link (@links) {
+    test_page($m, $link);
+}
+
+$m->get_ok('/NoAuth/Logout.html');
+
+sub test_page {
+    my $m = shift;
+    my $link = shift;
+    $m->get_ok( $link, $link );
+    $m->no_warnings_ok($link);
+
+    my $tree = HTML::TreeBuilder->new();
+    $tree->parse( $m->content );
+    $tree->elementify;
+    my ($top_menu)  = $tree->look_down( id => 'main-navigation' );
+    my ($page_menu) = $tree->look_down( id => 'page-navigation' );
+
+    my (@links) =
+      grep { m{^/*RTIR/*} && /^[^#]/ && !$viewed{$_}++ }
+      map { $_->attr('href') || () } ( $top_menu ? $top_menu->find('a') : () ),
+      ( $page_menu ? $page_menu->find('a') : () );
+
+    for my $link (@links) {
+        test_page($m, $link);
+    }
+}
+

commit a003eacae585c5c9a41cc1b126e24747139090df
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:42:42 2011 +0200

    lifecycles will default status to first available
    
    no need in default value

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 4a2af12..67c349b 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -18,9 +18,6 @@
   page comes first to mind
 
 * scan code for hardcoded statuses
-** html/RTIR/Tools/ScriptedAction.html uses open, probably it should
-   be deleted, we create new investigations and incidents with First
-   available status
 
 === CLEANUP && REFACTORING
 
diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index 32a0fa0..31fa4bd 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -33,7 +33,7 @@
 <input type="hidden" name="Action" value="Respond" />
 <input type="hidden" name="Owner" value="<%$session{'CurrentUser'}->Id%>" />
 <input type="hidden" name="id" value="new" />
-<input type="hidden" name="Status" value="<%$ARGS{Status}||'open'%>" />
+<input type="hidden" name="Status" value="<% $ARGS{Status} || '' %>" />
 <a name="top"></a>
         
 % if ( $ARGS{'TestAddresses'} && keys %$addrhash ) {

commit 542366319581e16e27d574c991de67cf05a7c957
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 11:51:29 2011 +0200

    move logo image -> no need in custom autohandler

diff --git a/html/RTIR/NoAuth/images/logo.png b/html/NoAuth/images/RTIR/logo.png
similarity index 100%
rename from html/RTIR/NoAuth/images/logo.png
rename to html/NoAuth/images/RTIR/logo.png
diff --git a/html/RTIR/Elements/Header b/html/RTIR/Elements/Header
index 9343909..8535490 100644
--- a/html/RTIR/Elements/Header
+++ b/html/RTIR/Elements/Header
@@ -24,7 +24,7 @@
 <& /Elements/Header,
     URL  => RT->Config->Get('WebPath') ."/RTIR/index.html",
     Name => loc("RTIR for [_1]", RT->Config->Get('rtirname')),
-    LogoURL => RT->Config->Get('WebPath')."/RTIR/NoAuth/images/logo.png",
+    LogoURL => RT->Config->Get('WebPath')."/NoAuth/images/RTIR/logo.png",
     %ARGS
 
 &>
diff --git a/html/RTIR/NoAuth/images/autohandler b/html/RTIR/NoAuth/images/autohandler
deleted file mode 100644
index 7018a44..0000000
--- a/html/RTIR/NoAuth/images/autohandler
+++ /dev/null
@@ -1,27 +0,0 @@
-<%INIT>
-
-# This autohandler will spit out RT's images if the user hasn't 
-# properly configured their webserver to stop RT from passing 
-# images through the mason handler.
-
-my $file = $m->base_comp->source_file;
-
-my $type = "application/octet-stream";
-if ($file =~ /\.(gif|png|jpe?g)$/i) {
-    $type = "image/$1";
-    $type =~ s/jpg/jpeg/gi;
-}
-
-die "file not found" unless -f $file && -r _;
-
-$r->content_type($type);
-open my $fh, "<$file" or die "couldn't open file: $!";
-binmode($fh);
-{
-    local $/ = \16384;
-    $m->out($_) while (<$fh>);
-    $m->flush_buffer;
-}
-close $fh;
-$m->abort;
-</%INIT>

commit a60f167a6257783c5215a0d7069c1b4865d00899
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 13:48:27 2011 +0200

    there is no 3.5-default style in RT4

diff --git a/html/Callbacks/RTIR/NoAuth/css/3.5-default/titlebox.css/Default b/html/Callbacks/RTIR/NoAuth/css/3.5-default/titlebox.css/Default
deleted file mode 100644
index dc0a29d..0000000
--- a/html/Callbacks/RTIR/NoAuth/css/3.5-default/titlebox.css/Default
+++ /dev/null
@@ -1,6 +0,0 @@
-<%ARGS>
-$pages => []
-</%ARGS>
-<%INIT>
-push @$pages, 'RTIR';
-</%INIT>

commit 40e8c4720344b05f9b2602d152e068872c3dc654
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Oct 5 14:03:22 2011 +0200

    use CSS squishing for RTIR

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 67c349b..00f80e8 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -21,8 +21,6 @@
 
 === CLEANUP && REFACTORING
 
-* re-use CSS squishing
-
 * stop abusing $session{'tickets'} so we can get working
   First, Prev, Next and Last links in RTIR.
 
diff --git a/html/Callbacks/RTIR/Elements/Header/Head b/html/Callbacks/RTIR/Elements/Header/Head
deleted file mode 100644
index df03d4f..0000000
--- a/html/Callbacks/RTIR/Elements/Header/Head
+++ /dev/null
@@ -1,21 +0,0 @@
-%# BEGIN LICENSE BLOCK
-%# 
-%#  Copyright (c) 2002-2003 Jesse Vincent <jesse at bestpractical.com>
-%#  
-%#  This program is free software; you can redistribute it and/or modify
-%#  it under the terms of version 2 of the GNU General Public License 
-%#  as published by the Free Software Foundation.
-%# 
-%#  A copy of that license should have arrived with this
-%#  software, but in any event can be snarfed from www.gnu.org.
-%# 
-%#  This program 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.
-%# 
-%# END LICENSE BLOCK
-<link rel="stylesheet" href="<%RT->Config->Get('WebPath')%>/RTIR/NoAuth/webrtir.css" type="text/css">
-<%INIT>
-return unless $m->request_comp->path =~ m{^/RTIR/};
-</%INIT>
diff --git a/html/Callbacks/RTIR/NoAuth/css/base/main.css/End b/html/Callbacks/RTIR/NoAuth/css/base/main.css/End
new file mode 100644
index 0000000..b8fa78a
--- /dev/null
+++ b/html/Callbacks/RTIR/NoAuth/css/base/main.css/End
@@ -0,0 +1 @@
+ at import "../RTIR/base/main.css";
\ No newline at end of file
diff --git a/html/NoAuth/css/RTIR/base/main.css b/html/NoAuth/css/RTIR/base/main.css
new file mode 100644
index 0000000..49a037b
--- /dev/null
+++ b/html/NoAuth/css/RTIR/base/main.css
@@ -0,0 +1 @@
+ at import "misc.css";
diff --git a/html/RTIR/NoAuth/webrtir.css b/html/NoAuth/css/RTIR/base/misc.css
similarity index 100%
rename from html/RTIR/NoAuth/webrtir.css
rename to html/NoAuth/css/RTIR/base/misc.css

commit 8948d85135c742d21d1d5c4af87ef9d23851e88a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 18:50:16 2011 +0400

    get rid of uninit warning

diff --git a/html/RTIR/Tools/Elements/ToolFormIframe b/html/RTIR/Tools/Elements/ToolFormIframe
index e78d4a4..bbd985e 100644
--- a/html/RTIR/Tools/Elements/ToolFormIframe
+++ b/html/RTIR/Tools/Elements/ToolFormIframe
@@ -15,7 +15,7 @@
 </form>
 <%args>
 $q => undef
-$ResearchTool => undef
+$ResearchTool => ''
 @PassArguments => ()
 </%args>
 <%INIT>

commit 3596735a6d815a1529df9fc22f6b5c0d935558f9
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 18:51:41 2011 +0400

    refactor whois lookups
    
    extract things into libs
    * finding first whois server
    * whois lookups

diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index 00f80e8..898da17 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -24,7 +24,6 @@
 * stop abusing $session{'tickets'} so we can get working
   First, Prev, Next and Last links in RTIR.
 
-* code for getting default whois server is repeated
 
 === TESTS
 
diff --git a/html/RTIR/Tools/Elements/GetEmailFromIP b/html/RTIR/Tools/Elements/GetEmailFromIP
index 0da88d6..1429fb5 100644
--- a/html/RTIR/Tools/Elements/GetEmailFromIP
+++ b/html/RTIR/Tools/Elements/GetEmailFromIP
@@ -27,23 +27,20 @@
 
 $$address = loc("ADDRESS_UNKNOWN");
 
-use Net::Whois::RIPE;
-my $whois = Net::Whois::RIPE->new( $server, Debug => 1 );
-unless ( $whois ) {
-    $$error = loc("Unable to connect to whois server '[_1]'", $server);
-    return;
-}
-
-my @query = grep defined, $whois->query($q);
-unless ( @query ) {
-    $$error = loc("Unable to connect to whois server '[_1]'", $server);
+my ($iterator, $msg) = RT::IR->WhoisLookup(
+    Server => $server,
+    Query => $q,
+    CurrentUser => $session{'CurrentUser'},
+);
+unless ( $iterator ) {
+    $$error = $msg;
     return;
 }
 
 $field ||= 'notify';
 
 my @res;
-foreach my $query ( @query ) {
+while ( my $query = $iterator->next ) {
     foreach my $attr ( grep lc $_ eq lc $field, $query->attributes ) {
         push @res, $query->$attr();
     }
diff --git a/html/RTIR/Tools/Elements/SelectWhoisServer b/html/RTIR/Tools/Elements/SelectWhoisServer
new file mode 100644
index 0000000..83488d8
--- /dev/null
+++ b/html/RTIR/Tools/Elements/SelectWhoisServer
@@ -0,0 +1,16 @@
+<select name="<% $Name %>">
+<%PERL>
+foreach my $s ( sort grep $servers{ $_ }, keys %servers ) {
+    my $srv = $servers{ $s };
+    my ($host, $name) = ref $srv?  ($srv->{'Host'}, $srv->{'FriendlyName'}): ($srv, '');
+</%PERL>
+    <option value="<% $host %>" <% $host eq $Default ? 'selected' : '' %>><% $name || $host %></option>
+% }
+</select>
+<%ARGS>
+$Name => 'WhoisServer'
+$Default => ''
+</%ARGS>
+<%INIT>
+my %servers = %{ RT->Config->Get('whois') || {} };
+</%INIT>
diff --git a/html/RTIR/Tools/Elements/ToolFormWhois b/html/RTIR/Tools/Elements/ToolFormWhois
index 7336e69..386dc3b 100644
--- a/html/RTIR/Tools/Elements/ToolFormWhois
+++ b/html/RTIR/Tools/Elements/ToolFormWhois
@@ -2,21 +2,12 @@
 % foreach my $arg ( grep exists $ARGS{$_}, @PassArguments ) {
   <input type="hidden" name="<% $arg %>" value="<% $ARGS{ $arg } %>" />
 % }
-  <tr>
-    <span class="label">WHOIS:</span>
-    <span class="input">
-      <input type="text" size="30" name="q" value="<% $q %>" /> at 
-      <select name="WhoisServer">
-<%PERL>
-foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
-    my $srv = $servers->{ $s };
-    my ($host, $name) = ref $srv?  ($srv->{'Host'}, $srv->{'FriendlyName'}): ($srv, '');
-</%PERL>
-        <option value="<% $host %>" <% $host eq $WhoisServer ? 'SELECTED' : '' %>><% $name || $host %></option>
-% }
-      </select>
-    </span>
-    <input type="submit" value="<%loc('Go')%>" />
+  <span class="label">WHOIS:</span>
+  <span class="input">
+    <input type="text" size="30" name="q" value="<% $q %>" /> at 
+    <& SelectWhoisServer, Name => 'WhoisServer', Default => $WhoisServer &>
+  </span>
+  <input type="submit" value="<%loc('Go')%>" />
 </form>
 <%args>
 $q => undef
@@ -25,8 +16,6 @@ $server => undef
 @PassArguments => ()
 </%args>
 <%INIT>
-my $servers = RT->Config->Get('whois');
-
 $WhoisServer = $server unless defined $WhoisServer;
 $WhoisServer ||= '';
 </%INIT>
diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
index 519b39c..27c5813 100644
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -18,7 +18,7 @@ if ( $WhoisIterator ) {
             my $content = join "", $obj->content;
             $m->comp( '/Elements/MakeClicky',
                 ticket        => $TicketObj,
-                lookup_params => "ticket=". $TicketObj->id ."&server=$WhoisServer",
+                lookup_params => "ticket=". ($TicketObj? $TicketObj->id : 0) ."&server=$WhoisServer",
                 content       => \$content,
             );
             $DoInvestigate = 1 if $content =~ /Requestorbox/ig;
@@ -66,21 +66,13 @@ $server => undef
 $WhoisServer = $server unless defined $WhoisServer;
 unless ($WhoisServer) {
     return unless RT->Config->Get('RunWhoisRequestByDefault');
-
-    my $servers = RT->Config->Get('whois');
-    ($WhoisServer) = map ref $servers->{$_}? $servers->{$_}->{'Host'}: $servers->{$_},
-        (sort keys %$servers)[0];
-}
-
-use Net::Whois::RIPE;
-my ($whois, $port) = split(/\s*:\s*/, $WhoisServer, 2);
-$port = 43 unless ($port || '') =~ /^\d+$/;
-my $query = Net::Whois::RIPE->new( $whois, Port => $port, Debug => 1 );
-my ($WhoisIterator, $WhoisError);
-$WhoisIterator = $query->query_iterator($q) if $query;
-unless ( $WhoisIterator ) {
-    $WhoisError = loc( "Unable to connect to WHOIS server '[_1]'", $WhoisServer);
+    $WhoisServer = RT::IR->FirstWhoisServer;
 }
 
+my ($WhoisIterator, $WhoisError) = RT::IR->WhoisLookup(
+    Server => $WhoisServer,
+    Query => $q,
+    CurrentUser => $session{'CurrentUser'},
+);
 
 </%init>
diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index 31fa4bd..b594a47 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -54,35 +54,15 @@
 % if ($loop eq 'IP') {
   <tr>
     <td class="label">WHOIS:</td>
-  <td>
-  <table>
-  <tr>
-    <td class="input">
-      <select name="server">
-<%PERL>
-foreach my $entry ( map $whois_servers->{ $_ }, sort keys %{$whois_servers} ) {
-    next unless $entry;
-
-    my ($host, $name) = ref($entry)
-        ? ($entry->{'Host'}, $entry->{'FriendlyName'})
-        : ($entry, $entry);
-    next unless $host;
-
-    my $selected = "";
-    $selected = " selected" if $host eq $server;
-</%PERL>
-        <option value="<% $host %>" <% $selected %>><% $name || $host %></option>
-% }
-      </select>
-  </tr>
-  </table>
-  </td>
+    <td class="value">
+        <& Elements/SelectWhoisServer, Name => 'server', Default => $server &>
+    </td>
   </tr>
   <tr>
     <td class="label">
       <&|/l&>Contact Field</&>:
     </td>
-    <td>
+    <td class="value">
       <input type="text" name="field" value="<% $ARGS{'field'} %>" />
     </td>
   </tr>
@@ -129,6 +109,7 @@ foreach my $entry ( map $whois_servers->{ $_ }, sort keys %{$whois_servers} ) {
   </td>
 </tr>
 </table>
+
 % if ($loop eq "IP") {
 <& /Elements/Submit, Name => "TestAddresses", Caption => loc("Test email addresses"), Label => loc("Test")&>
 % }
@@ -217,16 +198,6 @@ if ($incidentid) {
 
 $ARGS{'loop'} = $loop if !defined $ARGS{'loop'};
 
-# get the list of WHOIS servers
-my $whois_servers = RT->Config->Get('whois');
-unless ( $server ) {
-    ($server) =
-        grep defined && length,
-        map ref( $_ )? $_->{'Host'} : $_,
-        map $whois_servers->{ $_ },
-        sort keys %$whois_servers;
-}
-
 # Load the Incidents Queue
 my $incidentq = new RT::Queue($session{'CurrentUser'});
 unless ( $incidentq->Load('Incidents') ) {
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index 80ac610..f14c40e 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -485,6 +485,40 @@ sub MapStatus {
     return $res;
 }
 
+sub FirstWhoisServer {
+    my $self = shift;
+    my $servers = RT->Config->Get('whois');
+    my ($res) = map ref $servers->{$_}? $servers->{$_}->{'Host'}: $servers->{$_},
+        (sort keys %$servers)[0];
+    return $res;
+}
+
+sub WhoisLookup {
+    my $self = shift;
+    my %args = (
+        Server => undef,
+        Query  => undef,
+        @_
+    );
+
+    my $server = $args{'Server'} || $self->FirstWhoisServer;
+    return (undef, $args{'CurrentUser'}->loc("No whois servers configured"))
+        unless $server;
+
+    my ($host, $port) = split /\s*:\s*/, $server, 2;
+    $port = 43 unless ($port || '') =~ /^\d+$/;
+
+    use Net::Whois::RIPE;
+    my $whois = Net::Whois::RIPE->new( $host, Port => $port, Debug => 1 );
+    my $iterator;
+    $iterator = $whois->query_iterator( $args{'Query'} )
+        if $whois;
+    return (undef, $args{'CurrentUser'}->loc("Unable to connect to WHOIS server '[_1]'", $server) )
+        unless $iterator;
+
+    return $iterator;
+}
+
 sub GetCustomField {
     my $field = shift or return;
     return (__PACKAGE__->CustomFields( $field ))[0];

commit 4c869bbea73dee97cc942f85a1aba8f135a334af
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 20:39:25 2011 +0400

    use classes for all cells in the table

diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index b594a47..ead10dc 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -59,18 +59,14 @@
     </td>
   </tr>
   <tr>
-    <td class="label">
-      <&|/l&>Contact Field</&>:
-    </td>
-    <td class="value">
-      <input type="text" name="field" value="<% $ARGS{'field'} %>" />
-    </td>
+    <td class="label"><&|/l&>Contact Field</&>:</td>
+    <td class="value"><input type="text" name="field" value="<% $ARGS{'field'} %>" /></td>
   </tr>
   <tr>
-    <td class="labeltop">
+    <td class="label">
       <&|/l&>IP Addresses</&>:<br /><small>arg: <i>_IP_</i></small>
     </td>
-    <td colspan="5">
+    <td class="value">
 % if (exists $ARGS{IPs}) {
       <& /Elements/MessageBox, Name=>"IPs", Width => 30, Default=>$ARGS{IPs}, IncludeSignature => 0, %ARGS&>
 % } else {
@@ -80,10 +76,8 @@
   </tr>
 % } else {
   <tr>
-    <td class="labeltop">
-      <&|/l&>Addresses</&>:<br /><small>arg: <i>_ADDR_</i></small>
-    </td>
-    <td colspan="5">
+    <td class="label"><&|/l&>Addresses</&>:<br /><small>arg: <i>_ADDR_</i></small></td>
+    <td class="value">
 % if (exists $ARGS{Addresses}) {
       <& /Elements/MessageBox, Name=>"Addresses", Width => 30, Default=>$ARGS{Addresses}, IncludeSignature => 0, %ARGS&>
 % } else {
@@ -93,18 +87,14 @@
   </tr>
 % }
 <tr>
-  <td class="label">
-    <&|/l&>Template</&>:
-  </td>
-  <td>
+  <td class="label"><&|/l&>Template</&>:</td>
+  <td class="value">
     <& /Admin/Elements/SelectTemplate, Name => "Template", Default => $ARGS{'Template'}, Queue => $investigationq->Id &>
   </td>
 </tr>
 <tr>
-  <td class="label">
-    <&|/l&>Argument</&>:
-  </td>
-  <td>
+  <td class="label"><&|/l&>Argument</&>:</td>
+  <td class="value">
     <input type="text" name="TemplateArg" size="60" value="<% $ARGS{'TemplateArg'} %>" />
   </td>
 </tr>

commit cec31bb52feb77acbd90bfcbbe3b7ba0b17f6281
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 20:51:34 2011 +0400

    don't use indirect object syntax: new XXXX(...)

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index abaaee4..d1b52a5 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -323,7 +323,7 @@ $m->callback(
     ARGSRef => \%ARGS,
 );
 
-my $QueueObj = new RT::Queue( $session{'CurrentUser'} );
+my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $Queue ) || Abort( loc("Queue could not be loaded.") );
 
 
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 0c16e4f..b59a3aa 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -112,7 +112,7 @@
 &>
 <%INIT>
 my ($name);
-my $Ticket = new RT::Ticket( $session{'CurrentUser'} );
+my $Ticket = RT::Ticket->new( $session{'CurrentUser'} );
 
 my $QueueObj;
 unless ( $id eq 'new' ) {
@@ -122,7 +122,7 @@ unless ( $id eq 'new' ) {
     }
     $QueueObj = $Ticket->QueueObj;
 } else {
-    $QueueObj = new RT::Queue( $session{'CurrentUser'} );
+    $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
     $QueueObj->Load($Queue) || Abort(loc("Queue could not be loaded."));
 }
 
diff --git a/html/RTIR/Elements/AddWatchers b/html/RTIR/Elements/AddWatchers
index c88a3cf..41767ca 100644
--- a/html/RTIR/Elements/AddWatchers
+++ b/html/RTIR/Elements/AddWatchers
@@ -67,7 +67,7 @@ if ( $UserString ) {
     );
 }
 
-$Groups = new RT::Groups( $session{'CurrentUser'} );
+$Groups = RT::Groups->new( $session{'CurrentUser'} );
 $Groups->LimitToUserDefinedGroups;
 
 </%INIT>
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index 9d7b658..4c7c157 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -230,7 +230,7 @@ if ( $ARGS{'BulkLink'} || $Child ) {
 # If we deleted any links, check if what we deleted from still has children
 if ( $deleted_links ) {
     # XXX: Can we ever get here?
-    my $children = new RT::Tickets( $session{'CurrentUser'} );
+    my $children = RT::Tickets->new( $session{'CurrentUser'} );
     $children->LimitQueue( VALUE => 'Incident Reports' );
     $children->LimitQueue( VALUE => 'Investigations' );
     $children->LimitQueue( VALUE => 'Blocks' );
diff --git a/html/RTIR/Reporting/Report.html b/html/RTIR/Reporting/Report.html
index 9a4b26b..fdaa9cf 100644
--- a/html/RTIR/Reporting/Report.html
+++ b/html/RTIR/Reporting/Report.html
@@ -148,9 +148,9 @@ $ReportAs = 'TSV' if $SpreadsheetReport;
 
 my $start = ParseDateToISO( $StartDate );
 my $end = ParseDateToISO( $EndDate );
-my $rtstart = new RT::Date( $session{'CurrentUser'} );
+my $rtstart = RT::Date->new( $session{'CurrentUser'} );
 $rtstart->Set( Format => 'ISO', Value => $start );
-my $rtend = new RT::Date( $session{'CurrentUser'} );
+my $rtend = RT::Date->new( $session{'CurrentUser'} );
 $rtend->Set( Format => 'ISO', Value => $end );
 
 # of new reports created during the period broken down by function
diff --git a/html/RTIR/Reporting/index.html b/html/RTIR/Reporting/index.html
index 638b975..333f289 100644
--- a/html/RTIR/Reporting/index.html
+++ b/html/RTIR/Reporting/index.html
@@ -82,14 +82,14 @@ if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} )
     $m->redirect($url);
 }
 
-my $QueueObj = new RT::Queue($session{'CurrentUser'});
+my $QueueObj = RT::Queue->new($session{'CurrentUser'});
 $QueueObj->Load('Incidents');
 
-my $now = new RT::Date($RT::SystemUser);
+my $now = RT::Date->new($RT::SystemUser);
 $now->SetToNow();
-my $end = new RT::Date($RT::SystemUser);
+my $end = RT::Date->new($RT::SystemUser);
 $end->SetToNow();
-my $start = new RT::Date($RT::SystemUser);
+my $start = RT::Date->new($RT::SystemUser);
 $start->SetToNow();
 $start->AddDays(0-30);
 
diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index ead10dc..9a28a26 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -169,7 +169,7 @@ foreach my $arg (keys %ARGS) {
 }
 
 if ($incidentid) {
-    $Incident = new RT::Ticket($session{'CurrentUser'});
+    $Incident = RT::Ticket->new($session{'CurrentUser'});
     $Incident->Load($incidentid);
 
     if (!exists $ARGS{Content}) {
@@ -189,19 +189,19 @@ if ($incidentid) {
 $ARGS{'loop'} = $loop if !defined $ARGS{'loop'};
 
 # Load the Incidents Queue
-my $incidentq = new RT::Queue($session{'CurrentUser'});
+my $incidentq = RT::Queue->new($session{'CurrentUser'});
 unless ( $incidentq->Load('Incidents') ) {
     Abort('Queue not found');
 }
 
 # Load the Investigations Queue
-my $investigationq = new RT::Queue($session{'CurrentUser'});        
+my $investigationq = RT::Queue->new($session{'CurrentUser'});        
 unless ($investigationq->Load('Investigations')) {
     Abort('Queue not found');
 }
 
 # Load the Incident Reports Queue
-my $reportq = new RT::Queue($session{'CurrentUser'});        
+my $reportq = RT::Queue->new($session{'CurrentUser'});        
 unless ($reportq->Load('Incident Reports')) {
     Abort('Queue not found');
 }

commit 1d7cdfd1693c0206c7a19046304f2ebc0bdc76d1
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 20:53:06 2011 +0400

    use RT->SystemUser instead of direct var access

diff --git a/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList b/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
index d7cbb47..d120314 100644
--- a/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
+++ b/html/Callbacks/RTIR/Elements/SelectOwner/UpdateObjectList
@@ -12,7 +12,7 @@ my @new_objects;
 foreach my $object (@$objects) {
     next unless ($object->__Value('Name')||'') =~ /^(?:Incidents|Investigations|Incident Reports|Blocks)$/;
 
-    my $queues = RT::Queues->new( $RT::SystemUser );
+    my $queues = RT::Queues->new( RT->SystemUser );
     $queues->Limit(
         FIELD =>'Name',
         OPERATOR => 'STARTSWITH',
diff --git a/html/Callbacks/RTIR/Ticket/Display.html/Initial b/html/Callbacks/RTIR/Ticket/Display.html/Initial
index 202f4e2..c98daf2 100644
--- a/html/Callbacks/RTIR/Ticket/Display.html/Initial
+++ b/html/Callbacks/RTIR/Ticket/Display.html/Initial
@@ -3,15 +3,15 @@ return if $ARGSRef->{'NoRedirect'};
 
 my $Queue;
 if ( $TicketObj ) {
-    my $tmp = RT::Ticket->new( $RT::SystemUser );
+    my $tmp = RT::Ticket->new( RT->SystemUser );
     $tmp->Load( $TicketObj->id );
     $Queue = $tmp->QueueObj->Name;
 } elsif ( $ARGSRef->{'id'} && $ARGSRef->{'id'} ne 'new' ) {
-    my $tmp = RT::Ticket->new( $RT::SystemUser );
+    my $tmp = RT::Ticket->new( RT->SystemUser );
     $tmp->Load( $ARGSRef->{'id'} );
     $Queue = $tmp->QueueObj->Name;
 } elsif ( $ARGSRef->{'Queue'} ) {
-    my $QueueObj = RT::Queue->new( $RT::SystemUser );
+    my $QueueObj = RT::Queue->new( RT->SystemUser );
     $QueueObj->Load( $ARGSRef->{'Queue'} );
     $Queue = $QueueObj->Name;
 }
diff --git a/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction b/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
index a62557b..62bb20f 100644
--- a/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
+++ b/html/Callbacks/RTIR/Ticket/Elements/ShowHistory/SkipTransaction
@@ -7,7 +7,7 @@ return if $$skip;
 
 # skip IP changes done by system user(scrips)
 return unless $Transaction->Type eq 'CustomField'
-    && $Transaction->Creator == $RT::SystemUser->id;
+    && $Transaction->Creator == RT->SystemUser->id;
 
 # check only ticket's transactions
 my $obj = $Transaction->Object;
diff --git a/html/RTIR/Reporting/index.html b/html/RTIR/Reporting/index.html
index 333f289..3fa8218 100644
--- a/html/RTIR/Reporting/index.html
+++ b/html/RTIR/Reporting/index.html
@@ -85,11 +85,11 @@ if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} )
 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
 $QueueObj->Load('Incidents');
 
-my $now = RT::Date->new($RT::SystemUser);
+my $now = RT::Date->new(RT->SystemUser);
 $now->SetToNow();
-my $end = RT::Date->new($RT::SystemUser);
+my $end = RT::Date->new(RT->SystemUser);
 $end->SetToNow();
-my $start = RT::Date->new($RT::SystemUser);
+my $start = RT::Date->new(RT->SystemUser);
 $start->SetToNow();
 $start->AddDays(0-30);
 
diff --git a/lib/RT/Action/RTIR_SetConstituency.pm b/lib/RT/Action/RTIR_SetConstituency.pm
index b9f0b18..784e8a4 100644
--- a/lib/RT/Action/RTIR_SetConstituency.pm
+++ b/lib/RT/Action/RTIR_SetConstituency.pm
@@ -51,7 +51,7 @@ sub InheritConstituency {
     my $type = $self->TransactionObj->Type;
     if ( $type eq 'AddLink' ) {
         # inherit from parent on linking
-        my $tickets = RT::Tickets->new( $RT::SystemUser );
+        my $tickets = RT::Tickets->new( RT->SystemUser );
         $tickets->FromSQL( $query ." AND HasMember = ". $ticket->Id );
         $tickets->RowsPerPage( 1 );
         if ( my $parent = $tickets->First ) {
@@ -67,7 +67,7 @@ sub InheritConstituency {
 
     # propagate to members
     foreach my $link_type (qw(MemberOf HasMember)) {
-        my $tickets = RT::Tickets->new( $RT::SystemUser );
+        my $tickets = RT::Tickets->new( RT->SystemUser );
         $tickets->FromSQL( $query ." AND $link_type = ". $ticket->Id );
         while ( my $t = $tickets->Next ) {
             $RT::Logger->debug(
@@ -135,7 +135,7 @@ sub GetConstituencyFromAttachment {
 
 sub GetConstituencyFromParent {
     my $self = shift;
-    my $parents = RT::Tickets->new( $RT::SystemUser );
+    my $parents = RT::Tickets->new( RT->SystemUser );
     $parents->FromSQL( "HasMember = ". $self->TicketObj->id );
     $parents->OrderByCols( { FIELD => 'LastUpdated', ORDER => 'DESC' } );
     $parents->RowsPerPage(1);
@@ -151,7 +151,7 @@ sub IsValidConstituency {
     my $self = shift;
     my $value = shift or return 0;
     unless ( keys %constituency ) {
-        my $cf = RT::CustomField->new( $RT::SystemUser );
+        my $cf = RT::CustomField->new( RT->SystemUser );
         $cf->Load('Constituency');
         unless ( $cf->id ) {
             $RT::Logger->crit("Couldn't load constituency field");
diff --git a/lib/RT/Action/RTIR_SetConstituencyGroup.pm b/lib/RT/Action/RTIR_SetConstituencyGroup.pm
index 6354cc7..d352ae7 100644
--- a/lib/RT/Action/RTIR_SetConstituencyGroup.pm
+++ b/lib/RT/Action/RTIR_SetConstituencyGroup.pm
@@ -36,7 +36,7 @@ sub Commit {
         }
     }
     if ( !$required_group_there && $constituency ) {
-        my $group = RT::Group->new( $RT::SystemUser );
+        my $group = RT::Group->new( RT->SystemUser );
         $group->LoadUserDefinedGroup("DutyTeam $constituency");
         unless ( $group->id ) {
             $RT::Logger->warning("Couldn't load group 'DutyTeam $constituency'");
@@ -59,7 +59,7 @@ sub ConstituencyValues {
     my $self = shift;
     my $value = shift or return 0;
     unless ( @constituencies ) {
-        my $cf = RT::CustomField->new( $RT::SystemUser );
+        my $cf = RT::CustomField->new( RT->SystemUser );
         $cf->Load('Constituency');
         unless ( $cf->id ) {
             $RT::Logger->crit("Couldn't load constituency field");
diff --git a/lib/RT/Action/RTIR_SetDueBySLA.pm b/lib/RT/Action/RTIR_SetDueBySLA.pm
index a80cd08..cdbb854 100644
--- a/lib/RT/Action/RTIR_SetDueBySLA.pm
+++ b/lib/RT/Action/RTIR_SetDueBySLA.pm
@@ -82,7 +82,7 @@ sub Commit {
     # TODO: specify a start date, but default to now
     my $due = $SLAObj->Due( $time, $SLAObj->SLA( $time ) );
 
-    my $date = RT::Date->new( $RT::SystemUser );
+    my $date = RT::Date->new( RT->SystemUser );
     $date->Set( Format => 'unix', Value => $due );
     $self->TicketObj->SetDue( $date->ISO );
 
diff --git a/lib/RT/Action/RTIR_SetDueCorrespond.pm b/lib/RT/Action/RTIR_SetDueCorrespond.pm
index 2b7a5e4..8337213 100644
--- a/lib/RT/Action/RTIR_SetDueCorrespond.pm
+++ b/lib/RT/Action/RTIR_SetDueCorrespond.pm
@@ -64,7 +64,7 @@ sub Commit {
 
     my $bizhours = RT::IR::BusinessHours();
 	
-    my $date = RT::Date->new( $RT::SystemUser );
+    my $date = RT::Date->new( RT->SystemUser );
     my $due = ( $self->TicketObj->QueueObj->DefaultDueIn || (RT->Config->Get('OverdueAfter')) || 7 ) ;
     $date->SetToNow;
     $date->AddDays( $due );
diff --git a/lib/RT/Action/RTIR_SetDueReopen.pm b/lib/RT/Action/RTIR_SetDueReopen.pm
index 01bdb57..220b6ba 100644
--- a/lib/RT/Action/RTIR_SetDueReopen.pm
+++ b/lib/RT/Action/RTIR_SetDueReopen.pm
@@ -75,7 +75,7 @@ sub Commit {
     my $time = time;
     my $due = $SLAObj->Due( $time, $SLAObj->SLA( $time ) );
 
-    my $date = RT::Date->new( $RT::SystemUser );
+    my $date = RT::Date->new( RT->SystemUser );
     $date->Set( Format => 'unix', Value => $due );
     $self->TicketObj->SetDue( $date->ISO );
 
diff --git a/lib/RT/Action/RTIR_SetDueToNow.pm b/lib/RT/Action/RTIR_SetDueToNow.pm
index 0d57cf1..96ebbac 100644
--- a/lib/RT/Action/RTIR_SetDueToNow.pm
+++ b/lib/RT/Action/RTIR_SetDueToNow.pm
@@ -78,7 +78,7 @@ sub Commit {
     my $time = time;
     my $due = $SLAObj->Due( $time, $SLAObj->SLA( $time ) );
 
-    my $date = RT::Date->new($RT::SystemUser);
+    my $date = RT::Date->new(RT->SystemUser);
     $date->Set( Format => 'unix', Value => $due );
     my ($status, $msg) = $self->TicketObj->SetDue( $date->ISO );
     $RT::Logger->error($msg) unless $status;
diff --git a/lib/RT/Action/RTIR_SetStartsByBizHours.pm b/lib/RT/Action/RTIR_SetStartsByBizHours.pm
index 2ccff8b..de8f1ca 100644
--- a/lib/RT/Action/RTIR_SetStartsByBizHours.pm
+++ b/lib/RT/Action/RTIR_SetStartsByBizHours.pm
@@ -74,7 +74,7 @@ Look up the SLA and set the Starts date to the next time during Business Hours
 sub Commit {
     my $self = shift;
 
-    my $date = RT::Date->new($RT::SystemUser);
+    my $date = RT::Date->new(RT->SystemUser);
     $date->SetToNow;
 
     my $bizhours = RT::IR::BusinessHours();
diff --git a/lib/RT/Action/RTIR_SetStartsToNow.pm b/lib/RT/Action/RTIR_SetStartsToNow.pm
index 5dba7b8..8d8047e 100644
--- a/lib/RT/Action/RTIR_SetStartsToNow.pm
+++ b/lib/RT/Action/RTIR_SetStartsToNow.pm
@@ -81,7 +81,7 @@ Set the Starts date to now.
 sub Commit {
     my $self = shift;
 
-    my $date = RT::Date->new($RT::SystemUser);
+    my $date = RT::Date->new(RT->SystemUser);
     $date->SetToNow;
     $self->TicketObj->SetStarts($date->ISO);
 
diff --git a/lib/RT/Action/RTIR_UnsetDue.pm b/lib/RT/Action/RTIR_UnsetDue.pm
index 53af28d..143ba74 100644
--- a/lib/RT/Action/RTIR_UnsetDue.pm
+++ b/lib/RT/Action/RTIR_UnsetDue.pm
@@ -59,7 +59,7 @@ Set the Due date accordingly.
 sub Commit {
     my $self = shift;
 
-    my $date = RT::Date->new($RT::SystemUser);
+    my $date = RT::Date->new(RT->SystemUser);
     $date->Set(Format => 'unix', Value=> 0);
     $self->TicketObj->SetDue( $date->ISO );
 
diff --git a/lib/RT/Condition/RTIR.pm b/lib/RT/Condition/RTIR.pm
index d7a3c9b..3dfb96a 100644
--- a/lib/RT/Condition/RTIR.pm
+++ b/lib/RT/Condition/RTIR.pm
@@ -37,7 +37,7 @@ sub IsStaff {
     my $self = shift;
 
     my $actor_id = $self->TransactionObj->Creator;
-    my $cgm = RT::CachedGroupMembers->new( $RT::SystemUser );
+    my $cgm = RT::CachedGroupMembers->new( RT->SystemUser );
     $cgm->Limit(FIELD => 'MemberId', VALUE => $actor_id );
     my $group_alias = $cgm->Join(
         FIELD1 => 'GroupId', TABLE2 => 'Groups', FIELD2 => 'id'
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index f14c40e..c2ac129 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -173,7 +173,7 @@ sub TicketType {
     my %arg = ( Queue => undef, Ticket => undef, @_);
 
     if ( defined $arg{'Ticket'} && !defined $arg{'Queue'} ) {
-        my $obj = RT::Ticket->new( $RT::SystemUser );
+        my $obj = RT::Ticket->new( RT->SystemUser );
         $obj->Load( ref $arg{'Ticket'} ? $arg{'Ticket'}->id : $arg{'Ticket'} );
         $arg{'Queue'} = $obj->QueueObj->Name if $obj->id;
     }
@@ -181,7 +181,7 @@ sub TicketType {
 
     return $TYPE{ lc $arg{'Queue'} } if !ref $arg{'Queue'} && $arg{'Queue'} !~ /^\d+$/;
 
-    my $obj = RT::Queue->new( $RT::SystemUser );
+    my $obj = RT::Queue->new( RT->SystemUser );
     $obj->Load( ref $arg{'Queue'}? $arg{'Queue'}->id : $arg{'Queue'} );
     return $TYPE{ lc $obj->Name } if $obj->id;
 
@@ -223,7 +223,7 @@ sub Statuses {
     my (@initial, @active, @inactive);
     foreach my $queue (@queues) {
         unless ( blessed $queue ) {
-            my $tmp = RT::Queue->new($RT::SystemUser);
+            my $tmp = RT::Queue->new(RT->SystemUser);
             $tmp->Load( $queue );
             $RT::Logger->error( "failed to load queue $queue" )
                 unless $tmp->id;
@@ -544,7 +544,7 @@ sub CustomFields {
             my $type = TicketType( Queue => $qname );
             $cache{$type} = [];
 
-            my $queue = RT::Queue->new( $RT::SystemUser );
+            my $queue = RT::Queue->new( RT->SystemUser );
             $queue->Load( $qname );
             unless ($queue->id) {
                 $RT::Logger->error("Couldn't load queue '$qname'");
@@ -552,7 +552,7 @@ sub CustomFields {
                 return;
             }
 
-            my $cfs = RT::CustomFields->new( $RT::SystemUser );
+            my $cfs = RT::CustomFields->new( RT->SystemUser );
             $cfs->LimitToLookupType( 'RT::Queue-RT::Ticket' );
             $cfs->LimitToQueue( $queue->id );
             while ( my $cf = $cfs->Next ) {
@@ -561,7 +561,7 @@ sub CustomFields {
         }
 
         $cache{'Global'} = [];
-        my $cfs = RT::CustomFields->new( $RT::SystemUser );
+        my $cfs = RT::CustomFields->new( RT->SystemUser );
         $cfs->LimitToLookupType( 'RT::Queue-RT::Ticket' );
         $cfs->LimitToGlobal;
         while ( my $cf = $cfs->Next ) {
@@ -630,7 +630,7 @@ sub DefaultConstituency {
 
     my @values;
 
-    my $queues = RT::Queues->new( $RT::SystemUser );
+    my $queues = RT::Queues->new( RT->SystemUser );
     $queues->Limit( FIELD => 'Name', OPERATOR => 'STARTSWITH', VALUE => "$name - " );
     while ( my $pqueue = $queues->Next ) {
         next unless $pqueue->HasRight( Principal => $queue->CurrentUser, Right => "ShowTicket" );
@@ -665,19 +665,19 @@ if ( RT::IR->HasConstituency ) {
     wrap 'RT::Ticket::ACLEquivalenceObjects', pre => sub {
         my $self = shift;
 
-        my $queue = RT::Queue->new($RT::SystemUser);
+        my $queue = RT::Queue->new(RT->SystemUser);
         $queue->Load($self->__Value('Queue'));
 
         # We do this, rather than fall through to the orignal sub, as that
         # interacts poorly with our overloaded QueueObj below
-        if ( $self->CurrentUser->id == $RT::SystemUser->id ) {
+        if ( $self->CurrentUser->id == RT->SystemUser->id ) {
             $_[-1] =  [$queue];
             return;
         }
         if ( UNIVERSAL::isa( $self, 'RT::Ticket' ) ) {
             my $const = $RT::IR::ConstituencyCache{ $self->id };
             if (!$const || $const eq '_none' ) {
-                my $systicket = RT::Ticket->new($RT::SystemUser);
+                my $systicket = RT::Ticket->new(RT->SystemUser);
                 $systicket->Load( $self->id );
                 $const = $RT::IR::ConstituencyCache{ $self->id } =
                     $systicket->FirstCustomFieldValue('Constituency')
@@ -686,7 +686,7 @@ if ( RT::IR->HasConstituency ) {
             return if $const eq '_none';
             return if $RT::IR::HasNoQueueCache{ $const };
 
-            my $new_queue = RT::Queue->new($RT::SystemUser);
+            my $new_queue = RT::Queue->new(RT->SystemUser);
             $new_queue->LoadByCols(
                 Name => $queue->Name . " - " . $const
             );
@@ -738,7 +738,7 @@ if ( RT::IR->HasConstituency ) {
         my %args = (@_[1..(@_-2)]);
         $args{'Principal'} ||= $_[0]->CurrentUser;
 
-        my $queues = RT::Queues->new( $RT::SystemUser );
+        my $queues = RT::Queues->new( RT->SystemUser );
         $queues->Limit( FIELD => 'Name', OPERATOR => 'STARTSWITH', VALUE => "$name - " );
         my $has_right = $args{'Principal'}->HasRight(
             %args,
@@ -762,13 +762,13 @@ if ( RT::IR->HasConstituency ) {
         if ( ( my $id = $queue->{'_for_ticket'} ) ) {
             my $const = $RT::IR::ConstituencyCache{$id};
             if (!$const || $const eq '_none' ) {
-                my $ticket = RT::Ticket->new($RT::SystemUser);
+                my $ticket = RT::Ticket->new(RT->SystemUser);
                 $ticket->Load($id);
                 $const = $RT::IR::ConstituencyCache{$ticket->id}
                     = $ticket->FirstCustomFieldValue('Constituency') || '_none';
             }
             if ($const ne '_none' && !$RT::IR::HasNoQueueCache{$const} ) {
-                my $new_queue = RT::Queue->new($RT::SystemUser);
+                my $new_queue = RT::Queue->new(RT->SystemUser);
                 $new_queue->LoadByCols(
                     Name => $queue->Name . " - " . $const );
                 if ( $new_queue->id ) {
@@ -799,7 +799,7 @@ if ( RT::IR->HasConstituency ) {
         return if $args{ 'CustomField-'. $cf->id };
 
         # get out of here if it's not RTIR queue
-        my $QueueObj = RT::Queue->new( $RT::SystemUser );
+        my $QueueObj = RT::Queue->new( RT->SystemUser );
         if ( ref $args{'Queue'} eq 'RT::Queue' ) {
             $QueueObj->Load( $args{'Queue'}->Id );
         }

commit bac54ba27ab2fb488ab46bcd74f203e6476edcec
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 20:56:29 2011 +0400

    use RT->Logger

diff --git a/html/Callbacks/RTIR/Elements/EditCustomField/EditComponentName b/html/Callbacks/RTIR/Elements/EditCustomField/EditComponentName
index a04bef9..733e4dd 100644
--- a/html/Callbacks/RTIR/Elements/EditCustomField/EditComponentName
+++ b/html/Callbacks/RTIR/Elements/EditCustomField/EditComponentName
@@ -3,7 +3,7 @@ return unless $CustomField->LookupType eq 'RT::Queue-RT::Ticket';
 
 my $type = RT::IR->OurQueue( $ARGS{'QueueObj'} || $Object->QueueObj );
 unless ( $type ) {
-    $RT::Logger->error("Couldn't figure out queue from arguments")
+    RT->Logger->error("Couldn't figure out queue from arguments")
         unless defined $type;
     return;
 }
diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 0adfe9e..4b90b60 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -146,6 +146,6 @@ ${$ARGS{handle}} = sub {
 %{$ARGS{actions}} = ( %{$ARGS{actions}}, %actions );
 push @{$ARGS{types}}, @types;
 
-$RT::Logger->info("Finished adding callbacks");
+RT->Logger->info("Finished adding callbacks");
 
 </%init>
diff --git a/html/Callbacks/RTIR/autohandler/Default b/html/Callbacks/RTIR/autohandler/Default
index ba3862d..5aa79f9 100644
--- a/html/Callbacks/RTIR/autohandler/Default
+++ b/html/Callbacks/RTIR/autohandler/Default
@@ -3,6 +3,6 @@ eval {
     require RT::IR;
 };
 if ( $@ ) {
-    $RT::Logger->crit("System error. Couldn't load RTIR module(s): $@");
+    RT->Logger->crit("System error. Couldn't load RTIR module(s): $@");
 }
 </%ONCE>
diff --git a/html/RTIR/Elements/ShowChildren b/html/RTIR/Elements/ShowChildren
index e1992ce..d0f6327 100644
--- a/html/RTIR/Elements/ShowChildren
+++ b/html/RTIR/Elements/ShowChildren
@@ -63,7 +63,7 @@
 my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $Queue );
 unless ( $QueueObj->id ) {
-    $RT::Logger->error("Couldn't load queue '$Queue'");
+    RT->Logger->error("Couldn't load queue '$Queue'");
     return;
 }
 
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 2f1d342..34feb8e 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -225,7 +225,7 @@ if ( ($DefaultsNamePrefix||'') ne $NamePrefix ) {
             unless ( $src_cf->id ) {
                 $cf_map{ $cf_id } = 0;
                 delete $ARGS{ $k };
-                $RT::Logger->error("Couldn't load CF #$cf_id");
+                RT->Logger->error("Couldn't load CF #$cf_id");
                 next;
             }
 
@@ -239,7 +239,7 @@ if ( ($DefaultsNamePrefix||'') ne $NamePrefix ) {
             unless ( $dst_cf && $dst_cf->id ) {
                 $cf_map{ $cf_id } = 0;
                 delete $ARGS{ $k };
-                $RT::Logger->debug( $src_cf->Name .' is not applied. skipping.' );
+                RT->Logger->debug( $src_cf->Name .' is not applied. skipping.' );
                 next;
             }
             $cf_map{ $cf_id } = $dst_cf->id;
diff --git a/html/RTIR/Search/Elements/ProcessQuery b/html/RTIR/Search/Elements/ProcessQuery
index f93ab79..b910320 100644
--- a/html/RTIR/Search/Elements/ProcessQuery
+++ b/html/RTIR/Search/Elements/ProcessQuery
@@ -95,7 +95,7 @@ foreach my $arg ( keys %ARGS ) {
         @ops    = ( $ARGS{ $field . 'Op' } );
         @values = ( $ARGS{ 'ValueOf' . $field } );
     }
-    $RT::Logger->error("Bad Parameters passed into Query Builder")
+    RT->Logger->error("Bad Parameters passed into Query Builder")
         unless @ops == @values;
 
     for ( my $i = 0; $i < @ops; $i++ ) {
diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index 9a28a26..0beac1b 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -324,7 +324,7 @@ if ( $ARGS{'SubmitAction'} ) {
         my $TemplateObj = RT::Template->new( $session{'CurrentUser'} );
         if ( $ARGS{'Template'} ) {
             $TemplateObj->Load( $ARGS{'Template'} );
-            $RT::Logger->error("Couldn't load template '$ARGS{'Template'}'")
+            RT->Logger->error("Couldn't load template '$ARGS{'Template'}'")
                 unless $TemplateObj->id;
         }
 
@@ -349,7 +349,7 @@ if ( $ARGS{'SubmitAction'} ) {
                 TransactionObj => $transaction,
             );
             unless ( $result ) {
-                $RT::Logger->error("Couldn't parse template: $message");
+                RT->Logger->error("Couldn't parse template: $message");
             }
 
             # add the template's MIMEObj to the Attachments list
diff --git a/html/RTIR/Tools/Traceroute.html b/html/RTIR/Tools/Traceroute.html
index d65e79f..cba98ab 100644
--- a/html/RTIR/Tools/Traceroute.html
+++ b/html/RTIR/Tools/Traceroute.html
@@ -52,7 +52,7 @@ my $title = loc("Traceroute to '[_1]'", $q);
 
 my $cmd = RT->Config->Get('TracerouteCommand') || '/usr/sbin/traceroute';
 unless ( -f $cmd && -x _ ) {
-    $RT::Logger->error(
+    RT->Logger->error(
         "'$cmd' doesn't exist or it's not executable."
         ."Setup \$TracerouteCommand option"
     );
diff --git a/lib/RT/Action/RTIR_Activate.pm b/lib/RT/Action/RTIR_Activate.pm
index 3288a3d..6cec7a1 100644
--- a/lib/RT/Action/RTIR_Activate.pm
+++ b/lib/RT/Action/RTIR_Activate.pm
@@ -20,7 +20,7 @@ sub Commit {
 
     my ($status, $msg) = $ticket->SetStatus( $new );
     unless ( $status ) {
-        $RT::Logger->error( "Couldn't activate ticket: $msg" );
+        RT->Logger->error( "Couldn't activate ticket: $msg" );
         return 0;
     }
 
diff --git a/lib/RT/Action/RTIR_ChangeChildOwnership.pm b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
index b5595a6..86afbee 100644
--- a/lib/RT/Action/RTIR_ChangeChildOwnership.pm
+++ b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
@@ -83,7 +83,7 @@ sub Commit {
 
     while ( my $member = $members->Next ) {
         my ($res, $msg) = $action_cb->( $member );
-        $RT::Logger->info( "Couldn't change owner: $msg" ) unless $res;
+        RT->Logger->info( "Couldn't change owner: $msg" ) unless $res;
     }
     return 1;
 }
diff --git a/lib/RT/Action/RTIR_ChangeParentOwnership.pm b/lib/RT/Action/RTIR_ChangeParentOwnership.pm
index f7cf39c..bbbfb65 100644
--- a/lib/RT/Action/RTIR_ChangeParentOwnership.pm
+++ b/lib/RT/Action/RTIR_ChangeParentOwnership.pm
@@ -75,7 +75,7 @@ sub Commit {
         } else {
             ($res, $msg) = $incident->SetOwner($txn->NewValue);
         }
-        $RT::Logger->info("Couldn't set owner: $msg") unless $res;
+        RT->Logger->info("Couldn't set owner: $msg") unless $res;
     }
     return 1;
 }
diff --git a/lib/RT/Action/RTIR_FindIP.pm b/lib/RT/Action/RTIR_FindIP.pm
index 4c9d3e1..ad218fc 100644
--- a/lib/RT/Action/RTIR_FindIP.pm
+++ b/lib/RT/Action/RTIR_FindIP.pm
@@ -32,7 +32,7 @@ sub Commit {
     }
 
     if ( $how_many_can && $how_many_can <= keys %existing ) {
-        $RT::Logger->debug("Ticket #". $ticket->id ." already has maximum number of IPs, skipping" );
+        RT->Logger->debug("Ticket #". $ticket->id ." already has maximum number of IPs, skipping" );
         return 1;
     }
 
@@ -74,7 +74,7 @@ sub AddIP {
         Value => $arg{'IP'},
         Field => $arg{'CustomField'},
     );
-    $RT::Logger->error("Couldn't add IP address: $msg") unless $status;
+    RT->Logger->error("Couldn't add IP address: $msg") unless $status;
 
     return 1;
 }
diff --git a/lib/RT/Action/RTIR_MergeIPs.pm b/lib/RT/Action/RTIR_MergeIPs.pm
index 4a57956..577e092 100644
--- a/lib/RT/Action/RTIR_MergeIPs.pm
+++ b/lib/RT/Action/RTIR_MergeIPs.pm
@@ -19,7 +19,7 @@ sub Commit {
     my $uri_obj = RT::URI->new( $self->CurrentUser );
     my ($status) = $uri_obj->FromURI( $uri );
     unless ( $status && $uri_obj->Resolver && $uri_obj->Scheme ) {
-        $RT::Logger->error( "Couldn't resolve '$uri' into a URI." );
+        RT->Logger->error( "Couldn't resolve '$uri' into a URI." );
         return 1;
     }
 
@@ -39,7 +39,7 @@ sub Commit {
             Value => $ip,
             Field => 'IP',
         );
-        $RT::Logger->error("Couldn't add IP address: $msg")
+        RT->Logger->error("Couldn't add IP address: $msg")
             unless $status;
     }
 
diff --git a/lib/RT/Action/RTIR_OpenParent.pm b/lib/RT/Action/RTIR_OpenParent.pm
index 541bec0..1e3e305 100644
--- a/lib/RT/Action/RTIR_OpenParent.pm
+++ b/lib/RT/Action/RTIR_OpenParent.pm
@@ -77,7 +77,7 @@ sub Commit {
         next unless $status;
 
         my ($res, $msg) = $parent->SetStatus( $status );
-        $RT::Logger->info("Couldn't open incident: $msg")
+        RT->Logger->info("Couldn't open incident: $msg")
             unless $res;
     }
     return 1;
diff --git a/lib/RT/Action/RTIR_SetBlockStatus.pm b/lib/RT/Action/RTIR_SetBlockStatus.pm
index c7dec9d..ae95b4a 100644
--- a/lib/RT/Action/RTIR_SetBlockStatus.pm
+++ b/lib/RT/Action/RTIR_SetBlockStatus.pm
@@ -86,7 +86,7 @@ sub Commit {
     return 1 unless $new;
 
     my ( $res, $msg ) = $t->SetStatus( $new );
-    $RT::Logger->warning("Couldn't set status to $new: $msg")
+    RT->Logger->warning("Couldn't set status to $new: $msg")
         unless $res;
     return 1;
 
diff --git a/lib/RT/Action/RTIR_SetConstituency.pm b/lib/RT/Action/RTIR_SetConstituency.pm
index 784e8a4..c095505 100644
--- a/lib/RT/Action/RTIR_SetConstituency.pm
+++ b/lib/RT/Action/RTIR_SetConstituency.pm
@@ -55,12 +55,12 @@ sub InheritConstituency {
         $tickets->FromSQL( $query ." AND HasMember = ". $ticket->Id );
         $tickets->RowsPerPage( 1 );
         if ( my $parent = $tickets->First ) {
-            $RT::Logger->debug( "Ticket #". $ticket->id ." inherits constituency from ticket #". $parent->id );
+            RT->Logger->debug( "Ticket #". $ticket->id ." inherits constituency from ticket #". $parent->id );
             my ($res, $msg) = $ticket->AddCustomFieldValue(
                 Field => 'Constituency',
                 Value => $constituency,
             );
-            $RT::Logger->warning( "Couldn't set CF: $msg" ) unless $res;
+            RT->Logger->warning( "Couldn't set CF: $msg" ) unless $res;
             return 1;
         }
     }
@@ -70,7 +70,7 @@ sub InheritConstituency {
         my $tickets = RT::Tickets->new( RT->SystemUser );
         $tickets->FromSQL( $query ." AND $link_type = ". $ticket->Id );
         while ( my $t = $tickets->Next ) {
-            $RT::Logger->debug(
+            RT->Logger->debug(
                 "Ticket #". $t->id ." inherits constituency"
                 ." from ticket #". $ticket->id
             );
@@ -78,7 +78,7 @@ sub InheritConstituency {
                 Field => 'Constituency',
                 Value => $constituency,
             );
-            $RT::Logger->warning( "Couldn't set CF: $msg" ) unless $res;
+            RT->Logger->warning( "Couldn't set CF: $msg" ) unless $res;
         }
     }
     return 1;
@@ -95,7 +95,7 @@ sub SetConstituencyOnCreate {
         if ( $propagation eq 'inherit' ) {
             $value = $tmp;
         } elsif ( $propagation eq 'reject' && ($current||'') ne $tmp ) {
-            $RT::Logger->error(
+            RT->Logger->error(
                 "Constituency propagation algorithm is 'reject', but "
                 . "ticket ". $ticket->id ." has constituency '$current'"
                 . " when its parent incident has '$tmp'"
@@ -110,7 +110,7 @@ sub SetConstituencyOnCreate {
         Field => 'Constituency',
         Value => $value,
     );
-    $RT::Logger->warning( "Couldn't set CF: $msg" ) unless $status;
+    RT->Logger->warning( "Couldn't set CF: $msg" ) unless $status;
     return $status || 0;
 }
 
@@ -129,7 +129,7 @@ sub GetConstituencyFromAttachment {
 
     my $value = $attachment->GetHeader('X-RT-Mail-Extension');
     return undef unless $self->IsValidConstituency( $value );
-    $RT::Logger->debug( "Got constituency from attachment". ($value||'(no value)') );
+    RT->Logger->debug( "Got constituency from attachment". ($value||'(no value)') );
     return $value;
 }
 
@@ -141,7 +141,7 @@ sub GetConstituencyFromParent {
     $parents->RowsPerPage(1);
     return unless my $parent = $parents->First;
     my $value = $parent->FirstCustomFieldValue('Constituency');
-    $RT::Logger->debug( "Got constituency from parent: ". ($value||'(no value)') );
+    RT->Logger->debug( "Got constituency from parent: ". ($value||'(no value)') );
     return $value;
 }
 
@@ -154,7 +154,7 @@ sub IsValidConstituency {
         my $cf = RT::CustomField->new( RT->SystemUser );
         $cf->Load('Constituency');
         unless ( $cf->id ) {
-            $RT::Logger->crit("Couldn't load constituency field");
+            RT->Logger->crit("Couldn't load constituency field");
             return 0;
         }
         %constituency = map { lc $_->Name => $_->Name } @{ $cf->Values->ItemsArrayRef };
diff --git a/lib/RT/Action/RTIR_SetConstituencyGroup.pm b/lib/RT/Action/RTIR_SetConstituencyGroup.pm
index d352ae7..892befd 100644
--- a/lib/RT/Action/RTIR_SetConstituencyGroup.pm
+++ b/lib/RT/Action/RTIR_SetConstituencyGroup.pm
@@ -15,7 +15,7 @@ sub Commit {
     my $ticket = $self->TicketObj;
     my $admincc_group = $ticket->AdminCc;
     unless ( $admincc_group && $admincc_group->id ) {
-        $RT::Logger->crit("Couldn't load AdminCc group of ticket #". $ticket->id);
+        RT->Logger->crit("Couldn't load AdminCc group of ticket #". $ticket->id);
         return 0;
     }
     my $groups = $admincc_group->GroupMembersObj( Recursively => 0 );
@@ -32,14 +32,14 @@ sub Commit {
                 Type        => 'AdminCc',
                 PrincipalId => $group->id,
             );
-            $RT::Logger->error("Couldn't delete admin cc: $msg") unless $status;
+            RT->Logger->error("Couldn't delete admin cc: $msg") unless $status;
         }
     }
     if ( !$required_group_there && $constituency ) {
         my $group = RT::Group->new( RT->SystemUser );
         $group->LoadUserDefinedGroup("DutyTeam $constituency");
         unless ( $group->id ) {
-            $RT::Logger->warning("Couldn't load group 'DutyTeam $constituency'");
+            RT->Logger->warning("Couldn't load group 'DutyTeam $constituency'");
             # return success as if there is no custom group for the constituency
             # then it means that no custom ACLs should be applied
             return 1;
@@ -48,7 +48,7 @@ sub Commit {
             Type        => 'AdminCc',
             PrincipalId => $group->id,
         );
-        $RT::Logger->error("Couldn't add admin cc: $msg") unless $status;
+        RT->Logger->error("Couldn't add admin cc: $msg") unless $status;
     }
     return 1;
 }
@@ -62,7 +62,7 @@ sub ConstituencyValues {
         my $cf = RT::CustomField->new( RT->SystemUser );
         $cf->Load('Constituency');
         unless ( $cf->id ) {
-            $RT::Logger->crit("Couldn't load constituency field");
+            RT->Logger->crit("Couldn't load constituency field");
             return 0;
         }
         @constituencies = map $_->Name, @{ $cf->Values->ItemsArrayRef };
diff --git a/lib/RT/Action/RTIR_SetDueToNow.pm b/lib/RT/Action/RTIR_SetDueToNow.pm
index 96ebbac..53ad519 100644
--- a/lib/RT/Action/RTIR_SetDueToNow.pm
+++ b/lib/RT/Action/RTIR_SetDueToNow.pm
@@ -81,9 +81,9 @@ sub Commit {
     my $date = RT::Date->new(RT->SystemUser);
     $date->Set( Format => 'unix', Value => $due );
     my ($status, $msg) = $self->TicketObj->SetDue( $date->ISO );
-    $RT::Logger->error($msg) unless $status;
+    RT->Logger->error($msg) unless $status;
 
-    $RT::Logger->debug( "Set Due to now: ". $date->ISO );
+    RT->Logger->debug( "Set Due to now: ". $date->ISO );
 
     return 1;
 }
diff --git a/lib/RT/Action/RTIR_SetIncidentResolution.pm b/lib/RT/Action/RTIR_SetIncidentResolution.pm
index 9512e01..7c89e81 100644
--- a/lib/RT/Action/RTIR_SetIncidentResolution.pm
+++ b/lib/RT/Action/RTIR_SetIncidentResolution.pm
@@ -37,7 +37,7 @@ sub Commit {
     return 1 if $t->FirstCustomFieldValue( $cf->id );
 
     my ($res, $msg) = $t->AddCustomFieldValue( Field => $cf->id, Value => $value );
-    $RT::Logger->warning("Couldn't add custom field value: $msg") unless $res;
+    RT->Logger->warning("Couldn't add custom field value: $msg") unless $res;
     return 1;
 }
 
diff --git a/lib/RT/Condition/RTIR_LinkingToIncident.pm b/lib/RT/Condition/RTIR_LinkingToIncident.pm
index cf0d4d1..c9e5426 100644
--- a/lib/RT/Condition/RTIR_LinkingToIncident.pm
+++ b/lib/RT/Condition/RTIR_LinkingToIncident.pm
@@ -24,7 +24,7 @@ sub IsApplicable {
             URI => $self->TransactionObj->NewValue
         );
         unless ( $parent && $parent->id ) {
-            $RT::Logger->error( "Couldn't load linked ticket #". $self->TransactionObj->NewValue );
+            RT->Logger->error( "Couldn't load linked ticket #". $self->TransactionObj->NewValue );
             return 0;
         }
         return $parent->QueueObj->Name eq 'Incidents';
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index c2ac129..47f5b69 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -225,7 +225,7 @@ sub Statuses {
         unless ( blessed $queue ) {
             my $tmp = RT::Queue->new(RT->SystemUser);
             $tmp->Load( $queue );
-            $RT::Logger->error( "failed to load queue $queue" )
+            RT->Logger->error( "failed to load queue $queue" )
                 unless $tmp->id;
             $queue = $tmp;
         }
@@ -547,7 +547,7 @@ sub CustomFields {
             my $queue = RT::Queue->new( RT->SystemUser );
             $queue->Load( $qname );
             unless ($queue->id) {
-                $RT::Logger->error("Couldn't load queue '$qname'");
+                RT->Logger->error("Couldn't load queue '$qname'");
                 delete $cache{$type};
                 return;
             }
@@ -696,7 +696,7 @@ if ( RT::IR->HasConstituency ) {
             }
             $_[-1] =  [$queue, $new_queue];
         } else {
-            $RT::Logger->crit("$self is not a ticket object like I expected");
+            RT->Logger->crit("$self is not a ticket object like I expected");
         }
     };
 }
@@ -773,7 +773,7 @@ if ( RT::IR->HasConstituency ) {
                     Name => $queue->Name . " - " . $const );
                 if ( $new_queue->id ) {
                     my $val = $new_queue->_Value($attr) || $queue->_Value($attr);
-                    $RT::Logger->debug("Overriden $attr is $val for ticket #$id according to constituency $const");
+                    RT->Logger->debug("Overriden $attr is $val for ticket #$id according to constituency $const");
                     return $val;
                 } else {
                     $RT::IR::HasNoQueueCache{$const} = 1;
@@ -823,7 +823,7 @@ if ( RT::IR->HasConstituency ) {
                     grep lc $_->Name eq lc $tmp, @{ $cf->Values->ItemsArrayRef };
             }
             $value = $tmp;
-            $RT::Logger->debug("Found Constituency '$tmp' in email") if $tmp;
+            RT->Logger->debug("Found Constituency '$tmp' in email") if $tmp;
         }
         $value ||= RT->Config->Get('RTIR_CustomFieldsDefaults')->{'Constituency'};
         return unless $value;

commit 0dd9b35da25057541e90b7aff4f9a6700e0c1c8a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 21:00:23 2011 +0400

    avoid indirect object syntax in libs

diff --git a/lib/RT/Action/RTIR.pm b/lib/RT/Action/RTIR.pm
index 2979875..4b1d58d 100644
--- a/lib/RT/Action/RTIR.pm
+++ b/lib/RT/Action/RTIR.pm
@@ -14,7 +14,7 @@ sub Prepare { return 1 }
 
 sub CreatorCurrentUser {
     my $self = shift;
-    my $user = new RT::CurrentUser($self->TransactionObj->CurrentUser);
+    my $user = RT::CurrentUser->new($self->TransactionObj->CurrentUser);
     $user->Load($self->TransactionObj->Creator);
     return $user;
 }
diff --git a/lib/RT/Action/RTIR_ChangeChildOwnership.pm b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
index 86afbee..a35580b 100644
--- a/lib/RT/Action/RTIR_ChangeChildOwnership.pm
+++ b/lib/RT/Action/RTIR_ChangeChildOwnership.pm
@@ -78,7 +78,7 @@ sub Commit {
                 ." OR Queue = 'Blocks'"
                 .") AND MemberOf = ". $self->TicketObj->Id
                 ." AND Owner != ". $transaction->NewValue;
-    my $members = new RT::Tickets( $actor );
+    my $members = RT::Tickets->new( $actor );
     $members->FromSQL( $query );
 
     while ( my $member = $members->Next ) {
diff --git a/lib/RT/Action/RTIR_ChangeParentOwnership.pm b/lib/RT/Action/RTIR_ChangeParentOwnership.pm
index bbbfb65..0b149cd 100644
--- a/lib/RT/Action/RTIR_ChangeParentOwnership.pm
+++ b/lib/RT/Action/RTIR_ChangeParentOwnership.pm
@@ -65,7 +65,7 @@ sub Commit {
     my $query =  "Queue = 'Incidents'"
                 ." AND HasMember = " . $self->TicketObj->Id
                 ." AND Owner != ". $txn->NewValue;
-    my $parents = new RT::Tickets( $self->CreatorCurrentUser );
+    my $parents = RT::Tickets->new( $self->CreatorCurrentUser );
     $parents->FromSQL($query);
 
     while ( my $incident = $parents->Next ) {
diff --git a/lib/RT/Action/RTIR_SetDueIncident.pm b/lib/RT/Action/RTIR_SetDueIncident.pm
index 2570660..23a1ea1 100644
--- a/lib/RT/Action/RTIR_SetDueIncident.pm
+++ b/lib/RT/Action/RTIR_SetDueIncident.pm
@@ -62,7 +62,7 @@ sub Commit {
 
     my $type = $self->TransactionObj->Type;
     if ( $type eq 'DeleteLink' ) {
-        my $uri = new RT::URI( $self->CurrentUser );
+        my $uri = RT::URI->new( $self->CurrentUser );
         $uri->FromURI( $self->TransactionObj->OldValue );
         return $self->UpdateDue( $uri->Object );
     }
@@ -89,7 +89,7 @@ sub UpdateDue {
                 . join( " OR ", map "Status = '$_'",
                         RT::Queue->ActiveStatusArray )
                 .")";
-    my $children = new RT::Tickets($self->CurrentUser);
+    my $children = RT::Tickets->new($self->CurrentUser);
     $children->FromSQL( $query );
     $children->OrderBy( FIELD => 'Due', ORDER => 'ASC' );
     $children->RowsPerPage(1);

commit f084932814e62fe7f47135ae7123cdbfef42d8c5
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 22:20:34 2011 +0400

    we shouldn't $m->abort from css or set content type

diff --git a/html/NoAuth/css/RTIR/base/misc.css b/html/NoAuth/css/RTIR/base/misc.css
index 5f85e86..1d60039 100644
--- a/html/NoAuth/css/RTIR/base/misc.css
+++ b/html/NoAuth/css/RTIR/base/misc.css
@@ -92,8 +92,3 @@ ul.userlist li:last-child::after{
         clear: both;
     }
 }
-
-% $m->abort;
-<%INIT>
-$r->content_type('text/css');
-</%INIT>

commit 76d25648f7112ec5df97d5b4156f8eee5530c49c
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Oct 7 23:41:09 2011 +0400

    get rid of uninit warnings

diff --git a/html/RTIR/Update.html b/html/RTIR/Update.html
index 3f3e643..7ff0a08 100644
--- a/html/RTIR/Update.html
+++ b/html/RTIR/Update.html
@@ -135,7 +135,7 @@ my $CanComment = 0;
 # for the convenience:
 
 my ($CommentDefault, $ResponseDefault);
-if (($Action eq 'Comment') or ($ARGS{'UpdateType'} eq 'private')) {
+if ( $Action eq 'Comment' || ($ARGS{'UpdateType'}||'') eq 'private' ) {
     $CommentDefault = "SELECTED"; 
 } else {
     $ResponseDefault = "SELECTED";
@@ -212,7 +212,7 @@ if ( !$checks_failure && $SubmitTicket ) {
 <%ARGS>
 $id => undef
 $Status => undef
-$Action => undef
+$Action => ''
 @TxnSendMailTo => ()
 $TxnRecipients => ''
 

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


More information about the Rt-commit mailing list