optimize CDR rating after timed rate perf regression, RT#15739
[freeside.git] / httemplate / browse / radius_group.html
1 <& elements/browse.html,
2   'title'       => 'RADIUS Groups',
3   'name'        => 'RADIUS Groups',
4   'menubar'     => [ 'Add a RADIUS Group' => $p.'edit/radius_group.html', ],
5   'query'       => { 'table' => 'radius_group' },
6   'count_query' => 'SELECT COUNT(*) FROM radius_group',
7   'header'      => [ '#', 'RADIUS Group', 'Description', 'Priority',
8                      'Check', 'Reply' ],
9   'fields'      => [ 'groupnum',
10                      'groupname',
11                      'description',
12                      'priority',
13                      $check_attr, $reply_attr
14                    ],
15   'align'       => 'lllcll',
16   'links'       => [ $link, $link, '', '', '', '',
17                    ],
18 &>
19 <%init>
20
21 my $curuser = $FS::CurrentUser::CurrentUser;
22
23 die "access denied"
24   unless $curuser->access_right('Configuration');
25
26 my $attr_sub = sub {
27   my $type = shift;
28   my $radius_group = shift;
29   [ map { [ { data => join(' ', $_->attrname, $_->op, $_->value) } ] }
30     grep {$_->attrtype eq $type} 
31       $radius_group->radius_attr
32   ];
33 };
34
35 my $check_attr = sub { &$attr_sub('C', @_) };
36 my $reply_attr = sub { &$attr_sub('R', @_) };
37
38 my $link = [ $p.'edit/radius_group.html?', 'groupnum' ];
39
40 </%init>