1 <% include( 'elements/browse.html',
2 'title' => 'Internal Access Groups',
3 'menubar' => [ # 'Main menu' => $p,
4 'Internal users' => $p.'browse/access_user.html',
6 'html_init' => $html_init,
7 'name' => 'internal access groups',
8 'query' => { 'table' => 'access_group',
10 'extra_sql' => 'ORDER BY groupname', #??
12 'count_query' => $count_query,
18 'fields' => [ 'groupnum',
33 "Internal access groups control access to the back-office interface.<BR><BR>".
34 qq!<A HREF="${p}edit/access_group.html"><I>Add an internal access group</I></A><BR><BR>!;
36 #false laziness w/access_user.html & agent_type.cgi
37 my $agents_sub = sub {
38 my $access_group = shift;
41 my $access_groupagent = $_;
42 my $agent = $access_groupagent->agent;
45 'data' => $agent->agent,
47 'link' => $p. 'edit/agent.cgi?'. $agent->agentnum,
52 $access_group->access_groupagent,
58 tie my %rights, 'Tie::IxHash', FS::AccessRight->rights_info;
60 my $rights_sub = sub {
61 my $access_group = shift;
63 #[ map { my $access_right = $_;
66 # 'data' => $access_right->rightname,
71 # $access_group->access_rights,
74 #some false laziness w/edit/access_group.html
78 #include('/elements/table-grid.html', bgcolor=>'#cccccc' ).
80 '<TR>'. join( '', map {
82 '<TD CLASS="inv" VALIGN="top"><TABLE WIDTH=100%>'.
83 '<TR><TH BGCOLOR="#dcdcdc">'. $_. '</TH></TR>'.
86 join('<BR>', grep { warn "$access_group->access_right($_): ".
87 $access_group->access_right($_). "\n";
88 $access_group->access_right($_); }
89 map { ref($_) ? $_->{'rightname'} : $_; }
93 '</TD></TR></TABLE></TD>'.
94 ( ++$count % $columns ? '' : '</TR><TR>')
96 } keys %rights ). '</TR></TABLE>';
100 my $count_query = 'SELECT COUNT(*) FROM access_group';
102 my $link = [ $p.'edit/access_group.html?', 'groupnum' ];
108 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');