X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-pkg_class.html;h=9f782e663d0c83b84d0f6dbff9f346f7c9cae398;hp=de10885c8b793a7bacef55004734734178760c65;hb=24a7dd6d18a1413ec34b906274365e4b2fef28e8;hpb=1a033848671cad2cbe7687b37fc718b3b2a68b83 diff --git a/httemplate/elements/tr-select-pkg_class.html b/httemplate/elements/tr-select-pkg_class.html index de10885c8..9f782e663 100644 --- a/httemplate/elements/tr-select-pkg_class.html +++ b/httemplate/elements/tr-select-pkg_class.html @@ -1,29 +1,27 @@ -<% - my( $classnum, %opt ) = @_; +% if ( scalar(@{ $opt{'pkg_class'} }) == 0 ) { - my @pkg_class; - if ( $opt{'pkg_class'} ) { - @pkg_class = @{ $opt{'pkg_class'} }; - } else { - @pkg_class = qsearch( 'pkg_class', {} ); # { disabled=>'' } ); - } + -%> - -<% if ( scalar(@pkg_class) == 0 ) { %> - - - -<% } else { %> +% } else { - <%= $opt{'label'} || 'Package class' %> + <% $opt{'label'} || 'Package class' %> - <%= include( '/elements/select-pkg_class.html', $classnum, - 'pkg_class' => \@pkg_class, - ) + <% include( '/elements/select-pkg_class.html', + 'curr_value' => $classnum, + %opt + ) %> -<% } %> +% } + +<%init> + +my %opt = @_; +my $classnum = $opt{'curr_value'} || $opt{'value'}; + +$opt{'pkg_class'} ||= [ qsearch( 'pkg_class', { disabled=>'' } ) ]; + +