<?php declare(strict_types = 0);
$operations_table = (new CTable())
->setAttribute('style', 'width: 100%;');
if (in_array($data['eventsource'], [EVENT_SOURCE_TRIGGERS, EVENT_SOURCE_INTERNAL, EVENT_SOURCE_SERVICE])) {
$operations_table->setHeader([_('Steps'), _('Details'), _('Start in'), _('Duration'), _('Action')]);
$operations_table->setHeader([_('Details'), _('Action')]);
if (array_key_exists('descriptions', $data)) {
if (array_key_exists('operation', $data['descriptions'])) {
$data['descriptions'] = $data['descriptions']['operation'];
$details_column = getActionOperationDescriptions(
$data['action']['operations'], $data['eventsource'], $data['descriptions']
foreach ($data['action']['operations'] as $i => $operation) {
if (!str_in_array($operation['operationtype'], $data['allowedOperations'][ACTION_OPERATION])) {
if (in_array($data['eventsource'], [EVENT_SOURCE_TRIGGERS, EVENT_SOURCE_INTERNAL, EVENT_SOURCE_SERVICE])) {
$simple_interval_parser = new CSimpleIntervalParser();
$delays = count_operations_delay($data['action']['operations'], $data['action']['esc_period']);
if ($operation['esc_step_from'] < 1) {
$operation['esc_step_from'] = 1;
$esc_steps_txt = ($operation['esc_step_from'] == $operation['esc_step_to'])
? $operation['esc_step_from']