Esempio n. 1
0
 function BodyToString($destroy = true)
 {
     $table = new CTable(null, 'setup_wizard');
     $table->setAlign('center');
     $table->setHeader(array(new CCol(S_ZABBIX_VER, 'left'), SPACE), 'header');
     $table->addRow(array(SPACE, new CCol($this->stage[$this->getStep()]['title'], 'right')), 'title');
     $table->addRow(array(new CCol($this->getList(), 'left'), new CCol($this->getState(), 'right')), 'center');
     $next = new CButton('next[' . $this->getStep() . ']', S_NEXT . ' >>');
     if ($this->DISABLE_NEXT_BUTTON) {
         $next->setEnabled(false);
     }
     $table->setFooter(array(new CCol(new CButton('cancel', S_CANCEL), 'left'), new CCol(array(isset($this->stage[$this->getStep() - 1]) ? new CButton('back[' . $this->getStep() . ']', '<< ' . S_PREVIOUS) : null, isset($this->stage[$this->getStep() + 1]) ? $next : new CButton('finish', S_FINISH)), 'right')), 'footer');
     return parent::BodyToString($destroy) . $table->ToString();
 }
** 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'));
    $editButton->setEnabled($this->data['isTriggerEditable']);
} else {
    $editButton = null;
}
$commentForm->addItem(makeFormFooter($updateButton, array($editButton, new CButtonCancel('&triggerid=' . $this->data['triggerid']))));
$commentWidget->addItem($commentForm);
return $commentWidget;
    foreach ($groups as &$group) {
        $group['nodename'] = get_node_name_by_elid($group['groupid'], true, ': ');
    }
    unset($group);
    $sortFields = array(array('field' => 'nodename', 'order' => ZBX_SORT_UP), array('field' => 'name', 'order' => ZBX_SORT_UP));
    CArrayHelper::sort($groups, $sortFields);
    $lstGroups = new CListBox('del_groups[]', null, 15);
    $lstGroups->setAttribute('style', 'width: 200px;');
    foreach ($groups as $gnum => $group) {
        $lstGroups->addItem($group['groupid'], $group['nodename'] . $group['name']);
    }
    if (!$filterEnable) {
        $lstGroups->setAttribute('disabled', 'disabled');
    }
    $addButton = new CButton('add', _('Add'), "return PopUp('popup_right.php?dstfrm=" . $dashForm->getName() . "&permission=" . PERM_READ_WRITE . "',450,450);");
    $addButton->setEnabled($filterEnable);
    $delButton = new CSubmit('delete', _('Delete selected'));
    $delButton->setEnabled($filterEnable);
    $dashList->addRow(_('Groups'), array($lstGroups, BR(), $addButton, $delButton));
}
//HOSTS
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
    $cbMain->setAttribute('disabled', 'disabled');
}
$dashList->addRow(_('Hosts'), array($cbMain, _('Show hosts in maintenance')));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
Esempio n. 4
0
$_REQUEST['steps'] = array_merge(get_request('steps', array()));
/* reinitialize keys */
if (!isset($_REQUEST['form'])) {
    //creating button "Create scenario"
    $form_button = new CForm(null, 'get');
    $form_button->addVar('hostid', $_REQUEST['hostid']);
    //if host is selected
    if (!isset($_REQUEST['form']) && $_REQUEST['hostid'] > 0) {
        //allowing to press button
        $create_scenario_button = new CButton('form', S_CREATE_SCENARIO);
        $create_scenario_button->setEnabled('yes');
    } else {
        //adding additional hint to button
        $create_scenario_button = new CButton('form', S_CREATE_SCENARIO . ' ' . S_SELECT_HOST_FIRST);
        //and disabling it
        $create_scenario_button->setEnabled('no');
    }
    $form_button->addItem($create_scenario_button);
} else {
    $form_button = null;
}
$http_wdgt = new CWidget();
$http_wdgt->addPageHeader(S_CONFIGURATION_OF_WEB_MONITORING_BIG, $form_button);
$db_hosts = DBselect('select hostid from hosts where ' . DBin_node('hostid'));
if (isset($_REQUEST['form']) && isset($_REQUEST['hostid']) && DBfetch($db_hosts)) {
    $form = new CFormTable(S_SCENARIO);
    $form->setName('form_scenario');
    if ($_REQUEST['groupid'] > 0) {
        $form->addVar('groupid', $_REQUEST['groupid']);
    }
    $form->addVar('hostid', $_REQUEST['hostid']);