- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/classes/general/taskcomments.php
- Класс: CTaskComments
- Вызов: CTaskComments::update
static function update($taskId, $commentId, $commentEditorId, $arFields)
{
CTaskAssert::assertLaxIntegers($taskId, $commentId, $commentEditorId);
CTaskAssert::assert(is_array($arFields) && !empty($arFields));
if ( ! CModule::includeModule('forum') )
{
throw new TasksException(
'forum module can not be loaded',
TasksException::TE_ACTION_FAILED_TO_BE_PROCESSED
);
}
IncludeModuleLangFile(__FILE__);
$forumId = CTasksTools::GetForumIdForIntranet();
$arErrorCodes = array();
try
{
$oTask = CTaskItem::getInstance($taskId, $commentEditorId);
$arTask = $oTask->getData();
}
catch (TasksException $e)
{
throw new TasksException(
serialize($arErrorCodes),
TasksException::TE_ACTION_FAILED_TO_BE_PROCESSED
| TasksException::TE_FLAG_SERIALIZED_ERRORS_IN_MESSAGE
);
}
$outForumTopicId = $outStrUrl = null;
$arFields = array_merge(array(
'EDITOR_ID' => $commentEditorId
), $arFields);
$messageId = self::__deprecated_Add(
$arFields['POST_MESSAGE'],
$forumTopicId = $arTask['FORUM_TOPIC_ID'],
$forumId,
$nameTemplate = CSite::GetNameFormat(false),
$arTask = $arTask,
$permissions = 'Y',
$commentId = $commentId,
$givenUserId = $commentEditorId,
$imageWidth = 300,
$imageHeight = 300,
$arSmiles = array(),
$arForum = CForumNew::GetByID($forumId),
$messagesPerPage = 10,
$arUserGroupArray = CUser::GetUserGroup($commentEditorId),
$backPage = null,
$strMsgAddComment = GetMessage("TASKS_COMMENT_MESSAGE_ADD"),
$strMsgEditComment = GetMessage("TASKS_COMMENT_MESSAGE_EDIT"),
$strMsgNewTask = GetMessage("TASKS_COMMENT_SONET_NEW_TASK_MESSAGE"),
$componentName = null,
$outForumTopicId,
$arErrorCodes,
$outStrUrl,
$arFields
);
if ( ! ($messageId >= 1) )
{
throw new TasksException(
serialize($arErrorCodes),
TasksException::TE_ACTION_FAILED_TO_BE_PROCESSED
| TasksException::TE_FLAG_SERIALIZED_ERRORS_IN_MESSAGE
);
}
return ( true );
}