本文整理汇总了PHP中CCrmOwnerType::GetNames方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmOwnerType::GetNames方法的具体用法?PHP CCrmOwnerType::GetNames怎么用?PHP CCrmOwnerType::GetNames使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmOwnerType
的用法示例。
在下文中一共展示了CCrmOwnerType::GetNames方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: EmailMessageAdd
//.........这里部分代码省略.........
foreach ($arBodyEmails as $email) {
if (self::FindUserIDByEmail($email) <= 0) {
$arCommEmails[] = $email;
}
}
}
}
// Try to resolve communications
$arCommData = self::ExtractCommsFromEmails($arCommEmails);
} else {
//It is email from unknown user
//Try to resolve bindings from addresser
$arCommData = self::ExtractCommsFromEmails($arCommEmails);
if (!empty($arCommData)) {
// Try to resolve responsible user
foreach ($arCommData as &$arComm) {
$userID = self::ResolveResponsibleID($arComm['ENTITY_TYPE_ID'], $arComm['ENTITY_ID']);
if ($userID > 0) {
break;
}
}
unset($arComm);
}
}
// Try to resolve owner by old-style method-->
$arACTION_VARS = explode('&', $ACTION_VARS);
for ($i = 0, $ic = count($arACTION_VARS); $i < $ic; $i++) {
$v = $arACTION_VARS[$i];
if ($pos = strpos($v, '=')) {
$name = substr($v, 0, $pos);
${$name} = urldecode(substr($v, $pos + 1));
}
}
$arTypeNames = CCrmOwnerType::GetNames(array(CCrmOwnerType::Lead, CCrmOwnerType::Deal, CCrmOwnerType::Contact, CCrmOwnerType::Company));
foreach ($arTypeNames as $typeName) {
$regexVar = 'W_CRM_ENTITY_REGEXP_' . $typeName;
if (empty(${$regexVar})) {
continue;
}
$match = array();
if (preg_match('/' . ${$regexVar} . '/i' . BX_UTF_PCRE_MODIFIER, $subject, $match) === 1) {
$ownerID = intval($match[1]);
$ownerTypeID = CCrmOwnerType::ResolveID($typeName);
break;
}
}
// <-- Try to resolve owner by old-style method
// Filter communications by owner
if ($ownerTypeID > 0 && $ownerID > 0) {
if (!empty($arCommData)) {
foreach ($arCommData as $commKey => $arComm) {
if ($arComm['ENTITY_TYPE_ID'] === $ownerTypeID && $arComm['ENTITY_ID'] === $ownerID) {
continue;
}
unset($arCommData[$commKey]);
}
$arCommData = array_values($arCommData);
}
if (empty($arCommData)) {
if ($addresserID > 0) {
foreach ($addresseeEmails as $email) {
if ($email === $crmEmail) {
continue;
}
$arCommData = array(self::CreateComm($ownerTypeID, $ownerID, $email));
}