/** * Decrements counters for users, which not view task (not regitered in b_tasks_viewed) */ private static function decrementNewTasksCounters($responsibleId, $arAccomplices, $taskId) { // Get users, who viewed this task try { $arUsersViewed = CTasks::getUsersViewedTask($taskId); } catch (TasksException $e) { $arUsersViewed = array(); } // Responsible didn't watch tasks yet? // So his counter of "new tasks" is incremented and we must decrement it $responsibleId = (int) $responsibleId; if (!in_array($responsibleId, $arUsersViewed, true)) { CTaskCountersQueue::push(CTaskCountersProcessor::COUNTER_TASKS_MY_NEW, CTaskCountersQueue::OP_DECREMENT, array($responsibleId)); } CTaskCountersQueue::push(CTaskCountersProcessor::COUNTER_TASKS_ACCOMPLICE_NEW, CTaskCountersQueue::OP_DECREMENT, array_diff($arAccomplices, $arUsersViewed)); }