Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / httemplate / elements / searchbar-cust_main.html
1 % if ( $curuser->access_right('List customers') ) {
2
3   <FORM ACTION="<%$fsurl%>search/cust_main.cgi" METHOD="POST" STYLE="margin:0">
4     <INPUT NAME="search_cust" TYPE="text" VALUE="<% $cust_label |n %>" STYLE="width:<%$width%>" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
5     <A HREF="<%$fsurl%>search/report_cust_main.html" CLASS="fslink" STYLE="font-size: 11px"><% mt('Advanced') |h %></A>
6     <INPUT TYPE="submit" VALUE="<% mt('Search customers') |h %>" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
7   </FORM>
8   <% $menu_position eq 'left' ? '<BR>' : '' |n %>
9
10 % }
11
12 <SCRIPT TYPE="text/javascript">
13
14   function clearhint_search_cust (what) {
15     if ( what.value == '<% $cust_label |n %>' )
16       what.value = '';
17   }
18
19 </SCRIPT>
20 <%init> 
21
22 my $conf = new FS::Conf;
23
24 my $curuser = $FS::CurrentUser::CurrentUser;
25
26 my $menu_position = $curuser->option('menu_position') || 'top';
27
28 my $cust_width = 246;
29 my $cust_label = '(cust #, name, company, email';
30 if ( $conf->exists('address1-search') ) {
31   $cust_label .= ', address';
32   $cust_width += 56;
33 }
34 $cust_label .= ' or contact phone)';
35
36 $cust_label = emt($cust_label);
37
38 my $width = $menu_position eq 'left' ? '190px' : $cust_width.'px';
39
40 </%init>