Source
makeHelpIcon(_('This setting will display log time instead of item\'s timestamp. "Show timestamp" must also be checked in the advanced configuration.'))
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* @var CView $this
* @var array $data
*/
use Widgets\ItemHistory\Includes\CWidgetFieldColumnsList;
$form = (new CForm())
->setId('item_history_column_edit_form')
->setName('item_history_column_edit_form')
->addStyle('display: none;')
->addVar('action', $data['action'])
->addVar('update', 1);
// Enable form submitting on Enter.
$form->addItem((new CSubmitButton())->addClass(ZBX_STYLE_FORM_SUBMIT_HIDDEN));
$form_grid = new CFormGrid();
$scripts = [];
if (array_key_exists('edit', $data)) {
$form->addVar('edit', 1);
}
// Name.
$form_grid->addItem([
(new CLabel(_('Name'), 'column_name'))->setAsteriskMark(),
new CFormField(
(new CTextBox('name', $data['name'], false))
->setId('column_name')
->setWidth(ZBX_TEXTAREA_STANDARD_WIDTH)
->setAttribute('autofocus', 'autofocus')
->setAriaRequired()
)
]);
// Itemid.
$parameters = [
'srctbl' => 'items',
'srcfld1' => 'itemid',
'dstfrm' => $form->getName(),
'dstfld1' => 'itemid'
];
$parameters += $data['templateid'] === ''
? [