[Rt-commit] rtir branch, 4.0/save-lookup-results, repushed
Aaron Kondziela
aaron at bestpractical.com
Thu Apr 13 21:07:36 EDT 2017
The branch 4.0/save-lookup-results was deleted and repushed:
was 94387639bbc688aee8c2ae27e9aab2f66be7899d
now f3696756d075f71e2ab172739962f16a7de760f7
1: 74c709e ! 1: f369675 Add button to save Whois and Traceroute results to a ticket
@@ -1,6 +1,8 @@
Author: Aaron Kondziela <aaron at bestpractical.com>
- Add button to save Whois results to a ticket
+ Add button to save Whois and Traceroute results to a ticket
+
+ Fixes T#183237
diff --git a/html/RTIR/Tools/Elements/ToolResultsWhois b/html/RTIR/Tools/Elements/ToolResultsWhois
--- a/html/RTIR/Tools/Elements/ToolResultsWhois
@@ -43,8 +45,16 @@
</form>
+
+% if ($TicketObj and $WhoisIterator and $SavedContent) {
-+ <form method="post" action="">
-+ <input type="hidden" name="LookupResults" value="<% $SavedContent | h %>" />
++% my $url = RT::IR->HREFTo(
++% "Tools/Lookup.html?"
++% . $m->comp(
++% '/Elements/QueryString',
++% ticket => $TicketObj->id,
++% q => $q,
++% )
++% );
++ <form method="post" action="<% $url %>">
++ <input type="hidden" name="LookupResults" value="<% $SavedContent %>" />
+ <input type="submit" value="<% loc('Save these results to the ticket') %>" id="save-results-to-ticket" />
+ </form>
+% }
@@ -54,14 +64,10 @@
$handparse => 1
$TicketObj => undef
$WhoisServer => undef
-+$WhoisResults => undef
+$results => undef
$server => undef
</%args>
-+
<%init>
-
- $WhoisServer = $server unless defined $WhoisServer;
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
--- a/html/RTIR/Tools/Lookup.html
@@ -84,15 +90,6 @@
if ( $ARGS{'InvestigateTo'} ) {
my $requestors = join ', ', map /^Requestorbox-(.*)/, keys %ARGS;
@@
- ));
- }
-
--my $title = $q ? loc("Lookup '[_1]'", $q) : loc("Lookup");
--
- my ($TicketObj, $TicketType);
- if ( $ticket ) {
- $TicketObj = LoadTicket( $ticket );
-@@
$TicketType = RT::IR::TicketType( Ticket => $TicketObj );
}
@@ -103,8 +100,6 @@
+ push @results, loc("Lookup results for Ticket [_1]: [_2]", $TicketObj->id, $msg);
+}
+
-+my $title = $q ? loc("Lookup '[_1]'", $q) : loc("Lookup");
-+
</%INIT>
<%ARGS>
$q => ''
@@ -114,3 +109,48 @@
$HideResults => 0
</%ARGS>
+diff --git a/html/RTIR/Tools/Traceroute.html b/html/RTIR/Tools/Traceroute.html
+--- a/html/RTIR/Tools/Traceroute.html
++++ b/html/RTIR/Tools/Traceroute.html
+@@
+
+ <div style="margin: 2em;">
+
++% my $SavedContent = '';
++
+ <&| /Widgets/TitleBox,
+ title => $title,
+ class => 'traceroute',
+ &>
++% if ($TicketObj) {
++ <button onClick="jQuery('#save-results-to-ticket').click()"><% loc('Save these results to the ticket') %></button>
++% }
+ <pre>
+ <%PERL>
+ while (my $content = <$tr>) {
++ $SavedContent = $SavedContent . $content . "\n";
+ $m->comp('/Elements/MakeClicky', content => \$content, ($TicketObj? (object => $TicketObj):()) );
+ $m->out( $content );
+ $m->out('<br />');
+@@
+ </pre>
+ </&>
+
++% if ($TicketObj and $SavedContent) {
++% my $url = RT::IR->HREFTo(
++% "Tools/Lookup.html?"
++% . $m->comp(
++% '/Elements/QueryString',
++% ticket => $ticket,
++% q => $q,
++% )
++% );
++ <form method="post" action="<% $url %>">
++ <input type="hidden" name="LookupResults" value="<% $SavedContent %>" />
++ <input type="submit" value="<% loc('Save these results to the ticket') %>" id="save-results-to-ticket" />
++ </form>
++% }
++
+ </div>
+ <%INIT>
+ unless ( $q =~ /^[A-Z0-9.:]+$/i ) {
2: 9438763 < -: ------- Add button to save Traceroute results to a ticket
More information about the rt-commit
mailing list