1 <% include( 'elements/browse.html',
2 'title' => 'Employee Groups',
3 'menubar' => [ 'View Employees' => $p.'browse/access_user.html', ],
4 'html_init' => $html_init,
5 'name' => 'employee groups',
6 'query' => { 'table' => 'access_group',
8 'order_by' => 'ORDER BY groupname', #??
10 'count_query' => $count_query,
16 'fields' => [ 'groupnum',
31 "Employee groups control access to the back-office interface. Each employee can be assigned to one or more groups.<BR><BR>".
32 qq!<A HREF="${p}edit/access_group.html"><I>Add an employee group</I></A><BR><BR>!;
34 #false laziness w/access_user.html & agent_type.cgi
35 my $agents_sub = sub {
36 my $access_group = shift;
39 my $access_groupagent = $_;
40 my $agent = $access_groupagent->agent;
43 'data' => $agent->agent,
45 'link' => $p. 'edit/agent.cgi?'. $agent->agentnum,
50 $access_group->access_groupagent,
56 tie my %rights, 'Tie::IxHash', FS::AccessRight->rights_info;
58 my $rights_sub = sub {
59 my $access_group = shift;
61 #[ map { my $access_right = $_;
64 # 'data' => $access_right->rightname,
69 # $access_group->access_rights,
72 #some false laziness w/edit/access_group.html
76 #include('/elements/table-grid.html', bgcolor=>'#cccccc' ).
78 '<TR>'. join( '', map {
80 '<TD CLASS="inv" VALIGN="top"><TABLE WIDTH=100%>'.
81 '<TR><TH BGCOLOR="#dcdcdc">'. $_. '</TH></TR>'.
84 join('<BR>', grep { $access_group->access_right($_); }
85 map { ref($_) ? $_->{'rightname'} : $_; }
89 '</TD></TR></TABLE></TD>'.
90 ( ++$count % $columns ? '' : '</TR><TR>')
92 } keys %rights ). '</TR></TABLE>';
96 my $count_query = 'SELECT COUNT(*) FROM access_group';
98 my $link = [ $p.'edit/access_group.html?', 'groupnum' ];
104 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');