$eventsComboBox = new CComboBox('show_events', $filter['showEvents'], null, array(EVENTS_OPTION_NOEVENT => _('Hide all'), EVENTS_OPTION_ALL => _n('Show all (%1$s day)', 'Show all (%1$s days)', $config['event_expire']))); if ($config['event_ack_enable']) { $eventsComboBox->addItem(EVENTS_OPTION_NOT_ACK, _n('Show unacknowledged (%1$s day)', 'Show unacknowledged (%1$s days)', $config['event_expire'])); } $filterForm->addRow(_('Events'), $eventsComboBox); } // min severity $filterForm->addRow(_('Minimum trigger severity'), new CComboBox('show_severity', $filter['showSeverity'], null, array(TRIGGER_SEVERITY_NOT_CLASSIFIED => getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), TRIGGER_SEVERITY_INFORMATION => getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), TRIGGER_SEVERITY_WARNING => getSeverityCaption(TRIGGER_SEVERITY_WARNING), TRIGGER_SEVERITY_AVERAGE => getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), TRIGGER_SEVERITY_HIGH => getSeverityCaption(TRIGGER_SEVERITY_HIGH), TRIGGER_SEVERITY_DISASTER => getSeverityCaption(TRIGGER_SEVERITY_DISASTER)))); // age less than $statusChangeDays = new CNumericBox('status_change_days', $filter['statusChangeDays'], 3, false, false, false); if (!$filter['statusChange']) { $statusChangeDays->setAttribute('disabled', 'disabled'); } $statusChangeDays->addStyle('vertical-align: middle;'); $statusChangeCheckBox = new CCheckBox('status_change', $filter['statusChange'], 'javascript: this.checked ? $("status_change_days").enable() : $("status_change_days").disable()', 1); $statusChangeCheckBox->addStyle('vertical-align: middle;'); $daysSpan = new CSpan(_('days')); $daysSpan->addStyle('vertical-align: middle;'); $filterForm->addRow(_('Age less than'), array($statusChangeCheckBox, $statusChangeDays, SPACE, $daysSpan)); // name $filterForm->addRow(_('Filter by name'), new CTextBox('txt_select', $filter['txtSelect'], 40)); // application $filterForm->addRow(_('Filter by application'), array(new CTextBox('application', $filter['application'], 40), new CButton('application_name', _('Select'), 'return PopUp("popup.php?srctbl=applications&srcfld1=name&real_hosts=1&dstfld1=application&with_applications=1' . '&dstfrm=' . $filterForm->getName() . '");', 'filter-button'))); // inventory filter $inventoryFilters = $filter['inventory']; if (!$inventoryFilters) { $inventoryFilters = array(array('field' => '', 'value' => '')); } $inventoryFields = array(); foreach (getHostInventories() as $inventory) { $inventoryFields[$inventory['db_field']] = $inventory['title'];
if ($config['event_ack_enable']) { $ev_select->addItem(EVENTS_OPTION_NOT_ACK, S_SHOW_UNACKNOWLEDGED . SPACE . '(' . $config['event_expire'] . SPACE . ($config['event_expire'] > 1 ? S_DAYS : S_DAY) . ')'); } $filterForm->addRow(S_EVENTS, $ev_select); $severity_select = new CComboBox('show_severity', $show_severity); $cb_items = array(-1 => S_ALL_S, TRIGGER_SEVERITY_NOT_CLASSIFIED => S_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION => S_INFORMATION, TRIGGER_SEVERITY_WARNING => S_WARNING, TRIGGER_SEVERITY_AVERAGE => S_AVERAGE, TRIGGER_SEVERITY_HIGH => S_HIGH, TRIGGER_SEVERITY_DISASTER => S_DISASTER); $severity_select->addItems($cb_items); $filterForm->addRow(S_MIN_SEVERITY, $severity_select); $action = 'javascrip: this.checked ? $("status_change_days").enable() : $("status_change_days").disable()'; $sts_change_days_cb = new CNumericBox('status_change_days', $_REQUEST['status_change_days'], 4); if (!$_REQUEST['status_change']) { $sts_change_days_cb->setAttribute('disabled', 'disabled'); } $sts_change_days_cb->addStyle('vertical-align: middle;'); $cbd = new CCheckBox('status_change', $_REQUEST['status_change'], $action, 1); $cbd->addStyle('vertical-align: middle;'); $spand = new CSpan(S_DAYS_SMALL); $spand->addStyle('vertical-align: middle;'); $filterForm->addRow(S_AGE_LESS_THAN, array($cbd, $sts_change_days_cb, $spand)); $filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1)); $filterForm->addRow(S_FILTER_BY_NAME, new CTextBox('txt_select', $_REQUEST['txt_select'], 40)); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow(new CButton('filter_rst', S_RESET)); $trigg_wdgt->addFlicker($filterForm, CProfile::get('web.tr_status.filter.state', 0)); /*************** FILTER END ******************/ if ($_REQUEST['fullscreen']) { $triggerInfo = new CTriggersInfo($_REQUEST['groupid'], $_REQUEST['hostid']); $triggerInfo->HideHeader(); $triggerInfo->show(); } $m_form = new CForm('acknow.php');
} else { $enabled = true; } $hostInventoryFieldComboBox->addItem($fieldNo, $fieldInfo['title'], $this->data['inventory_link'] == $fieldNo && $enabled ? 'yes' : null, $enabled ? 'yes' : 'no'); } $itemFormList->addRow(_('Populates host inventory field'), $hostInventoryFieldComboBox, false, 'row_inventory_link'); } } // append description to form list $description = new CTextArea('description', $this->data['description']); $description->addStyle('margin-top: 5px;'); $itemFormList->addRow(_('Description'), $description); // status if (isset($this->data['is_item_prototype'])) { $enabledCheckBox = new CCheckBox('status', !$this->data['status'], null, ITEM_STATUS_ACTIVE); $enabledCheckBox->addStyle('vertical-align: middle;'); $itemFormList->addRow(_('Enabled'), $enabledCheckBox); } else { $statusComboBox = new CComboBox('status', $this->data['status']); $statusComboBox->addItems(item_status2str()); $itemFormList->addRow(_('Status'), $statusComboBox); } // append tabs to form $itemTab = new CTabView(); $itemTab->addTab('itemTab', $this->data['caption'], $itemFormList); $itemForm->addItem($itemTab); // append buttons to form $buttons = array(); if (!empty($this->data['itemid'])) { array_push($buttons, new CSubmit('clone', _('Clone'))); if (!$this->data['is_template'] && !empty($this->data['itemid']) && empty($this->data['parent_discoveryid']) && !$this->data['is_discovery_rule']) {