<?php declare(strict_types = 0);
namespace Widgets\Problems\Actions;
use CControllerDashboardWidgetView,
class WidgetView extends CControllerDashboardWidgetView {
protected function init(): void {
$this->addValidationRules([
'initial_load' => 'in 0,1'
protected function doAction(): void {
if ($this->isTemplateDashboard() && !$this->fields_values['override_hostid']) {
$this->setResponse(new CControllerResponseData([
'name' => $this->getInput('name', $this->widget->getDefaultName()),
'error' => _('No data.'),
'debug_mode' => $this->getDebugMode()
$search_limit = CSettingsHelper::get(CSettingsHelper::SEARCH_LIMIT);
$data = CScreenProblem::getData([
'show' => $this->fields_values['show'],
'groupids' => !$this->isTemplateDashboard() ? $this->fields_values['groupids'] : null,
'exclude_groupids' => !$this->isTemplateDashboard() ? $this->fields_values['exclude_groupids'] : null,
'hostids' => !$this->isTemplateDashboard()
? $this->fields_values['hostids']
: $this->fields_values['override_hostid'],
'name' => $this->fields_values['problem'],
'severities' => $this->fields_values['severities'],
'evaltype' => $this->fields_values['evaltype'],
'tags' => $this->fields_values['tags'],
'show_symptoms' => $this->fields_values['show_symptoms'],
'show_suppressed' => $this->fields_values['show_suppressed'],
'acknowledgement_status' => $this->fields_values['acknowledgement_status'],
'acknowledged_by_me' => $this->fields_values['acknowledgement_status'] == ZBX_ACK_STATUS_ACK