本文整理汇总了PHP中CCrmOwnerType::COMPANY_INDUSTRY方法的典型用法代码示例。如果您正苦于以下问题:PHP CCrmOwnerType::COMPANY_INDUSTRY方法的具体用法?PHP CCrmOwnerType::COMPANY_INDUSTRY怎么用?PHP CCrmOwnerType::COMPANY_INDUSTRY使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCrmOwnerType
的用法示例。
在下文中一共展示了CCrmOwnerType::COMPANY_INDUSTRY方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: PrepareEntityInfo
private static function PrepareEntityInfo($typeID, $ID, &$arRes, $options = null)
{
$enableEditUrl = is_array($options) && isset($options['ENABLE_EDIT_URL']) && $options['ENABLE_EDIT_URL'] === true;
switch ($typeID) {
case self::Lead:
$treatAsContact = false;
$treatAsCompany = false;
if (is_array($options)) {
$treatAsContact = isset($options['TREAT_AS_CONTACT']) && $options['TREAT_AS_CONTACT'];
$treatAsCompany = isset($options['TREAT_AS_COMPANY']) && $options['TREAT_AS_COMPANY'];
}
if ($treatAsContact) {
$result = array('TITLE' => CCrmLead::PrepareFormattedName($arRes), 'LEGEND' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '');
} elseif ($treatAsCompany) {
$result = array('TITLE' => isset($arRes['COMPANY_TITLE']) ? $arRes['COMPANY_TITLE'] : '', 'LEGEND' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '');
} else {
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => CCrmLead::PrepareFormattedName($arRes));
}
$result['RESPONSIBLE_ID'] = isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0;
$result['IMAGE_FILE_ID'] = 0;
$result['SHOW_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_lead_show'), array('lead_id' => $ID));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_lead_edit'), array('lead_id' => $ID));
}
return $result;
case self::Contact:
$result = array('TITLE' => CCrmContact::PrepareFormattedName($arRes), 'LEGEND' => isset($arRes['COMPANY_TITLE']) ? $arRes['COMPANY_TITLE'] : '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => isset($arRes['PHOTO']) ? intval($arRes['PHOTO']) : 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_show'), array('contact_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_edit'), array('contact_id' => $ID));
}
return $result;
case self::Company:
if (self::$COMPANY_TYPE === null) {
self::$COMPANY_TYPE = CCrmStatus::GetStatusList('COMPANY_TYPE');
}
if (self::$COMPANY_INDUSTRY === null) {
self::$COMPANY_INDUSTRY = CCrmStatus::GetStatusList('INDUSTRY');
}
$legendParts = array();
$typeID = isset($arRes['COMPANY_TYPE']) ? $arRes['COMPANY_TYPE'] : '';
if ($typeID !== '' && isset(self::$COMPANY_TYPE[$typeID])) {
$legendParts[] = self::$COMPANY_TYPE[$typeID];
}
$industryID = isset($arRes['INDUSTRY']) ? $arRes['INDUSTRY'] : '';
if ($industryID !== '' && isset(self::$COMPANY_INDUSTRY[$industryID])) {
$legendParts[] = self::$COMPANY_INDUSTRY[$industryID];
}
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => !empty($legendParts) ? implode(', ', $legendParts) : '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => isset($arRes['LOGO']) ? intval($arRes['LOGO']) : 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_show'), array('company_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_edit'), array('company_id' => $ID));
}
return $result;
case self::Deal:
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_show'), array('deal_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_edit'), array('deal_id' => $ID));
}
return $result;
case self::Invoice:
$result = array('TITLE' => isset($arRes['ORDER_TOPIC']) ? $arRes['ORDER_TOPIC'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['RESPONSIBLE_ID']) ? intval($arRes['RESPONSIBLE_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_invoice_show'), array('invoice_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_invoice_edit'), array('invoice_id' => $ID));
}
return $result;
case self::Quote:
$result = array('TITLE' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'LEGEND' => '', 'RESPONSIBLE_ID' => isset($arRes['ASSIGNED_BY_ID']) ? intval($arRes['ASSIGNED_BY_ID']) : 0, 'IMAGE_FILE_ID' => 0, 'SHOW_URL' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_quote_show'), array('quote_id' => $ID)));
if ($enableEditUrl) {
$result['EDIT_URL'] = CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_quote_edit'), array('quote_id' => $ID));
}
return $result;
}
return null;
}