• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/classes/general/timeman_report.php
  • Класс: CAllTimeManReport
  • Вызов: CAllTimeManReport::CheckFields
static function CheckFields($action, &$arFields)
{
	global $DB, $USER;

	if ($action == 'ADD')
	{
		if (!$arFields['ENTRY_ID'])
			return false;

		if (!$arFields['USER_ID'])
			$arFields['USER_ID'] = $USER->GetID();
	}

	if (isset($arFields['REPORT']))
		$arFields['REPORT'] = trim($arFields['REPORT']);

	if (isset($arFields['ACTIVE']))
		$arFields['ACTIVE'] = $arFields['ACTIVE'] == 'N' ? 'N' : 'Y';

	unset($arFields['TIMESTAMP_X']);

	if ($action == 'UPDATE')
		$arFields['~TIMESTAMP_X'] = $DB->GetNowFunction();

	return true;
}