X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fsearch-cust_main.html;h=317922d3c5c543787b74c883c62301bddb3ac443;hp=f2b17eacb5e500e1ad4fdea298347f7e52a1626c;hb=74a3083375ccc3a0dc8b74f9b39392989d088656;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index f2b17eacb..317922d3c 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -1,25 +1,39 @@ -% -% 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, -% ); -% } -% - - - +<%doc> - +Example: + + include( '/elements/search-cust_main.html, + 'field' => 'custnum', + #slightly deprecated old synonym for field#'field_name'=>'custnum', + 'find_button' => 1, #add a "find" button to the field + 'curr_value' => 54, #current value + 'value => 32, #deprecated synonym for curr_value + ); + + + - + - + +% if ( $opt{'find_button'} ) { + +% } + + <% include('/elements/xmlhttp.html', @@ -30,7 +44,7 @@ +<%init> + +my( %opt ) = @_; + +my $field = $opt{'field'} || $opt{'field_name'} || 'custnum'; + +my $value = $opt{'curr_value'} || $opt{'value'}; + +my $cust_main = ''; +if ( $value ) { + $cust_main = qsearchs({ + 'table' => 'cust_main', + 'hashref' => { 'custnum' => $value }, + 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, + }); +} +