Source
? makeHelpIcon(_('Event name matches Trigger name (with macros expanded) unless a custom Event name is specified in Trigger settings.'))
<?php
/*
** Zabbix
** Copyright (C) 2001-2025 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.
**/
/**
* @var CView $this
*/
$inline_js = '';
$form = (new CForm())
->cleanItems()
->setId('popup.condition')
->setName('popup.condition')
->addVar('action', $data['action'])
->addVar('type', $data['type']);
if (array_key_exists('source', $data)) {
$form->addVar('source', $data['source']);
}
$condition_type = (int) $data['last_type'];
$form_list = (new CFormList())->cleanItems();
switch ($data['type']) {
case ZBX_POPUP_CONDITION_TYPE_EVENT_CORR:
// Type select.
$form_list->addRow(new CLabel(_('Type'), 'label-condition-type'), (new CSelect('condition_type'))
->setFocusableElementId('label-condition-type')
->setValue($condition_type)
->setId('condition-type')
->addOptions(CSelect::createOptionsFromArray(CCorrelationHelper::getConditionTypes()))
);
$inline_js .= '$(() => $("#condition-type").on("change",'
.'(e) => reloadPopup($(e.target).closest("form").get(0), "popup.condition.event.corr")));';
switch ($condition_type) {
// Old|New event tag form elements.
case ZBX_CORR_CONDITION_OLD_EVENT_TAG:
case ZBX_CORR_CONDITION_NEW_EVENT_TAG:
$operator = (new CRadioButtonList('', CONDITION_OPERATOR_EQUAL))
->setModern(true)
->addValue(CCorrelationHelper::getLabelByOperator(
CCorrelationHelper::getOperatorsByConditionType(ZBX_CORR_CONDITION_OLD_EVENT_TAG)[0]