Changes
This commit is contained in:
parent
0ed9417ace
commit
0242159928
|
|
@ -12963,13 +12963,12 @@ class FormController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selected user attribute codes when the form is configured to show them.
|
* Selected user attribute codes when Show User Attributes is Yes.
|
||||||
* Uses the saved attribute list as the source of truth so columns still render
|
* A saved attribute list is ignored while that setting is No.
|
||||||
* if Show User Attributes was left off after attributes were selected.
|
|
||||||
*/
|
*/
|
||||||
protected function userAttributeCodes($form): array
|
protected function userAttributeCodes($form): array
|
||||||
{
|
{
|
||||||
if (!$form) {
|
if (!$form || ($form->show_user_attributes ?? 'no') !== 'yes') {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
$raw = $form->user_attributes ?? [];
|
$raw = $form->user_attributes ?? [];
|
||||||
|
|
|
||||||
|
|
@ -158,9 +158,6 @@ class FormentityController extends Controller
|
||||||
$values->show_manager_details = $values->show_manager_details ?? 'no';
|
$values->show_manager_details = $values->show_manager_details ?? 'no';
|
||||||
$values->show_user_attributes = (($values->show_user_attributes ?? 'no') === 'yes') ? 'yes' : 'no';
|
$values->show_user_attributes = (($values->show_user_attributes ?? 'no') === 'yes') ? 'yes' : 'no';
|
||||||
$values->user_attributes = $this->normalizeAttributeCodes($values->user_attributes ?? []);
|
$values->user_attributes = $this->normalizeAttributeCodes($values->user_attributes ?? []);
|
||||||
if (!empty($values->user_attributes)) {
|
|
||||||
$values->show_user_attributes = 'yes';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//echo '<pre>'; print_r($values); exit;
|
//echo '<pre>'; print_r($values); exit;
|
||||||
return $values;
|
return $values;
|
||||||
|
|
@ -254,9 +251,6 @@ class FormentityController extends Controller
|
||||||
$data['roles_info'] = ($data['roles_info'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
$data['roles_info'] = ($data['roles_info'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
||||||
$data['show_user_attributes'] = ($data['show_user_attributes'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
$data['show_user_attributes'] = ($data['show_user_attributes'] ?? 'no') === 'yes' ? 'yes' : 'no';
|
||||||
$data['user_attributes'] = $this->normalizeAttributeCodes($data['user_attributes'] ?? []);
|
$data['user_attributes'] = $this->normalizeAttributeCodes($data['user_attributes'] ?? []);
|
||||||
if (!empty($data['user_attributes'])) {
|
|
||||||
$data['show_user_attributes'] = 'yes';
|
|
||||||
}
|
|
||||||
if ($data['email_notification'] === 'no') {
|
if ($data['email_notification'] === 'no') {
|
||||||
$data['email_notification_rules'] = [];
|
$data['email_notification_rules'] = [];
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue