summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Conf.pm16
-rw-r--r--FS/FS/Schema.pm5
-rw-r--r--FS/FS/svc_Tower_Mixin.pm17
-rw-r--r--FS/FS/svc_acct.pm4
-rwxr-xr-xFS/FS/svc_broadband.pm12
-rwxr-xr-xhttemplate/edit/svc_acct.cgi13
-rw-r--r--httemplate/view/svc_acct/basics.html11
7 files changed, 61 insertions, 17 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index efdad43..a11dc4e 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4735,13 +4735,17 @@ and customer address. Include units.',
{
'key' => 'translate-auto-insert',
'section' => '',
- 'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values. DO NOT TURN THIS ON.',
- 'type' => 'select-sub',
+ 'description' => 'Auto-insert untranslated strings for selected non-en_US locales with their default/en_US values. Do not turn this on unless translating the interface into a new language.',
+ 'type' => 'select',
'multiple' => 1,
- 'options_sub' => sub { map { $_ => '' }
- grep { $_ ne 'en_US' } FS::Locales::locales;
- },
- 'option_sub' => sub { ''; },
+ 'select_enum' => [ grep { $_ ne 'en_US' } FS::Locales::locales ],
+ },
+
+ {
+ 'key' => 'svc_acct-tower_sector',
+ 'section' => '',
+ 'description' => 'Track tower and sector for svc_acct (account) services.',
+ 'type' => 'checkbox',
},
{ key => "apacheroot", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 797597c..3a487f4 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1892,6 +1892,7 @@ sub tables_hashref {
'_password_encoding', 'varchar', 'NULL', $char_d, '', '',
'sec_phrase', 'varchar', 'NULL', $char_d, '', '',
'popnum', 'int', 'NULL', '', '', '',
+ 'sectornum', 'int', 'NULL', '', '', '',
'uid', 'int', 'NULL', '', '', '',
'gid', 'int', 'NULL', '', '', '',
'finger', 'varchar', 'NULL', 2*$char_d, '', '',
@@ -2534,6 +2535,10 @@ sub tables_hashref {
#'agentnum', 'int', 'NULL', '', '', '',
'towername', 'varchar', '', $char_d, '', '',
'disabled', 'char', 'NULL', 1, '', '',
+ 'latitude', 'decimal', 'NULL', '10,7', '', '',
+ 'longitude','decimal', 'NULL', '10,7', '', '',
+ 'altitude', 'decimal', 'NULL', '', '', '',
+ 'coord_auto', 'char', 'NULL', 1, '', '',
],
'primary_key' => 'towernum',
'unique' => [ [ 'towername' ] ], # , 'agentnum' ] ],
diff --git a/FS/FS/svc_Tower_Mixin.pm b/FS/FS/svc_Tower_Mixin.pm
new file mode 100644
index 0000000..8caef6d
--- /dev/null
+++ b/FS/FS/svc_Tower_Mixin.pm
@@ -0,0 +1,17 @@
+package FS::svc_Tower_Mixin;
+
+use strict;
+use FS::Record qw(qsearchs); #qsearch;
+use FS::tower_sector;
+
+=item tower_sector
+
+=cut
+
+sub tower_sector {
+ my $self = shift;
+ return '' unless $self->sectornum;
+ qsearchs('tower_sector', { sectornum => $self->sectornum });
+}
+
+1;
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 64f2c35..3bb7af4 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -5,6 +5,7 @@ use base qw( FS::svc_Domain_Mixin
FS::svc_CGP_Mixin
FS::svc_CGPRule_Mixin
FS::svc_Radius_Mixin
+ FS::svc_Tower_Mixin
FS::svc_Common );
use vars qw( $DEBUG $me $conf $skip_fuzzyfiles
$dir_prefix @shells $usernamemin
@@ -53,6 +54,7 @@ use FS::svc_forward;
use FS::svc_www;
use FS::cdr;
use FS::acct_snarf;
+use FS::tower_sector;
$DEBUG = 0;
$me = '[FS::svc_acct]';
@@ -338,6 +340,7 @@ sub table_info {
disable_inventory => 1,
disable_select => 1, #UI wonky, pry works otherwise
},
+ 'sectornum' => 'Tower sector',
'usergroup' => {
label => 'RADIUS groups',
type => 'select-radius_group.html',
@@ -1122,6 +1125,7 @@ sub check {
#|| $self->ut_number('domsvc')
|| $self->ut_foreign_key( 'domsvc', 'svc_domain', 'svcnum' )
|| $self->ut_foreign_keyn('pbxsvc', 'svc_pbx', 'svcnum' )
+ || $self->ut_foreign_keyn('sectornum','tower_sector','sectornum')
|| $self->ut_textn('sec_phrase')
|| $self->ut_snumbern('seconds')
|| $self->ut_snumbern('upbytes')
diff --git a/FS/FS/svc_broadband.pm b/FS/FS/svc_broadband.pm
index 678a788..94c285b 100755
--- a/FS/FS/svc_broadband.pm
+++ b/FS/FS/svc_broadband.pm
@@ -10,7 +10,7 @@ use FS::addr_block;
use FS::part_svc_router;
use FS::tower_sector;
-@ISA = qw( FS::svc_Radius_Mixin FS::svc_Common );
+@ISA = qw( FS::svc_Radius_Mixin FS::svc_Tower_Mixin FS::svc_Common );
$FS::UID::callback{'FS::svc_broadband'} = sub {
$conf = new FS::Conf;
@@ -489,16 +489,6 @@ sub NetAddr {
new NetAddr::IP ($self->ip_addr);
}
-=item tower_sector
-
-=cut
-
-sub tower_sector {
- my $self = shift;
- return '' unless $self->sectornum;
- qsearchs('tower_sector', { sectornum => $self->sectornum });
-}
-
=item addr_block
Returns the FS::addr_block record (i.e. the address block) for this broadband service.
diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi
index 52fbd37..38567ef 100755
--- a/httemplate/edit/svc_acct.cgi
+++ b/httemplate/edit/svc_acct.cgi
@@ -160,6 +160,19 @@ function randomPass() {
<TD><% FS::svc_acct_pop::popselector($popnum) %></TD>
</TR>
% }
+
+%#tower (huh)
+%if ( $conf->exists('svc_acct-tower_sector')
+% && $part_svc->part_svc_column('sectornum')->columnflag ne 'F' ) {
+ <& /elements/tr-select-tower_sector.html,
+ 'curr_value' => $svc_acct->sectornum,
+ #'part_svc' => $part_svc,
+ #'cust_pkg' => $cust_pkg,
+ &>
+%} else {
+ <INPUT TYPE="hidden" NAME="sectornum" VALUE="<% $svc_acct->sectornum %>">
+%}
+
% #uid/gid
% foreach my $xid (qw( uid gid )) {
%
diff --git a/httemplate/view/svc_acct/basics.html b/httemplate/view/svc_acct/basics.html
index 6adebc6..8f180b6 100644
--- a/httemplate/view/svc_acct/basics.html
+++ b/httemplate/view/svc_acct/basics.html
@@ -42,6 +42,17 @@
<& /view/elements/tr.html, label=>mt('Access number'), value=>$svc_acct_pop->text &>
% }
+% if ( $svc_acct->sectornum && $conf->exists('svc_acct-tower_sector') ) {
+% my $tower_sector = $svc_acct->tower_sector;
+% my $link = $tower_sector->ip_addr
+% ? '<A HREF="http://'. $tower_sector->ip_addr. '">'
+% : '';
+ <& /view/elements/tr.html,
+ label => mt('Tower sector'),
+ value => $link. $tower_sector->description. ($link ? '</A>' : ''),
+ &>
+% }
+
% if ($svc_acct->uid ne '') {
<& /view/elements/tr.html, label=>mt('UID'), value=>$svc_acct->uid &>
% }