// name $column1->addRow(_('Filter by name'), (new CTextBox('txt_select', $filter['txtSelect']))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH)); $application_name_url = 'popup.php?srctbl=applications&srcfld1=name&real_hosts=1&dstfld1=application&with_applications=1&dstfrm=zbx_filter'; // application $column2 = (new CFormList())->addRow(_('Filter by application'), [(new CTextBox('application', $filter['application']))->setWidth(ZBX_TEXTAREA_FILTER_STANDARD_WIDTH), (new CDiv())->addClass(ZBX_STYLE_FORM_INPUT_MARGIN), (new CButton('application_name', _('Select')))->addClass(ZBX_STYLE_BTN_GREY)->onClick('return PopUp("' . $application_name_url . '");')]); // inventory filter $inventoryFilters = $filter['inventory']; if (!$inventoryFilters) { $inventoryFilters = [['field' => '', 'value' => '']]; } $inventoryFields = []; foreach (getHostInventories() as $inventory) { $inventoryFields[$inventory['db_field']] = $inventory['title']; } $inventoryFilterTable = new CTable(); $inventoryFilterTable->setId('inventory-filter'); $i = 0; foreach ($inventoryFilters as $field) { $inventoryFilterTable->addRow([new CComboBox('inventory[' . $i . '][field]', $field['field'], null, $inventoryFields), (new CTextBox('inventory[' . $i . '][value]', $field['value']))->setWidth(ZBX_TEXTAREA_FILTER_SMALL_WIDTH), (new CCol((new CButton('inventory[' . $i . '][remove]', _('Remove')))->addClass(ZBX_STYLE_BTN_LINK)->addClass('element-table-remove')))->addClass(ZBX_STYLE_NOWRAP)], 'form_row'); $i++; } $inventoryFilterTable->addRow((new CCol((new CButton('inventory_add', _('Add')))->addClass(ZBX_STYLE_BTN_LINK)->addClass('element-table-add')))->setColSpan(2)); $column2->addRow(_('Filter by host inventory'), $inventoryFilterTable); // maintenance filter $column2->addRow(_('Show hosts in maintenance'), (new CCheckBox('show_maintenance'))->setChecked($filter['showMaintenance'] == 1)); // show details if (!$overview) { $column2->addRow(_('Show details'), (new CCheckBox('show_details'))->setChecked($filter['showDetails'] == 1)); } $filterForm->addColumn($column1); $filterForm->addColumn($column2);