diff options
| -rw-r--r-- | FS/FS/Conf.pm | 16 | ||||
| -rw-r--r-- | FS/FS/Schema.pm | 5 | ||||
| -rw-r--r-- | FS/FS/svc_Tower_Mixin.pm | 17 | ||||
| -rw-r--r-- | FS/FS/svc_acct.pm | 4 | ||||
| -rwxr-xr-x | FS/FS/svc_broadband.pm | 12 | ||||
| -rwxr-xr-x | httemplate/edit/svc_acct.cgi | 13 | ||||
| -rw-r--r-- | httemplate/view/svc_acct/basics.html | 11 | 
7 files changed, 61 insertions, 17 deletions
| diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index efdad430a..a11dc4eee 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 797597ce5..3a487f496 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 000000000..8caef6dc8 --- /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 64f2c35d5..3bb7af4a6 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 678a7889f..94c285b5d 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 52fbd37af..38567ef67 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 6adebc6ce..8f180b648 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 &>  % }  | 
