[Rt-commit] rtir branch, 4.0/improve-lookup-tool, created. 4.0.1-1-g03869ebe

Craig Kaiser craig at bestpractical.com
Fri Oct 26 15:55:10 EDT 2018


The branch, 4.0/improve-lookup-tool has been created
        at  03869ebe9a8f2f56a2b54d9152c2d8e48f8937c9 (commit)

- Log -----------------------------------------------------------------
commit 03869ebe9a8f2f56a2b54d9152c2d8e48f8937c9
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Fri Oct 26 15:52:53 2018 -0400

    Add IP lookup option when no ticketObj

diff --git a/html/RTIR/Tools/Elements/ToolFormLookup b/html/RTIR/Tools/Elements/ToolFormLookup
new file mode 100644
index 00000000..b82d8769
--- /dev/null
+++ b/html/RTIR/Tools/Elements/ToolFormLookup
@@ -0,0 +1,18 @@
+<table>
+    <tr>
+        <td valign="top" class="label"><%loc('Lookup Fields')%>:</td>
+        <td valign="top">
+            <form name="ToolLookupField" action="Lookup.html" method="get">
+                <input type="text" size="30" name="q" value="<% $q %>" /> for
+                <select name="type">
+                    <option value="ip">IP</option>
+                </select>
+            <input type="submit" value="<%loc('Go')%>" />
+            </form>
+        </td>
+    </tr>
+</table>
+
+<%args>
+$q => ''
+</%args>
diff --git a/html/RTIR/Tools/Lookup.html b/html/RTIR/Tools/Lookup.html
index 266879b6..d2f3bb4c 100644
--- a/html/RTIR/Tools/Lookup.html
+++ b/html/RTIR/Tools/Lookup.html
@@ -51,6 +51,13 @@
 
 % $m->callback(CallbackName => 'BeforeCurrent', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => $q);
 
+% if ( ! $TicketObj ) {
+    <& Elements/ToolFormLookup,
+        %ARGS,
+        q => $q,
+    &>
+% }
+
 % if ( $TicketObj ) {
 <&| /Widgets/TitleBox, title => loc("Current [_1]: #[_2]", $TicketType, $ticket), class => 'ticket-info-basics' &>
 <& /Elements/CollectionList, Query => "id = $ticket", Format => RT->Config->Get('RTIRSearchResultFormats')->{$TicketType . 'Default'}, ShowNavigation => 0,
@@ -58,13 +65,13 @@
 </&>
 % }
 
-% $m->callback(CallbackName => 'AfterCurrent', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => $q);
+% $m->callback(CallbackName => 'AfterCurrent', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => \$q);
 
 % if ( ! $HideResults ) {
 <& Elements/LookupRelatedTickets, TicketObj => $TicketObj, LookupType => $type, q => $q &>
 % }
 
-% $m->callback(CallbackName => 'BeforeTools', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => $q);
+% $m->callback(CallbackName => 'BeforeTools', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => \$q);
 
 % if ($TicketObj || $q) {
 <hr>
@@ -78,7 +85,7 @@
     PassArguments => [qw(ticket type HideResults)],
 &>
 
-% $m->callback(CallbackName => 'AfterTools', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => $q);
+% $m->callback(CallbackName => 'AfterTools', %ARGS, ARGSRef => \%ARGS, Ticket => $TicketObj, LookupType => $type, q => \$q);
 
 <%INIT>
 my @results;

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


More information about the rt-commit mailing list