X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Faccess_group.html;h=4686a627ae16b5df250a21ad65b53b5f7fa79dc0;hp=d447512c25e78a285ef59e404fbeafde07544e13;hb=eb4ff7f73c5d4bdf74a3472448b5a195598ff4cd;hpb=32b5d3a31f112a381f0a15ac5e3a2204242f3405 diff --git a/httemplate/edit/access_group.html b/httemplate/edit/access_group.html index d447512c2..4686a627a 100644 --- a/httemplate/edit/access_group.html +++ b/httemplate/edit/access_group.html @@ -1,46 +1,80 @@ <% include( 'elements/edit.html', - 'name' => 'Internal Access Group', - 'table' => 'access_group', - 'labels' => { - 'groupnum' => 'Group number', - 'groupname' => 'Group name', - }, - - 'viewall_dir' => 'browse', - - 'html_bottom' => - sub { - my $access_group = shift; - - "
Group virtualized to customers of agents:
". - ntable("#cccccc",2). - ''. - include( '/elements/checkboxes-table.html', - 'source_obj' => $access_group, - 'link_table' => 'access_groupagent', - 'target_table' => 'agent', - 'name_col' => 'agent', - 'target_link' => $p.'edit/agent.cgi?', - 'disable-able' => 1, - ). - ''. - - "
Group rights:
". - ntable("#cccccc",2). - ''. - include( '/elements/checkboxes-table-name.html', - 'source_obj' => $access_group, - 'link_table' => 'access_right', - 'link_static' => { 'righttype' => - 'FS::access_group', - }, - 'num_col' => 'rightobjnum', - 'name_col' => 'rightname', - 'names_list' => [ FS::AccessRight->rights() ], - ). - '' - - ; - }, - ) + 'name' => 'Internal Access Group', + 'table' => 'access_group', + 'labels' => { + 'groupnum' => 'Group number', + 'groupname' => 'Group name', + }, + + 'viewall_dir' => 'browse', + + 'html_bottom' => $html_bottom_sub, + ) %> +<%once> + +tie my %rights, 'Tie::IxHash', FS::AccessRight->rights_info; + + +<%init> + +my $html_bottom_sub = sub { + my $access_group = shift; + + #some false laziness w/browse/access_group.html + my $columns = 3; + my $count = 0; + + '
'. + 'Group limited to these agent(s)
'. + 'Employees in this group will only see customers of the selected agents in the system and reports.
'. + ntable("#cccccc",2). + ''. + include( '/elements/checkboxes-table.html', + 'source_obj' => $access_group, + 'link_table' => 'access_groupagent', + 'target_table' => 'agent', + 'name_col' => 'agent', + 'target_link' => $p.'edit/agent.cgi?', + 'disable-able' => 1, + ). + ''. + + '
Group access rights
'. + include('/elements/table-grid.html', bgcolor=>'#cccccc' ). + ''. join( '', map { + ''. + ''. + '
'. $_. '
'. + include( '/elements/checkboxes-table-name.html', + 'source_obj' => $access_group, + 'link_table' => 'access_right', + 'link_static' => { 'righttype' => + 'FS::access_group', + }, + 'num_col' => 'rightobjnum', + 'name_col' => 'rightname', + 'names_list' => [ map { + my $rn = + ref($_) ? $_->{'rightname'} : $_; + my %hash = (); + $hash{'note'} = ' *' + if ref($_) && $_->{'global'}; + $hash{'desc'} = $_->{'desc'} + if ref($_) && $_->{'desc'}; + [ $rn => \%hash ]; + } + @{ $rights{$_} } + ], + ). + '
'. + '
'. + ( ++$count % $columns ? '' : '') + + } keys %rights ). ''. + + '* Global rights. These rights provide access to global data which is shared among all agents. Their use is not recommended for groups which are limited to a subset of agents.
'; + +}; + +