diff options
author | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-10-07 17:23:18 +0300 |
---|---|---|
committer | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-10-07 17:23:18 +0300 |
commit | 247b305eae06839c383ec69077c04f1b8d2bf257 (patch) | |
tree | 84c730a200edacb04634e60ef9c45aa38873a3e5 /ui/app/controllers | |
parent | 345acf85f3e564d9cb657993280017146bb75143 (diff) | |
parent | c9b884b8439aaa8a831b4cfba810d9ddfa514e7e (diff) |
.......... [ZBXNEXT-710] merged from latest master; fixed conflicts in:
- ui/include/defines.inc.php
- src/libs/zbxdbupgrade/dbupgrade_5010.c
- create/src/schema.tmpl
Diffstat (limited to 'ui/app/controllers')
-rw-r--r-- | ui/app/controllers/CControllerDashboardView.php | 4 | ||||
-rw-r--r-- | ui/app/controllers/CControllerHost.php | 4 | ||||
-rw-r--r-- | ui/app/controllers/CControllerPopupGeneric.php | 2 | ||||
-rw-r--r-- | ui/app/controllers/CControllerPopupItemTestEdit.php | 6 | ||||
-rw-r--r-- | ui/app/controllers/CControllerPopupItemTestGetValue.php | 6 | ||||
-rw-r--r-- | ui/app/controllers/CControllerPopupItemTestSend.php | 6 | ||||
-rw-r--r-- | ui/app/controllers/CControllerScriptEdit.php | 6 | ||||
-rw-r--r-- | ui/app/controllers/CControllerUsergroupEdit.php | 4 |
8 files changed, 20 insertions, 18 deletions
diff --git a/ui/app/controllers/CControllerDashboardView.php b/ui/app/controllers/CControllerDashboardView.php index b62a3d69abc..963fa4df928 100644 --- a/ui/app/controllers/CControllerDashboardView.php +++ b/ui/app/controllers/CControllerDashboardView.php @@ -127,13 +127,13 @@ class CControllerDashboardView extends CControllerDashboardAbstract { $data['dynamic'] = [ 'has_dynamic_widgets' => true, - 'host' => $hosts + 'host' => $hosts ? $hosts[0] : null ]; } else { $data['dynamic'] = [ 'has_dynamic_widgets' => false, - 'host' => [] + 'host' => null ]; } diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php index 2a72c52ecea..5d4d1e99510 100644 --- a/ui/app/controllers/CControllerHost.php +++ b/ui/app/controllers/CControllerHost.php @@ -106,7 +106,7 @@ abstract class CControllerHost extends CController { * @param string $filter['evaltype'] Filter hosts by tags. * @param string $filter['tags'] Filter hosts by tag names and values. * @param string $filter['severities'] Filter problems on hosts by severities. - * @param string $filter['show_suppressed'] Filter supressed problems. + * @param string $filter['show_suppressed'] Filter suppressed problems. * @param int $filter['maintenance_status'] Filter hosts by maintenance. * @param int $filter['page'] Page number. * @param string $filter['sort'] Sorting field. @@ -153,7 +153,7 @@ abstract class CControllerHost extends CController { // Split result array and create paging. $paging = CPagerHelper::paginate($filter['page'], $hosts, $filter['sortorder'], $view_curl); - // Get additonal data to limited host amount. + // Get additional data to limited host amount. $hosts = API::Host()->get([ 'output' => ['hostid', 'name', 'status', 'maintenance_status', 'maintenanceid', 'maintenance_type', 'available', 'snmp_available', 'jmx_available', 'ipmi_available', 'error', 'ipmi_error', 'snmp_error', diff --git a/ui/app/controllers/CControllerPopupGeneric.php b/ui/app/controllers/CControllerPopupGeneric.php index bc2ce4318fc..09620e23c47 100644 --- a/ui/app/controllers/CControllerPopupGeneric.php +++ b/ui/app/controllers/CControllerPopupGeneric.php @@ -768,7 +768,7 @@ class CControllerPopupGeneric extends CController { $this->group_preselect_required = in_array($this->source_table, self::POPUPS_HAVING_GROUP_FILTER); $this->page_options = $this->getPageOptions(); - // Make control filters. Must be called bedore extending groupids. + // Make control filters. Must be called before extending groupids. $filters = $this->makeFilters(); // Select subgroups. diff --git a/ui/app/controllers/CControllerPopupItemTestEdit.php b/ui/app/controllers/CControllerPopupItemTestEdit.php index f5693a1185d..d0a88187b1b 100644 --- a/ui/app/controllers/CControllerPopupItemTestEdit.php +++ b/ui/app/controllers/CControllerPopupItemTestEdit.php @@ -26,13 +26,13 @@ class CControllerPopupItemTestEdit extends CControllerPopupItemTest { protected function checkInput() { $fields = [ - 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'data' => 'array', 'delay' => 'string', 'get_value' => 'in 0,1', 'headers' => 'array', 'hostid' => 'db hosts.hostid', - 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'http_password' => 'string', 'http_proxy' => 'string', 'http_username' => 'string', @@ -252,7 +252,7 @@ class CControllerPopupItemTestEdit extends CControllerPopupItemTest { } elseif ($usermacros['macros'][$macro_name] === ZBX_SECRET_MASK) { /* - * Macro values were not set by user, so this means form was openened for the first time. So in this + * Macro values were not set by user, so this means form was opened for the first time. So in this * case check if there are secret macros. If there are, clear the values and show warning message box. */ diff --git a/ui/app/controllers/CControllerPopupItemTestGetValue.php b/ui/app/controllers/CControllerPopupItemTestGetValue.php index 50aa35cdcee..c24029cb7ea 100644 --- a/ui/app/controllers/CControllerPopupItemTestGetValue.php +++ b/ui/app/controllers/CControllerPopupItemTestGetValue.php @@ -26,11 +26,11 @@ class CControllerPopupItemTestGetValue extends CControllerPopupItemTest { protected function checkInput() { $fields = [ - 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'headers' => 'array', 'hostid' => 'db hosts.hostid', 'proxy_hostid' => 'id', - 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'http_password' => 'string', 'http_proxy' => 'string', 'http_username' => 'string', @@ -146,7 +146,7 @@ class CControllerPopupItemTestGetValue extends CControllerPopupItemTest { // Get post data for particular item type. $data = $this->getItemTestProperties($this->getInputAll()); - // Apply efective macros values to properties. + // Apply effective macros values to properties. $data = $this->resolveItemPropertyMacros($data); if ($this->item_type != ITEM_TYPE_AGGREGATE && $this->item_type != ITEM_TYPE_CALCULATED) { diff --git a/ui/app/controllers/CControllerPopupItemTestSend.php b/ui/app/controllers/CControllerPopupItemTestSend.php index c5fe751a2ce..3954801e26d 100644 --- a/ui/app/controllers/CControllerPopupItemTestSend.php +++ b/ui/app/controllers/CControllerPopupItemTestSend.php @@ -54,13 +54,13 @@ class CControllerPopupItemTestSend extends CControllerPopupItemTest { protected function checkInput() { $fields = [ - 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'get_value' => 'in 0,1', 'eol' => 'in '.implode(',', [ZBX_EOL_LF, ZBX_EOL_CRLF]), 'headers' => 'array', 'proxy_hostid' => 'id', 'hostid' => 'db hosts.hostid', - 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), + 'http_authtype' => 'in '.implode(',', [HTTPTEST_AUTH_NONE, HTTPTEST_AUTH_BASIC, HTTPTEST_AUTH_NTLM, HTTPTEST_AUTH_KERBEROS, HTTPTEST_AUTH_DIGEST, ITEM_AUTHTYPE_PASSWORD, ITEM_AUTHTYPE_PUBLICKEY]), 'http_password' => 'string', 'http_proxy' => 'string', 'http_username' => 'string', @@ -262,7 +262,7 @@ class CControllerPopupItemTestSend extends CControllerPopupItemTest { // Get post data for particular item type. $item_test_data = $this->getItemTestProperties($this->getInputAll()); - // Apply efective macros values to properties. + // Apply effective macros values to properties. $item_test_data = $this->resolveItemPropertyMacros($item_test_data); // Rename fields according protocol. diff --git a/ui/app/controllers/CControllerScriptEdit.php b/ui/app/controllers/CControllerScriptEdit.php index 5f3ceebfd0a..197fbe0a24f 100644 --- a/ui/app/controllers/CControllerScriptEdit.php +++ b/ui/app/controllers/CControllerScriptEdit.php @@ -148,8 +148,10 @@ class CControllerScriptEdit extends CController { $usergroups = API::UserGroup()->get([ 'output' => ['usrgrpid', 'name'] ]); - order_result($usergroups, 'name'); - $data['usergroups'] = $usergroups; + + CArrayHelper::sort($usergroups, ['name']); + + $data['usergroups'] = array_column($usergroups, 'name', 'usrgrpid'); $response = new CControllerResponseData($data); $response->setTitle(_('Configuration of scripts')); diff --git a/ui/app/controllers/CControllerUsergroupEdit.php b/ui/app/controllers/CControllerUsergroupEdit.php index 35cc9599b30..9ad870e4c25 100644 --- a/ui/app/controllers/CControllerUsergroupEdit.php +++ b/ui/app/controllers/CControllerUsergroupEdit.php @@ -156,7 +156,7 @@ class CControllerUsergroupEdit extends CController { } /** - * Returs all needed host groups formatted for multiselector. + * Returns all needed host groups formatted for multiselector. * * @param array $groupids * @@ -178,7 +178,7 @@ class CControllerUsergroupEdit extends CController { } /** - * Returs all needed user formatted for multiselector. + * Returns all needed user formatted for multiselector. * * @return array */ |