Source
if (in_array($filter['tag_source'], [ZBX_SERVICE_FILTER_TAGS_ANY, ZBX_SERVICE_FILTER_TAGS_SERVICE])) {
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2024 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.
**/
abstract class CControllerServiceListGeneral extends CController {
protected const WITHOUT_PARENTS_SERVICEID = 0;
protected const FILTER_DEFAULT_NAME = '';
protected const FILTER_DEFAULT_STATUS = SERVICE_STATUS_ANY;
protected const FILTER_DEFAULT_WITHOUT_CHILDREN = false;
protected const FILTER_DEFAULT_WITHOUT_PROBLEM_TAGS = false;
protected const FILTER_DEFAULT_TAG_SOURCE = ZBX_SERVICE_FILTER_TAGS_SERVICE;
protected const FILTER_DEFAULT_EVALTYPE = TAG_EVAL_TYPE_AND_OR;
/**
* @var array
*/
protected $service;
/**
* @throws APIException
*
* @return bool
*/
protected function checkPermissions(): bool {
if ($this->hasInput('serviceid')) {
$db_service = API::Service()->get([
'output' => ['serviceid', 'name', 'status', 'readonly'],
'serviceids' => $this->getInput('serviceid'),
'selectParents' => ['serviceid'],
'selectTags' => ['tag', 'value']
]);
if (!$db_service) {
return false;
}
$this->service = $db_service[0];
}
return true;
}
/**
* @throws APIException