diff options
author | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-08-02 14:18:51 +0300 |
---|---|---|
committer | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-08-02 14:18:51 +0300 |
commit | e30c15c716487d71f8329ddd2eb48ec8535c770b (patch) | |
tree | 12bfdaabca855fdef371553fdacc10834b751925 | |
parent | f5d80303bc8ae5489920f8ad63a47592eb7b3515 (diff) |
..F....... [ZBXNEXT-710] fixed url for unsaved filter when sorting or changing result page
-rw-r--r-- | ui/app/controllers/CControllerHost.php | 2 | ||||
-rw-r--r-- | ui/app/controllers/CControllerHostViewRefresh.php | 6 | ||||
-rw-r--r-- | ui/include/classes/services/CTabFilterProfile.php | 10 |
3 files changed, 13 insertions, 5 deletions
diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php index cfec8b61cfd..f135594b070 100644 --- a/ui/app/controllers/CControllerHost.php +++ b/ui/app/controllers/CControllerHost.php @@ -217,7 +217,7 @@ abstract class CControllerHost extends CController { // Sort for paging so we know which IDs go to which page. CArrayHelper::sort($hosts, [['field' => $filter['sort'], 'order' => $filter['sortorder']]]); - $view_curl = (new CUrl('zabbix.php'))->setArgument('action', 'host.view'); + $view_curl = (new CUrl())->setArgument('action', 'host.view'); // Split result array and create paging. $paging = CPagerHelper::paginate($filter['page'], $hosts, $filter['sortorder'], $view_curl); diff --git a/ui/app/controllers/CControllerHostViewRefresh.php b/ui/app/controllers/CControllerHostViewRefresh.php index f4894196386..70582d46f99 100644 --- a/ui/app/controllers/CControllerHostViewRefresh.php +++ b/ui/app/controllers/CControllerHostViewRefresh.php @@ -108,9 +108,13 @@ class CControllerHostViewRefresh extends CControllerHost { }); $prepared_data = $this->getData($filter); + $view_url = (new CUrl()) + ->setArgument('action', 'host.view') + ->removeArgument('page'); + $data = [ 'filter' => $filter, - 'view_curl' => (new CUrl('zabbix.php'))->setArgument('action', 'host.view'), + 'view_curl' => $view_url, 'sort' => $filter['sort'], 'sortorder' => $filter['sortorder'] ] + $prepared_data; diff --git a/ui/include/classes/services/CTabFilterProfile.php b/ui/include/classes/services/CTabFilterProfile.php index 6461ae49230..0c2559cd661 100644 --- a/ui/include/classes/services/CTabFilterProfile.php +++ b/ui/include/classes/services/CTabFilterProfile.php @@ -144,9 +144,13 @@ class CTabFilterProfile { $this->selected = count($this->tabfilters); $this->tabfilters[] = $this->createFilterTab($input); } - elseif ($this->selected != $name_index) { - $this->selected = $name_index; - $this->update(); + else { + if ($this->selected != $name_index) { + $this->selected = $name_index; + $this->update(); + } + + $this->tabfilters[$name_index] = $input + $this->filter_defaults; } } |