Source
? makeHelpIcon(_('Event name matches Trigger name (with macros expanded) unless a custom Event name is specified in Trigger settings.'))
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2023 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
* @var array $data
*/
$inline_js = getPagePostJs().$this->readJsFile('popup.condition.edit.js.php');
$form = (new CForm())
->setId('popup.condition')
->setName('popup.condition')
->setAttribute('aria-labeledby', CHtmlPage::PAGE_TITLE_ID)
->addVar('action', $data['action'])
->addVar('row_index', $data['row_index'] ? $data['row_index'] : 0)
->addVar('type', $data['type']);
if ($data['type'] == ZBX_POPUP_CONDITION_TYPE_ACTION) {
$form->addVar('source', $data['eventsource']);
}
elseif ($data['type'] == ZBX_POPUP_CONDITION_TYPE_ACTION_OPERATION) {
$form->addVar('source', $data['source']);
}
$condition_type = (int) $data['last_type'];
$form_grid = (new CFormGrid());
switch ($data['type']) {
case ZBX_POPUP_CONDITION_TYPE_ACTION:
require_once __DIR__ .'/../../include/actions.inc.php';
// Collect all operators options.
$operators_by_condition = [];
$action_conditions = [];
foreach ($data['allowed_conditions'] as $type) {
if ($data['eventsource'] == EVENT_SOURCE_SERVICE && $type == ZBX_CONDITION_TYPE_EVENT_TAG) {
$action_conditions[$type] = _('Service tag name');
}
elseif ($data['eventsource'] == EVENT_SOURCE_SERVICE && $type == ZBX_CONDITION_TYPE_EVENT_TAG_VALUE) {
$action_conditions[$type] = _('Service tag value');
}
else {
$action_conditions[$type] = condition_type2str($type);
}