$createForm->addVar('eventsource', $this->data['eventsource']); $createForm->addItem(new CSubmit('form', _('Create action'))); $actionWidget->addPageHeader(_('CONFIGURATION OF ACTIONS'), $createForm); // create widget header $sourceComboBox = new CComboBox('eventsource', $this->data['eventsource'], 'submit()'); $sourceComboBox->addItem(EVENT_SOURCE_TRIGGERS, _('Triggers')); $sourceComboBox->addItem(EVENT_SOURCE_DISCOVERY, _('Discovery')); $sourceComboBox->addItem(EVENT_SOURCE_AUTO_REGISTRATION, _('Auto registration')); $sourceComboBox->addItem(EVENT_SOURCE_INTERNAL, _x('Internal', 'event source')); $filterForm = new CForm('get'); $filterForm->addItem(array(_('Event source'), SPACE, $sourceComboBox)); $actionWidget->addHeader(_('Actions'), $filterForm); $actionWidget->addHeaderRowNumber(); // create form $actionForm = new CForm(); $actionForm->setName('actionForm'); // create table $actionTable = new CTableInfo(_('No actions found.')); $actionTable->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $actionForm->getName() . "', 'all_items', 'g_actionid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Conditions'), _('Operations'), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder']))); foreach ($this->data['actions'] as $action) { $conditions = array(); order_result($action['filter']['conditions'], 'conditiontype', ZBX_SORT_DOWN); foreach ($action['filter']['conditions'] as $condition) { $conditions[] = get_condition_desc($condition['conditiontype'], $condition['operator'], $condition['value']); $conditions[] = BR(); } sortOperations($this->data['eventsource'], $action['operations']); $operations = array(); foreach ($action['operations'] as $operation) { $operations[] = get_operation_descr(SHORT_DESCRIPTION, $operation); }
// append host summary to widget header if (!empty($this->data['hostid'])) { if (!empty($this->data['parent_discoveryid'])) { $triggersWidget->addItem(get_header_host_table('triggers', $this->data['hostid'], $this->data['parent_discoveryid'])); } else { $triggersWidget->addItem(get_header_host_table('triggers', $this->data['hostid'])); } } if (!empty($this->data['parent_discoveryid'])) { $triggersWidget->addPageHeader(_('CONFIGURATION OF TRIGGER PROTOTYPES')); } else { $triggersWidget->addPageHeader(_('CONFIGURATION OF TRIGGERS')); } // create form $triggersForm = new CForm(); $triggersForm->setName('triggersForm'); $triggersForm->addVar('hostid', $this->data['hostid']); $triggersForm->addVar('action', $this->data['action']); if ($this->data['parent_discoveryid']) { $triggersForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); } foreach ($this->data['g_triggerid'] as $triggerid) { $triggersForm->addVar('g_triggerid[' . $triggerid . ']', $triggerid); } // create form list $triggersFormList = new CFormList('triggersFormList'); // append severity to form list $severityDiv = new CSeverity(array('id' => 'priority_div', 'name' => 'priority', 'value' => $this->data['priority'])); $triggersFormList->addRow(array(_('Severity'), SPACE, new CVisibilityBox('visible[priority]', isset($this->data['visible']['priority']), 'priority_div', _('Original'))), $severityDiv); // append dependencies to form list if (empty($this->data['parent_discoveryid'])) {
** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $mediaTypeWidget = new CWidget(); // create new media type button $createForm = new CForm('get'); $createForm->addItem(new CSubmit('form', _('Create media type'))); $mediaTypeWidget->addPageHeader(_('CONFIGURATION OF MEDIA TYPES'), $createForm); $mediaTypeWidget->addHeader(_('Media types')); $mediaTypeWidget->addHeaderRowNumber(); // create form $mediaTypeForm = new CForm(); $mediaTypeForm->setName('mediaTypesForm'); // create table $mediaTypeTable = new CTableInfo(_('No media types found.')); $mediaTypeTable->setHeader(array(new CCheckBox('all_media_types', null, "checkAll('" . $mediaTypeForm->getName() . "', 'all_media_types', 'mediatypeids');"), $this->data['displayNodes'] ? _('Node') : null, make_sorting_header(_('Name'), 'description'), make_sorting_header(_('Type'), 'type'), _('Status'), _('Used in actions'), _('Details'))); foreach ($this->data['mediatypes'] as $mediaType) { switch ($mediaType['typeid']) { case MEDIA_TYPE_EMAIL: $details = _('SMTP server') . NAME_DELIMITER . '"' . $mediaType['smtp_server'] . '", ' . _('SMTP helo') . NAME_DELIMITER . '"' . $mediaType['smtp_helo'] . '", ' . _('SMTP email') . NAME_DELIMITER . '"' . $mediaType['smtp_email'] . '"'; break; case MEDIA_TYPE_EXEC: $details = _('Script name') . NAME_DELIMITER . '"' . $mediaType['exec_path'] . '"'; break; case MEDIA_TYPE_SMS: $details = _('GSM modem') . NAME_DELIMITER . '"' . $mediaType['gsm_modem'] . '"'; break; case MEDIA_TYPE_JABBER:
** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $proxyWidget = new CWidget(); $proxyWidget->addPageHeader(_('CONFIGURATION OF PROXIES')); // create form $proxyForm = new CForm(); $proxyForm->setName('proxyForm'); $proxyForm->addVar('form', $this->data['form']); $proxyForm->addVar('form_refresh', $this->data['form_refresh']); if (!empty($this->data['proxyid'])) { $proxyForm->addVar('proxyid', $this->data['proxyid']); } // create form list $proxyFormList = new CFormList('proxyFormList'); $nameTextBox = new CTextBox('host', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, 'no', 64); $nameTextBox->attr('autofocus', 'autofocus'); $proxyFormList->addRow(_('Proxy name'), $nameTextBox); // append status to form list $statusBox = new CComboBox('status', $this->data['status'], 'submit()'); $statusBox->addItem(HOST_STATUS_PROXY_ACTIVE, _('Active')); $statusBox->addItem(HOST_STATUS_PROXY_PASSIVE, _('Passive')); $proxyFormList->addRow(_('Proxy mode'), $statusBox);
** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $discoveryWidget = new CWidget(); // create new discovery rule button $createForm = new CForm('get'); $createForm->cleanItems(); $createForm->addItem(new CSubmit('form', _('Create discovery rule'))); $discoveryWidget->addPageHeader(_('CONFIGURATION OF DISCOVERY RULES'), $createForm); $discoveryWidget->addHeader(_('Discovery rules')); $discoveryWidget->addHeaderRowNumber(); // create form $discoveryForm = new CForm(); $discoveryForm->setName('druleForm'); // create table $discoveryTable = new CTableInfo(_('No discovery rules found.')); $discoveryTable->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $discoveryForm->getName() . "', 'all_drules', 'g_druleid');"), make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('IP range'), _('Delay'), _('Checks'), _('Status'))); foreach ($data['drules'] as $drule) { array_push($drule['description'], new CLink($drule['name'], '?form=update&druleid=' . $drule['druleid'])); $status = new CCol(new CLink(discovery_status2str($drule['status']), '?g_druleid[]=' . $drule['druleid'] . '&action=' . ($drule['status'] == DRULE_STATUS_ACTIVE ? 'drule.massdisable' : 'drule.massenable'), discovery_status2style($drule['status']))); $discoveryTable->addRow(array(new CCheckBox('g_druleid[' . $drule['druleid'] . ']', null, null, $drule['druleid']), $drule['description'], $drule['iprange'], $drule['delay'], !empty($drule['checks']) ? implode(', ', $drule['checks']) : '', $status)); } // create go buttons $goComboBox = new CComboBox('action'); $goOption = new CComboItem('drule.massenable', _('Enable selected')); $goOption->setAttribute('confirm', _('Enable selected discovery rules?')); $goComboBox->addItem($goOption); $goOption = new CComboItem('drule.massdisable', _('Disable selected')); $goOption->setAttribute('confirm', _('Disable selected discovery rules?'));
** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/js/configuration.action.edit.js.php'; $actionWidget = new CWidget(null, 'action-edit'); $actionWidget->addPageHeader(_('CONFIGURATION OF ACTIONS')); // create form $actionForm = new CForm(); $actionForm->setName('action.edit'); $actionForm->addVar('form', $this->data['form']); $actionForm->addVar('form_refresh', $this->data['form_refresh']); $actionForm->addVar('eventsource', $this->data['eventsource']); if (!empty($this->data['actionid'])) { $actionForm->addVar('actionid', $this->data['actionid']); } /* * Action tab */ $actionFormList = new CFormList('actionlist'); $nameTextBox = new CTextBox('name', $this->data['action']['name'], ZBX_TEXTBOX_STANDARD_SIZE); $nameTextBox->attr('autofocus', 'autofocus'); $actionFormList->addRow(_('Name'), $nameTextBox); $actionFormList->addRow(_('Default subject'), new CTextBox('def_shortdata', $this->data['action']['def_shortdata'], ZBX_TEXTBOX_STANDARD_SIZE)); $actionFormList->addRow(_('Default message'), new CTextArea('def_longdata', $this->data['action']['def_longdata']));
<?php /* ** Zabbix ** Copyright (C) 2001-2013 Zabbix SIA ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $scriptWidget = new CWidget(); // create form $scriptForm = new CForm(); $scriptForm->setName('scriptForm'); // append tabs to form $scriptTab = new CTabView(); $scriptTab->addTab('scriptTab', _s('Result of "%s"', $this->data['info']['name']), new CSpan($this->data['message'], 'pre fixedfont')); $scriptForm->addItem($scriptTab); $scriptWidget->addItem($scriptForm); return $scriptWidget;
** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $userGroupWidget = new CWidget(); $userGroupWidget->addPageHeader(_('CONFIGURATION OF USER GROUPS')); // create form $userGroupForm = new CForm(); $userGroupForm->setName('userGroupsForm'); $userGroupForm->addVar('form', $this->data['form']); $userGroupForm->addVar('group_rights', $this->data['group_rights']); if (isset($this->data['usrgrpid'])) { $userGroupForm->addVar('usrgrpid', $this->data['usrgrpid']); } /* * User group tab */ $userGroupFormList = new CFormList('userGroupFormList'); $nameTextBox = new CTextBox('gname', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE); $nameTextBox->attr('autofocus', 'autofocus'); $userGroupFormList->addRow(_('Group name'), $nameTextBox); // append groups to form list $groupsComboBox = new CComboBox('selusrgrp', $this->data['selected_usrgrp'], 'submit()'); $groupsComboBox->addItem(0, _('All'));
** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $discoveryWidget = new CWidget('hat_discovery'); // create header form $discoveryHeaderForm = new CForm('get'); $discoveryHeaderForm->setName('slideHeaderForm'); $discoveryHeaderForm->addVar('fullscreen', $this->data['fullscreen']); $discoveryWidget->addPageHeader(_('STATUS OF DISCOVERY'), get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen']))); $discoveryRulesComboBox = $this->data['pageFilter']->getDiscoveryCB(); $discoveryHeaderForm->addItem(array(_('Discovery rule') . SPACE, $discoveryRulesComboBox)); $discoveryWidget->addHeader(_('Discovery rules'), $discoveryHeaderForm); // create table $discoveryTable = new CTableInfo(_('No discovered devices found.')); $discoveryTable->makeVerticalRotation(); $discoveredDeviceCol = make_sorting_header(_('Discovered device'), 'ip', $this->data['sort'], $this->data['sortorder']); $discoveredDeviceCol->addClass('left'); $header = array($discoveredDeviceCol, new CCol(_('Monitored host'), 'left'), new CCol(array(_('Uptime') . '/', _('Downtime')), 'left')); foreach ($this->data['services'] as $name => $foo) { $header[] = new CCol($name, 'vertical_rotation'); } $discoveryTable->setHeader($header, 'vertical_header');
** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $sysmapWidget = new CWidget(); // create header buttons $createForm = new CForm('get'); $createForm->cleanItems(); $createForm->addItem(new CSubmit('form', _('Create map'))); $createForm->addItem(new CButton('form', _('Import'), 'redirect("conf.import.php?rules_preset=map")')); $sysmapWidget->addPageHeader(_('CONFIGURATION OF NETWORK MAPS'), $createForm); // create form $sysmapForm = new CForm(); $sysmapForm->setName('frm_maps'); $sysmapWidget->addHeader(_('Maps')); $sysmapWidget->addHeaderRowNumber(); // create table $sysmapTable = new CTableInfo(_('No maps found.')); $sysmapTable->setHeader(array(new CCheckBox('all_maps', null, "checkAll('" . $sysmapForm->getName() . "', 'all_maps', 'maps');"), $this->data['displayNodes'] ? _('Node') : null, make_sorting_header(_('Name'), 'name'), make_sorting_header(_('Width'), 'width'), make_sorting_header(_('Height'), 'height'), _('Edit'))); foreach ($this->data['maps'] as $map) { $sysmapTable->addRow(array(new CCheckBox('maps[' . $map['sysmapid'] . ']', null, null, $map['sysmapid']), $this->data['displayNodes'] ? $map['nodename'] : null, new CLink($map['name'], 'sysmap.php?sysmapid=' . $map['sysmapid']), $map['width'], $map['height'], new CLink(_('Edit'), 'sysmaps.php?form=update&sysmapid=' . $map['sysmapid'] . '#form'))); } // create go button $goComboBox = new CComboBox('go'); $goComboBox->addItem('export', _('Export selected')); $goOption = new CComboItem('delete', _('Delete selected')); $goOption->setAttribute('confirm', _('Delete selected maps?')); $goComboBox->addItem($goOption); $goButton = new CSubmit('goButton', _('Go') . ' (0)');
$itemInterfaceType = itemTypeInterface($item['type']); if (!($itemInterfaceType === false || $itemInterfaceType === INTERFACE_TYPE_ANY)) { $locked = 1; break; } } $interfaces[$hinum]['locked'] = $locked; } } $clear_templates = array_intersect($clear_templates, array_keys($original_templates)); $clear_templates = array_diff($clear_templates, array_keys($templateIds)); natcasesort($templateIds); // whether this is a discovered host $isDiscovered = get_request('hostid') && $dbHost['flags'] == ZBX_FLAG_DISCOVERY_CREATED && get_request('form') == 'update'; $frmHost = new CForm(); $frmHost->setName('web.hosts.host.php.'); $frmHost->addVar('form', get_request('form', 1)); $frmHost->addVar('clear_templates', $clear_templates); $hostList = new CFormList('hostlist'); if ($_REQUEST['hostid'] > 0 && get_request('form') != 'clone') { $frmHost->addVar('hostid', $_REQUEST['hostid']); } if ($_REQUEST['groupid'] > 0) { $frmHost->addVar('groupid', $_REQUEST['groupid']); } // LLD rule link if ($isDiscovered) { $hostList->addRow(_('Discovered by'), new CLink($dbHost['discoveryRule']['name'], 'host_prototypes.php?parent_discoveryid=' . $dbHost['discoveryRule']['itemid'], 'highlight underline weight_normal')); } $hostTB = new CTextBox('host', $host, ZBX_TEXTBOX_STANDARD_SIZE, $isDiscovered); $hostTB->setAttribute('maxlength', 64);
** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $hostGroupWidget = new CWidget(); $hostGroupWidget->addPageHeader(_('CONFIGURATION OF HOST GROUPS')); // create form $hostGroupForm = new CForm(); $hostGroupForm->setName('hostgroupForm'); $hostGroupForm->addVar('form', $this->data['form']); if (isset($this->data['groupid'])) { $hostGroupForm->addVar('groupid', $this->data['groupid']); } // create hostgroup form list $hostGroupFormList = new CFormList('hostgroupFormList'); $nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE, $this->data['groupid'] && $this->data['group']['flags'] == ZBX_FLAG_DISCOVERY_CREATED, 64); $nameTextBox->attr('autofocus', 'autofocus'); $hostGroupFormList->addRow(_('Group name'), $nameTextBox); // append groups and hosts to form list $groupsComboBox = new CComboBox('twb_groupid', $this->data['twb_groupid'], 'submit()'); $groupsComboBox->addItem('0', _('All')); foreach ($this->data['db_groups'] as $group) { $groupsComboBox->addItem($group['groupid'], $group['name']); }
$createGraphButton->setEnabled(false); $createForm->addItem($createGraphButton); } $graphWidget->addPageHeader(_('CONFIGURATION OF GRAPHS'), $createForm); $filterForm = new CForm('get'); $filterForm->addItem(array(_('Group') . SPACE, $this->data['pageFilter']->getGroupsCB(true))); $filterForm->addItem(array(SPACE . _('Host') . SPACE, $this->data['pageFilter']->getHostsCB(true))); $graphWidget->addHeader(_('Graphs'), $filterForm); if (!empty($this->data['hostid'])) { $graphWidget->addItem(get_header_host_table('graphs', $this->data['hostid'])); } } $graphWidget->addHeaderRowNumber(); // create form $graphForm = new CForm(); $graphForm->setName('graphForm'); $graphForm->addVar('hostid', $this->data['hostid']); if (!empty($this->data['parent_discoveryid'])) { $graphForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); } // create table $graphTable = new CTableInfo(!empty($this->data['parent_discoveryid']) ? _('No graph prototypes found.') : _('No graphs found.')); $graphTable->setHeader(array(new CCheckBox('all_graphs', null, "checkAll('" . $graphForm->getName() . "', 'all_graphs', 'group_graphid');"), $this->data['displayNodes'] ? _('Node') : null, !empty($this->data['hostid']) ? null : _('Hosts'), make_sorting_header(_('Name'), 'name'), _('Width'), _('Height'), make_sorting_header(_('Graph type'), 'graphtype'))); foreach ($this->data['graphs'] as $graph) { $graphid = $graph['graphid']; $hostList = null; if (empty($this->data['hostid'])) { $hostList = array(); foreach ($graph['hosts'] as $host) { $hostList[$host['name']] = $host['name']; }
$filterTable->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . NAME_DELIMITER), new CTextBox('filter_port', $_REQUEST['filter_port'], 20)))); $filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true); chkbxRange.clearSelectedOnFilterChange();"); $filter->useJQueryStyle('main'); $reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');"); $reset->useJQueryStyle(); $divButtons = new CDiv(array($filter, SPACE, $reset)); $divButtons->setAttribute('style', 'padding: 4px 0;'); $filterTable->addRow(new CCol($divButtons, 'center', 4)); $filterForm = new CForm('get'); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterForm->addItem($filterTable); $hostsWidget->addFlicker($filterForm, CProfile::get('web.hosts.filter.state', 0)); // table hosts $form = new CForm(); $form->setName('hosts'); $table = new CTableInfo(_('No hosts found.')); $table->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $form->getName() . "', 'all_hosts', 'hosts');"), $displayNodes ? _('Node') : null, make_sorting_header(_('Name'), 'name'), _('Applications'), _('Items'), _('Triggers'), _('Graphs'), _('Discovery'), _('Web'), _('Interface'), _('Templates'), make_sorting_header(_('Status'), 'status'), _('Availability'))); // get Hosts $hosts = array(); $sortfield = getPageSortField('name'); $sortorder = getPageSortOrder(); if ($pageFilter->groupsSelected) { $hosts = API::Host()->get(array('groupids' => $pageFilter->groupid > 0 ? $pageFilter->groupid : null, 'editable' => true, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1, 'search' => array('name' => empty($_REQUEST['filter_host']) ? null : $_REQUEST['filter_host'], 'ip' => empty($_REQUEST['filter_ip']) ? null : $_REQUEST['filter_ip'], 'dns' => empty($_REQUEST['filter_dns']) ? null : $_REQUEST['filter_dns']), 'filter' => array('port' => empty($_REQUEST['filter_port']) ? null : $_REQUEST['filter_port']))); } else { $hosts = array(); } // sorting && paging order_result($hosts, $sortfield, $sortorder); $paging = getPagingLine($hosts, array('hostid')); $hosts = API::Host()->get(array('hostids' => zbx_objectValues($hosts, 'hostid'), 'output' => API_OUTPUT_EXTEND, 'selectParentTemplates' => array('hostid', 'name'), 'selectInterfaces' => API_OUTPUT_EXTEND, 'selectItems' => API_OUTPUT_COUNT, 'selectDiscoveries' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectApplications' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'selectDiscoveryRule' => array('itemid', 'name'), 'selectHostDiscovery' => array('ts_delete')));
** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/js/configuration.slideconf.edit.js.php'; $slideWidget = new CWidget(); $slideWidget->addPageHeader(_('CONFIGURATION OF SLIDE SHOWS')); // create form $slideForm = new CForm(); $slideForm->setName('slideForm'); $slideForm->addVar('form', $this->data['form']); $slideForm->addVar('slides', $this->data['slides_without_delay']); if (!empty($this->data['slideshowid'])) { $slideForm->addVar('slideshowid', $this->data['slideshowid']); } // create slide form list $slideFormList = new CFormList('slideFormList'); $slideFormList->addRow(_('Name'), new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE)); $slideFormList->addRow(_('Default delay (in seconds)'), new CNumericBox('delay', $this->data['delay'], 5, 'no', false, false)); // append slide table $slideTable = new CTableInfo(_('No slides defined.'), 'formElementTable'); $slideTable->setAttribute('style', 'min-width: 500px;'); $slideTable->setAttribute('id', 'slideTable'); $slideTable->setHeader(array(new CCol(SPACE, null, null, '15'), new CCol(SPACE, null, null, '15'), new CCol(_('Screen'), null, null, '140'), new CCol(_('Delay'), null, null, '70'), new CCol(_('Action'), null, null, '50'))); $i = 1;
** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ include 'include/views/js/configuration.services.edit.js.php'; $servicesParentWidget = new CWidget(); $servicesParentWidget->addPageHeader(_('IT service parent')); // create form $servicesParentForm = new CForm(); $servicesParentForm->setName('servicesForm'); if (!empty($this->data['service'])) { $servicesParentForm->addVar('serviceid', $this->data['service']['serviceid']); } // create table $servicesParentTable = new CTableInfo(); $servicesParentTable->setHeader(array(_('Service'), _('Status calculation'), _('Trigger'))); $prefix = null; // root $description = new CLink(_('root'), '#', null, 'javascript: jQuery(\'#parent_name\', window.opener.document).val(' . zbx_jsvalue(_('root')) . '); jQuery(\'#parentname\', window.opener.document).val(' . zbx_jsvalue(_('root')) . '); jQuery(\'#parentid\', window.opener.document).val(' . zbx_jsvalue(0) . '); self.close(); return false;'); $servicesParentTable->addRow(array(array($prefix, $description), _('Note'), '-'));
$severityTab->addRow(_('Information'), array($severityNameTB1, SPACE, $severityColorTB1)); $severityNameTB2 = new CTextBox('severity_name_2', $this->data['config']['severity_name_2']); $severityNameTB2->addStyle('width: 15em;'); $severityNameTB2->setAttribute('maxlength', 32); $severityColorTB2 = new CColor('severity_color_2', $this->data['config']['severity_color_2']); $severityTab->addRow(_('Warning'), array($severityNameTB2, SPACE, $severityColorTB2)); $severityNameTB3 = new CTextBox('severity_name_3', $this->data['config']['severity_name_3']); $severityNameTB3->addStyle('width: 15em;'); $severityNameTB3->setAttribute('maxlength', 32); $severityColorTB3 = new CColor('severity_color_3', $this->data['config']['severity_color_3']); $severityTab->addRow(_('Average'), array($severityNameTB3, SPACE, $severityColorTB3)); $severityNameTB4 = new CTextBox('severity_name_4', $this->data['config']['severity_name_4']); $severityNameTB4->addStyle('width: 15em;'); $severityNameTB4->setAttribute('maxlength', 32); $severityColorTB4 = new CColor('severity_color_4', $this->data['config']['severity_color_4']); $severityTab->addRow(_('High'), array($severityNameTB4, SPACE, $severityColorTB4)); $severityNameTB5 = new CTextBox('severity_name_5', $this->data['config']['severity_name_5']); $severityNameTB5->addStyle('width: 15em;'); $severityNameTB5->setAttribute('maxlength', 32); $severityColorTB5 = new CColor('severity_color_5', $this->data['config']['severity_color_5']); $severityTab->addRow(_('Disaster'), array($severityNameTB5, SPACE, $severityColorTB5)); $severityTab->addRow(SPACE); $severityTab->addInfo(_('Custom severity names affect all locales and require manual translation!')); $severityView = new CTabView(); $severityView->addTab('severities', _('Trigger severities'), $severityTab); $severityForm = new CForm(); $severityForm->setName('triggerSeverity'); $severityForm->addVar('form_refresh', $this->data['form_refresh'] + 1); $severityForm->addItem($severityView); $severityForm->addItem(makeFormFooter(array(new CSubmit('save', _('Save'))), new CButton('resetDefaults', _('Reset defaults')))); return $severityForm;
** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $screenWidget = new CWidget(); $screenWidget->addPageHeader(_('CONFIGURATION OF SCREENS')); if (!empty($this->data['templateid'])) { $screenWidget->addItem(get_header_host_table('screens', $this->data['templateid'])); } // create form $screenForm = new CForm(); $screenForm->setName('screenForm'); $screenForm->addVar('form', $this->data['form']); if (!empty($this->data['screenid'])) { $screenForm->addVar('screenid', $this->data['screenid']); } $screenForm->addVar('templateid', $this->data['templateid']); // create screen form list $screenFormList = new CFormList('screenFormList'); $nameTextBox = new CTextBox('name', $this->data['name'], ZBX_TEXTBOX_STANDARD_SIZE); $nameTextBox->attr('autofocus', 'autofocus'); $screenFormList->addRow(_('Name'), $nameTextBox); $screenFormList->addRow(_('Columns'), new CNumericBox('hsize', $this->data['hsize'], 3)); $screenFormList->addRow(_('Rows'), new CNumericBox('vsize', $this->data['vsize'], 3)); // append tabs to form $screenTab = new CTabView(); $screenTab->addTab('screenTab', _('Screen'), $screenFormList);
** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $imageForm = new CForm('post', null, 'multipart/form-data'); $imageForm->setName('imageForm'); $imageForm->addVar('form', $this->data['form']); if (isset($this->data['imageid'])) { $imageForm->addVar('imageid', $this->data['imageid']); } $imageForm->addVar('imagetype', $this->data['imagetype']); // append form list $imageFormList = new CFormList('imageFormList'); $nameTextBox = new CTextBox('name', $this->data['imagename'], 64, false, 64); $nameTextBox->attr('autofocus', 'autofocus'); $imageFormList->addRow(_('Name'), $nameTextBox); $imageFormList->addRow(_('Upload'), new CFile('image')); if (isset($this->data['imageid'])) { if ($this->data['imagetype'] == IMAGE_TYPE_BACKGROUND) { $imageFormList->addRow(_('Image'), new CLink(new CImg('imgstore.php?width=200&height=200&iconid=' . $this->data['imageid'], 'no image'), 'image.php?imageid=' . $this->data['imageid'])); } else {
$sqls[] = 'SELECT m.* ' . ' FROM maintenances m, maintenances_hosts mh, hosts_groups hg ' . ' WHERE ' . DBin_node('m.maintenanceid') . ' AND ' . DBcondition('m.maintenanceid', $available_maintenances) . ' AND hg.groupid=' . $_REQUEST['groupid'] . ' AND mh.hostid=hg.hostid ' . ' AND m.maintenanceid=mh.maintenanceid '; ' ORDER BY m.name'; } else { if ($config['dropdown_first_entry'] == ZBX_DROPDOWN_FIRST_ALL) { $sqls[] = 'SELECT m.* ' . ' FROM maintenances m ' . ' WHERE ' . DBin_node('m.maintenanceid') . ' AND ' . DBcondition('m.maintenanceid', $available_maintenances) . ' ORDER BY m.name'; } } foreach ($sqls as $num => $sql) { $db_maintenances = DBselect($sql); while ($maintenance = DBfetch($db_maintenances)) { $maintenances[$maintenance['maintenanceid']] = $maintenance; $maintenanceids[$maintenance['maintenanceid']] = $maintenance['maintenanceid']; } } $form = new CForm(null, 'post'); $form->setName('maintenances'); $table = new CTableInfo(); $table->setHeader(array(new CCheckBox('all_maintenances', NULL, "checkAll('" . $form->GetName() . "','all_maintenances','maintenanceids');"), make_sorting_link(S_NAME, 'm.name'), S_TYPE, S_STATUS, S_DESCRIPTION)); foreach ($maintenances as $maintenanceid => $maintenance) { if ($maintenance['active_till'] < time()) { $mnt_status = new CSpan(S_EXPIRED, 'red'); } else { $mnt_status = new CSpan(S_ACTIVE, 'green'); } $table->addRow(array(new CCheckBox('maintenanceids[' . $maintenance['maintenanceid'] . ']', NULL, NULL, $maintenance['maintenanceid']), new CLink($maintenance['name'], 'maintenance.php?form=update&maintenanceid=' . $maintenance['maintenanceid'] . '#form'), $maintenance['maintenance_type'] ? S_NO_DATA_PROCESSING : S_NORMAL_PROCESSING, $mnt_status, $maintenance['description'])); $row_count++; } // $table->setFooter(new CCol(new CButtonQMessage('delete_selected',S_DELETE_SELECTED,S_DELETE_SELECTED_USERS_Q))); $goBox = new CComboBox('go'); $goBox->addItem('delete', S_DELETE_SELECTED); // goButton name is necessary!!!
unset($_REQUEST["form"]); } show_messages($result, S_MAP_DELETED, S_CANNOT_DELETE_MAP); } } } $form = new CForm(); $form->SetMethod('get'); $form->AddItem(new CButton("form", S_CREATE_MAP)); show_table_header(S_CONFIGURATION_OF_NETWORK_MAPS, $form); echo SBR; if (isset($_REQUEST["form"])) { insert_map_form(); } else { $form = new CForm(); $form->setName('frm_maps'); $numrows = new CSpan(null, 'info'); $numrows->setAttribute('name', 'numrows'); $header = get_table_header(array(S_MAPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows)); show_table_header($header); $table = new CTableInfo(S_NO_MAPS_DEFINED); $table->SetHeader(array(new CCheckBox('all_maps', NULL, "checkAll('" . $form->getName() . "','all_maps','maps');"), make_sorting_link(S_NAME, 'sm.name'), make_sorting_link(S_WIDTH, 'sm.width'), make_sorting_link(S_HEIGHT, 'sm.height'), S_MAP)); $result = DBselect('SELECT sm.sysmapid,sm.name,sm.width,sm.height ' . ' FROM sysmaps sm' . ' WHERE ' . DBin_node('sm.sysmapid') . order_by('sm.name,sm.width,sm.height', 'sm.sysmapid')); while ($row = DBfetch($result)) { if (!sysmap_accessible($row["sysmapid"], PERM_READ_WRITE)) { continue; } $table->AddRow(array(new CCheckBox('maps[' . $row['sysmapid'] . ']', NULL, NULL, $row['sysmapid']), new CLink($row["name"], "sysmaps.php?form=update" . "&sysmapid=" . $row["sysmapid"] . "#form", 'action'), $row["width"], $row["height"], new CLink(S_EDIT, "sysmap.php?sysmapid=" . $row["sysmapid"]))); } //----- GO ------ $goBox = new CComboBox('go');
** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/js/configuration.triggers.expression.js.php'; $expressionWidget = new CWidget(); // create form $expressionForm = new CForm(); $expressionForm->setName('expression'); $expressionForm->addVar('dstfrm', $this->data['dstfrm']); $expressionForm->addVar('dstfld1', $this->data['dstfld1']); $expressionForm->addVar('itemid', $this->data['itemid']); if (!empty($this->data['parent_discoveryid'])) { $expressionForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); } // create form list $expressionFormList = new CFormList('expressionFormList'); // append item to form list $item = array(new CTextBox('description', $this->data['description'], ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), new CButton('select', _('Select'), 'return PopUp(\'popup.php?writeonly=1&dstfrm=' . $expressionForm->getName() . '&dstfld1=itemid&dstfld2=description&submitParent=1' . (!empty($this->data['parent_discoveryid']) ? '&normal_only=1' : '') . '&srctbl=items&srcfld1=itemid&srcfld2=name\', 0, 0, \'zbx_popup_item\');', 'formlist')); if (!empty($this->data['parent_discoveryid'])) { $item[] = new CButton('select', _('Select prototype'), 'return PopUp(\'popup.php?dstfrm=' . $expressionForm->getName() . '&dstfld1=itemid&dstfld2=description&submitParent=1' . url_param('parent_discoveryid', true) . '&srctbl=prototypes&srcfld1=itemid&srcfld2=name\', 0, 0, \'zbx_popup_item\');', 'formlist'); } $expressionFormList->addRow(_('Item'), $item); // append function to form list
$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'); $m_form->setName('tr_status'); $m_form->addVar('backurl', $page['file']); $admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN; $show_event_col = $config['event_ack_enable'] && $_REQUEST['show_events'] != EVENTS_OPTION_NOEVENT; $table = new CTableInfo(); $switcherName = 'trigger_switchers'; $header_cb = $show_event_col ? new CCheckBox('all_events', false, "checkAll('" . $m_form->GetName() . "','all_events','events');") : new CCheckBox('all_triggers', false, "checkAll('" . $m_form->GetName() . "','all_triggers', 'triggers');"); if ($show_events != EVENTS_OPTION_NOEVENT) { $whow_hide_all = new CDiv(SPACE, 'filterclosed'); $whow_hide_all->setAttribute('id', $switcherName); } else { $whow_hide_all = NULL; } $table->setHeader(array($whow_hide_all, $config['event_ack_enable'] ? $header_cb : null, make_sorting_header(S_SEVERITY, 'priority'), S_STATUS, make_sorting_header(S_LAST_CHANGE, 'lastchange'), S_AGE, $show_event_col ? S_DURATION : NULL, $config['event_ack_enable'] ? S_ACKNOWLEDGED : NULL, is_show_all_nodes() ? S_NODE : null, S_HOST, make_sorting_header(S_NAME, 'description'), S_COMMENTS)); $sortfield = getPageSortField('description'); $sortorder = getPageSortOrder();
** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ require_once dirname(__FILE__) . '/js/monitoring.triggerComment.js.php'; $commentWidget = new CWidget('triggerComment'); $commentWidget->addPageHeader(_('TRIGGER DESCRIPTION')); // create form $commentForm = new CForm(); $commentForm->setName('commentForm'); $commentForm->addVar('triggerid', $this->data['triggerid']); // create form list $commentFormList = new CFormList('commentFormList'); $commentTextArea = new CTextArea('comments', CMacrosResolverHelper::resolveTriggerDescription($this->data['trigger']), array('rows' => 25, 'width' => ZBX_TEXTAREA_BIG_WIDTH, 'readonly' => $this->data['isCommentExist'])); $commentTextArea->attr('autofocus', 'autofocus'); $commentFormList->addRow(_('Description'), $commentTextArea); // append tabs to form $commentTab = new CTabView(); $commentTab->addTab('commentTab', _s('Description for "%s".', $this->data['trigger']['description']), $commentFormList); $commentForm->addItem($commentTab); // append buttons to form $updateButton = new CSubmit('update', _('Update')); $updateButton->setEnabled(!$this->data['isCommentExist']); if ($this->data['isCommentExist']) { $editButton = new CButton('edit', _('Edit'));
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $itemsWidget = new CWidget(); // create new item button $createForm = new CForm('get'); $createForm->cleanItems(); $createForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); $createForm->addItem(new CSubmit('form', _('Create item prototype'))); $itemsWidget->addPageHeader(_('CONFIGURATION OF ITEM PROTOTYPES'), $createForm); // header $itemsWidget->addHeader(array(_('Item prototypes of') . SPACE, new CSpan($this->data['discovery_rule']['name'], 'parent-discovery'))); $itemsWidget->addHeaderRowNumber(); $itemsWidget->addItem(get_header_host_table('items', $this->data['hostid'], $this->data['parent_discoveryid'])); // create form $itemForm = new CForm(); $itemForm->setName('items'); $itemForm->addVar('hostid', $this->data['hostid']); $itemForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); // create table $itemTable = new CTableInfo(_('No item prototypes found.')); $sortLink = new CUrl(); $sortLink->setArgument('parent_discoveryid', $this->data['parent_discoveryid']); $sortLink = $sortLink->getUrl(); $itemTable->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $itemForm->getName() . "', 'all_items', 'group_itemid');"), make_sorting_header(_('Name'), 'name', $sortLink), make_sorting_header(_('Key'), 'key_', $sortLink), make_sorting_header(_('Interval'), 'delay', $sortLink), make_sorting_header(_('History'), 'history', $sortLink), make_sorting_header(_('Trends'), 'trends', $sortLink), make_sorting_header(_('Type'), 'type', $sortLink), _('Applications'), make_sorting_header(_('Status'), 'status', $sortLink))); foreach ($this->data['items'] as $item) { $description = array(); if (!empty($item['templateid'])) { $template_host = get_realhost_by_itemid($item['templateid']); $templateDiscoveryRuleId = get_realrule_by_itemid_and_hostid($this->data['parent_discoveryid'], $template_host['hostid']); $description[] = new CLink($template_host['name'], '?parent_discoveryid=' . $templateDiscoveryRuleId, 'unknown'); $description[] = NAME_DELIMITER;
if (empty($dlt_groups)) { $dltButton->setAttribute('disabled', 'disabled'); } $frmHostG->addItemToBottomRow($dltButton); } $frmHostG->addItemToBottomRow(SPACE); $frmHostG->addItemToBottomRow(new CButtonCancel(url_param('config'))); $frmHostG->show(); } else { $config = select_config(); $numrows = new CSpan(null, 'info'); $numrows->setAttribute('name', 'numrows'); $header = get_table_header(array(S_HOST_GROUPS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows)); show_table_header($header); $form = new CForm('hostgroups.php'); $form->setName('form_groups'); $table = new CTableInfo(S_NO_HOST_GROUPS_DEFINED); $table->setHeader(array(new CCheckBox('all_groups', NULL, "checkAll('" . $form->GetName() . "','all_groups','groups');"), make_sorting_link(S_NAME, 'g.name'), ' # ', S_MEMBERS)); $groups = CHostGroup::get(array('order' => 'name', 'editable' => 1, 'extendoutput' => 1, 'select_hosts' => 1)); foreach ($groups as $groupid => $group) { $tpl_count = 0; $host_count = 0; $i = 0; $hosts_output = array(); foreach ($group['hosts'] as $hostid => $host) { $i++; if ($i > $config['max_in_table']) { $hosts_output[] = '...'; $hosts_output[] = '//empty for array_pop'; break; }
$configurationComboBox->addItem('users.php', _('Users')); $createForm->addItem(array($configurationComboBox, new CSubmit('form', _('Create user')))); $usersWidget->addPageHeader(_('CONFIGURATION OF USERS'), $createForm); // append form header to widget $userGroupListForm = new CForm('get'); $userGroupComboBox = new CComboBox('filter_usrgrpid', $_REQUEST['filter_usrgrpid'], 'submit()'); $userGroupComboBox->addItem(0, _('All')); foreach ($this->data['userGroups'] as $userGroup) { $userGroupComboBox->addItem($userGroup['usrgrpid'], $userGroup['name']); } $userGroupListForm->addItem(array(_('User group') . SPACE, $userGroupComboBox)); $usersWidget->addHeader(_('Users'), $userGroupListForm); $usersWidget->addHeaderRowNumber(); // create form $usersForm = new CForm(); $usersForm->setName('userForm'); // create users table $usersTable = new CTableInfo(_('No users found.')); $usersTable->setHeader(array(new CCheckBox('all_users', null, "checkAll('" . $usersForm->getName() . "', 'all_users', 'group_userid');"), make_sorting_header(_('Alias'), 'alias', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_x('Name', 'user first name'), 'name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Surname'), 'surname', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('User type'), 'type', $this->data['sort'], $this->data['sortorder']), _('Groups'), _('Is online?'), _('Login'), _('Frontend access'), _('Debug mode'), _('Status'))); foreach ($this->data['users'] as $user) { $userId = $user['userid']; $session = $this->data['usersSessions'][$userId]; // online time if ($session['lastaccess']) { $onlineTime = $user['autologout'] == 0 || ZBX_USER_ONLINE_TIME < $user['autologout'] ? ZBX_USER_ONLINE_TIME : $user['autologout']; $online = $session['lastaccess'] + $onlineTime >= time() ? new CCol(_('Yes') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'enabled') : new CCol(_('No') . ' (' . zbx_date2str(DATE_TIME_FORMAT_SECONDS, $session['lastaccess']) . ')', 'disabled'); } else { $online = new CCol(_('No'), 'disabled'); } // blocked $blocked = $user['attempt_failed'] >= ZBX_LOGIN_ATTEMPTS ? new CLink(_('Blocked'), 'users.php?action=user.massunblock&group_userid[]=' . $userId, 'on') : new CSpan(_('Ok'), 'green');
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $maintenanceWidget = new CWidget(); // create new maintenance button $createForm = new CForm('get'); $createForm->cleanItems(); $createForm->addItem(new CSubmit('form', _('Create maintenance period'))); $maintenanceWidget->addPageHeader(_('CONFIGURATION OF MAINTENANCE PERIODS'), $createForm); // header $filterForm = new CForm('get'); $filterForm->addItem(array(_('Group') . SPACE, $this->data['pageFilter']->getGroupsCB(true))); $maintenanceWidget->addHeader(_('Maintenance periods'), $filterForm); $maintenanceWidget->addHeaderRowNumber(); // create form $maintenanceForm = new CForm(); $maintenanceForm->setName('maintenanceForm'); // create table $maintenanceTable = new CTableInfo(_('No maintenance periods found.')); $maintenanceTable->setHeader(array(new CCheckBox('all_maintenances', null, "checkAll('" . $maintenanceForm->getName() . "', 'all_maintenances', 'maintenanceids');"), $this->data['displayNodes'] ? _('Node') : null, make_sorting_header(_('Name'), 'name'), make_sorting_header(_('Type'), 'maintenance_type'), _('State'), _('Description'))); foreach ($this->data['maintenances'] as $maintenance) { $maintenanceid = $maintenance['maintenanceid']; switch ($maintenance['status']) { case MAINTENANCE_STATUS_EXPIRED: $maintenanceStatus = new CSpan(_x('Expired', 'maintenance status'), 'red'); break; case MAINTENANCE_STATUS_APPROACH: $maintenanceStatus = new CSpan(_x('Approaching', 'maintenance status'), 'blue'); break; case MAINTENANCE_STATUS_ACTIVE: $maintenanceStatus = new CSpan(_x('Active', 'maintenance status'), 'green'); break;
**/ $itemsWidget = new CWidget(); $discoveryRule = $this->data['discovery_rule']; // create new item button $createForm = new CForm('get'); $createForm->cleanItems(); $createForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); $createForm->addItem(new CSubmit('form', _('Create host prototype'))); $itemsWidget->addPageHeader(_('CONFIGURATION OF HOST PROTOTYPES'), $createForm); // header $itemsWidget->addHeader(array(_('Host prototypes of') . SPACE, new CSpan($this->data['discovery_rule']['name'], 'parent-discovery'))); $itemsWidget->addHeaderRowNumber(); $itemsWidget->addItem(get_header_host_table('hosts', $discoveryRule['hostid'], $this->data['parent_discoveryid'])); // create form $itemForm = new CForm(); $itemForm->setName('hosts'); $itemForm->addVar('parent_discoveryid', $this->data['parent_discoveryid']); // create table $hostTable = new CTableInfo(_('No host prototypes found.')); $sortLink = new CUrl(); $sortLink->setArgument('parent_discoveryid', $this->data['parent_discoveryid']); $sortLink = $sortLink->getUrl(); $hostTable->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $itemForm->getName() . "', 'all_hosts', 'group_hostid');"), make_sorting_header(_('Name'), 'name', $sortLink), _('Templates'), make_sorting_header(_('Status'), 'status', $sortLink))); foreach ($this->data['hostPrototypes'] as $hostPrototype) { // name $name = array(); if ($hostPrototype['templateid']) { $sourceTemplate = $hostPrototype['sourceTemplate']; $name[] = new CLink($sourceTemplate['name'], '?parent_discoveryid=' . $hostPrototype['sourceDiscoveryRuleId'], 'unknown'); $name[] = NAME_DELIMITER; }
** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. ** ** You should have received a copy of the GNU General Public License ** along with this program; if not, write to the Free Software ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ $slideshowWidget = new CWidget('hat_slides'); // create header form $slideHeaderForm = new CForm('get'); $slideHeaderForm->setName('slideHeaderForm'); $configComboBox = new CComboBox('config', 'slides.php', 'javascript: redirect(this.options[this.selectedIndex].value);'); $configComboBox->addItem('screens.php', _('Screens')); $configComboBox->addItem('slides.php', _('Slide shows')); $slideHeaderForm->addItem($configComboBox); if ($this->data['slideshows']) { $favouriteIcon = $this->data['screen'] ? get_icon('favourite', array('fav' => 'web.favorite.screenids', 'elname' => 'slideshowid', 'elid' => $this->data['elementId'])) : new CIcon(_('Favourites'), 'iconplus'); $refreshIcon = new CIcon(_('Menu'), 'iconmenu'); if ($this->data['screen']) { $refreshIcon->setMenuPopup(CMenuPopupHelper::getRefresh(WIDGET_SLIDESHOW, 'x' . $this->data['refreshMultiplier'], true, array('elementid' => $this->data['elementId']))); } $slideshowWidget->addPageHeader(_('SLIDE SHOWS'), array($slideHeaderForm, SPACE, $favouriteIcon, SPACE, $refreshIcon, SPACE, get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen'])))); $slideshowForm = new CForm('get'); $slideshowForm->setName('slideForm'); $slideshowForm->addVar('fullscreen', $this->data['fullscreen']); $slideshowsComboBox = new CComboBox('elementid', $this->data['elementId'], 'submit()');