require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/triggers.inc.php';
$page['title'] = _('100 busiest triggers');
$page['file'] = 'toptriggers.php';
$page['scripts'] = ['class.calendar.js', 'gtlc.js'];
require_once dirname(__FILE__).'/include/page_header.php';
'groupids' => [T_ZBX_INT, O_OPT, P_SYS|P_ONLY_ARRAY, DB_ID, null],
'hostids' => [T_ZBX_INT, O_OPT, P_SYS|P_ONLY_ARRAY, DB_ID, null],
'severities' => [T_ZBX_INT, O_OPT, P_SYS|P_ONLY_ARRAY, null, null],
'filter_rst' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'filter_set' => [T_ZBX_STR, O_OPT, P_SYS, null, null],
'from' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null],
'to' => [T_ZBX_RANGE_TIME, O_OPT, P_SYS, null, null]
if (hasRequest('from') || hasRequest('to')) {
validateTimeSelectorPeriod(
hasRequest('from') ? getRequest('from') : null,
hasRequest('to') ? getRequest('to') : null
$timeselector_from = getRequest('from', CProfile::get('web.toptriggers.filter.from',
'now-'.CSettingsHelper::get(CSettingsHelper::PERIOD_DEFAULT)));
$timeselector_to = getRequest('to', CProfile::get('web.toptriggers.filter.to', 'now'));
if (hasRequest('filter_set')) {
CProfile::updateArray('web.toptriggers.filter.severities', getRequest('severities', []), PROFILE_TYPE_STR);
CProfile::updateArray('web.toptriggers.filter.groupids', getRequest('groupids', []), PROFILE_TYPE_STR);
CProfile::updateArray('web.toptriggers.filter.hostids', getRequest('hostids', []), PROFILE_TYPE_STR);
CProfile::update('web.toptriggers.filter.from', $timeselector_from, PROFILE_TYPE_STR);
CProfile::update('web.toptriggers.filter.to', $timeselector_to, PROFILE_TYPE_STR);