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
40
41
42
43
44
|
<% include( 'elements/browse.html',
'title' => 'Towers',
'name' => 'towers',
'menubar' => [ 'Add a new tower' =>
$p.'edit/tower.html',
],
'query' => { 'table' => 'tower', },
'count_query' => 'SELECT COUNT(*) FROM tower',
'disableable' => 1,
'disabled_statuspos' => 1,
'header' => [ 'Name', 'Sectors', ],
'fields' => [ 'towername',
$sector_sub,
],
'links' => [ $link,
'',
],
)
%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $link = [ "${p}edit/tower.html?", 'towernum' ];
my $sector_sub = sub {
my $tower = shift;
[ map {
[
{ 'data' => $_->sectorname,
'link' => ( $_->ip_addr ? 'http://'. $_->ip_addr : '' ),
},
],
}
$tower->tower_sector
];
};
</%init>
|