Livefeed::readComments

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. Livefeed
  4. readComments
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/activity/provider/livefeed.php
  • Класс: Bitrix\Crm\Activity\Provider\Livefeed
  • Вызов: Livefeed::readComments
static function readComments($params)
{
	$userId = (
		!empty($params["USER_ID"])
			? intval($params["USER_ID"])
			: 0
	);

	$timeStamp = (
		!empty($params["TIMESTAMP"])
			? intval($params["TIMESTAMP"])
			: 0
	);

	if ($userId > 0)
	{
		$res = \CCrmActivity::getList(
			array(),
			array(
				'=RESPONSIBLE_ID' => $userId,
				'=PROVIDER_ID' => self::PROVIDER_ID,
				'=PROVIDER_TYPE_ID' => self::PROVIDER_TYPE_ID_COMMENT,
				'=DIRECTION' => \CCrmActivityDirection::Incoming,
				'=COMPLETED' => 'N',
				'>START_TIME' => convertTimeStamp(($timeStamp + \CTimeZone::getOffset()), 'FULL', SITE_ID),
				'CHECK_PERMISSIONS' => 'N'
			),
			false,
			false,
			array('ID', 'PROVIDER_PARAMS')
		);

		while($activity = $res->fetch())
		{
			if (
				!is_array($activity['PROVIDER_PARAMS'])
				|| !isset($activity['PROVIDER_PARAMS']['NO_AUTOCOMPLETE'])
				|| $activity['PROVIDER_PARAMS']['NO_AUTOCOMPLETE'] != "Y"
			)
			{
				\CCrmActivity::complete($activity['ID']);
			}
		}
	}
}

Добавить комментарий