- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/lib/internals/effective.php
- Класс: BitrixTasksInternalsEffective
- Вызов: Effective::modify
static function modify(
int $userId,
string $userType,
array $taskData,
int $groupId = 0,
bool $isViolation = null,
bool $recountEfficiency = true
): bool
{
$deadline = $taskData['DEADLINE'];
$createdBy = $taskData['CREATED_BY'];
if (!$userId || !$createdBy || $userId === $createdBy)
{
return false;
}
if ($isViolation === null)
{
$isViolation = static::isViolation($deadline);
}
EffectiveTable::add([
'DATETIME' => new DateTime(),
'USER_ID' => $userId,
'USER_TYPE' => $userType,
'GROUP_ID' => $groupId,
'EFFECTIVE' => static::getEfficiencyForNow($userId, $groupId),
'TASK_ID' => $taskData['ID'],
'TASK_TITLE' => $taskData['TITLE'],
'TASK_DEADLINE' => $deadline,
'IS_VIOLATION'=> ($isViolation ? 'Y' : 'N'),
]);
if ($recountEfficiency)
{
static::recountEfficiencyUserCounter($userId);
}
return true;
}