diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-09-10 01:33:25 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-09-10 01:33:25 -0700 |
commit | ec9b0f903dfa57efc0c82791b9efa74f0c746bc0 (patch) | |
tree | a2deef2c89f770fafce26f3d5d1b5770fc7c0536 /httemplate | |
parent | fcadc3a661a041b9119c287ade346e70f108f335 (diff) |
svc_cable service have a single serial / MAC / model, not one-to-many devices like svc_phone and svc_dsl, RT#22009
Diffstat (limited to 'httemplate')
-rw-r--r-- | httemplate/edit/elements/part_svc_column.html | 4 | ||||
-rw-r--r-- | httemplate/edit/svc_Common.html | 12 | ||||
-rw-r--r-- | httemplate/elements/menu.html | 6 |
3 files changed, 20 insertions, 2 deletions
diff --git a/httemplate/edit/elements/part_svc_column.html b/httemplate/edit/elements/part_svc_column.html index ddfc85cfc..64901a80f 100644 --- a/httemplate/edit/elements/part_svc_column.html +++ b/httemplate/edit/elements/part_svc_column.html @@ -183,8 +183,8 @@ that field. 'curr_value' => $value, &> % } -% } elsif ( $def->{'type'} =~ /select-(.*?).html/ ) { - <& '/elements/'.$def->{'type'}, +% } elsif ( $def->{'type'} =~ /^select-(.*?)(.html)?$/ && $1 ne 'hardware' ) { + <& "/elements/select-$1.html", 'field' => $name, 'id' => $name.'_select', 'multiple' => $def->{'multiple'}, diff --git a/httemplate/edit/svc_Common.html b/httemplate/edit/svc_Common.html index 3da72d2e8..5949a4dc0 100644 --- a/httemplate/edit/svc_Common.html +++ b/httemplate/edit/svc_Common.html @@ -20,6 +20,7 @@ if ( UNIVERSAL::can("FS::$table", 'table_info') ) { $opt{'name'} = "FS::$table"->table_info->{'name'}; my $fields = "FS::$table"->table_info->{'fields'}; + my %labels = map { $_ => ( ref($fields->{$_}) ? $fields->{$_}{'label'} : $fields->{$_} @@ -28,6 +29,17 @@ if ( UNIVERSAL::can("FS::$table", 'table_info') ) { keys %$fields; $opt{'labels'} = \%labels; + #transform FS::svc_* table_info's structure into one edit.html likes + delete $fields->{svcnum}; + $opt{'fields'} = [ map { ref $fields->{$_} + ? { field => $_, + %{ $fields->{$_} } + } + : $_ + } keys %$fields + ]; + + } </%init> diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index b619aba30..8cbbd1742 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -516,6 +516,10 @@ tie my %config_radius, 'Tie::IxHash', 'RADIUS Clients' => [ $fsurl.'browse/nas.html', 'Manage RADIUS clients' ], ; +tie my %config_cable, 'Tie::IxHash', + 'Cable modem models' => [ $fsurl.'browse/cable_model.html', '' ], +; + tie my %config_export_svc, 'Tie::IxHash', (); if ( $curuser->access_right('Configuration') ) { $config_export_svc{'Service definitions'} = [ $fsurl.'browse/part_svc.cgi', 'Services are items you offer to your customers' ]; @@ -530,6 +534,8 @@ $config_export_svc{'Phone'} = [ \%config_phone, '' ] if $curuser->access_right('Configuration'); $config_export_svc{'RADIUS'} = [ \%config_radius, '' ] if $curuser->access_right('Configuration'); +$config_export_svc{'Cable'} = [ \%config_cable, '' ] + if $curuser->access_right('Configuration'); $config_export_svc{'Hardware types'} = [ $fsurl.'browse/hardware_class.html', 'Set up hardware type catalog' ] if $curuser->access_right('Configuration'); |