5 include( '/elements/select-part_pkg.html',
7 #strongly recommended (you want your forms to be "sticky" on errors, right?)
8 'curr_value' => 'current_value',
11 'part_pkg' => \@records,
13 #select-table.html options
18 <& /elements/select-table.html,
19 'table' => 'part_pkg',
23 'empty_label' => 'Select package', #should this be the default?
24 'label_callback' => $opt{'label_callback'} || sub { shift->pkg_comment_only },
32 $opt{'records'} = delete $opt{'part_pkg'}
36 $hash{'disabled'} = '' unless $opt{'showdisabled'};
38 if ( exists($opt{'classnum'}) && defined($opt{'classnum'}) ) {
39 if ( $opt{'classnum'} > 0 ) {
40 $hash{'classnum'} = $opt{'classnum'};
41 } elsif ( $opt{'classnum'} eq '' || $opt{'classnum'} == 0 ) {
42 $hash{'classnum'} = '';
43 } #else -1 or not specified, all classes, so don't set classnum
46 $opt{'extra_sql'} .= ( keys(%hash) ? ' AND ' : ' WHERE ' ).
47 FS::part_pkg->curuser_pkgs_sql;