1 <DIV STYLE="display:inline;
5 border:1px solid #cccccc">
7 <FORM ACTION="<%$fsurl%>search/searchbar.cgi"
9 STYLE="margin:0; display:inline">
10 <SCRIPT TYPE="text/javascript">
11 var hints=new Array(<% join(',', map {"'$hints{$_}'"} @searches) |n%>);
12 function update_hint() {
13 var s = document.getElementById('search_for');
14 var q = document.getElementById('q');
15 q.value = hints[s.selectedIndex];
17 function clear_hint() {
18 var s = document.getElementById('search_for');
19 var q = document.getElementById('q');
20 if ( q.value == hints[s.selectedIndex] ) {
25 <SELECT NAME="search_for" id="search_for" STYLE="width:auto" onchange="update_hint()">
26 % foreach (@searches) {
27 <OPTION NAME="<% $_ %>"><% $_ %></OPTION>
30 <INPUT NAME="q" ID="q" TYPE="text" STYLE="width:140px" VALUE="<% $hints{$searches[0]} %>" onmousedown="clear_hint()">
31 <INPUT TYPE="submit" VALUE="Search" STYLE="width:auto">
35 my $curuser = $FS::CurrentUser::CurrentUser;
37 push @searches, 'customers' if $curuser->access_right('List customers');
38 push @searches, 'prospects' if $curuser->access_right('List prospects');
39 push @searches, 'invoices' if $curuser->access_right('View invoices');
40 push @searches, 'services' if $curuser->access_right('View customer services');
41 push @searches, 'tickets' if FS::Conf->new->exists('ticket_system');
44 'customers' => '(cust #, name, company)',
45 'prospects' => '(name, company, phone)',
46 'invoices' => '(invoice #)',
47 'services' => '(user, email, phone...)',
48 'tickets' => '(ticket #, subject, email)',