combine ticket notification scrips, #15353
[freeside.git] / httemplate / elements / select-taxproduct.html
1 <% $opt{'prefix'} %><INPUT NAME    = "<% $name %>"
2                            ID      = "<% $name %>"
3                            TYPE    = "hidden"
4                            VALUE   = "<% $value |h %>"
5                     >
6                     <INPUT NAME    = "<% $name %>_description"
7                            ID      = "<% $name %>_description"
8                            TYPE    = "text"
9                            VALUE   = "<% $description %>"
10                            SIZE    = "12"
11                            onClick = "<% $onclick %>"><% $opt{'postfix'} %>
12 <%init>
13
14 my %opt = @_;
15 my $name = $opt{element_name} || $opt{field} || 'taxproductnum';
16 my $value = length($opt{curr_value}) ? $opt{curr_value} : $opt{value};
17 my $description = $opt{'taxproduct_description'};
18   
19 unless ( $description || ! $value ) {
20     my $part_pkg_taxproduct =
21       qsearchs( 'part_pkg_taxproduct', { 'taxproductnum'=> $value } );
22     $description = $part_pkg_taxproduct->description
23       if $part_pkg_taxproduct;
24 }
25
26 my $onclick = $opt{onclick} || "overlib( OLiframeContent('${p}/browse/part_pkg_taxproduct.cgi?_type=select&id=${name}&taxproductnum='+document.getElementById('${name}').value, 1000, 400, 'tax_product_popup'), CAPTION, 'Select product', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK); return false;";
27
28 </%init>