From 68fcc90d8e95f1efe0efe07b2f59e5fab2d8c535 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 27 Apr 2011 08:31:03 +0000 Subject: RT mobile UI, #11630 --- httemplate/elements/header.html | 30 ++++++++++++++++- httemplate/elements/menu.html | 20 ++++++++--- httemplate/elements/searchbar-combined.html | 51 +++++++++++++++++++++++++++++ httemplate/search/searchbar.cgi | 16 +++++++++ 4 files changed, 112 insertions(+), 5 deletions(-) create mode 100644 httemplate/elements/searchbar-combined.html create mode 100644 httemplate/search/searchbar.cgi (limited to 'httemplate') diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index c83529e2b..432e9c6af 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -28,10 +28,14 @@ Example: +% if ( $mobile ) { + +% } <% include('menu.html', 'freeside_baseurl' => $fsurl, 'position' => $menu_position, 'nocss' => $nocss, + 'mobile' => $mobile, ) |n %> @@ -67,6 +71,19 @@ Example: +% if ( $mobile ) { + + + + + + <% include('searchbar-combined.html') |n %> + + +% } else { + + + + + + +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +my @searches = (); +push @searches, 'customers' if $curuser->access_right('List customers'); +push @searches, 'prospects' if $curuser->access_right('List prospects'); +push @searches, 'invoices' if $curuser->access_right('View invoices'); +push @searches, 'services' if $curuser->access_right('View customer services'); +push @searches, 'tickets' if FS::Conf->new->exists('ticket_system'); + +my %hints = ( + 'customers' => '(cust #, name, company)', + 'prospects' => '(name, company, phone)', + 'invoices' => '(invoice #)', + 'services' => '(user, email, phone...)', + 'tickets' => '(ticket #, subject, email)', +); + + diff --git a/httemplate/search/searchbar.cgi b/httemplate/search/searchbar.cgi new file mode 100644 index 000000000..c9328716e --- /dev/null +++ b/httemplate/search/searchbar.cgi @@ -0,0 +1,16 @@ +<%init> +my %searches = ( + 'customers' => 'cust_main.cgi?search_cust=', + 'prospects' => 'prospect_main.html?search_prospect=', + 'invoices' => 'cust_bill.html?invnum=', + 'services' => 'cust_svc.html?search_svc=', +); +if ( FS::Conf->new->config('ticket_system') ) { + $searches{'tickets'} = FS::TicketSystem->baseurl . 'index.html?q='; +} + +$cgi->param('search_for') =~ /^(\w+)$/; +my $search = $searches{$1} or die "unknown search type: '$1'\n"; +my $q = $cgi->param('q'); # pass through unparsed + +<% $cgi->redirect($search . $q) %> -- cgit v1.2.1