From 7aef2e455fe8a4722036f231ee8609ac63b2a9c9 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 10 Nov 2011 21:40:25 +0000 Subject: RADIUS groups for svc_broadband, #14695 --- httemplate/elements/select-radius_group.html | 23 ++++++----------------- httemplate/elements/tr-fixed.html | 12 +++++++++++- httemplate/elements/tr-select-radius_group.html | 11 +++++++++++ 3 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 httemplate/elements/tr-select-radius_group.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/select-radius_group.html b/httemplate/elements/select-radius_group.html index e1e3c5980..06972b522 100644 --- a/httemplate/elements/select-radius_group.html +++ b/httemplate/elements/select-radius_group.html @@ -1,17 +1,6 @@ - -<%init> - -my %opt = @_; - -my %groups = map { $_->groupnum => $_->long_description } - qsearch('radius_group', {}); -my @sel_groups = split(/,/,$opt{'curr_value'}); - - +<& /elements/select-table.html, + table => 'radius_group', + name_col => 'long_description', + order_by => 'groupname', # better idea? + @_ +&> diff --git a/httemplate/elements/tr-fixed.html b/httemplate/elements/tr-fixed.html index 095e1bce9..f358343dd 100644 --- a/httemplate/elements/tr-fixed.html +++ b/httemplate/elements/tr-fixed.html @@ -1,6 +1,6 @@ <% include('tr-td-label.html', @_ ) %> - ><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %> + ><% $value %> @@ -12,4 +12,14 @@ my %opt = @_; my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; +my $value = $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'}; +#compatibility with select-table and friends +if ( $opt{'multiple'} ) { + $value = [ split(/\s*,\s*/, $value) ] if !ref $value; + $value = join('
', map {encode_entities($_)} @$value); +} +else { + $value = encode_entities($value) +} + diff --git a/httemplate/elements/tr-select-radius_group.html b/httemplate/elements/tr-select-radius_group.html new file mode 100644 index 000000000..299252755 --- /dev/null +++ b/httemplate/elements/tr-select-radius_group.html @@ -0,0 +1,11 @@ +<% include('tr-td-label.html', label => emt('RADIUS groups'), %opt ) %> + > + <% include( '/elements/select-radius_group.html', %opt ) %> + + +<%init> + +my( %opt ) = @_; +my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : ''; + + -- cgit v1.2.1