From b19897e1db4c110d7d7e8b52800cda5ab58ce9e0 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 14 Aug 2006 12:13:40 +0000 Subject: sprinkle some magic ajax fairy dust on referring customer SELEKTAH. rewind! make smart search smarter, re-layout the top search bars and add an invoice one --- httemplate/edit/cust_main.cgi | 10 +- httemplate/elements/header.html | 94 +++++++++++++---- httemplate/elements/search-cust_main.html | 163 ++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 19 deletions(-) create mode 100644 httemplate/elements/search-cust_main.html (limited to 'httemplate') diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi index 45cb69fc2..c3d1804bc 100755 --- a/httemplate/edit/cust_main.cgi +++ b/httemplate/edit/cust_main.cgi @@ -64,7 +64,9 @@ if ( $cgi->param('error') ) { @invoicing_list = (); } $cgi->delete_all(); + my $action = $custnum ? 'Edit' : 'Add'; +$action .= ": ". $cust_main->name if $custnum; my $r = qq!* !; @@ -139,7 +141,13 @@ if ( $cust_main->referral_custnum Referring customer - + + + <%= include('/elements/search-cust_main.html', + 'field_name' => 'referral_custnum', + ) + %> + <% } else { %> diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index 3aa81be3b..ea8c418c3 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -3,6 +3,7 @@ my $etc = @_ ? shift : ''; #$etc is for things like onLoad= etc. my $head = @_ ? shift : ''; #$head is for things that go in the section my $conf = new FS::Conf; + %> @@ -18,17 +19,22 @@ @@ -39,13 +45,11 @@ STYLE="margin-top:0; margin-bottom:0; margin-left:0; margin-right:0"> - + - @@ -77,34 +81,88 @@
- freeside - freeside <%= $conf->config('company_name') || 'ExampleCo' %> Logged in as <%= getotaker %> 
Preferences 

+
Logged in as <%= getotaker %> 
Preferences 
- + + +
- + + - + + + + - +
+ +
- +
- - +
+ Advanced +
+ <% if ( $FS::CurrentUser::CurrentUser->access_right('View invoices') ) { %> +
+ + <% if ( $FS::CurrentUser::CurrentUser->access_right('List invoices') ) { %> + Advanced + <% } %> +
+ +
+ <% } %> +
- - +
+ Advanced +
+ +
- - +
+ Advanced +
diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html new file mode 100644 index 000000000..ca91b4027 --- /dev/null +++ b/httemplate/elements/search-cust_main.html @@ -0,0 +1,163 @@ +<% + my( %opt ) = @_; + $opt{'field_name'} ||= 'custnum'; + + my $cust_main = ''; + if ( $opt{'value'} ) { + $cust_main = qsearchs( + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $opt{'value'} }, + 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, + ); + } +%> + + + + + + + + + +<%= include('/elements/xmlhttp.html', + 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', + 'subs' => [ 'smart_search' ], + ) +%> + + + -- cgit v1.2.1