diff options
author | Vladimirs Maksimovs <vladimirs.maksimovs@zabbix.com> | 2020-07-09 09:14:23 +0300 |
---|---|---|
committer | Vladimirs Maksimovs <vladimirs.maksimovs@zabbix.com> | 2020-07-09 09:14:23 +0300 |
commit | 1c44eb2b98a705824e8847f1d5edef4836f76139 (patch) | |
tree | e37f92041cde42235a4e7dc9f2a2e6828531d00f /ui/app | |
parent | c622f9fc2f9a297d5c3fbdaf05f01b1fec7850c7 (diff) |
A.F....... [ZBXNEXT-82] reworked defines; fixed code style
Diffstat (limited to 'ui/app')
-rw-r--r-- | ui/app/controllers/CControllerGuiEdit.php | 32 | ||||
-rw-r--r-- | ui/app/controllers/CControllerGuiUpdate.php | 32 | ||||
-rw-r--r-- | ui/app/controllers/CControllerMiscConfigEdit.php | 62 | ||||
-rw-r--r-- | ui/app/controllers/CControllerMiscConfigUpdate.php | 58 | ||||
-rw-r--r-- | ui/app/controllers/CControllerTrigDisplayEdit.php | 88 | ||||
-rw-r--r-- | ui/app/controllers/CControllerTrigDisplayUpdate.php | 88 | ||||
-rw-r--r-- | ui/app/views/administration.miscconfig.edit.php | 2 | ||||
-rw-r--r-- | ui/app/views/js/administration.trigdisplay.edit.js.php | 48 | ||||
-rw-r--r-- | ui/app/views/layout.htmlpage.php | 9 | ||||
-rw-r--r-- | ui/app/views/popup.generic.php | 3 |
10 files changed, 212 insertions, 210 deletions
diff --git a/ui/app/controllers/CControllerGuiEdit.php b/ui/app/controllers/CControllerGuiEdit.php index 40ad5a6be8e..749e33a31f6 100644 --- a/ui/app/controllers/CControllerGuiEdit.php +++ b/ui/app/controllers/CControllerGuiEdit.php @@ -27,15 +27,15 @@ class CControllerGuiEdit extends CController { protected function checkInput() { $fields = [ - 'default_theme' => 'db config.default_theme', - 'search_limit' => 'db config.search_limit', - 'max_in_table' => 'db config.max_in_table', - 'server_check_interval' => 'db config.server_check_interval', - 'work_period' => 'db config.work_period', - 'show_technical_errors' => 'db config.show_technical_errors', - 'history_period' => 'db config.history_period', - 'period_default' => 'db config.period_default', - 'max_period' => 'db config.max_period' + 'default_theme' => 'db config.default_theme', + 'search_limit' => 'db config.search_limit', + 'max_in_table' => 'db config.max_in_table', + 'server_check_interval' => 'db config.server_check_interval', + 'work_period' => 'db config.work_period', + 'show_technical_errors' => 'db config.show_technical_errors', + 'history_period' => 'db config.history_period', + 'period_default' => 'db config.period_default', + 'max_period' => 'db config.max_period' ]; $ret = $this->validateInput($fields); @@ -53,23 +53,23 @@ class CControllerGuiEdit extends CController { protected function doAction() { $data = [ - 'default_theme' => + 'default_theme' => $this->getInput('default_theme', CSettingsHelper::get(CSettingsHelper::DEFAULT_THEME)), - 'search_limit' => + 'search_limit' => $this->getInput('search_limit', CSettingsHelper::get(CSettingsHelper::SEARCH_LIMIT)), - 'max_in_table' => + 'max_in_table' => $this->getInput('max_in_table', CSettingsHelper::get(CSettingsHelper::MAX_IN_TABLE)), 'server_check_interval' => $this->getInput('server_check_interval', CSettingsHelper::get(CSettingsHelper::SERVER_CHECK_INTERVAL)), - 'work_period' => + 'work_period' => $this->getInput('work_period', CSettingsHelper::get(CSettingsHelper::WORK_PERIOD)), 'show_technical_errors' => $this->getInput('show_technical_errors', CSettingsHelper::get(CSettingsHelper::SHOW_TECHNICAL_ERRORS)), - 'history_period' => + 'history_period' => $this->getInput('history_period', CSettingsHelper::get(CSettingsHelper::HISTORY_PERIOD)), - 'period_default' => + 'period_default' => $this->getInput('period_default', CSettingsHelper::get(CSettingsHelper::PERIOD_DEFAULT)), - 'max_period' => + 'max_period' => $this->getInput('max_period', CSettingsHelper::get(CSettingsHelper::MAX_PERIOD)) ]; diff --git a/ui/app/controllers/CControllerGuiUpdate.php b/ui/app/controllers/CControllerGuiUpdate.php index 73567a8dba9..e15185c42bf 100644 --- a/ui/app/controllers/CControllerGuiUpdate.php +++ b/ui/app/controllers/CControllerGuiUpdate.php @@ -24,15 +24,15 @@ class CControllerGuiUpdate extends CController { protected function checkInput() { $themes = array_keys(APP::getThemes()); $fields = [ - 'default_theme' => 'required|in '.implode(',', $themes).'|db config.default_theme', - 'search_limit' => 'required|db config.search_limit|ge 1|le 999999', - 'max_in_table' => 'required|db config.max_in_table|ge 1|le 99999', - 'server_check_interval' => 'required|db config.server_check_interval|in 0,'.SERVER_CHECK_INTERVAL, - 'work_period' => 'required|db config.work_period|time_periods', - 'show_technical_errors' => 'db config.show_technical_errors|in 0,1', - 'history_period' => 'required|db config.history_period', - 'period_default' => 'required|db config.period_default', - 'max_period' => 'required|db config.max_period' + 'default_theme' => 'required|in '.implode(',', $themes).'|db config.default_theme', + 'search_limit' => 'required|db config.search_limit|ge 1|le 999999', + 'max_in_table' => 'required|db config.max_in_table|ge 1|le 99999', + 'server_check_interval' => 'required|db config.server_check_interval|in 0,'.SERVER_CHECK_INTERVAL, + 'work_period' => 'required|db config.work_period|time_periods', + 'show_technical_errors' => 'db config.show_technical_errors|in 0,1', + 'history_period' => 'required|db config.history_period', + 'period_default' => 'required|db config.period_default', + 'max_period' => 'required|db config.max_period' ]; $ret = $this->validateInput($fields); @@ -106,15 +106,15 @@ class CControllerGuiUpdate extends CController { protected function doAction() { $result = API::Settings()->update([ - CSettingsHelper::DEFAULT_THEME => $this->getInput('default_theme'), - CSettingsHelper::SEARCH_LIMIT => $this->getInput('search_limit'), - CSettingsHelper::MAX_IN_TABLE => $this->getInput('max_in_table'), + CSettingsHelper::DEFAULT_THEME => $this->getInput('default_theme'), + CSettingsHelper::SEARCH_LIMIT => $this->getInput('search_limit'), + CSettingsHelper::MAX_IN_TABLE => $this->getInput('max_in_table'), CSettingsHelper::SERVER_CHECK_INTERVAL => $this->getInput('server_check_interval'), - CSettingsHelper::WORK_PERIOD => $this->getInput('work_period'), + CSettingsHelper::WORK_PERIOD => $this->getInput('work_period'), CSettingsHelper::SHOW_TECHNICAL_ERRORS => $this->getInput('show_technical_errors', 0), - CSettingsHelper::HISTORY_PERIOD => $this->getInput('history_period'), - CSettingsHelper::PERIOD_DEFAULT => $this->getInput('period_default'), - CSettingsHelper::MAX_PERIOD => $this->getInput('max_period') + CSettingsHelper::HISTORY_PERIOD => $this->getInput('history_period'), + CSettingsHelper::PERIOD_DEFAULT => $this->getInput('period_default'), + CSettingsHelper::MAX_PERIOD => $this->getInput('max_period') ]); $response = new CControllerResponseRedirect((new CUrl('zabbix.php')) diff --git a/ui/app/controllers/CControllerMiscConfigEdit.php b/ui/app/controllers/CControllerMiscConfigEdit.php index 27de7a36780..a5b986c83b8 100644 --- a/ui/app/controllers/CControllerMiscConfigEdit.php +++ b/ui/app/controllers/CControllerMiscConfigEdit.php @@ -27,22 +27,22 @@ class CControllerMiscConfigEdit extends CController { protected function checkInput() { $fields = [ - 'refresh_unsupported' => 'db config.refresh_unsupported', - 'discovery_groupid' => 'db config.discovery_groupid', - 'default_inventory_mode' => 'db config.default_inventory_mode', - 'alert_usrgrpid' => 'db config.alert_usrgrpid', - 'snmptrap_logging' => 'db config.snmptrap_logging', - 'login_attempts' => 'db config.login_attempts', - 'login_block' => 'db config.login_block', - 'session_name' => 'db config.session_name', - 'validate_uri_schemes' => 'db config.validate_uri_schemes', - 'uri_valid_schemes' => 'db config.uri_valid_schemes', - 'x_frame_options' => 'db config.x_frame_options', - 'socket_timeout' => 'db config.socket_timeout', - 'connect_timeout' => 'db config.connect_timeout', - 'media_type_test_timeout' => 'db config.media_type_test_timeout', - 'script_timeout' => 'db config.script_timeout', - 'item_test_timeout' => 'db config.item_test_timeout', + 'refresh_unsupported' => 'db config.refresh_unsupported', + 'discovery_groupid' => 'db config.discovery_groupid', + 'default_inventory_mode' => 'db config.default_inventory_mode', + 'alert_usrgrpid' => 'db config.alert_usrgrpid', + 'snmptrap_logging' => 'db config.snmptrap_logging', + 'login_attempts' => 'db config.login_attempts', + 'login_block' => 'db config.login_block', + 'session_name' => 'db config.session_name', + 'validate_uri_schemes' => 'db config.validate_uri_schemes', + 'uri_valid_schemes' => 'db config.uri_valid_schemes', + 'x_frame_options' => 'db config.x_frame_options', + 'socket_timeout' => 'db config.socket_timeout', + 'connect_timeout' => 'db config.connect_timeout', + 'media_type_test_timeout' => 'db config.media_type_test_timeout', + 'script_timeout' => 'db config.script_timeout', + 'item_test_timeout' => 'db config.item_test_timeout' ]; $ret = $this->validateInput($fields); @@ -60,38 +60,38 @@ class CControllerMiscConfigEdit extends CController { protected function doAction() { $data = [ - 'refresh_unsupported' => + 'refresh_unsupported' => $this->getInput('refresh_unsupported', CSettingsHelper::get(CSettingsHelper::REFRESH_UNSUPPORTED)), - 'discovery_groupid' => + 'discovery_groupid' => $this->getInput('discovery_groupid', CSettingsHelper::get(CSettingsHelper::DISCOVERY_GROUPID)), - 'default_inventory_mode' => $this->getInput('default_inventory_mode', CSettingsHelper::get( + 'default_inventory_mode' => $this->getInput('default_inventory_mode', CSettingsHelper::get( CSettingsHelper::DEFAULT_INVENTORY_MODE )), - 'alert_usrgrpid' => + 'alert_usrgrpid' => $this->getInput('alert_usrgrpid', CSettingsHelper::get(CSettingsHelper::ALERT_USRGRPID)), - 'snmptrap_logging' => + 'snmptrap_logging' => $this->getInput('snmptrap_logging', CSettingsHelper::get(CSettingsHelper::SNMPTRAP_LOGGING)), - 'login_attempts' => + 'login_attempts' => $this->getInput('login_attempts', CSettingsHelper::get(CSettingsHelper::LOGIN_ATTEMPTS)), - 'login_block' => + 'login_block' => $this->getInput('login_block', CSettingsHelper::get(CSettingsHelper::LOGIN_BLOCK)), - 'session_name' => + 'session_name' => $this->getInput('session_name', CSettingsHelper::get(CSettingsHelper::SESSION_NAME)), - 'validate_uri_schemes' => + 'validate_uri_schemes' => $this->getInput('validate_uri_schemes', CSettingsHelper::get(CSettingsHelper::VALIDATE_URI_SCHEMES)), - 'uri_valid_schemes' => + 'uri_valid_schemes' => $this->getInput('uri_valid_schemes', CSettingsHelper::get(CSettingsHelper::URI_VALID_SCHEMES)), - 'x_frame_options' => + 'x_frame_options' => $this->getInput('x_frame_options', CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS)), - 'socket_timeout' => + 'socket_timeout' => $this->getInput('socket_timeout', CSettingsHelper::get(CSettingsHelper::SOCKET_TIMEOUT)), - 'connect_timeout' => + 'connect_timeout' => $this->getInput('connect_timeout', CSettingsHelper::get(CSettingsHelper::CONNECT_TIMEOUT)), 'media_type_test_timeout' => $this->getInput('media_type_test_timeout', CSettingsHelper::get(CSettingsHelper::MEDIA_TYPE_TEST_TIMEOUT)), - 'script_timeout' => + 'script_timeout' => $this->getInput('script_timeout', CSettingsHelper::get(CSettingsHelper::SCRIPT_TIMEOUT)), - 'item_test_timeout' => + 'item_test_timeout' => $this->getInput('item_test_timeout', CSettingsHelper::get(CSettingsHelper::ITEM_TEST_TIMEOUT)) ]; diff --git a/ui/app/controllers/CControllerMiscConfigUpdate.php b/ui/app/controllers/CControllerMiscConfigUpdate.php index ba5a4f3fe2e..7d0823aaa7c 100644 --- a/ui/app/controllers/CControllerMiscConfigUpdate.php +++ b/ui/app/controllers/CControllerMiscConfigUpdate.php @@ -23,22 +23,22 @@ class CControllerMiscConfigUpdate extends CController { protected function checkInput() { $fields = [ - 'refresh_unsupported' => 'required|db config.refresh_unsupported', - 'discovery_groupid' => 'required|db config.discovery_groupid', - 'default_inventory_mode' => 'required|in '.HOST_INVENTORY_DISABLED.','.HOST_INVENTORY_MANUAL.','.HOST_INVENTORY_AUTOMATIC, - 'alert_usrgrpid' => 'db config.alert_usrgrpid', - 'snmptrap_logging' => 'required|db config.snmptrap_logging|in 0,1', - 'login_attempts' => 'required|db config.login_attempts|ge 1|le 32', - 'login_block' => 'required|db config.login_block', - 'session_name' => 'required|db config.session_name', - 'validate_uri_schemes' => 'required|db config.validate_uri_schemes|in 0,1', - 'uri_valid_schemes' => 'db config.uri_valid_schemes', - 'x_frame_options' => 'required|db config.x_frame_options', - 'socket_timeout' => 'required|db config.socket_timeout', - 'connect_timeout' => 'required|db config.connect_timeout', - 'media_type_test_timeout' => 'required|db config.media_type_test_timeout', - 'script_timeout' => 'required|db config.script_timeout', - 'item_test_timeout' => 'required|db config.item_test_timeout' + 'refresh_unsupported' => 'required|db config.refresh_unsupported', + 'discovery_groupid' => 'required|db config.discovery_groupid', + 'default_inventory_mode' => 'required|in '.HOST_INVENTORY_DISABLED.','.HOST_INVENTORY_MANUAL.','.HOST_INVENTORY_AUTOMATIC, + 'alert_usrgrpid' => 'db config.alert_usrgrpid', + 'snmptrap_logging' => 'required|db config.snmptrap_logging|in 0,1', + 'login_attempts' => 'required|db config.login_attempts|ge 1|le 32', + 'login_block' => 'required|db config.login_block', + 'session_name' => 'required|db config.session_name', + 'validate_uri_schemes' => 'required|db config.validate_uri_schemes|in 0,1', + 'uri_valid_schemes' => 'db config.uri_valid_schemes', + 'x_frame_options' => 'required|db config.x_frame_options', + 'socket_timeout' => 'required|db config.socket_timeout', + 'connect_timeout' => 'required|db config.connect_timeout', + 'media_type_test_timeout' => 'required|db config.media_type_test_timeout', + 'script_timeout' => 'required|db config.script_timeout', + 'item_test_timeout' => 'required|db config.item_test_timeout' ]; $ret = $this->validateInput($fields); @@ -160,20 +160,20 @@ class CControllerMiscConfigUpdate extends CController { protected function doAction() { $settings = [ - CSettingsHelper::REFRESH_UNSUPPORTED => $this->getInput('refresh_unsupported'), - CSettingsHelper::DISCOVERY_GROUPID => $this->getInput('discovery_groupid'), - CSettingsHelper::DEFAULT_INVENTORY_MODE => $this->getInput('default_inventory_mode'), - CSettingsHelper::SNMPTRAP_LOGGING => $this->getInput('snmptrap_logging'), - CSettingsHelper::LOGIN_ATTEMPTS => $this->getInput('login_attempts'), - CSettingsHelper::LOGIN_BLOCK => $this->getInput('login_block'), - CSettingsHelper::SESSION_NAME => $this->getInput('session_name'), - CSettingsHelper::VALIDATE_URI_SCHEMES => $this->getInput('validate_uri_schemes'), - CSettingsHelper::X_FRAME_OPTIONS => $this->getInput('x_frame_options'), - CSettingsHelper::SOCKET_TIMEOUT => $this->getInput('socket_timeout'), - CSettingsHelper::CONNECT_TIMEOUT => $this->getInput('connect_timeout'), + CSettingsHelper::REFRESH_UNSUPPORTED => $this->getInput('refresh_unsupported'), + CSettingsHelper::DISCOVERY_GROUPID => $this->getInput('discovery_groupid'), + CSettingsHelper::DEFAULT_INVENTORY_MODE => $this->getInput('default_inventory_mode'), + CSettingsHelper::SNMPTRAP_LOGGING => $this->getInput('snmptrap_logging'), + CSettingsHelper::LOGIN_ATTEMPTS => $this->getInput('login_attempts'), + CSettingsHelper::LOGIN_BLOCK => $this->getInput('login_block'), + CSettingsHelper::SESSION_NAME => $this->getInput('session_name'), + CSettingsHelper::VALIDATE_URI_SCHEMES => $this->getInput('validate_uri_schemes'), + CSettingsHelper::X_FRAME_OPTIONS => $this->getInput('x_frame_options'), + CSettingsHelper::SOCKET_TIMEOUT => $this->getInput('socket_timeout'), + CSettingsHelper::CONNECT_TIMEOUT => $this->getInput('connect_timeout'), CSettingsHelper::MEDIA_TYPE_TEST_TIMEOUT => $this->getInput('media_type_test_timeout'), - CSettingsHelper::SCRIPT_TIMEOUT => $this->getInput('script_timeout'), - CSettingsHelper::ITEM_TEST_TIMEOUT => $this->getInput('item_test_timeout') + CSettingsHelper::SCRIPT_TIMEOUT => $this->getInput('script_timeout'), + CSettingsHelper::ITEM_TEST_TIMEOUT => $this->getInput('item_test_timeout') ]; $settings[CSettingsHelper::ALERT_USRGRPID] = $this->hasInput('alert_usrgrpid') diff --git a/ui/app/controllers/CControllerTrigDisplayEdit.php b/ui/app/controllers/CControllerTrigDisplayEdit.php index eebf462ab70..891494ed6bc 100644 --- a/ui/app/controllers/CControllerTrigDisplayEdit.php +++ b/ui/app/controllers/CControllerTrigDisplayEdit.php @@ -27,29 +27,29 @@ class CControllerTrigDisplayEdit extends CController { protected function checkInput() { $fields = [ - 'custom_color' => 'db config.custom_color', - 'problem_unack_color' => 'db config.problem_unack_color', - 'problem_ack_color' => 'db config.problem_ack_color', - 'ok_unack_color' => 'db config.ok_unack_color', - 'ok_ack_color' => 'db config.ok_ack_color', - 'problem_unack_style' => 'db config.problem_unack_style', - 'problem_ack_style' => 'db config.problem_ack_style', - 'ok_unack_style' => 'db config.ok_unack_style', - 'ok_ack_style' => 'db config.ok_ack_style', - 'ok_period' => 'db config.ok_period', - 'blink_period' => 'db config.blink_period', - 'severity_name_0' => 'db config.severity_name_0', - 'severity_color_0' => 'db config.severity_color_0', - 'severity_name_1' => 'db config.severity_name_1', - 'severity_color_1' => 'db config.severity_color_1', - 'severity_name_2' => 'db config.severity_name_2', - 'severity_color_2' => 'db config.severity_color_2', - 'severity_name_3' => 'db config.severity_name_3', - 'severity_color_3' => 'db config.severity_color_3', - 'severity_name_4' => 'db config.severity_name_4', - 'severity_color_4' => 'db config.severity_color_4', - 'severity_name_5' => 'db config.severity_name_5', - 'severity_color_5' => 'db config.severity_color_5' + 'custom_color' => 'db config.custom_color', + 'problem_unack_color' => 'db config.problem_unack_color', + 'problem_ack_color' => 'db config.problem_ack_color', + 'ok_unack_color' => 'db config.ok_unack_color', + 'ok_ack_color' => 'db config.ok_ack_color', + 'problem_unack_style' => 'db config.problem_unack_style', + 'problem_ack_style' => 'db config.problem_ack_style', + 'ok_unack_style' => 'db config.ok_unack_style', + 'ok_ack_style' => 'db config.ok_ack_style', + 'ok_period' => 'db config.ok_period', + 'blink_period' => 'db config.blink_period', + 'severity_name_0' => 'db config.severity_name_0', + 'severity_color_0' => 'db config.severity_color_0', + 'severity_name_1' => 'db config.severity_name_1', + 'severity_color_1' => 'db config.severity_color_1', + 'severity_name_2' => 'db config.severity_name_2', + 'severity_color_2' => 'db config.severity_color_2', + 'severity_name_3' => 'db config.severity_name_3', + 'severity_color_3' => 'db config.severity_color_3', + 'severity_name_4' => 'db config.severity_name_4', + 'severity_color_4' => 'db config.severity_color_4', + 'severity_name_5' => 'db config.severity_name_5', + 'severity_color_5' => 'db config.severity_color_5' ]; $ret = $this->validateInput($fields); @@ -70,51 +70,51 @@ class CControllerTrigDisplayEdit extends CController { $data = [ 'custom_color' => - $this->getInput('custom_color', CSettingsHelper::get(CSettingsHelper::CUSTOM_COLOR)), + $this->getInput('custom_color', CSettingsHelper::get(CSettingsHelper::CUSTOM_COLOR)), 'problem_unack_color' => $this->getInput('problem_unack_color', CSettingsHelper::get(CSettingsHelper::PROBLEM_UNACK_COLOR)), 'problem_ack_color' => - $this->getInput('problem_ack_color', CSettingsHelper::get(CSettingsHelper::PROBLEM_ACK_COLOR)), + $this->getInput('problem_ack_color', CSettingsHelper::get(CSettingsHelper::PROBLEM_ACK_COLOR)), 'ok_unack_color' => - $this->getInput('ok_unack_color', CSettingsHelper::get(CSettingsHelper::OK_UNACK_COLOR)), + $this->getInput('ok_unack_color', CSettingsHelper::get(CSettingsHelper::OK_UNACK_COLOR)), 'ok_ack_color' => - $this->getInput('ok_ack_color', CSettingsHelper::get(CSettingsHelper::OK_ACK_COLOR)), + $this->getInput('ok_ack_color', CSettingsHelper::get(CSettingsHelper::OK_ACK_COLOR)), 'problem_unack_style' => $this->getInput('problem_unack_style', CSettingsHelper::get(CSettingsHelper::PROBLEM_UNACK_STYLE)), 'problem_ack_style' => - $this->getInput('problem_ack_style', CSettingsHelper::get(CSettingsHelper::PROBLEM_ACK_STYLE)), + $this->getInput('problem_ack_style', CSettingsHelper::get(CSettingsHelper::PROBLEM_ACK_STYLE)), 'ok_unack_style' => - $this->getInput('ok_unack_style', CSettingsHelper::get(CSettingsHelper::OK_UNACK_STYLE)), + $this->getInput('ok_unack_style', CSettingsHelper::get(CSettingsHelper::OK_UNACK_STYLE)), 'ok_ack_style' => - $this->getInput('ok_ack_style', CSettingsHelper::get(CSettingsHelper::OK_ACK_STYLE)), + $this->getInput('ok_ack_style', CSettingsHelper::get(CSettingsHelper::OK_ACK_STYLE)), 'ok_period' => - $this->getInput('ok_period', CSettingsHelper::get(CSettingsHelper::OK_PERIOD)), + $this->getInput('ok_period', CSettingsHelper::get(CSettingsHelper::OK_PERIOD)), 'blink_period' => - $this->getInput('blink_period', CSettingsHelper::get(CSettingsHelper::BLINK_PERIOD)), + $this->getInput('blink_period', CSettingsHelper::get(CSettingsHelper::BLINK_PERIOD)), 'severity_name_0' => - $this->getInput('severity_name_0', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_0)), + $this->getInput('severity_name_0', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_0)), 'severity_color_0' => - $this->getInput('severity_color_0', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_0)), + $this->getInput('severity_color_0', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_0)), 'severity_name_1' => - $this->getInput('severity_name_1', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_1)), + $this->getInput('severity_name_1', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_1)), 'severity_color_1' => - $this->getInput('severity_color_1', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_1)), + $this->getInput('severity_color_1', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_1)), 'severity_name_2' => - $this->getInput('severity_name_2', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_2)), + $this->getInput('severity_name_2', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_2)), 'severity_color_2' => - $this->getInput('severity_color_2', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_2)), + $this->getInput('severity_color_2', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_2)), 'severity_name_3' => - $this->getInput('severity_name_3', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_3)), + $this->getInput('severity_name_3', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_3)), 'severity_color_3' => - $this->getInput('severity_color_3', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_3)), + $this->getInput('severity_color_3', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_3)), 'severity_name_4' => - $this->getInput('severity_name_4', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_4)), + $this->getInput('severity_name_4', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_4)), 'severity_color_4' => - $this->getInput('severity_color_4', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_4)), + $this->getInput('severity_color_4', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_4)), 'severity_name_5' => - $this->getInput('severity_name_5', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_5)), + $this->getInput('severity_name_5', CSettingsHelper::get(CSettingsHelper::SEVERITY_NAME_5)), 'severity_color_5' => - $this->getInput('severity_color_5', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_5)) + $this->getInput('severity_color_5', CSettingsHelper::get(CSettingsHelper::SEVERITY_COLOR_5)) ]; $response = new CControllerResponseData($data); diff --git a/ui/app/controllers/CControllerTrigDisplayUpdate.php b/ui/app/controllers/CControllerTrigDisplayUpdate.php index 639c2ee5210..65770acc827 100644 --- a/ui/app/controllers/CControllerTrigDisplayUpdate.php +++ b/ui/app/controllers/CControllerTrigDisplayUpdate.php @@ -23,29 +23,29 @@ class CControllerTrigDisplayUpdate extends CController { protected function checkInput() { $fields = [ - 'custom_color' => 'required|db config.custom_color|in '.EVENT_CUSTOM_COLOR_DISABLED.','.EVENT_CUSTOM_COLOR_ENABLED, - 'problem_unack_color' => 'db config.problem_unack_color|rgb', - 'problem_ack_color' => 'db config.problem_ack_color|rgb', - 'ok_unack_color' => 'db config.ok_unack_color|rgb', - 'ok_ack_color' => 'db config.ok_ack_color|rgb', - 'problem_unack_style' => 'required|db config.problem_unack_style|in 0,1', - 'problem_ack_style' => 'required|db config.problem_ack_style|in 0,1', - 'ok_unack_style' => 'required|db config.ok_unack_style|in 0,1', - 'ok_ack_style' => 'required|db config.ok_ack_style|in 0,1', - 'ok_period' => 'required|db config.ok_period|not_empty', - 'blink_period' => 'required|db config.blink_period|not_empty', - 'severity_name_0' => 'required|db config.severity_name_0|not_empty', - 'severity_color_0' => 'required|db config.severity_color_0|rgb', - 'severity_name_1' => 'required|db config.severity_name_1|not_empty', - 'severity_color_1' => 'required|db config.severity_color_1|rgb', - 'severity_name_2' => 'required|db config.severity_name_2|not_empty', - 'severity_color_2' => 'required|db config.severity_color_2|rgb', - 'severity_name_3' => 'required|db config.severity_name_3|not_empty', - 'severity_color_3' => 'required|db config.severity_color_3|rgb', - 'severity_name_4' => 'required|db config.severity_name_4|not_empty', - 'severity_color_4' => 'required|db config.severity_color_4|rgb', - 'severity_name_5' => 'required|db config.severity_name_5|not_empty', - 'severity_color_5' => 'required|db config.severity_color_5|rgb' + 'custom_color' => 'required|db config.custom_color|in '.EVENT_CUSTOM_COLOR_DISABLED.','.EVENT_CUSTOM_COLOR_ENABLED, + 'problem_unack_color' => 'db config.problem_unack_color|rgb', + 'problem_ack_color' => 'db config.problem_ack_color|rgb', + 'ok_unack_color' => 'db config.ok_unack_color|rgb', + 'ok_ack_color' => 'db config.ok_ack_color|rgb', + 'problem_unack_style' => 'required|db config.problem_unack_style|in 0,1', + 'problem_ack_style' => 'required|db config.problem_ack_style|in 0,1', + 'ok_unack_style' => 'required|db config.ok_unack_style|in 0,1', + 'ok_ack_style' => 'required|db config.ok_ack_style|in 0,1', + 'ok_period' => 'required|db config.ok_period|not_empty', + 'blink_period' => 'required|db config.blink_period|not_empty', + 'severity_name_0' => 'required|db config.severity_name_0|not_empty', + 'severity_color_0' => 'required|db config.severity_color_0|rgb', + 'severity_name_1' => 'required|db config.severity_name_1|not_empty', + 'severity_color_1' => 'required|db config.severity_color_1|rgb', + 'severity_name_2' => 'required|db config.severity_name_2|not_empty', + 'severity_color_2' => 'required|db config.severity_color_2|rgb', + 'severity_name_3' => 'required|db config.severity_name_3|not_empty', + 'severity_color_3' => 'required|db config.severity_color_3|rgb', + 'severity_name_4' => 'required|db config.severity_name_4|not_empty', + 'severity_color_4' => 'required|db config.severity_color_4|rgb', + 'severity_name_5' => 'required|db config.severity_name_5|not_empty', + 'severity_color_5' => 'required|db config.severity_color_5|rgb' ]; $ret = $this->validateInput($fields); @@ -122,32 +122,32 @@ class CControllerTrigDisplayUpdate extends CController { protected function doAction() { $settings = [ - CSettingsHelper::CUSTOM_COLOR => $this->getInput('custom_color', EVENT_CUSTOM_COLOR_DISABLED), + CSettingsHelper::CUSTOM_COLOR => $this->getInput('custom_color', EVENT_CUSTOM_COLOR_DISABLED), CSettingsHelper::PROBLEM_UNACK_STYLE => $this->getInput('problem_unack_style'), - CSettingsHelper::PROBLEM_ACK_STYLE => $this->getInput('problem_ack_style'), - CSettingsHelper::OK_UNACK_STYLE => $this->getInput('ok_unack_style'), - CSettingsHelper::OK_ACK_STYLE => $this->getInput('ok_ack_style'), - CSettingsHelper::OK_PERIOD => trim($this->getInput('ok_period')), - CSettingsHelper::BLINK_PERIOD => trim($this->getInput('blink_period')), - CSettingsHelper::SEVERITY_NAME_0 => $this->getInput('severity_name_0'), - CSettingsHelper::SEVERITY_COLOR_0 => $this->getInput('severity_color_0'), - CSettingsHelper::SEVERITY_NAME_1 => $this->getInput('severity_name_1'), - CSettingsHelper::SEVERITY_COLOR_1 => $this->getInput('severity_color_1'), - CSettingsHelper::SEVERITY_NAME_2 => $this->getInput('severity_name_2'), - CSettingsHelper::SEVERITY_COLOR_2 => $this->getInput('severity_color_2'), - CSettingsHelper::SEVERITY_NAME_3 => $this->getInput('severity_name_3'), - CSettingsHelper::SEVERITY_COLOR_3 => $this->getInput('severity_color_3'), - CSettingsHelper::SEVERITY_NAME_4 => $this->getInput('severity_name_4'), - CSettingsHelper::SEVERITY_COLOR_4 => $this->getInput('severity_color_4'), - CSettingsHelper::SEVERITY_NAME_5 => $this->getInput('severity_name_5'), - CSettingsHelper::SEVERITY_COLOR_5 => $this->getInput('severity_color_5') + CSettingsHelper::PROBLEM_ACK_STYLE => $this->getInput('problem_ack_style'), + CSettingsHelper::OK_UNACK_STYLE => $this->getInput('ok_unack_style'), + CSettingsHelper::OK_ACK_STYLE => $this->getInput('ok_ack_style'), + CSettingsHelper::OK_PERIOD => trim($this->getInput('ok_period')), + CSettingsHelper::BLINK_PERIOD => trim($this->getInput('blink_period')), + CSettingsHelper::SEVERITY_NAME_0 => $this->getInput('severity_name_0'), + CSettingsHelper::SEVERITY_COLOR_0 => $this->getInput('severity_color_0'), + CSettingsHelper::SEVERITY_NAME_1 => $this->getInput('severity_name_1'), + CSettingsHelper::SEVERITY_COLOR_1 => $this->getInput('severity_color_1'), + CSettingsHelper::SEVERITY_NAME_2 => $this->getInput('severity_name_2'), + CSettingsHelper::SEVERITY_COLOR_2 => $this->getInput('severity_color_2'), + CSettingsHelper::SEVERITY_NAME_3 => $this->getInput('severity_name_3'), + CSettingsHelper::SEVERITY_COLOR_3 => $this->getInput('severity_color_3'), + CSettingsHelper::SEVERITY_NAME_4 => $this->getInput('severity_name_4'), + CSettingsHelper::SEVERITY_COLOR_4 => $this->getInput('severity_color_4'), + CSettingsHelper::SEVERITY_NAME_5 => $this->getInput('severity_name_5'), + CSettingsHelper::SEVERITY_COLOR_5 => $this->getInput('severity_color_5') ]; if ($settings[CSettingsHelper::CUSTOM_COLOR] == EVENT_CUSTOM_COLOR_ENABLED) { $settings[CSettingsHelper::PROBLEM_UNACK_COLOR] = $this->getInput('problem_unack_color'); - $settings[CSettingsHelper::PROBLEM_ACK_COLOR] = $this->getInput('problem_ack_color'); - $settings[CSettingsHelper::OK_UNACK_COLOR] = $this->getInput('ok_unack_color'); - $settings[CSettingsHelper::OK_ACK_COLOR] = $this->getInput('ok_ack_color'); + $settings[CSettingsHelper::PROBLEM_ACK_COLOR] = $this->getInput('problem_ack_color'); + $settings[CSettingsHelper::OK_UNACK_COLOR] = $this->getInput('ok_unack_color'); + $settings[CSettingsHelper::OK_ACK_COLOR] = $this->getInput('ok_ack_color'); } $result = API::Settings()->update($settings); diff --git a/ui/app/views/administration.miscconfig.edit.php b/ui/app/views/administration.miscconfig.edit.php index 8b5048ef7a8..bfaf5af4e4a 100644 --- a/ui/app/views/administration.miscconfig.edit.php +++ b/ui/app/views/administration.miscconfig.edit.php @@ -50,7 +50,7 @@ $from_list = (new CFormList()) 'dstfrm' => 'otherForm', 'dstfld1' => 'discovery_groupid', 'normal_only' => '1', - 'editable' => true, + 'editable' => true ] ] ]))->setWidth(ZBX_TEXTAREA_MEDIUM_WIDTH) diff --git a/ui/app/views/js/administration.trigdisplay.edit.js.php b/ui/app/views/js/administration.trigdisplay.edit.js.php index 42b6b89917a..44af9adee09 100644 --- a/ui/app/views/js/administration.trigdisplay.edit.js.php +++ b/ui/app/views/js/administration.trigdisplay.edit.js.php @@ -27,19 +27,19 @@ $schema = DB::getSchema('config'); ?> <script type="text/javascript"> - jQuery(document).ready(function() { - jQuery("input[name=custom_color]").on('change', function() { - var checked = jQuery(this).is(':checked'); - jQuery(".js-event-color-picker").each(function() { - var $field = jQuery(this); + $(document).ready(function() { + $("input[name=custom_color]").on('change', function() { + var checked = $(this).is(':checked'); + $(".js-event-color-picker").each(function() { + var $field = $(this); $field.toggleClass('<?= ZBX_STYLE_DISABLED ?>', !checked); - jQuery("input", $field).prop('disabled', !checked); + $("input", $field).prop('disabled', !checked); }); }); - jQuery("#resetDefaults").click(function() { + $("#resetDefaults").click(function() { overlayDialogue({ 'title': <?= json_encode(_('Reset confirmation')) ?>, - 'content': jQuery('<span>').text(<?= json_encode(_('Reset all fields to default values?')) ?>), + 'content': $('<span>').text(<?= json_encode(_('Reset all fields to default values?')) ?>), 'buttons': [ { 'title': <?= json_encode(_('Cancel')) ?>, @@ -57,48 +57,48 @@ $schema = DB::getSchema('config'); : 'false' ?>; - jQuery('#custom_color') + $('#custom_color') .prop('checked', custom_color_enabled) - .trigger('change'); + .change(); // Unacknowledged problem events - jQuery('#problem_unack_color') + $('#problem_unack_color') .val("<?= $schema['fields']['problem_unack_color']['default'] ?>") .prop('disabled', !custom_color_enabled) - .trigger('change'); - jQuery('#problem_unack_style').prop('checked', + .change(); + $('#problem_unack_style').prop('checked', <?= ($schema['fields']['problem_unack_style']['default'] == 0) ? 'false' : 'true' ?> ); // Acknowledged problem events - jQuery('#problem_ack_color') + $('#problem_ack_color') .val("<?= $schema['fields']['problem_ack_color']['default'] ?>") .prop('disabled', !custom_color_enabled) - .trigger('change'); - jQuery('#problem_ack_style').prop('checked', + .change(); + $('#problem_ack_style').prop('checked', <?= ($schema['fields']['problem_ack_style']['default'] == 0) ? 'false' : 'true' ?> ); // Unacknowledged resolved events - jQuery('#ok_unack_color') + $('#ok_unack_color') .val("<?= $schema['fields']['ok_unack_color']['default'] ?>") .prop('disabled', !custom_color_enabled) - .trigger('change'); - jQuery('#ok_unack_style').prop('checked', + .change(); + $('#ok_unack_style').prop('checked', <?= ($schema['fields']['ok_unack_style']['default'] == 0) ? 'false' : 'true' ?> ); // Acknowledged resolved events - jQuery('#ok_ack_color') + $('#ok_ack_color') .val("<?= $schema['fields']['ok_ack_color']['default'] ?>") .prop('disabled', !custom_color_enabled) - .trigger('change'); - jQuery('#ok_ack_style').prop('checked', + .change(); + $('#ok_ack_style').prop('checked', <?= ($schema['fields']['ok_ack_style']['default'] == 0) ? 'false' : 'true' ?> ); - jQuery('#ok_period').val("<?= $schema['fields']['ok_period']['default'] ?>"); - jQuery('#blink_period').val("<?= $schema['fields']['blink_period']['default'] ?>"); + $('#ok_period').val("<?= $schema['fields']['ok_period']['default'] ?>"); + $('#blink_period').val("<?= $schema['fields']['blink_period']['default'] ?>"); $('#severity_name_0').val("<?= $schema['fields']['severity_name_0']['default'] ?>"); $('#severity_name_1').val("<?= $schema['fields']['severity_name_1']['default'] ?>"); diff --git a/ui/app/views/layout.htmlpage.php b/ui/app/views/layout.htmlpage.php index 09aedf97052..79c57a2bf5f 100644 --- a/ui/app/views/layout.htmlpage.php +++ b/ui/app/views/layout.htmlpage.php @@ -28,13 +28,14 @@ function local_showHeader(array $data): void { header('X-Content-Type-Options: nosniff'); header('X-XSS-Protection: 1; mode=block'); - if (X_FRAME_OPTIONS !== null) { - if (strcasecmp(X_FRAME_OPTIONS, 'SAMEORIGIN') == 0 || strcasecmp(X_FRAME_OPTIONS, 'DENY') == 0) { - $x_frame_options = X_FRAME_OPTIONS; + if (CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS) !== '') { + if (strcasecmp(CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS), 'SAMEORIGIN') == 0 + || strcasecmp(CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS), 'DENY') == 0) { + $x_frame_options = CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS); } else { $x_frame_options = 'SAMEORIGIN'; - $allowed_urls = explode(',', X_FRAME_OPTIONS); + $allowed_urls = explode(',', CSettingsHelper::get(CSettingsHelper::X_FRAME_OPTIONS)); $url_to_check = array_key_exists('HTTP_REFERER', $_SERVER) ? parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST) : null; diff --git a/ui/app/views/popup.generic.php b/ui/app/views/popup.generic.php index e8ae48dd655..4a62b5b9d1c 100644 --- a/ui/app/views/popup.generic.php +++ b/ui/app/views/popup.generic.php @@ -243,7 +243,8 @@ switch ($data['popup_type']) { : null; $js_action = "javascript: addValue(".zbx_jsvalue($options['reference']).', '. - zbx_jsvalue($item['usrgrpid']).', '.$options['parentid'].');'; + zbx_jsvalue($item['usrgrpid']).', '.$options['parentid'].');' + ; $name = (new CLink($item['name'], 'javascript: void(0);')) ->setId('spanid'.$item['usrgrpid']) |