diff options
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/process/tower.html | 7 | ||||
-rw-r--r-- | httemplate/edit/svc_broadband.cgi | 4 | ||||
-rw-r--r-- | httemplate/edit/tower.html | 37 |
3 files changed, 47 insertions, 1 deletions
diff --git a/httemplate/edit/process/tower.html b/httemplate/edit/process/tower.html new file mode 100644 index 000000000..7353784e5 --- /dev/null +++ b/httemplate/edit/process/tower.html @@ -0,0 +1,7 @@ +<& elements/process.html, + table => 'tower', + viewall_dir => 'browse', + process_o2m => { 'table' => 'tower_sector', + 'fields' => [qw( sectorname ip_addr )], + }, +&> diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi index d4baf35a0..ad4d6046d 100644 --- a/httemplate/edit/svc_broadband.cgi +++ b/httemplate/edit/svc_broadband.cgi @@ -97,7 +97,9 @@ END ; my @fields = ( - qw( description ip_addr speed_down speed_up blocknum ), + qw( description ip_addr speed_down speed_up ), + { field=>'sectornum', type=>'select-tower_sector', }, + qw( blocknum ), { field=>'block_label', type=>'fixed' }, qw( mac_addr latitude longitude altitude vlan_profile performance_profile authkey plan_id ), diff --git a/httemplate/edit/tower.html b/httemplate/edit/tower.html new file mode 100644 index 000000000..c27d9d255 --- /dev/null +++ b/httemplate/edit/tower.html @@ -0,0 +1,37 @@ +<& elements/edit.html, + name_singular => 'tower', + table => 'tower', + viewall_dir => 'browse', + fields => [ 'towername', + { field=>'disabled', type=>'checkbox', value=>'Y', }, + { field => 'sectornum', + type => 'tower_sector', + o2m_table => 'tower_sector', + m2_label => 'Sector', + m2_error_callback => $m2_error_callback, + }, + ], + labels => { 'towernum' => 'Tower', + 'towername' => 'Name', + 'sectornum' => 'Sector', + 'disabled' => 'Disabled', + }, +&> +<%init> + +my $m2_error_callback = sub { # reconstruct the list + my ($cgi, $object) = @_; + + my @fields = qw(sectorname ip_addr); + map { + my $k = $_; + next if !length($cgi->param($k.'_sectorname')); + new FS::tower_sector { + 'towernum' => $object->towernum, + 'sectornum' => scalar( $cgi->param($k) ), + map { $_ => scalar( $cgi->param($k.'_'.$_) ) } @fields, + }; + } grep /^sectornum\d+$/, ($cgi->param); +}; + +</%init> |