summaryrefslogtreecommitdiff
path: root/httemplate/edit/torrus_srvderive.html
blob: 63f4654206cfd6b24896bdfb2f87c883ec1f58e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<% include( 'elements/edit.html',
              'name_singular' => 'virtual port',
              'table'         => 'torrus_srvderive',
              'labels'        => { 'derivenum' => 'Virtual Port',
                                   'serviceid' => 'Torrus serviceid',
                                 },
              'fields'        => [ 'serviceid',
                                   { field=>'last_srv_date', type=>'hidden' },
                                 ],
              'viewall_dir'   => 'browse',
              'html_bottom'   => $html_bottom_sub,
          )
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configure network monitoring');

my $html_bottom_sub = sub {
  my $torrus_srvderive = shift;

  my $nms = new FS::NetworkMonitoringSystem;
  my @serviceids = $nms->torrus_serviceids;

  ntable('#cccccc',2).'<TR><TD>'.
    include( '/elements/checkboxes-table-name.html',
               'source_obj'    => $torrus_srvderive,
               'link_table'    => 'torrus_srvderive_component',
               'num_col'       => 'derivenum',
               'name_col'      => 'serviceid',
               'names_list'    => \@serviceids,
               'disable_links' => 1,
           ).
  '</TD></TR></TABLE>';

};


</%init>