add a service search
authorivan <ivan>
Fri, 2 Jun 2006 13:20:24 +0000 (13:20 +0000)
committerivan <ivan>
Fri, 2 Jun 2006 13:20:24 +0000 (13:20 +0000)
httemplate/elements/header.html
httemplate/search/svc_Smart.html [new file with mode: 0644]
rt/FREESIDE_MODIFIED
rt/html/Elements/FreesideSvcSearch [new file with mode: 0644]
rt/html/Elements/PageLayout
rt/html/Elements/Tabs

index 2be2c79..3aa81be 100644 (file)
         if ( what.value = '(cust #, name or company)' )
           what.value = '';
       }
-    </SCRIPT>
 
-    <SCRIPT TYPE="text/javascript">
+      function clearhint_search_svc (what) {
+        if ( what.value = '(user, user@domain or domain)' )
+          what.value = '';
+      }
+
       function clearhint_search_ticket (what) {
         if ( what.value = '(ticket # or subject string)' )
           what.value = '';
         <TD COLSPAN=4 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<%=$fsurl%>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
       </TR>
       <TR>
-        <TD COLSPAN=1 BGCOLOR="#000000" WIDTH="154">
-        </TD>
-        <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
+        <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right" WIDTH="15%">
           <FORM ACTION="<%=$fsurl%>edit/cust_main.cgi" METHOD="GET" STYLE="margin:0">
             <INPUT TYPE="submit" VALUE="New customer">
           </FORM>
         </TD>
         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
           <FORM ACTION="<%=$fsurl%>search/cust_main.cgi" METHOD="GET" STYLE="margin:0">
-            <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name or company)" SIZE="23" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right">
+            <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name or company)" SIZE="22" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" STYLE="text-align:right">
             <INPUT TYPE="submit" VALUE="Search customers">
           </FORM>
         </TD>
         <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
+          <FORM ACTION="<%=$fsurl%>search/svc_Smart.html" METHOD="GET" STYLE="margin:0">
+            <INPUT NAME="search_svc" TYPE="text" VALUE="(user, user@domain or domain)" SIZE="26" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="text-align:right">
+            <INPUT TYPE="submit" VALUE="Search services">
+          </FORM>
+        </TD>
+        <TD COLSPAN=1 BGCOLOR="#000000" ALIGN="right">
           <FORM ACTION="<%=$fsurl%>rt/index.html" METHOD="GET" STYLE="margin:0">
             <INPUT NAME="q" TYPE="text" VALUE="(ticket # or subject string)" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" STYLE="text-align:right">
             <INPUT TYPE="submit" VALUE="Search tickets">
diff --git a/httemplate/search/svc_Smart.html b/httemplate/search/svc_Smart.html
new file mode 100644 (file)
index 0000000..93dbbea
--- /dev/null
@@ -0,0 +1,22 @@
+<%
+
+if ( $cgi->param('search_svc') =~ /\.[a-z]{2,8}$/i ) {
+
+  # looks (enough) like a domain
+
+  %><%= $cgi->redirect('svc_domain.cgi?domain='. uri_escape( $cgi->param('search_svc') ) ) %><%
+
+} elsif ( $cgi->param('search_svc') =~ /\w/ ) {
+
+  #looks (enough) like a username
+
+  %><%= $cgi->redirect('svc_acct.cgi?username_type=Exact;username='. uri_escape( $cgi->param('search_svc') ) ) %><%
+
+} else {
+
+%><%= include('/elements/header.html', 'Unrecognized service string') %>
+  <%= include('/elements/footer.html') %><%
+
+} 
+
+%>
index 82f0ff2..1b0c47c 100644 (file)
@@ -24,3 +24,8 @@ html/NoAuth/images/small-logo.png
 
 html/Elements/TitleBoxStart
 html/Search/Bulk.html
+
+html/Elements/FreesideNewCust
+html/Elements/FreesideSearch
+html/Elements/FreesideSvcSearch
+
diff --git a/rt/html/Elements/FreesideSvcSearch b/rt/html/Elements/FreesideSvcSearch
new file mode 100644 (file)
index 0000000..47c430f
--- /dev/null
@@ -0,0 +1,10 @@
+<form action="<% $RT::URI::freeside::URL %>/search/svc_Smart.html" STYLE="margin:0">
+    <SCRIPT TYPE="text/javascript">
+      function clearhint_search_svc (what) {
+        if ( what.value = '(user, user@domain or domain)' )
+          what.value = '';
+      }
+    </SCRIPT>
+<input name="search_svc" accesskey="0" VALUE="(user, user@domain or domain)" SIZE="27" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" STYLE="text-align:right">
+<input type="submit" value="<&|/l&>Search services</&>">&nbsp;
+</form>
index 5289f78..dd0fd75 100644 (file)
 %# END BPS TAGGED BLOCK }}}
 <table class="black" border=0 cellspacing=0 cellpadding=0 width="100%">
 <tr>
-  <TD colspan=4 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
+  <TD colspan=5 WIDTH="100%" STYLE="padding:0"><IMG BORDER=0 ALT="" SRC="<% $RT::URI::freeside::URL %>images/black-gradient.png" HEIGHT="13" WIDTH="100%"></TD>
 </tr>
 <tr>
-  <th class="black" align="left" width=15%><span class="rtname"><%$AppName%></span>
-  </th>
+%#  <th class="black" align="left" width=15%><span class="rtname"><%$AppName%></span>
+%#  </th>
       <span class="topactions">
-% foreach my $action (sort keys %{$topactions}) {
-        <td class="blackright">
+% my $notfirst = 0; foreach my $action (sort keys %{$topactions}) {
+        <td class="blackright" ALIGN="right" <% $notfirst++ ? '' : 'WIDTH="15%"' %>>
         <%$topactions->{"$action"}->{'html'} |n %>
         </td>
 % }
index 2272007..dcb652e 100644 (file)
@@ -63,7 +63,9 @@ my $basetopactions = {
                },
        B => { html => $m->scomp('/Elements/FreesideSearch')    
                },
-       C => { html => $m->scomp('/Elements/SimpleSearch') 
+       C => { html => $m->scomp('/Elements/FreesideSvcSearch') 
+               },
+       D => { html => $m->scomp('/Elements/SimpleSearch') 
                }
        };
 my $basetabs = {