Вёрстка
5
Вклад в тег
//Устанавливаем дело-звонок и напоминание для сделки
$arFieldsDelo = array(
'TYPE_ID' => CCrmActivityType::Call,
'PROVIDER_ID' => 'VOXIMPLANT_CALL',
'ASSOCIATED_ENTITY_ID' => $_GET['deal'],
'SUBJECT' => "Тема",
'COMPLETED' => 'N',
'RESPONSIBLE_ID' => "ID отвественного",
'NOTIFY_TYPE' => \CCrmActivityNotifyType::Min,
'NOTIFY_VALUE' => 20,
'DESCRIPTION' => "Описание",
'START_TIME' => $_GET['datetime'],
'END_TIME' => $_GET['datetime'],
'PRIORITY' => CCrmActivityPriority::Medium,
'AUTHOR_ID' => $_GET['assigned'],
'ORIGIN_ID' => 'XYZ_1',
'DIRECTION' => CCrmActivityDirection::Outgoing,
'OWNER_ID' => $_GET['deal'],
'OWNER_TYPE_ID' => CCrmOwnerType::Deal,
);
$arComms = array(
array(
'ID' => 0,
'TYPE' => 'PHONE',
'VALUE' => $_GET['contactTel'],
'ENTITY_ID' => $_GET['deal'],
'ENTITY_TYPE_ID' => 'DEAL'
)
);
$ID = CCrmActivity::Add($arFieldsDelo, false, true, array('REGISTER_SONET_EVENT' => false));
if($ID > 0)
{
//сохраняем дело в календарь
CCrmActivity::SaveCommunications($ID, $arComms, $arFieldsDelo, true, false);
}
}