Merge branch 'ent-10255-14940-Funcionalidad-cuadro-naranja-en-las-consolas-visuales-cuando-hay-una-alerta' into 'develop'

setup check to enable/disable vc item alert frame

See merge request artica/pandorafms!5668
This commit is contained in:
Daniel Rodriguez 2023-04-20 17:22:57 +00:00
commit af80e204de
3 changed files with 25 additions and 1 deletions

View File

@ -1421,6 +1421,17 @@ $table_vc->data[$row][] = html_print_label_input_block(
true true
) )
); );
$table_vc->data[$row][] = html_print_label_input_block(
__('Display item frame on alert triggered'),
html_print_checkbox_switch(
'display_item_frame',
1,
(bool) $config['display_item_frame'],
true
)
);
$row++; $row++;

View File

@ -1222,6 +1222,10 @@ function config_update_config()
$error_update[] = __('Mobile view not allow visual console orientation'); $error_update[] = __('Mobile view not allow visual console orientation');
} }
if (config_update_value('display_item_frame', (int) get_parameter('display_item_frame'), true) === false) {
$error_update[] = __('Display item frame on alert triggered');
}
if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) { if (config_update_value('ser_menu_items', (int) get_parameter('ser_menu_items', 10), true) === false) {
$error_update[] = __('Default line menu items for the Services'); $error_update[] = __('Default line menu items for the Services');
} }
@ -3417,6 +3421,10 @@ function config_process_config()
config_update_value('mobile_view_orientation_vc', 0); config_update_value('mobile_view_orientation_vc', 0);
} }
if (isset($config['display_item_frame']) === false) {
config_update_value('display_item_frame', 1);
}
if (!isset($config['agent_size_text_small'])) { if (!isset($config['agent_size_text_small'])) {
config_update_value('agent_size_text_small', 18); config_update_value('agent_size_text_small', 18);
} }

View File

@ -194,6 +194,8 @@ class Item extends CachedModel
*/ */
protected function decode(array $data): array protected function decode(array $data): array
{ {
global $config;
$decodedData = [ $decodedData = [
'id' => (int) $data['id'], 'id' => (int) $data['id'],
'colorStatus' => (string) COL_UNKNOWN, 'colorStatus' => (string) COL_UNKNOWN,
@ -209,9 +211,12 @@ class Item extends CachedModel
'x' => static::extractX($data), 'x' => static::extractX($data),
'y' => static::extractY($data), 'y' => static::extractY($data),
'cacheExpiration' => static::extractCacheExpiration($data), 'cacheExpiration' => static::extractCacheExpiration($data),
'alertOutline' => static::checkLayoutAlertsRecursive($data),
]; ];
if ((bool) $config['display_item_frame'] === true) {
$decodedData['alertOutline'] = static::checkLayoutAlertsRecursive($data);
}
if (static::$useLinkedModule === true) { if (static::$useLinkedModule === true) {
$decodedData = array_merge( $decodedData = array_merge(
$decodedData, $decodedData,