first form-migrate tests with customer-add-form

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-02-18 10:42:02 +01:00
parent 28526b4544
commit 829b99bc06
5 changed files with 174 additions and 118 deletions

View File

@@ -17,7 +17,7 @@
return array(
'customer_add' => array(
'title' => $lng['admin']['customer_add'],
'image' => 'icons/user_add.png',
'image' => 'fa-solid fa-user-plus',
'sections' => array(
'section_a' => array(
'title' => $lng['admin']['accountdata'],
@@ -25,33 +25,20 @@ return array(
'fields' => array(
'new_loginname' => array(
'label' => $lng['login']['username'],
'type' => 'text'
'type' => 'text',
'placeholder' => 'Leave empty for autogenerated value'
),
'createstdsubdomain' => array(
'label' => $lng['admin']['stdsubdomain_add'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
\Froxlor\Settings::Get('system.createstdsubdom_default')
)
'value' => '1',
'checked' => \Froxlor\Settings::Get('system.createstdsubdom_default')
),
'store_defaultindex' => array(
'label' => $lng['admin']['store_defaultindex'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
),
'new_customer_password' => array(
'label' => $lng['login']['password'],
@@ -62,39 +49,27 @@ return array(
'label' => $lng['customer']['generated_pwd'],
'type' => 'text',
'visible' => (\Froxlor\Settings::Get('panel.password_regex') == ''),
'value' => \Froxlor\System\Crypt::generatePassword()
'value' => \Froxlor\System\Crypt::generatePassword(),
'readonly' => true
),
'sendpassword' => array(
'label' => $lng['admin']['sendpassword'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
),
'def_language' => array(
'label' => $lng['login']['language'],
'type' => 'select',
'select_var' => $language_options
'select_var' => $languages,
'selected' => \Froxlor\Settings::Get('panel.standardlanguage')
),
'api_allowed' => array(
'label' => $lng['usersettings']['api_allowed']['title'],
'desc' => $lng['usersettings']['api_allowed']['description'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
(\Froxlor\Settings::Get('api.enabled') == '1' ? '1' : '0')
),
'value' => '1',
'checked' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false),
'visible' => (\Froxlor\Settings::Get('api.enabled') == '1' ? true : false)
)
)
@@ -116,7 +91,11 @@ return array(
'gender' => array(
'label' => $lng['gender']['title'],
'type' => 'select',
'select_var' => $gender_options
'select_var' => [
0 => $lng['gender']['undef'],
1 => $lng['gender']['male'],
2 => $lng['gender']['female']
]
),
'company' => array(
'label' => $lng['customer']['company'],
@@ -163,13 +142,8 @@ return array(
'custom_notes_show' => array(
'label' => $lng['usersettings']['custom_notes']['show'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array()
'value' => '1',
'checked' => false
)
)
),
@@ -249,29 +223,15 @@ return array(
'email_imap' => array(
'label' => $lng['customer']['email_imap'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
),
'value' => '1',
'checked' => true,
'mandatory' => true
),
'email_pop3' => array(
'label' => $lng['customer']['email_pop3'],
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
),
'value' => '1',
'checked' => true,
'mandatory' => true
),
'ftps' => array(
@@ -292,58 +252,39 @@ return array(
'phpenabled' => array(
'label' => $lng['admin']['phpenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => array(
'1'
)
'value' => '1',
'checked' => true
),
'allowed_phpconfigs' => array(
'visible' => (((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 || (int) \Froxlor\Settings::Get('phpfpm.enabled') == 1) ? true : false),
'label' => $lng['admin']['phpsettings']['title'],
'type' => 'checkbox',
'values' => $phpconfigs,
'value' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ? array(
'value' => ((int) \Froxlor\Settings::Get('system.mod_fcgid') == 1 ?
\Froxlor\Settings::Get('system.mod_fcgid_defaultini')
) : ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ? array(
: ((int) \Froxlor\Settings::Get('phpfpm.enabled') == 1 ?
\Froxlor\Settings::Get('phpfpm.defaultini')
) : array())),
: null)),
'is_array' => 1
),
'perlenabled' => array(
'label' => $lng['admin']['perlenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
)
'value' => '1',
'checked' => false
),
'dnsenabled' => array(
'label' => $lng['admin']['dnsenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
),
'value' => '1',
'checked' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false),
'visible' => (\Froxlor\Settings::Get('system.dnsenabled') == '1' ? true : false)
),
'logviewenabled' => array(
'label' => $lng['admin']['logviewenabled'] . '?',
'type' => 'checkbox',
'values' => array(
array(
'label' => $lng['panel']['yes'],
'value' => '1'
)
)
'value' => '1',
'checked' => true
)
)
)