CBPDocument::setTasksUserStatus

  1. Bitrix24 API (v. 23.675.0)
  2. bizproc
  3. CBPDocument
  4. setTasksUserStatus
  • Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/document.php
  • Класс: CBPDocument
  • Вызов: CBPDocument::setTasksUserStatus
static function setTasksUserStatus($userId, $status, $ids = array(), &$errors = array())
{
	$filter = array(
		'USER_ID' => $userId,
		'STATUS' => CBPTaskStatus::Running,
		'USER_STATUS' => CBPTaskUserStatus::Waiting,
	);
	if ($ids)
	{
		$ids = array_filter(array_map('intval', (array)$ids));
		if ($ids)
			$filter['ID'] = $ids;
	}

	$iterator = CBPTaskService::GetList(array('ID'=>'ASC'),
		$filter,
		false,
		false,
		array('ID', 'NAME', 'WORKFLOW_ID', 'ACTIVITY', 'ACTIVITY_NAME', 'IS_INLINE'));
	while ($task = $iterator->fetch())
	{
		if ($task['IS_INLINE'] == 'Y')
		{
			$taskErrors = array();
			self::PostTaskForm($task, $userId, array('INLINE_USER_STATUS' => $status), $taskErrors);
			if (!empty($taskErrors))
				foreach ($taskErrors as $error)
					$errors[] = GetMessage('BPCGDOC_ERROR_ACTION', array('#NAME#' => $task['NAME'], '#ERROR#' => $error['message']));
		}
		else
			$errors[] = GetMessage('BPCGDOC_ERROR_TASK_IS_NOT_INLINE', array('#NAME#' => $task['NAME']));

	}
	return true;
}

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