X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Felements%2Fclass_Common.html;h=0a0916ebc470c582f9fa03327877d320f61ac2b5;hb=e695b4913b96dc0a9ff9ec7de96b64b4e33c9163;hp=69da4db313543421b052e607fad3cc3e371498e3;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/httemplate/edit/elements/class_Common.html b/httemplate/edit/elements/class_Common.html index 69da4db31..0a0916ebc 100644 --- a/httemplate/edit/elements/class_Common.html +++ b/httemplate/edit/elements/class_Common.html @@ -22,21 +22,22 @@ my %opt = @_; my $table = $opt{'table'}; my @category; +my $category_table; unless ( $opt{'nocat'} ) { - ( my $category_table = $table ) =~ s/class/category/ or die; + ( $category_table = $table ) =~ s/class/category/ or die; @category = qsearch($category_table, { 'disabled' => '' }); } my $fields = [ 'classname', (scalar(@category) - ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>'pkg_category', 'name_col'=>'categoryname' } + ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>$category_table, 'name_col'=>'categoryname' } : { field=>'categorynum', type=>'hidden' } ), { field=>'disabled', type=>'checkbox', value=>'Y', }, ]; -push @$fields, $opt{'addl_fields'} if $opt{'addl_fields'}; +push @$fields, @{ $opt{'addl_fields'} } if $opt{'addl_fields'}; my %addl_labels = (); -%addl_labels = %{$opt{'addl_labels'}} if $opt{'addl_labels'}; +%addl_labels = %{ $opt{'addl_labels'} } if $opt{'addl_labels'};