default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / browse / deploy_zone.html
1 <& /elements/header.html, 'Deployment zones' &>
2 <& /elements/menubar.html,
3   'Add a new fixed broadband zone' => $p.'edit/deploy_zone-fixed.html',
4   'Add a new mobile zone'          => $p.'edit/deploy_zone-mobile.html',
5 &>
6 <P><FONT SIZE="+1"><B>Fixed Broadband Zones</B></FONT></P>
7 <& elements/browse.html,
8   name_singular   => 'zone',
9   query           => { table      => 'deploy_zone',
10                        hashref    => { zonetype => 'B' },
11                      },
12   count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'B'",
13   agent_virt      => 1,
14   header          => [  '#',
15                         'Description',
16                         'Technology',
17                         'Market',
18                         'Advertised Mbps',
19                         'Contractual Mbps',
20                         'Vertices',
21                         'Census blocks',
22                      ],
23   fields          => [  'zonenum',
24                         'description',
25                         sub { my $self = shift;
26                               $tech_label->{$self->technology} },
27                         sub { my $self = shift;
28                               join( ' / ',
29                                 $self->is_consumer ? 'consumer' : (),
30                                 $self->is_business ? 'business' : ()
31                               )
32                             },
33                         sub { my $self = shift;
34                               join( ' / ', grep $_,
35                                 $self->adv_speed_down,
36                                 $self->adv_speed_up
37                               )
38                             },
39                         sub { my $self = shift;
40                               join( ' / ', grep $_,
41                                 $self->cir_speed_down,
42                                 $self->cir_speed_up
43                               )
44                             },
45                         sub { my $self = shift;
46                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
47                             },
48                         sub { my $self = shift;
49                               FS::deploy_zone_block->count('zonenum = '.$self->zonenum)
50                             },
51                      ],
52   sort_fields     => [ 'zonenum',
53                        'description',
54                        'technology',
55                        '(is_consumer is not null, is_business is not null)',
56                        '(adv_speed_down, adv_speed_up)',
57                        '(cir_speed_down, cir_speed_up)',
58                      ],
59   links           => [  $link_fixed, $link_fixed, ],
60   align           => 'cllllrrr',
61   nohtmlheader    => 1,
62   disable_maxselect => 1,
63   disable_total     => 1,
64   disableable       => 1,
65   disabled_statuspos => 2,
66 &>
67 <P><FONT SIZE="+1"><B>Mobile Zones</B></FONT></P>
68 <& elements/browse.html,
69   name_singular   => 'zone',
70   query           => { table      => 'deploy_zone',
71                        hashref    => { zonetype => 'P' },
72                      },
73   count_query     => "SELECT COUNT(*) FROM deploy_zone WHERE zonetype = 'P'",
74   agent_virt      => 1,
75   header          => [  '#',
76                         'Description',
77                         'Technology',
78                         'Spectrum',
79                         'Service Type',
80                         'Advertised Mbps',
81                         'Vertices', # number of vertices? not so useful
82                      ],
83   fields          => [  'zonenum',
84                         'description',
85                         sub { my $self = shift;
86                               $tech_label->{$self->technology} },
87                         sub { my $self = shift;
88                               $spec_label->{$self->spectrum} },
89                         sub { my $self = shift;
90                               join( ' / ',
91                                 $self->is_voice ? 'voice' : (),
92                                 $self->is_broadband ? 'broadband' : (),
93                               )
94                             },
95                         sub { my $self = shift;
96                               join( ' / ', grep $_,
97                                 $self->adv_speed_down,
98                                 $self->adv_speed_up
99                               )
100                             },
101                         sub { my $self = shift;
102                               FS::deploy_zone_vertex->count('zonenum = '.$self->zonenum)
103                             },
104                      ],
105   sort_fields     => [ 'zonenum',
106                        'description',
107                        'technology',
108                        'spectrum',
109                        '(is_voice is not null, is_broadband is not null)',
110                        '(adv_speed_down, adv_speed_up)',
111                      ],
112   links           => [  '', $link_mobile, ],
113   align           => 'clllllr',
114   nohtmlheader    => 1,
115   disable_maxselect => 1,
116   disable_total     => 1,
117   disableable       => 1,
118   disabled_statuspos => 2,
119 &>
120
121 <& /elements/footer.html &>
122 <%init>
123 my $curuser = $FS::CurrentUser::CurrentUser;
124 my $acl_edit = $curuser->access_right('Edit FCC report configuration');
125 my $acl_edit_global = $curuser->access_right('Edit FCC report configuration for all agents');
126 die "access denied"
127   unless $acl_edit or $acl_edit_global;
128
129 my $link_fixed = [ $p.'edit/deploy_zone-fixed.html?', 'zonenum' ];
130 my $link_mobile= [ $p.'edit/deploy_zone-mobile.html?', 'zonenum' ];
131
132 my $tech_label = FS::part_pkg_fcc_option->technology_labels;
133 my $spec_label = FS::part_pkg_fcc_option->spectrum_labels;
134 </%init>