[ZBX-6693] get_viewed_groups() and get_viewed_hosts() functions are a duplicate of API calls and should be removed Created: 2013 Jun 12  Updated: 2017 May 30  Resolved: 2013 Jun 26

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 2.1.0
Fix Version/s: 2.1.0

Type: Incident report Priority: Minor
Reporter: Alexander Vladishev Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: codequality
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The functions are used in three places:

frontends/php/include/views/monitoring.screen.php
frontends/php/report2.php
frontends/php/slides.php



 Comments   
Comment by Eduards Samersovs (Inactive) [ 2013 Jun 13 ]

Removed also validate_group_with_host()

Comment by Eduards Samersovs (Inactive) [ 2013 Jun 13 ]

Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-6693

Comment by Toms (Inactive) [ 2013 Jun 13 ]

(1) Regarding _initHosts() in class.cpagefilter.php

  • $defaultOptions is more appropriate than $optionsDefault;
  • it is not OK to mix API call options with page filter option, this applies to $options['only_templates'];
  • it is better to perform "isset($options['only_templates'])" only once and use classical "if" statement;

Eduards RESOLVED r.36361

P.S. Decided not to use pageFilter in inventories report filter so all changes in pageFilter is reverted.

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(2) Monitoring > Screens group and hosts filters works incorrectly when dynamic items present in screen. For example, we have screen with dynamic simple graph, we should see only those groups and hosts in which there is item for simple graph. After fix we see all groups and hosts.

Eduards RESOLVED r.36369

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(3) For host dropdown first item should be "Default" instead of "All". Applies both screens and slides.

Eduards RESOLVED r.36369

tomtom REOPENED Not fixed.

Eduards RESOLVED r.36537. Sorry I incorrectly reverted the changes in pageFilter.

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(4)

  $tmp = $_REQUEST['filter_timesince'];
  $_REQUEST['filter_timesince'] = $_REQUEST['filter_timetill'];
  $_REQUEST['filter_timetill'] = $tmp;

change to

  $_REQUEST['filter_timesince'] = $_REQUEST['filter_timetill'];
  $_REQUEST['filter_timetill'] = $_REQUEST['filter_timesince'];

This is wrong.

Eduards RESOLVED r.36361

tomtom REOPENED

If we change this then zbx_swap() should be used;

Eduards RESOLVED r.36537

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(5) report2.php line:180

$hosts = API::Host()->get(array(
  'templateids' => $_REQUEST['hostid']
));

this was fitting in one line

Eduards RESOLVED r.36361

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(6) regarding removal of get_report2_filter(), I think this is not a good idea to remove function by moving its code inline.

Eduards This function is redundant because: a) it's used only in report2.php and cannot be used in other places because it is too specific. b) we do not split filter code in other place (items is exception because filter is very big).

tomtom OK, CLOSED

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(7) in Report > Availability report filter in "By Host" mode, when choosing some hostgroup only one host appears in host dropdown.

Eduards RESOLVED r.36400

tomtom REOPENED Not resolved.

Eduards Filter work same as trunk. Host combobox is dependent from hostgroup combobox.. or a problem is in other place?

tomtom CLOSED Looks like before we could choose hosts without triggers but containing items. Now only hosts with triggers will be available.

Comment by Toms (Inactive) [ 2013 Jun 14 ]

(8) "filter_groupid" was more appropriate than just "groupid" in report2.php, same applies for "filter_hostid".

Eduards RESOLVED r.36382

tomtom CLOSED

Comment by Alexander Vladishev [ 2013 Jun 14 ]

(9) Error on "Monitoring"->"Latest data" page:

Action (Host) does not exist
Invalid argument supplied for foreach() [latest.php:146 → CPageFilter->__construct() → CPageFilter->_initHosts() in branches/dev/ZBX-6693/frontends/php/include/classes/class.cpagefilter.php:506]

Eduards RESOLVED r.36369 When task is in progress state it's is not ready for testing

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 25 ]

(10) in report2.php following scenario:
In filter select hostgroup
select particular host
change to hostgroup to which this host doesn't belong
host dropdown is setted to "all"
no triggers are displayed, all triggers for hostgroup should be displayed

mode: "By Host"

Eduards RESOLVED r.36537

tomtom CLOSED

Comment by Toms (Inactive) [ 2013 Jun 26 ]

TESTED

Comment by Eduards Samersovs (Inactive) [ 2013 Jun 26 ]

Fixed in versions pre-2.1.0 (beta) r.36546

Generated at Thu Apr 25 00:35:38 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.