employee (otaker / access_user) commissioning, RT#6991
[freeside.git] / httemplate / edit / access_user.html
1 <% include( 'elements/edit.html',
2                  'name'   => 'Employee',
3                  'table'  => 'access_user',
4                  'fields' => [
5                                'username',
6                                { field=>'_password', type=>'password' },
7                                { field=>'_password2', type=>'password' },
8                                'last',
9                                'first',
10                                { field=>'user_custnum', type=>'search-cust_main', },
11                                { field=>'disabled', type=>'checkbox', value=>'Y' },
12                              ],
13                  'labels' => { 
14                                'usernum'      => 'User number',
15                                'username'     => 'Username',
16                                '_password'    => 'Password',
17                                '_password2   '=> 'Re-enter Password',
18                                'last'         => 'Last name',
19                                'first'        => 'First name',
20                                'user_custnum' => 'Customer (optional)',
21                                'disabled'     => 'Disable employee',
22                              },
23                  'edit_callback' => sub { my( $c, $o ) = @_; 
24                                           $o->set('_password', '');
25                                         },
26                  'viewall_dir' => 'browse',
27                  'html_bottom' =>
28                    sub {
29                      my $access_user = shift;
30
31                      '<BR>Employee Groups<BR>'.
32                      ntable("#cccccc",2).
33                      '<TR><TD>'.
34                      include( '/elements/checkboxes-table.html',
35                                 'source_obj'   => $access_user,
36                                 'link_table'   => 'access_usergroup',
37                                 'target_table' => 'access_group',
38                                 'name_col'     => 'groupname',
39                                 'target_link'  => $p.'edit/access_group.html?',
40                                 #'disable-able' => 1,
41                             ).
42                      '</TR></TD></TABLE>'
43                      ;
44                    },
45            )
46 %>
47 <%init>
48
49 die "access denied"
50   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
51
52 </%init>