2 <tr style="display: none"><td>
3 <INPUT TYPE="hidden" NAME="<% $opt{field} %>" VALUE="<% $opt{curr_value}%>">
6 <& tr-select-table.html,
7 'table' => 'svc_acct', # for now
9 'order_by' => 'order by username',
18 my $pkgnum = $opt{pkgnum};
19 my $svcpart = $opt{svcpart};
21 my $field = $opt{'field'} ||= 'forward_svcnum';
23 my $part_svc = FS::part_svc->by_key($svcpart);
24 # kludgey assumptions for now:
25 # - this is only used to route DIDs to their real destinations
26 # - which is a svc_acct
27 # - in the same package (part_export::svc_with_role assumes this)
28 # - and shares an export
30 my $cust_pkg = FS::cust_pkg->by_key($pkgnum);
32 foreach my $part_export ( $part_svc->part_export ) {
33 foreach my $export_svc ( $part_export->export_svc ) {
34 push @svcparts, $export_svc->svcpart;
38 $pkgnum =~ /^(\d+)$/ or die "bad pkgnum $pkgnum";
41 'addl_from' => ' JOIN cust_svc USING (svcnum) ',
42 'extra_sql' => "WHERE pkgnum = $pkgnum AND svcpart IN(".
43 join(',', @svcparts) . ")"
47 $hide = 1 if $part_svc->part_svc_column($field) eq 'F';
48 $hide = 1 if !@svcparts;