summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2006-06-02 13:20:24 +0000
committerivan <ivan>2006-06-02 13:20:24 +0000
commit3a820c27d5290f9d2761636b2b4fe865caeb0804 (patch)
tree8360f16bb719eefbb1d2aec809e2f4bc8d3243e7 /httemplate
parent7b5aa356c7ed954bb60ce22d44d6de5f4852fafd (diff)
add a service search
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/header.html19
-rw-r--r--httemplate/search/svc_Smart.html22
2 files changed, 35 insertions, 6 deletions
diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html
index 2be2c7938..3aa81be3b 100644
--- a/httemplate/elements/header.html
+++ b/httemplate/elements/header.html
@@ -21,9 +21,12 @@
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 = '';
@@ -79,20 +82,24 @@
<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
index 000000000..93dbbeadd
--- /dev/null
+++ b/httemplate/search/svc_Smart.html
@@ -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') %><%
+
+}
+
+%>