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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
<& /elements/header.html, {
'title' => 'Sector coverage maps',
}
&>
<style>
a.createmap {
font-weight: bold;
color: blue;
}
a.viewmap {
font-weight: bold;
color: green;
}
</style>
<table class="grid">
<thead>
<tr>
<th>Tower / sector</th>
<th colspan=3>
</tr>
</thead>
<tbody>
% foreach my $sector (@sectors) {
% my $sectornum = $sector->sectornum;
<tr>
<td>
<a href="<% $fsurl %>edit/tower.html?<% $sector->towernum |h %>">
<% $sector->description |h %>
</a>
</td>
% my @need_fields = $sector->need_fields_for_coverage;
% if ( @need_fields ) {
<td>Need fields:</td>
<td>
<% join('<br>', @need_fields) %>
</td>
% } else {
<td colspan="2" style="text-align: center">
% my $text = 'Create map';
% if ( length($sector->image) > 0 ) {
% $text = 'Reprocess';
% }
<form name="create_<% $sectornum |h %>">
<input type="hidden" name="sectornum" value="<% $sectornum |h %>">
<& /elements/progress-init.html,
'create_'.$sectornum,
[ 'sectornum' ],
$fsurl.'misc/sector-create_map.html',
{ 'message' => 'Map generated' },
"sector$sectornum"
&>
<a class="createmap" href="#" onclick="sector<% $sectornum %>process()">
<% $text %>
</a>
% }
</td>
<td>
% if ( length($sector->image) > 0 ) {
<a class="viewmap" href="<% $fsurl %>search/svc_broadband-map.html?sectornum=<% $sectornum %>">
View map
</a>
% }
</td>
</tr>
% } # foreach $sector
</tbody>
</table>
<& /elements/footer.html &>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
my $query = {
table => 'tower_sector',
select => 'tower_sector.*,
tower.latitude, tower.longitude, tower.color, tower.towername',
extra_sql => ' WHERE tower.disabled is null',
addl_from => ' JOIN tower USING (towernum)',
order_by => ' ORDER BY towername, sectorname',
};
my @sectors = qsearch($query);
</%init>
|