本文整理汇总了PHP中CCrmDeal类的典型用法代码示例。如果您正苦于以下问题:PHP CCrmDeal类的具体用法?PHP CCrmDeal怎么用?PHP CCrmDeal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CCrmDeal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJavaScriptDescriptions
/**
* @return array Array of strings
*/
public static function getJavaScriptDescriptions($checkPermissions = false)
{
$result = array();
$descriptions = self::getAllDescriptions();
if (!$checkPermissions) {
$isInvoicePermitted = true;
$isQuotePermitted = true;
} else {
$flags = array();
\CCrmDeal::PrepareConversionPermissionFlags(0, $flags);
$isInvoicePermitted = $flags['CAN_CONVERT_TO_INVOICE'];
$isQuotePermitted = $flags['CAN_CONVERT_TO_QUOTE'];
}
if ($isInvoicePermitted && $isQuotePermitted) {
foreach ($descriptions as $schemeID => $description) {
$result[self::resolveName($schemeID)] = $description;
}
} else {
$schemes = array();
if ($isInvoicePermitted) {
$schemes[] = self::INVOICE;
}
if ($isQuotePermitted) {
$schemes[] = self::QUOTE;
}
foreach ($schemes as $schemeID) {
$result[self::resolveName($schemeID)] = $descriptions[$schemeID];
}
}
return $result;
}
示例2: prepareData
/**
* @return array
*/
public function prepareData()
{
$totals = array();
$stages = \CCrmStatus::GetStatusList('DEAL_STAGE');
foreach ($stages as $k => $v) {
$semanticID = \CCrmDeal::GetSemanticID($k);
if ($semanticID === PhaseSemantics::FAILURE) {
continue;
}
$totals[$k] = array('ID' => $k, 'NAME' => $v, 'TOTAL' => 0);
}
$source = new DealStageHistory(array(), $this->userID, $this->enablePermissionCheck);
//CREATION
$this->filter->setExtras(array('typeID' => HistoryEntryType::CREATION));
$values = $source->getList(array('filter' => $this->filter));
$this->prepareTotals($values, $totals);
//MODIFICATION
$this->filter->setExtras(array('typeID' => HistoryEntryType::MODIFICATION));
$values = $source->getList(array('filter' => $this->filter));
$this->prepareTotals($values, $totals);
//FINALIZATION
$this->filter->setExtras(array('typeID' => HistoryEntryType::FINALIZATION));
$values = $source->getList(array('filter' => $this->filter));
$this->prepareTotals($values, $totals);
$items = array();
foreach ($totals as $total) {
if ($total['TOTAL'] > 0) {
$items[] = $total;
}
}
return array('items' => $items, 'valueField' => 'TOTAL', 'titleField' => 'NAME');
}
示例3: rebind
protected function rebind($seedID, $targID)
{
\CCrmDeal::Rebind(\CCrmOwnerType::Contact, $seedID, $targID);
\CCrmQuote::Rebind(\CCrmOwnerType::Contact, $seedID, $targID);
\CCrmActivity::Rebind(\CCrmOwnerType::Contact, $seedID, $targID);
\CCrmLiveFeed::Rebind(\CCrmOwnerType::Contact, $seedID, $targID);
\CCrmSonetRelation::RebindRelations(\CCrmOwnerType::Contact, $seedID, $targID);
\CCrmEvent::Rebind(\CCrmOwnerType::Contact, $seedID, $targID);
}
示例4: initialize
public function initialize()
{
if ($this->currentPhase === DealConversionPhase::INTERMEDIATE) {
$this->currentPhase = DealConversionPhase::INVOICE_CREATION;
}
if (!\CCrmDeal::Exists($this->entityID)) {
throw new EntityConversionException(\CCrmOwnerType::Deal, \CCrmOwnerType::Undefined, EntityConversionException::TARG_SRC, EntityConversionException::NOT_FOUND);
}
/** @var \CCrmPerms $permissions */
$permissions = $this->getUserPermissions();
if (!\CCrmAuthorizationHelper::CheckReadPermission(\CCrmOwnerType::DealName, $this->entityID, $permissions)) {
throw new EntityConversionException(\CCrmOwnerType::Deal, \CCrmOwnerType::Undefined, EntityConversionException::TARG_SRC, EntityConversionException::READ_DENIED);
}
if (!\CCrmAuthorizationHelper::CheckUpdatePermission(\CCrmOwnerType::DealName, $this->entityID, $permissions)) {
throw new EntityConversionException(\CCrmOwnerType::Deal, \CCrmOwnerType::Undefined, EntityConversionException::TARG_SRC, EntityConversionException::UPDATE_DENIED);
}
}
示例5: ResolveEntityInfo
private static function ResolveEntityInfo($typeID, $ID)
{
$typeID = intval($typeID);
$ID = intval($ID);
if (!(CCrmOwnerType::IsDefined($typeID) && $ID > 0)) {
return array('TYPE_ID' => $typeID, 'TYPE_NAME' => CCrmOwnerType::ResolveName($typeID), 'ID' => $ID);
}
$fields = null;
if ($typeID === CCrmOwnerType::Lead) {
$fields = CCrmLead::GetByID($ID, false);
} elseif ($typeID === CCrmOwnerType::Contact) {
$fields = CCrmContact::GetByID($ID, false);
} elseif ($typeID === CCrmOwnerType::Company) {
$fields = CCrmCompany::GetByID($ID, false);
} elseif ($typeID === CCrmOwnerType::Deal) {
$fields = CCrmDeal::GetByID($ID, false);
}
return array('TYPE_ID' => $typeID, 'TYPE_NAME' => CCrmOwnerType::ResolveName($typeID), 'ID' => $ID, 'FIELDS' => $fields);
}
示例6: CCrmContact
}
// Add Contact
require_once "contact.demo.php";
$CCrmContact = new CCrmContact();
foreach ($arContacts as $ID => $arParams) {
$arContacts[$ID]['ID'] = $CCrmContact->Add($arParams);
}
// Add Company
require_once "company.demo.php";
$CCrmCompany = new CCrmCompany();
foreach ($arCompany as $ID => $arParams) {
$arCompany[$ID]['ID'] = $CCrmCompany->Add($arParams);
}
// Add Deal
require_once "deal.demo.php";
$CCrmDeal = new CCrmDeal();
foreach ($arDeals as $ID => &$arParams) {
$arProductRows = null;
if (isset($arParams['PRODUCT_ROWS'])) {
$arProductRows = $arParams['PRODUCT_ROWS'];
unset($arParams['PRODUCT_ROWS']);
}
$arParams['CURRENCY_ID'] = $currencyID;
$dealID = $CCrmDeal->Add($arParams);
$arDeals[$ID]['ID'] = $dealID;
if (is_array($arProductRows)) {
foreach ($arProductRows as &$arProductRow) {
$originID = $arProductRow['ORIGIN_ID'];
$arProduct = CCrmProduct::GetByOriginID($originID, $catalogID);
if (!is_array($arProduct)) {
continue;
示例7: ShowError
}
$entityTypeName = CCrmOwnerType::ResolveName($entityTypeID);
$userPerms = CCrmPerms::GetCurrentUserPermissions();
if (!CCrmAuthorizationHelper::CheckReadPermission($entityTypeName, $entityID, $userPerms)) {
ShowError(GetMessage('CRM_PERMISSION_DENIED'));
return;
}
$arParams['UID'] = isset($arParams['UID']) ? $arParams['UID'] : '';
if (!isset($arParams['UID']) || $arParams['UID'] === '') {
$arParams['UID'] = 'mobile_crm_product_row_list';
}
$arResult['UID'] = $arParams['UID'];
$arResult['ITEMS'] = array();
$arResult['TAX_MODE'] = 'NONE';
if ($entityTypeID === CCrmOwnerType::Deal) {
$dbRes = CCrmDeal::GetListEx(array(), array('ID' => $entityID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('TITLE', 'CURRENCY_ID', 'OPPORTUNITY'));
$arOwner = $dbRes ? $dbRes->Fetch() : null;
if ($arOwner) {
$arResult['TITLE'] = isset($arOwner['TITLE']) ? $arOwner['TITLE'] : '';
$arResult['CURRENCY_ID'] = isset($arOwner['CURRENCY_ID']) ? $arOwner['CURRENCY_ID'] : CCrmCurrency::GetBaseCurrencyID();
$arResult['SUM'] = isset($arOwner['OPPORTUNITY']) ? $arOwner['OPPORTUNITY'] : 0.0;
} else {
$arResult['TITLE'] = '';
$arResult['CURRENCY_ID'] = CCrmCurrency::GetBaseCurrencyID();
$arResult['SUM'] = 0.0;
}
$productRows = CCrmProductRow::LoadRows(CCrmOwnerTypeAbbr::Deal, $entityID);
foreach ($productRows as &$productRow) {
$productRow['FORMATTED_PRICE'] = CCrmCurrency::MoneyToString($productRow['PRICE'], $arResult['CURRENCY_ID']);
$arResult['ITEMS'][] = $productRow;
}
示例8: isset
continue;
}
$productID = isset($arProduct['ID']) ? $arProduct['ID'] : 0;
if ($productID <= 0) {
continue;
}
$arProductRows = array(array('PRODUCT_ID' => $productID, 'PRICE' => isset($arLead['OPPORTUNITY']) ? doubleval($arLead['OPPORTUNITY']) : 0.0, 'QUANTITY' => 1));
CCrmLead::SaveProductRows($ID, $arProductRows);
}
}
COption::SetOptionString('crm', '~crm_11_0_6_convertion', 'Y');
}
// <-- Convert LEAD CURRENCY and PRODUCT
// Convert DEAL EVENTS -->
if (COption::GetOptionString('crm', '~CRM_DEAL_EVENT_CONVERT_11_5_7', 'N') !== 'Y') {
$dbDeals = CCrmDeal::GetListEx(array(), array('@EVENT_ID' => array('PHONE', 'INFO')), false, false, array());
while ($arDeal = $dbDeals->Fetch()) {
CCrmActivity::CreateFromDealEvent($arDeal);
}
COption::SetOptionString('crm', '~CRM_DEAL_EVENT_CONVERT_11_5_7', 'Y');
}
// <-- Convert DEAL EVENTS
// SETUP DEFAULT RESPONSIBLE FOR COMPANIES-->
if (COption::GetOptionString('crm', '~CRM_COMPANY_RESPONSIBLE_11_5_7', 'N') !== 'Y') {
try {
if (CCrmCompany::SetDefaultResponsible(true)) {
COption::SetOptionString('crm', '~CRM_COMPANY_RESPONSIBLE_11_5_7', 'Y');
}
} catch (Exception $e) {
}
}
示例9: array
$arDesc = array();
if (isset($arCompanyTypeList[$arRes['COMPANY_TYPE']])) {
$arDesc[] = $arCompanyTypeList[$arRes['COMPANY_TYPE']];
}
if (isset($arCompanyIndustryList[$arRes['INDUSTRY']])) {
$arDesc[] = $arCompanyIndustryList[$arRes['INDUSTRY']];
}
$ar[] = array('title' => str_replace(array(';', ','), ' ', $arRes['TITLE']), 'desc' => implode(', ', $arDesc), 'id' => $arRes['SID'], 'url' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_company_show'), array('company_id' => $arRes['ID'])), 'image' => $arImg['src'], 'type' => 'company', 'selected' => $sSelected);
}
$arResult['ELEMENT'] = array_merge($ar, $arResult['ELEMENT']);
}
if ($arSettings['DEAL'] == 'Y' && isset($arSelected['DEAL']) && !empty($arSelected['DEAL'])) {
$arDealStageList = CCrmStatus::GetStatusListEx('DEAL_STAGE');
$arSelect = array('ID', 'TITLE', 'STAGE_ID', 'COMPANY_TITLE', 'CONTACT_FULL_NAME');
$ar = array();
$obRes = CCrmDeal::GetList(array('ID' => 'DESC'), array('ID' => $arSelected['DEAL']), $arSelect);
while ($arRes = $obRes->Fetch()) {
$arRes['SID'] = $arResult['PREFIX'] == 'Y' ? 'D_' . $arRes['ID'] : $arRes['ID'];
if (isset($arResult['SELECTED'][$arRes['SID']])) {
unset($arResult['SELECTED'][$arRes['SID']]);
$sSelected = 'Y';
} else {
$sSelected = 'N';
}
$clientTitle = !empty($arRes['COMPANY_TITLE']) ? $arRes['COMPANY_TITLE'] : '';
$clientTitle .= ($clientTitle !== '' && !empty($arRes['CONTACT_FULL_NAME']) ? ', ' : '') . $arRes['CONTACT_FULL_NAME'];
$ar[] = array('title' => str_replace(array(';', ','), ' ', $arRes['TITLE']), 'desc' => $clientTitle, 'id' => $arRes['SID'], 'url' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_deal_show'), array('deal_id' => $arRes['ID'])), 'type' => 'deal', 'selected' => $sSelected);
}
$arResult['ELEMENT'] = array_merge($ar, $arResult['ELEMENT']);
}
if ($arSettings['QUOTE'] == 'Y' && isset($arSelected['QUOTE']) && !empty($arSelected['QUOTE'])) {
示例10: GetDealCostOriginal
public static function GetDealCostOriginal($deal_id)
{
$res = 0;
$ar = CCrmDeal::GetByID($deal_id);
if (is_array($ar)) {
$res = $ar['OPPORTUNITY'];
}
return $res;
}
示例11: array
$arResult['TOOLBAR_ID'] = $toolbarID;
$arResult['BUTTONS'] = array();
if ($arParams['TYPE'] == 'list') {
$bRead = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'READ');
$bExport = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'EXPORT');
$bImport = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'IMPORT');
$bAdd = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'ADD');
$bWrite = !$CrmPerms->HavePerm('DEAL', BX_CRM_PERM_NONE, 'WRITE');
$bDelete = false;
} else {
$bExport = false;
$bImport = false;
$bRead = CCrmDeal::CheckReadPermission($arParams['ELEMENT_ID'], $CrmPerms);
$bAdd = CCrmDeal::CheckCreatePermission($CrmPerms);
$bWrite = CCrmDeal::CheckUpdatePermission($arParams['ELEMENT_ID'], $CrmPerms);
$bDelete = CCrmDeal::CheckDeletePermission($arParams['ELEMENT_ID'], $CrmPerms);
}
if (!$bRead && !$bAdd && !$bWrite) {
return false;
}
if ($arParams['TYPE'] === 'list') {
if ($bAdd) {
$arResult['BUTTONS'][] = array('TEXT' => GetMessage('DEAL_ADD'), 'TITLE' => GetMessage('DEAL_ADD_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_EDIT'], array('deal_id' => 0)), 'HIGHLIGHT' => true);
}
if ($bImport) {
$arResult['BUTTONS'][] = array('TEXT' => GetMessage('DEAL_IMPORT'), 'TITLE' => GetMessage('DEAL_IMPORT_TITLE'), 'LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_IMPORT'], array()), 'ICON' => 'btn-import');
}
if ($bExport) {
$arResult['BUTTONS'][] = array('TITLE' => GetMessage('DEAL_EXPORT_CSV_TITLE'), 'TEXT' => GetMessage('DEAL_EXPORT_CSV'), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($APPLICATION->GetCurPage(), array()), array('type' => 'csv', 'ncc' => '1')), 'ICON' => 'btn-export');
$arResult['BUTTONS'][] = array('TITLE' => GetMessage('DEAL_EXPORT_EXCEL_TITLE'), 'TEXT' => GetMessage('DEAL_EXPORT_EXCEL'), 'LINK' => CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($APPLICATION->GetCurPage(), array()), array('type' => 'excel', 'ncc' => '1')), 'ICON' => 'btn-export');
}
示例12: map
public function map(EntityConversionMap $map, array $options = null)
{
$srcFields = $this->getSourceFields();
if (empty($srcFields)) {
return array();
}
$dstFields = array();
$dstEntityTypeID = $map->getDestinationEntityTypeID();
foreach ($map->getItems() as $item) {
$dstFieldID = $item->getDestinationField();
//Skip empty binding
if ($dstFieldID === '-') {
continue;
}
$srcFieldID = $item->getSourceField();
if ((!isset($srcFields[$srcFieldID]) || $srcFields[$srcFieldID] === '') && $srcFieldID !== 'PRODUCT_ROWS') {
$altSrcFieldID = '';
foreach ($item->getAlternativeSourceFields() as $fieldID) {
if (isset($srcFields[$fieldID])) {
$altSrcFieldID = $fieldID;
break;
}
}
if ($altSrcFieldID !== '') {
$srcFieldID = $altSrcFieldID;
}
}
if ($dstFieldID === '') {
$dstFieldID = $srcFieldID;
}
if (strpos($srcFieldID, 'UF_') === 0 && strpos($dstFieldID, 'UF_') === 0) {
self::mapUserField(\CCrmOwnerType::Deal, $srcFieldID, $srcFields, $dstEntityTypeID, $dstFieldID, $dstFields, $options);
} elseif ($srcFieldID === 'PRODUCT_ROWS') {
$productRows = \CCrmDeal::LoadProductRows($this->srcEntityID);
if (count($productRows) > 0) {
if ($dstEntityTypeID === \CCrmOwnerType::Invoice) {
$currencyID = isset($srcFields['CURRENCY_ID']) ? $srcFields['CURRENCY_ID'] : '';
if ($currencyID === '' || !\CCrmCurrency::IsExists($currencyID)) {
$currencyID = \CCrmCurrency::GetBaseCurrencyID();
}
$actualRows = \CCrmInvoice::ProductRows2BasketItems($productRows, $currencyID, \CCrmInvoice::GetCurrencyID());
if (count($actualRows) > 0) {
foreach ($actualRows as &$productRow) {
unset($productRow['ID']);
}
unset($productRow);
$dstFields[$dstFieldID] = $actualRows;
}
} else {
foreach ($productRows as &$productRow) {
unset($productRow['ID']);
}
unset($productRow);
$dstFields[$dstFieldID] = $productRows;
}
}
} elseif (isset($srcFields[$srcFieldID])) {
$dstFields[$dstFieldID] = $srcFields[$srcFieldID];
}
}
if (!empty($dstFields)) {
if ($dstEntityTypeID === \CCrmOwnerType::Invoice) {
$dstFields['UF_DEAL_ID'] = $this->srcEntityID;
//region Prepare Invoice Properties
$dstFields['INVOICE_PROPERTIES'] = array();
$invoiceEntity = new \CCrmInvoice(false);
$companyID = isset($dstFields['UF_COMPANY_ID']) ? (int) $dstFields['UF_COMPANY_ID'] : 0;
$contactID = isset($dstFields['UF_CONTACT_ID']) ? (int) $dstFields['UF_CONTACT_ID'] : 0;
$personTypeID = 0;
$personTypes = \CCrmPaySystem::getPersonTypeIDs();
if ($companyID > 0 && isset($personTypes['COMPANY'])) {
$personTypeID = $personTypes['COMPANY'];
} elseif (isset($personTypes['CONTACT'])) {
$personTypeID = $personTypes['CONTACT'];
}
$properties = $invoiceEntity->GetProperties(0, $personTypeID);
if (is_array($properties)) {
\CCrmInvoice::__RewritePayerInfo($companyID, $contactID, $invoiceProperties);
foreach ($properties as $property) {
$dstFields['INVOICE_PROPERTIES'][$property['FIELDS']['ID']] = $property['VALUE'];
}
}
//endregion
} elseif ($dstEntityTypeID === \CCrmOwnerType::Quote) {
$dstFields['DEAL_ID'] = $this->srcEntityID;
}
}
return $dstFields;
}
示例13: PrepareConversionPermissionFlags
public static function PrepareConversionPermissionFlags($ID, array &$params, $userPermissions = null)
{
if (!$userPermissions) {
$userPermissions = CCrmPerms::GetCurrentUserPermissions();
}
$canCreateDeal = CCrmDeal::CheckCreatePermission($userPermissions);
$canCreateInvoice = IsModuleInstalled('sale') && CCrmInvoice::CheckCreatePermission($userPermissions);
$params['CAN_CONVERT_TO_DEAL'] = $canCreateDeal;
$params['CAN_CONVERT_TO_INVOICE'] = $canCreateInvoice;
$params['CAN_CONVERT'] = $params['CONVERT'] = $canCreateInvoice || $canCreateDeal;
$restriction = \Bitrix\Crm\Restriction\RestrictionManager::getConversionRestriction();
if ($restriction->hasPermission()) {
$params['CONVERSION_PERMITTED'] = true;
} else {
$params['CONVERSION_PERMITTED'] = false;
$params['CONVERSION_LOCK_SCRIPT'] = $restriction->preparePopupScript();
}
}
示例14: TryGetInfo
public static function TryGetInfo($typeID, $ID, &$info, $bCheckPermissions = false)
{
$typeID = intval($typeID);
$ID = intval($ID);
if ($ID <= 0) {
return array();
}
$result = null;
switch ($typeID) {
case self::Lead:
$dbRes = CCrmLead::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => $bCheckPermissions ? 'Y' : 'N'), false, false, array('TITLE'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'IMAGE_ID' => 0);
return true;
}
break;
case self::Contact:
$dbRes = CCrmContact::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => $bCheckPermissions ? 'Y' : 'N'), false, false, array('NAME', 'SECOND_NAME', 'LAST_NAME', 'PHOTO'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => CUser::FormatName(\Bitrix\Crm\Format\PersonNameFormatter::getFormat(), array('LOGIN' => '', 'NAME' => isset($arRes['NAME']) ? $arRes['NAME'] : '', 'SECOND_NAME' => isset($arRes['SECOND_NAME']) ? $arRes['SECOND_NAME'] : '', 'LAST_NAME' => isset($arRes['LAST_NAME']) ? $arRes['LAST_NAME'] : ''), false, false), 'IMAGE_ID' => isset($arRes['PHOTO']) ? intval($arRes['PHOTO']) : 0);
return true;
}
break;
case self::Company:
$dbRes = CCrmCompany::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => $bCheckPermissions ? 'Y' : 'N'), false, false, array('TITLE', 'LOGO'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'IMAGE_ID' => isset($arRes['LOGO']) ? intval($arRes['LOGO']) : 0);
return true;
}
break;
case self::Deal:
$dbRes = CCrmDeal::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => $bCheckPermissions ? 'Y' : 'N'), false, false, array('TITLE'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'IMAGE_ID' => 0);
return true;
}
break;
case self::Invoice:
$dbRes = CCrmInvoice::GetList(array(), array('ID' => $ID), false, false, array('ORDER_TOPIC'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => isset($arRes['ORDER_TOPIC']) ? $arRes['ORDER_TOPIC'] : '', 'IMAGE_ID' => 0);
return true;
}
break;
case self::Quote:
$dbRes = CCrmQuote::GetList(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => $bCheckPermissions ? 'Y' : 'N'), false, false, array('TITLE'));
$arRes = $dbRes ? $dbRes->Fetch() : null;
if (is_array($arRes)) {
$info = array('CAPTION' => isset($arRes['TITLE']) ? $arRes['TITLE'] : '', 'IMAGE_ID' => 0);
return true;
}
break;
}
return false;
}
示例15: GetDocumentType
public static function GetDocumentType($documentId)
{
$arDocumentID = self::GetDocumentInfo($documentId);
if (empty($arDocumentID)) {
throw new CBPArgumentNullException('documentId');
}
switch ($arDocumentID['TYPE']) {
case 'CONTACT':
$dbDocumentList = CCrmContact::GetList(array(), array('ID' => $arDocumentID['ID'], "CHECK_PERMISSIONS" => "N"), array('ID'));
break;
case 'COMPANY':
$dbDocumentList = CCrmCompany::GetList(array(), array('ID' => $arDocumentID['ID'], "CHECK_PERMISSIONS" => "N"), array('ID'));
break;
case 'DEAL':
$dbDocumentList = CCrmDeal::GetList(array(), array('ID' => $arDocumentID['ID'], "CHECK_PERMISSIONS" => "N"), array('ID'));
break;
case 'LEAD':
$dbDocumentList = CCrmLead::GetList(array(), array('ID' => $arDocumentID['ID'], "CHECK_PERMISSIONS" => "N"), array('ID'));
break;
}
$arResult = $dbDocumentList->Fetch();
if (!$arResult) {
throw new Exception(GetMessage('CRM_DOCUMENT_ELEMENT_IS_NOT_FOUND'));
}
return $arDocumentID['TYPE'];
}