- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/classes/general/tasknotifications.php
- Класс: CTaskNotifications
- Вызов: CTaskNotifications::OnAnswerNotify
static function OnAnswerNotify($module, $tag, $text, $arNotify)
{
if ($module == "tasks" && (string) $text != '')
{
$tagData = self::parseImNotificationTag($tag);
if($tagData['ENTITY'] == 'COMMENT')
{
if(!CModule::IncludeModule('forum') || !$GLOBALS['USER'] || !method_exists($GLOBALS['USER'], 'GetId'))
{
throw new SystemException(); // this will break json and make notify window glow red :)
}
else
{
try
{
if (self::addAnswer($tagData['TASK_ID'], $text))
{
return Loc::getMessage('TASKS_IM_ANSWER_SUCCESS');
}
}
catch(TasksException | CTaskAssertException $e)
{
$message = unserialize($e->getMessage(), ['allowed_classes' => false]);
return array(
'result' => false,
'text' => $message[0]
);
}
}
}
}
}