[Rt-commit] rtir branch, 4.0/RunWhoisRequestByDefault-option, updated. 2.6.1-7-gc8ffe60

Ruslan Zakirov ruz at bestpractical.com
Wed Sep 28 09:05:07 EDT 2011


The branch, 4.0/RunWhoisRequestByDefault-option has been updated
       via  c8ffe6079117edf4646a2b2754e9262b0696a940 (commit)
       via  d11c3a15686ad8744791ab64504e6679999b3031 (commit)
       via  92e055e98541bf30dd3019bab0e5a63cb5caec12 (commit)
      from  dda871f46f0266e684ff7272816f5842bc1b4bbd (commit)

Summary of changes:
 html/RTIR/Tools/Elements/ToolFormIframe   |    6 ++++--
 html/RTIR/Tools/Elements/ToolFormWhois    |    6 ++++--
 html/RTIR/Tools/Elements/ToolResultsWhois |    5 ++---
 html/RTIR/Tools/Lookup.html               |    8 ++++----
 4 files changed, 14 insertions(+), 11 deletions(-)

- Log -----------------------------------------------------------------
commit 92e055e98541bf30dd3019bab0e5a63cb5caec12
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 11:55:53 2011 +0400

    pass arguments around

diff --git a/html/RTIR/Tools/Elements/ToolFormIframe b/html/RTIR/Tools/Elements/ToolFormIframe
index 3c650ec..91f8f4d 100644
--- a/html/RTIR/Tools/Elements/ToolFormIframe
+++ b/html/RTIR/Tools/Elements/ToolFormIframe
@@ -1,5 +1,7 @@
 <form action="Lookup.html" method="get">
-  <input type="hidden" name="ticket" value="<% $TicketObj->id %>" />
+% foreach my $arg ( grep exists $ARGS{$_}, @PassArguments ) {
+  <input type="hidden" name="<% $arg %>" value="<% $ARGS{ $arg } %>" />
+% }
     <span class="label"><%loc('Research Tool')%>:</span>
     <span class="input">
       <input size="30" name="q" value="<% $q %>" /> at
@@ -12,9 +14,9 @@
     <input type="submit" value="<%loc('Go')%>" />
 </form>
 <%args>
-$TicketObj => undef
 $q => undef
 $ResearchTool => undef
+ at PassArguments => ()
 </%args>
 <%INIT>
 my $unique_id = time().rand();
diff --git a/html/RTIR/Tools/Elements/ToolFormWhois b/html/RTIR/Tools/Elements/ToolFormWhois
index a11a781..f7bee3f 100644
--- a/html/RTIR/Tools/Elements/ToolFormWhois
+++ b/html/RTIR/Tools/Elements/ToolFormWhois
@@ -1,5 +1,7 @@
 <form action="Lookup.html" method="get">
-  <input type="hidden" name="ticket" value="<% $TicketObj->id %>" />
+% foreach my $arg ( grep exists $ARGS{$_}, @PassArguments ) {
+  <input type="hidden" name="<% $arg %>" value="<% $ARGS{ $arg } %>" />
+% }
   <tr>
     <span class="label">WHOIS:</span>
     <span class="input">
@@ -17,10 +19,10 @@ foreach my $s ( sort grep $servers->{ $_ }, keys %{ $servers } ) {
     <input type="submit" value="<%loc('Go')%>" />
 </form>
 <%args>
-$TicketObj => undef
 $q => undef
 $WhoisServer => undef
 $server => undef
+ at PassArguments => ()
 </%args>
 <%INIT>
 my $servers = RT->Config->Get('whois');
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 09da169..dd86e06 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -42,9 +42,11 @@
 
 <hr>
 <h2><&|/l&>Look Up Information</&></h2>
-<& Elements/Tools, %ARGS, q => $q,
-    TicketType => $TicketType, 
+<& Elements/Tools,
+    %ARGS,
+    q => $q,
     TicketObj => $TicketObj,
+    PassArguments => [qw(ticket type HideResults)],
 &>
 
 <%INIT>
@@ -109,8 +111,6 @@ if ( $ticket ) {
     $TicketType = RT::IR::TicketType( Ticket => $TicketObj );
 }
 
-
-
 </%INIT>
 <%ARGS>
 $q         => undef

commit d11c3a15686ad8744791ab64504e6679999b3031
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 13:35:53 2011 +0400

    return back handparse's default value

diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
index 7509ccb..fde8b22 100644
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -57,7 +57,7 @@ Structured RIPE whois data returned. Click <a href="Lookup.html?q=<% $q |u %>&se
 </form>
 <%args>
 $q =>  undef
-$handparse => undef
+$handparse => 1
 $TicketType => undef
 $TicketObj => undef
 $WhoisServer => undef

commit c8ffe6079117edf4646a2b2754e9262b0696a940
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Sep 28 13:36:25 2011 +0400

    we don't pass TicketType

diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
index fde8b22..519b39c 100644
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
+++ b/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -1,6 +1,6 @@
 % if ( $q ) {
 <h2>WHOIS Results</h2>
-% if ( $TicketObj && $TicketType eq 'Incident' ) {
+% if ( $TicketObj && RT::IR::TicketType( Ticket => $TicketObj ) 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 %>" />
@@ -58,7 +58,6 @@ Structured RIPE whois data returned. Click <a href="Lookup.html?q=<% $q |u %>&se
 <%args>
 $q =>  undef
 $handparse => 1
-$TicketType => undef
 $TicketObj => undef
 $WhoisServer => undef
 $server => undef

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


More information about the Rt-commit mailing list