1 <% include( 'elements/edit.html',
3 'table' => 'access_user',
9 { field=>'user_custnum', type=>'search-cust_main', },
10 { field=>'report_salesnum', type=>'select-sales', empty_label=>'all', },
11 { field=>'disabled', type=>'checkbox', value=>'Y' },
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 'report_salesnum' => 'Limit commission report to sales person',
22 'disabled' => 'Disable employee',
24 'edit_callback' => \&edit_callback,
25 'field_callback'=> \&field_callback,
26 'viewall_dir' => 'browse',
29 my $access_user = shift;
31 '<BR>Employee Groups<BR>'.
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?',
45 'onsubmit' => 'check_user_custnum_search',
46 'html_foot' => $check_user_custnum_search,
52 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
55 FS::Auth->auth_class->can('change_password')
56 ? ( { field=>'_password', type=>'password' },
57 { field=>'_password2', type=>'password' },
61 my $check_user_custnum_search = <<END;
62 <SCRIPT TYPE="text/javascript">
63 function check_user_custnum_search(what) {
64 while ( user_custnum_search_active ) {
65 // javascript needs ambien
73 my ($cgi, $access_user, $fields_listref, $opt_hashref) = @_;
74 $access_user->_password('');
79 if($f->{'type'} eq 'password' and $o->is_system_user) {
80 $f->{'type'} = 'hidden';