From 483a2e4dad0f7ce8dbdc06a825d1aa11bd742f6b Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Mar 2010 20:21:51 +0000 Subject: [PATCH] when using a side menubar, put search boxes on the side too --- httemplate/elements/header.html | 123 ++++++--------------------- httemplate/elements/searchbar-address2.html | 34 ++++++++ httemplate/elements/searchbar-cust_bill.html | 34 ++++++++ httemplate/elements/searchbar-cust_main.html | 38 +++++++++ httemplate/elements/searchbar-cust_svc.html | 33 +++++++ httemplate/elements/searchbar-prospect.html | 33 +++++++ httemplate/elements/searchbar-ticket.html | 35 ++++++++ 7 files changed, 234 insertions(+), 96 deletions(-) create mode 100644 httemplate/elements/searchbar-address2.html create mode 100644 httemplate/elements/searchbar-cust_bill.html create mode 100644 httemplate/elements/searchbar-cust_main.html create mode 100644 httemplate/elements/searchbar-cust_svc.html create mode 100644 httemplate/elements/searchbar-prospect.html create mode 100644 httemplate/elements/searchbar-ticket.html diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 8a9cb8526..bfa138fbd 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -40,40 +40,6 @@ Example: <% include('rs_init_object.html') |n %> <% include('logout.html') |n %> - - <% $head |n %> @@ -110,76 +76,47 @@ Example: -% } - -% if ( $curuser->access_right('List prospects') ) { -
-
- Adv - -
-% } + <% include('searchbar-prospect.html') %> -% if ( $curuser->access_right('List customers') ) { -
-
- Advanced - -
-% } + <% include('searchbar-cust_main.html') %> -% if ( $conf->exists('address2-search') ) { -
- - -
- -
-% } + <% include('searchbar-address2.html') %> -% if ( $curuser->access_right('View invoices') ) { -
- -% if ( $curuser->access_right('List invoices') ) { - Adv\ -% } -
-
-% } + <% include('searchbar-cust_bill.html') %> -% if ( $curuser->access_right('View customer services') ) { -
-
- Advanced - -
-% } + <% include('searchbar-cust_svc.html') %> -% if ( $conf->config("ticket_system") ) { -
-
- Advanced - -
-% } + <% include('searchbar-ticket.html') %> +% } else { #$menu_position eq 'left' + + + + + + + + +% } + + @@ -190,6 +127,15 @@ Example: + +
+ <% include('searchbar-prospect.html') %> + <% include('searchbar-cust_main.html') %> + <% include('searchbar-address2.html') %> + <% include('searchbar-cust_bill.html') %> + <% include('searchbar-cust_svc.html') %> + <% include('searchbar-ticket.html') %> + % } @@ -238,19 +184,4 @@ if ( scalar(@agentnums) == 1 ) { $company_name = $conf->config('company_name'); } -my $prospect_label = '(name, company or phone)'; - -my $cust_width = 246; -my $cust_label = '(cust #, name, company'; -if ( $conf->exists('address1-search') ) { - $cust_label .= ', address'; - $cust_width += 56; -} -$cust_label .= ' or contact phone)'; - -my $address2_label = '(Unit #)'; -my $inv_label = '(inv #)'; -my $svc_label = '(user, email, ip, mac, domain or service phone)'; -my $ticketing_label = '(ticket #, subject, email or fulltext:text)'; - diff --git a/httemplate/elements/searchbar-address2.html b/httemplate/elements/searchbar-address2.html new file mode 100644 index 000000000..d5e2b37d7 --- /dev/null +++ b/httemplate/elements/searchbar-address2.html @@ -0,0 +1,34 @@ +% if ( $conf->exists('address2-search') ) { + + + + +
+ + + <% $menu_position eq 'left' ? '
' : '' %> + +% } + + +<%once> + +my $address2_label = '(Unit #)'; + + +<%init> + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + + diff --git a/httemplate/elements/searchbar-cust_bill.html b/httemplate/elements/searchbar-cust_bill.html new file mode 100644 index 000000000..448f40f09 --- /dev/null +++ b/httemplate/elements/searchbar-cust_bill.html @@ -0,0 +1,34 @@ +% if ( $curuser->access_right('View invoices') ) { + + + +% if ( $curuser->access_right('List invoices') ) { + Adv\ +% } +
+ + + <% $menu_position eq 'left' ? '

' : '' %> + +% } + + +<%once> + +my $inv_label = '(inv #)'; + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + + diff --git a/httemplate/elements/searchbar-cust_main.html b/httemplate/elements/searchbar-cust_main.html new file mode 100644 index 000000000..e910681dc --- /dev/null +++ b/httemplate/elements/searchbar-cust_main.html @@ -0,0 +1,38 @@ +% if ( $curuser->access_right('List customers') ) { + + +
+ Advanced + + + <% $menu_position eq 'left' ? '
' : '' %> + +% } + + +<%init> + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + +my $cust_width = 246; +my $cust_label = '(cust #, name, company'; +if ( $conf->exists('address1-search') ) { + $cust_label .= ', address'; + $cust_width += 56; +} +$cust_label .= ' or contact phone)'; + +my $width = $menu_position eq 'left' ? '190px' : $cust_width.'px'; + + diff --git a/httemplate/elements/searchbar-cust_svc.html b/httemplate/elements/searchbar-cust_svc.html new file mode 100644 index 000000000..cc0ec97a0 --- /dev/null +++ b/httemplate/elements/searchbar-cust_svc.html @@ -0,0 +1,33 @@ +% if ( $curuser->access_right('View customer services') ) { + + +
+ Advanced + + + <% $menu_position eq 'left' ? '
' : '' %> + +% } + + +<%once> + +my $svc_label = '(user, email, ip, mac, domain or service phone)'; + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + +my $width = $menu_position eq 'left' ? '190px' : '271px'; + + diff --git a/httemplate/elements/searchbar-prospect.html b/httemplate/elements/searchbar-prospect.html new file mode 100644 index 000000000..68b90d4e3 --- /dev/null +++ b/httemplate/elements/searchbar-prospect.html @@ -0,0 +1,33 @@ +% if ( $curuser->access_right('List prospects') ) { + + +
+ Adv + + + <% $menu_position eq 'left' ? '
' : '' %> + +% } + + +<%once> + +my $prospect_label = '(name, company or phone)'; + + +<%init> + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + +my $width = $menu_position eq 'left' ? '190px' : '155px'; + + diff --git a/httemplate/elements/searchbar-ticket.html b/httemplate/elements/searchbar-ticket.html new file mode 100644 index 000000000..0907a8924 --- /dev/null +++ b/httemplate/elements/searchbar-ticket.html @@ -0,0 +1,35 @@ +% if ( $conf->config("ticket_system") ) { + + +
+ Advanced + + + <% $menu_position eq 'left' ? '
' : '' %> + +% } + + +<%once> + +my $ticketing_label = '(ticket #, subject, email or fulltext:text)'; + + +<%init> + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +my $menu_position = $curuser->option('menu_position') || 'top'; + +my $width = $menu_position eq 'left' ? '190px' : '223px'; + + -- 2.11.0