diff options
author | ivan <ivan> | 2006-06-02 13:20:24 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-06-02 13:20:24 +0000 |
commit | 3a820c27d5290f9d2761636b2b4fe865caeb0804 (patch) | |
tree | 8360f16bb719eefbb1d2aec809e2f4bc8d3243e7 | |
parent | 7b5aa356c7ed954bb60ce22d44d6de5f4852fafd (diff) |
add a service search
-rw-r--r-- | httemplate/elements/header.html | 19 | ||||
-rw-r--r-- | httemplate/search/svc_Smart.html | 22 | ||||
-rw-r--r-- | rt/FREESIDE_MODIFIED | 5 | ||||
-rw-r--r-- | rt/html/Elements/FreesideSvcSearch | 10 | ||||
-rw-r--r-- | rt/html/Elements/PageLayout | 10 | ||||
-rw-r--r-- | rt/html/Elements/Tabs | 4 |
6 files changed, 58 insertions, 12 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') %><% + +} + +%> diff --git a/rt/FREESIDE_MODIFIED b/rt/FREESIDE_MODIFIED index 82f0ff2e6..1b0c47c06 100644 --- a/rt/FREESIDE_MODIFIED +++ b/rt/FREESIDE_MODIFIED @@ -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 index 000000000..47c430f1a --- /dev/null +++ b/rt/html/Elements/FreesideSvcSearch @@ -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</&>"> +</form> diff --git a/rt/html/Elements/PageLayout b/rt/html/Elements/PageLayout index 5289f78f3..dd0fd7504 100644 --- a/rt/html/Elements/PageLayout +++ b/rt/html/Elements/PageLayout @@ -45,14 +45,14 @@ %# 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> % } diff --git a/rt/html/Elements/Tabs b/rt/html/Elements/Tabs index 22720072c..dcb652e12 100644 --- a/rt/html/Elements/Tabs +++ b/rt/html/Elements/Tabs @@ -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 = { |