[freeside-commits] freeside/httemplate/elements tr-select-radius_group.html, NONE, 1.1 select-radius_group.html, 1.2, 1.3 tr-fixed.html, 1.2, 1.3

Mark Wells mark at wavetail.420.am
Thu Nov 10 13:40:06 PST 2011


Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail.420.am:/tmp/cvs-serv22579/httemplate/elements

Modified Files:
	select-radius_group.html tr-fixed.html 
Added Files:
	tr-select-radius_group.html 
Log Message:
RADIUS groups for svc_broadband, #14695

Index: select-radius_group.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/select-radius_group.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- select-radius_group.html	1 Jul 2011 06:54:03 -0000	1.2
+++ select-radius_group.html	10 Nov 2011 21:40:04 -0000	1.3
@@ -1,17 +1,6 @@
-<SELECT MULTIPLE NAME = "<% $opt{'element_name'} || $opt{'field'} || 'usergroup' %>"
-        <% $opt{'element_etc'} %>
->
-% foreach my $selopt ( keys %groups ) {
-%  my $selected = (grep{ $_ eq $selopt } @sel_groups) ? 'SELECTED' : '';
-    <OPTION VALUE="<%$selopt%>" <% $selected %>><% $groups{$selopt} %></OPTION>
-% }
-</SELECT>
-<%init>
-
-my %opt = @_;
-
-my %groups = map { $_->groupnum => $_->long_description }
-                                                    qsearch('radius_group', {});
-my @sel_groups = split(/,/,$opt{'curr_value'});
-
-</%init>
+<& /elements/select-table.html,
+    table       => 'radius_group',
+    name_col    => 'long_description',
+    order_by    => 'groupname', # better idea?
+    @_ 
+&>

--- NEW FILE: tr-select-radius_group.html ---
<% include('tr-td-label.html', label => emt('RADIUS groups'), %opt ) %>
  <TD <% $style %>>
  <% include( '/elements/select-radius_group.html', %opt ) %>
  </TD>
</TR>
<%init>

my( %opt ) = @_;
my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';

</%init>

Index: tr-fixed.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/tr-fixed.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- tr-fixed.html	4 Jan 2008 02:18:48 -0000	1.2
+++ tr-fixed.html	10 Nov 2011 21:40:04 -0000	1.3
@@ -1,6 +1,6 @@
 <% include('tr-td-label.html', @_ ) %>
 
-  <TD BGCOLOR="#dddddd" <% $style %>><% $opt{'formatted_value'} || $opt{'curr_value'} || $opt{'value'} |h %></TD>
+  <TD BGCOLOR="#dddddd" <% $style %>><% $value %></TD>
 
 </TR>
 
@@ -12,4 +12,14 @@
 
 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('<BR>', map {encode_entities($_)} @$value);
+}
+else {
+  $value = encode_entities($value)
+}
+
 </%init>



More information about the freeside-commits mailing list