X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fradius_group.html;h=884694618796ad22ff06825595c11febaf4880af;hp=706813f2a2a341237817aebc62dc66aca88c7853;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=9f2280fbce022ab9bcfc46fe94483730b0aeb0f8 diff --git a/httemplate/edit/process/radius_group.html b/httemplate/edit/process/radius_group.html index 706813f2a..884694618 100644 --- a/httemplate/edit/process/radius_group.html +++ b/httemplate/edit/process/radius_group.html @@ -1,10 +1,27 @@ <& elements/process.html, - 'table' => 'radius_group', - 'viewall_dir' => 'browse', + 'table' => 'radius_group', + 'viewall_dir' => 'browse', + 'process_o2m' => { + 'table' => 'radius_attr', + 'fields' => [ qw( attrtype attrname op value )], + }, + 'precheck_callback' => $precheck_callback, &> <%init> - die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $precheck_callback = sub { + my $cgi = shift; + my $param = $cgi->Vars; + # remove rows with a blank attrname and attrnum + foreach my $k (grep /^attrnum\d+$/, keys %$param) { + if ( !length($param->{$k}) and !length($param->{$k.'_attrname'}) ) { + delete $param->{$k.'_'.$_} foreach qw(attrtype attrname op value); + delete $param->{$k}; + } + } + ''; +}; +