[Rt-commit] rtir branch, 2.6-trunk, updated. 2.6.0-6-ga7a82b7
Jesse Vincent
jesse at bestpractical.com
Wed Dec 15 09:09:57 EST 2010
The branch, 2.6-trunk has been updated
via a7a82b7619677f5eaa8520f73bcc93ee4273a475 (commit)
via 332d8761a5961ee050e90bfd42837dbc6b9addc6 (commit)
via f0012df9a18deba5978d963d0af7c32e3a051362 (commit)
via 6a431a5c21a617e865029d368a86ff79b297ebba (commit)
via 5cbc76e1e1b79aafcbb4379a4614e2c9f5506553 (commit)
via 424efdab2de3e43cf923ab7d7b61c9632cfec7e4 (commit)
from a51c19d33840cf7401adb653e77b807d16768caf (commit)
Summary of changes:
html/RTIR/Tools/Elements/LookupRelatedTickets | 60 ++++++++
html/RTIR/Tools/Elements/ToolFormTraceroute | 8 +
html/RTIR/Tools/Elements/ToolFormWhois | 24 +++
html/RTIR/Tools/Elements/ToolResultsWhois | 77 ++++++++++
html/RTIR/Tools/Elements/Tools | 5 +
html/RTIR/Tools/Lookup.html | 192 +++----------------------
6 files changed, 193 insertions(+), 173 deletions(-)
create mode 100644 html/RTIR/Tools/Elements/LookupRelatedTickets
create mode 100644 html/RTIR/Tools/Elements/ToolFormTraceroute
create mode 100644 html/RTIR/Tools/Elements/ToolFormWhois
create mode 100644 html/RTIR/Tools/Elements/ToolResultsWhois
create mode 100644 html/RTIR/Tools/Elements/Tools
- Log -----------------------------------------------------------------
commit 424efdab2de3e43cf923ab7d7b61c9632cfec7e4
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 12:00:30 2010 -0500
Continue refactoring Tools/ for better plugability.
diff --git a/html/RTIR/Tools/Elements/ToolFormTraceroute b/html/RTIR/Tools/Elements/ToolFormTraceroute
new file mode 100644
index 0000000..09194d9
--- /dev/null
+++ b/html/RTIR/Tools/Elements/ToolFormTraceroute
@@ -0,0 +1,10 @@
+<form action="Traceroute.html" method="get" target="_blank">
+ <tr>
+ <td class="label">Traceroute to:</td>
+ <td class="input"><input size="30" name="q" value="<% $q %>" /></td>
+ <td align="left"><input type="submit" value="Go" /></td>
+ </tr>
+</form>
+<%args>
+$q => undef
+</%args>
diff --git a/html/RTIR/Tools/Elements/ToolFormWhois b/html/RTIR/Tools/Elements/ToolFormWhois
new file mode 100644
index 0000000..4c4ee4c
--- /dev/null
+++ b/html/RTIR/Tools/Elements/ToolFormWhois
@@ -0,0 +1,25 @@
+<form action="Lookup.html" method="get">
+ <input type="hidden" name="ticket" value="<% $TicketObj->id %>" />
+ <tr>
+ <td class="label">WHOIS:</td>
+ <td class="input">
+ <input size="30" name="q" value="<% $q %>" /> at
+ <select name="server">
+<%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 $server ? 'SELECTED' : '' %>><% $name || $host %></option>
+% }
+ </select>
+ </td>
+ <td align="left"><input type="submit" value="<%loc('Go')%>" /></td>
+ </tr>
+</form>
+<%args>
+$TicketObj => undef
+$q => undef
+$servers => undef
+$server => undef
+</%args>
diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
new file mode 100644
index 0000000..3eafc4d
--- /dev/null
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -0,0 +1,66 @@
+% if ( $q ) {
+<h2>WHOIS Results</h2>
+% if ( $TicketObj && $TicketType eq 'Incident' ) {
+<form method="post" action="<% RT->Config->Get('WebPath') %>/RTIR/Tools/Lookup.html">
+<input type="hidden" name="incidentid" value="<% $TicketObj->id %>" />
+<input type="hidden" name="Subject" value="<% $TicketObj->Subject %>" />
+% }
+% }
+% if ( $WhoisError ) {
+<b><% $WhoisError %></b>
+% }
+<%PERL>
+my $DoInvestigate = 0;
+if ( $WhoisIterator ) {
+ while ( my $obj = $WhoisIterator->next ) {
+ my @lines_starting_with_space = grep /^(\s+)(\w+)/, $obj->content;
+ if ( $handparse || $#lines_starting_with_space >= 4 ) { #we couldn't parse that. suck
+ my $content = join "", $obj->content;
+ $m->comp( '/Elements/MakeClicky',
+ ticket => $TicketObj,
+ lookup_params => "ticket=". $TicketObj->id ."&server=$WhoisServer",
+ content => \$content,
+ );
+ $DoInvestigate = 1 if $content =~ /Requestorbox/ig;
+</%PERL>
+<pre><% $content |n %></pre><br />
+% } else {
+Structured RIPE whois data returned. Click <a href="Lookup.html?q=<% $q |u %>&server=<% $WhoisServer |u %>&handparse=1">here</a> to manually parse this data.
+<br />Warnings <% $obj->warnings %>
+<br />errors <% $obj->errors %>
+<hr />
+% foreach my $attribute ( $obj->attributes ) {
+% foreach my $value ( $obj->$attribute() ) {
+ <b><%$attribute%></b>:
+% $m->comp('/Elements/MakeClicky', ticket => $TicketObj, lookup_params => "ticket=".$TicketObj->id, content => \$value);
+<% $value |n %><br />
+% }
+% }
+
+% }
+% }
+% }
+
+%# Don't offer the option of Investigating to unless there are addresses
+% if ( $DoInvestigate ) {
+<& /Elements/Submit,
+ Name => "InvestigateTo",
+ Caption => loc("Investigate to selected addresses"),
+ Label => loc("Investigate"),
+&>
+<& /Elements/Submit,
+ Name => "InvestigateWithScriptedActions",
+ Caption => loc("Investigate to selected addresses"),
+ Label => loc("Investigate using scripted action"),
+&>
+% }
+</form>
+<%args>
+$q => undef
+$handparse => undef
+$TicketType => undef
+$TicketObj => undef
+$WhoisError => undef
+$WhoisIterator => undef
+$WhoisServer => undef
+</%args>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 0100b80..3daa087 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -97,100 +97,12 @@
<h2><&|/l&>Look Up Information</&></h2>
<table>
-<form action="Lookup.html" method="get">
- <input type="hidden" name="ticket" value="<% $ticket %>" />
- <tr>
- <td class="label">WHOIS:</td>
- <td class="input">
- <input size="30" name="q" value="<% $q %>" /> at
- <select name="server">
-<%PERL>
-foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
- my $srv = $servers->{ $s };
- my ($host, $name) = ref $srv?
- ($srv->{'Host'}, $srv->{'FriendlyName'}):
- ($srv, '');
-
- my $selected = '';
- $selected = "selected" if $host eq $server;
-</%PERL>
- <option value="<% $host %>" <% $selected %>><% $name || $host %></option>
-% }
- </select>
- </td>
- <td align="left"><input type="submit" value="Go" /></td>
- </tr>
-</form>
-
-<form action="Traceroute.html" method="get" target="_blank">
- <tr>
- <td class="label">Traceroute to:</td>
- <td class="input"><input size="30" name="q" value="<% $q %>" /></td>
- <td align="left"><input type="submit" value="Go" /></td>
- </tr>
-</form>
+ <& Elements/ToolFormWhois, q=> $q, servers => $servers, server => $server, TicketObj => $TicketObj &>
+ <& Elements/ToolFormTraceroute, q => $q &>
</table>
-
<hr>
-% if ( $q ) {
-<h2>WHOIS Results</h2>
-% if ( $TicketObj && $TicketType eq 'Incident' ) {
-<form method="post" action="<% RT->Config->Get('WebPath') %>/RTIR/Tools/Lookup.html">
-<input type="hidden" name="incidentid" value="<% $ticket %>" />
-<input type="hidden" name="Subject" value="<% $TicketObj->Subject %>" />
-% }
-% }
-% if ( $error ) {
-<b><% $error %></b>
-% }
-<%PERL>
-my $DoInvestigate = 0;
-if ( $iterator ) {
- while ( my $obj = $iterator->next ) {
- my @lines_starting_with_space = grep /^(\s+)(\w+)/, $obj->content;
- if ( $handparse || $#lines_starting_with_space >= 4 ) { #we couldn't parse that. suck
- my $content = join "", $obj->content;
- $m->comp( '/Elements/MakeClicky',
- ticket => $TicketObj,
- lookup_params => "ticket=". $ticket ."&server=$server",
- content => \$content,
- );
- $DoInvestigate = 1 if $content =~ /Requestorbox/ig;
-</%PERL>
-<pre><% $content |n %></pre><br />
-% } else {
-Structured RIPE whois data returned. Click <a href="Lookup.html?q=<% $q |u %>&server=<% $server |u %>&handparse=1">here</a> to manually parse this data.
-<br />Warnings <% $obj->warnings %>
-<br />errors <% $obj->errors %>
-<hr />
-% foreach my $attribute ( $obj->attributes ) {
-% foreach my $value ( $obj->$attribute() ) {
- <b><%$attribute%></b>:
-% $m->comp('/Elements/MakeClicky', ticket => $TicketObj, lookup_params => "ticket=".$ticket, content => \$value);
-<% $value |n %><br />
-% }
-% }
-
-% }
-% }
-% }
-
-%# Don't offer the option of Investigating to unless there are addresses
-% if ( $DoInvestigate ) {
-<& /Elements/Submit,
- Name => "InvestigateTo",
- Caption => loc("Investigate to selected addresses"),
- Label => loc("Investigate"),
-&>
-<& /Elements/Submit,
- Name => "InvestigateWithScriptedActions",
- Caption => loc("Investigate to selected addresses"),
- Label => loc("Investigate using scripted action"),
-&>
-% }
-
-</form>
+<& Elements/ToolResultsWhois, q => $q, TicketType => $TicketType, TicketObj => $TicketObj, WhoisError => $WhoisError, WhoisIterator => $WhoisIterator, WhoisServer => $server, handparse => $handparse &>
<%INIT>
@@ -223,10 +135,10 @@ use Net::Whois::RIPE;
my ($whois, $port) = split(/\s*:\s*/, $server, 2);
$port = 43 unless ($port || '') =~ /^\d+$/;
my $query = Net::Whois::RIPE->new( $whois, Port => $port, Debug => 1 );
-my ($iterator, $error);
-$iterator = $query->query_iterator($q) if $query;
-unless ( $iterator ) {
- $error = loc( "Unable to connect to WHOIS server '[_1]'", $server);
+my ($WhoisIterator, $WhoisError);
+$WhoisIterator = $query->query_iterator($q) if $query;
+unless ( $WhoisIterator ) {
+ $WhoisError = loc( "Unable to connect to WHOIS server '[_1]'", $server);
}
my $max_age;
commit 5cbc76e1e1b79aafcbb4379a4614e2c9f5506553
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 12:04:10 2010 -0500
Move more Whois logic into the Whois lookup component
diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
index 3eafc4d..24309c8 100644
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -60,7 +60,18 @@ $q => undef
$handparse => undef
$TicketType => undef
$TicketObj => undef
-$WhoisError => undef
-$WhoisIterator => undef
$WhoisServer => undef
</%args>
+<%init>
+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);
+}
+
+
+</%init>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 3daa087..d29754a 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -102,7 +102,7 @@
</table>
<hr>
-<& Elements/ToolResultsWhois, q => $q, TicketType => $TicketType, TicketObj => $TicketObj, WhoisError => $WhoisError, WhoisIterator => $WhoisIterator, WhoisServer => $server, handparse => $handparse &>
+<& Elements/ToolResultsWhois, q => $q, TicketType => $TicketType, TicketObj => $TicketObj, WhoisServer => $server, handparse => $handparse &>
<%INIT>
@@ -125,22 +125,11 @@ if ( $ARGS{'InvestigateTo'} ) {
unless ( $server ) {
# just pick the first one
- ($server) = map ref $servers->{$_}? $servers->{$_}->{'Host'}: $servers->{$_},
- (sort keys %$servers)[0];
+ ($server) = map ref $servers->{$_}? $servers->{$_}->{'Host'}: $servers->{$_}, (sort keys %$servers)[0];
}
my $title = loc("Lookup '[_1]' using server [_2]", $q, $server);
-use Net::Whois::RIPE;
-my ($whois, $port) = split(/\s*:\s*/, $server, 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]'", $server);
-}
-
my $max_age;
if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {
$max_age = 0 - $tmp;
commit 6a431a5c21a617e865029d368a86ff79b297ebba
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 12:04:55 2010 -0500
Clean up a declaration
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index d29754a..bffd620 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -130,11 +130,10 @@ unless ( $server ) {
my $title = loc("Lookup '[_1]' using server [_2]", $q, $server);
-my $max_age;
+my $max_age = -60;
+
if ( my $tmp = RT->Config->Get('RTIR_OldestRelatedTickets') ) {
$max_age = 0 - $tmp;
-} else {
- $max_age = -60;
}
my $now = RT::Date->new( $session{'CurrentUser'} );
commit f0012df9a18deba5978d963d0af7c32e3a051362
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 14:20:13 2010 -0500
Extract out the section header bits into a mason component
diff --git a/html/RTIR/Tools/Elements/LookupRelatedTickets b/html/RTIR/Tools/Elements/LookupRelatedTickets
new file mode 100644
index 0000000..4f86592
--- /dev/null
+++ b/html/RTIR/Tools/Elements/LookupRelatedTickets
@@ -0,0 +1,60 @@
+<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' &>
+<& /RTIR/Elements/IncidentSummary,
+ Type => $TicketType,
+ ticket => $TicketObj->id,
+ lookuptype => $LookupType,
+ q => $q,
+&>
+</&>
+
+</td><td valign="top" width="50%">
+
+<&| /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,
+&>
+</&>
+
+</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',
+ Type => $TicketType,
+ ticket => $TicketObj->id,
+ lookuptype => $LookupType,
+ q => $q,
+&>
+</&>
+
+</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',
+ Type => $TicketType,
+ ticket => $TicketObj->id,
+ lookuptype => $LookupType,
+ q => $q,
+&>
+</&>
+</td></tr>
+
+</table>
+% }
+<%args>
+$TicketObj
+$LookupType => undef
+$q => undef
+</%args>
+<%init>
+my $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
+</%init>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index bffd620..fa73a62 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -37,60 +37,9 @@
% }
% unless ( $HideResults ) {
-<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' &>
-<& /RTIR/Elements/IncidentSummary,
- Type => $TicketType,
- ticket => $ticket,
- lookuptype => $type,
- q => $q,
-&>
-</&>
-
-</td><td valign="top" width="50%">
-
-<&| /Widgets/TitleBox, title => loc('Investigations: [_1]', $q), class => 'tickets-list-investigation' &>
-<& /RTIR/Elements/ChildSummary,
- Queue => 'Investigations',
- Type => $TicketType,
- ticket => $ticket,
- lookuptype => $type,
- q => $q,
-&>
-</&>
-
-</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',
- Type => $TicketType,
- ticket => $ticket,
- lookuptype => $type,
- q => $q,
-&>
-</&>
-
-</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',
- Type => $TicketType,
- ticket => $ticket,
- lookuptype => $type,
- q => $q,
-&>
-</&>
+<& Elements/LookupRelatedTickets, TicketObj => $TicketObj, LookupType => $type, q => $q &>
% }
-</td></tr>
-
-</table>
-% }
<hr>
@@ -167,7 +116,6 @@ my ($TicketObj, $TicketType);
if ( $ticket ) {
$TicketObj = LoadTicket( $ticket );
$ticket = $ARGS{'ticket'} = $TicketObj->id;
- $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
}
my $Format = RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'};
commit 332d8761a5961ee050e90bfd42837dbc6b9addc6
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 14:35:29 2010 -0500
Fix the ability to do research without a ticket object
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index fa73a62..be104b9 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -30,13 +30,13 @@
Title => $title,
&>
-% if ( $ticket ) {
+% if ( $TicketObj->id ) {
<&| /Widgets/TitleBox, title => loc("Current [_1]: #[_2]", $TicketType, $ticket), class => 'ticket-info-basics' &>
<& /Elements/TicketList, Query => "id = $ticket", Format => $Format, ShowNavigation => 0 &>
</&>
% }
-% unless ( $HideResults ) {
+% if ( ! $HideResults ) {
<& Elements/LookupRelatedTickets, TicketObj => $TicketObj, LookupType => $type, q => $q &>
% }
@@ -112,12 +112,15 @@ if ( $q ) {
$RT::Logger->warning( $msg ) unless $val;
}
-my ($TicketObj, $TicketType);
+my $TicketObj = RT::Ticket->new($session{CurrentUser});
+my $TicketType;
if ( $ticket ) {
$TicketObj = LoadTicket( $ticket );
$ticket = $ARGS{'ticket'} = $TicketObj->id;
+ $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
}
+
my $Format = RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'};
</%INIT>
commit a7a82b7619677f5eaa8520f73bcc93ee4273a475
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Tue Dec 14 15:44:03 2010 -0500
further refactoring of the Tools UI
diff --git a/html/RTIR/Tools/Elements/ToolFormTraceroute b/html/RTIR/Tools/Elements/ToolFormTraceroute
index 09194d9..a405e20 100644
--- a/html/RTIR/Tools/Elements/ToolFormTraceroute
+++ b/html/RTIR/Tools/Elements/ToolFormTraceroute
@@ -1,9 +1,7 @@
<form action="Traceroute.html" method="get" target="_blank">
- <tr>
- <td class="label">Traceroute to:</td>
- <td class="input"><input size="30" name="q" value="<% $q %>" /></td>
- <td align="left"><input type="submit" value="Go" /></td>
- </tr>
+ <span class="label">Traceroute to:</span>
+ <span class="input"><input size="30" name="q" value="<% $q %>" /></span>
+ <input type="submit" value="<%loc('Go')%>" />
</form>
<%args>
$q => undef
diff --git a/html/RTIR/Tools/Elements/ToolFormWhois b/html/RTIR/Tools/Elements/ToolFormWhois
index 4c4ee4c..06b95bd 100644
--- a/html/RTIR/Tools/Elements/ToolFormWhois
+++ b/html/RTIR/Tools/Elements/ToolFormWhois
@@ -1,8 +1,8 @@
<form action="Lookup.html" method="get">
<input type="hidden" name="ticket" value="<% $TicketObj->id %>" />
<tr>
- <td class="label">WHOIS:</td>
- <td class="input">
+ <span class="label">WHOIS:</span>
+ <spanclass="input">
<input size="30" name="q" value="<% $q %>" /> at
<select name="server">
<%PERL>
@@ -10,16 +10,15 @@ 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 $server ? 'SELECTED' : '' %>><% $name || $host %></option>
+ <option value="<% $host %>" <% $host eq $WhoisServer ? 'SELECTED' : '' %>><% $name || $host %></option>
% }
</select>
- </td>
- <td align="left"><input type="submit" value="<%loc('Go')%>" /></td>
- </tr>
+ </span>
+ <input type="submit" value="<%loc('Go')%>" />
</form>
<%args>
$TicketObj => undef
$q => undef
$servers => undef
-$server => undef
+$WhoisServer => undef
</%args>
diff --git a/html/RTIR/Tools/Elements/Tools b/html/RTIR/Tools/Elements/Tools
new file mode 100644
index 0000000..972fb1b
--- /dev/null
+++ b/html/RTIR/Tools/Elements/Tools
@@ -0,0 +1,5 @@
+<& ToolFormWhois, %ARGS &>
+<& ToolFormTraceroute, %ARGS &>
+<hr>
+
+<& ToolResultsWhois, %ARGS &>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index be104b9..8d059ea 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -32,7 +32,7 @@
% if ( $TicketObj->id ) {
<&| /Widgets/TitleBox, title => loc("Current [_1]: #[_2]", $TicketType, $ticket), class => 'ticket-info-basics' &>
-<& /Elements/TicketList, Query => "id = $ticket", Format => $Format, ShowNavigation => 0 &>
+<& /Elements/TicketList, Query => "id = $ticket", Format => RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'}, ShowNavigation => 0 &>
</&>
% }
@@ -40,21 +40,18 @@
<& Elements/LookupRelatedTickets, TicketObj => $TicketObj, LookupType => $type, q => $q &>
% }
-
<hr>
-
<h2><&|/l&>Look Up Information</&></h2>
-
-<table>
- <& Elements/ToolFormWhois, q=> $q, servers => $servers, server => $server, TicketObj => $TicketObj &>
- <& Elements/ToolFormTraceroute, q => $q &>
-</table>
-<hr>
-
-<& Elements/ToolResultsWhois, q => $q, TicketType => $TicketType, TicketObj => $TicketObj, WhoisServer => $server, handparse => $handparse &>
+<& Elements/Tools, q => $q,
+ TicketType => $TicketType,
+ TicketObj => $TicketObj,
+ WhoisServer => $server,
+ handparse => $handparse,
+ servers => $servers &>
<%INIT>
+# Redirect when necessary
if ( $ARGS{'InvestigateTo'} ) {
my $requestors = join ', ', map /^Requestorbox-(.*)/, keys %ARGS;
return RT::Interface::Web::Redirect(
@@ -99,10 +96,9 @@ if ( $q ) {
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 = "( 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 ."'"
@@ -121,7 +117,6 @@ if ( $ticket ) {
}
-my $Format = RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'};
</%INIT>
<%ARGS>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list