Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / browse / torrus_srvderive.html
1 <% include( 'elements/browse.html',
2               'title'          => 'Virtual network ports',
3               'name_singular'  => 'port',
4               'menubar'        => [ 'Add a new virtual port' =>
5                                       $p.'edit/torrus_srvderive.html',
6                                   ],
7               'query'          => { 'table' => 'torrus_srvderive' },
8               'count_query'    => 'SELECT COUNT(*) FROM torrus_srvderive',
9               'header'         => [ 'Virtual Port', 'Components', ],
10               'fields'         => [ 'serviceid', $components_sub, ],
11               'links'          => [ $link, '', ],
12           )
13 %>
14 <%init>
15
16 die "access denied"
17   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
18
19 my $link = [ $p.'edit/torrus_srvderive.html?', 'derivenum' ];
20
21 my $components_sub = sub {
22   my $torrus_srvderive = shift;
23   join('<BR>', $torrus_srvderive->component_serviceids);
24 };
25
26 </%init>