diff --git a/app/devices/app_config.php b/app/devices/app_config.php index 428404ad28..61f1927e84 100644 --- a/app/devices/app_config.php +++ b/app/devices/app_config.php @@ -350,6 +350,22 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "3"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3d847335-be0a-4130-9c38-0f1d906f3eea"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "devices"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "profile_add_rows"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "10"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "53ccbe30-0a40-46af-a31e-12899d6c8e05"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "devices"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "profile_edit_rows"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "3"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; //schema details $y=0; diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index dfd7d66153..31c5c93fbf 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -308,20 +308,30 @@ } //add an empty row - $x = is_array($device_profile_keys) ? count($device_profile_keys) : 0; - $device_profile_keys[$x]['domain_uuid'] = $domain_uuid; - $device_profile_keys[$x]['device_profile_uuid'] = $device_profile_uuid; - $device_profile_keys[$x]['device_profile_key_uuid'] = ''; - $device_profile_keys[$x]['profile_key_category'] = ''; - $device_profile_keys[$x]['profile_key_id'] = ''; - $device_profile_keys[$x]['profile_key_vendor'] = ''; - $device_profile_keys[$x]['profile_key_type'] = ''; - $device_profile_keys[$x]['profile_key_line'] = ''; - $device_profile_keys[$x]['profile_key_value'] = ''; - $device_profile_keys[$x]['profile_key_extension'] = ''; - $device_profile_keys[$x]['profile_key_protected'] = ''; - $device_profile_keys[$x]['profile_key_label'] = ''; - $device_profile_keys[$x]['profile_key_icon'] = ''; + if (!is_array($device_profile_keys) || count($device_profile_keys) == 0) { + $rows = $_SESSION['devices']['profile_add_rows']['numeric']; + $id = 0; + } + if (is_array($device_profile_keys) && count($device_profile_keys) > 0) { + $rows = $_SESSION['devices']['profile_edit_rows']['numeric']; + $id = count($device_profile_keys)+1; + } + for ($x = 0; $x < $rows; $x++) { + $device_profile_keys[$id]['domain_uuid'] = $domain_uuid; + $device_profile_keys[$id]['device_profile_uuid'] = $device_profile_uuid; + $device_profile_keys[$id]['device_profile_key_uuid'] = ''; + $device_profile_keys[$id]['profile_key_category'] = ''; + $device_profile_keys[$id]['profile_key_id'] = ''; + $device_profile_keys[$id]['profile_key_vendor'] = ''; + $device_profile_keys[$id]['profile_key_type'] = ''; + $device_profile_keys[$id]['profile_key_line'] = ''; + $device_profile_keys[$id]['profile_key_value'] = ''; + $device_profile_keys[$id]['profile_key_extension'] = ''; + $device_profile_keys[$id]['profile_key_protected'] = ''; + $device_profile_keys[$id]['profile_key_label'] = ''; + $device_profile_keys[$id]['profile_key_icon'] = ''; + $id++; + } //get the child data if (strlen($device_profile_uuid) > 0) {