• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CCrmCompany类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CCrmCompany的典型用法代码示例。如果您正苦于以下问题:PHP CCrmCompany类的具体用法?PHP CCrmCompany怎么用?PHP CCrmCompany使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了CCrmCompany类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getCompanyInfo

 protected static function getCompanyInfo($companyID)
 {
     if ($companyID <= 0) {
         return array();
     }
     $result = array('TITLE' => '', 'FULL_ADDRESS' => '', 'PHONE' => '', 'EMAIL' => '');
     $dbRes = \CCrmCompany::GetListEx(array(), array('=ID' => $companyID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('TITLE', 'ADDRESS', 'ADDRESS_2', 'ADDRESS_CITY', 'ADDRESS_POSTAL_CODE', 'ADDRESS_REGION', 'ADDRESS_PROVINCE', 'ADDRESS_COUNTRY'));
     $fields = is_object($dbRes) ? $dbRes->Fetch() : null;
     if (is_array($fields)) {
         $result['TITLE'] = isset($fields['TITLE']) ? $fields['TITLE'] : '';
         $result['FULL_ADDRESS'] = Format\CompanyAddressFormatter::format($fields, array('SEPARATOR' => Format\AddressSeparator::NewLine));
         $dbRes = \CCrmFieldMulti::GetListEx(array('ID' => 'asc'), array('ENTITY_ID' => 'COMPANY', 'ELEMENT_ID' => $companyID, '@TYPE_ID' => array('PHONE', 'EMAIL')), false, false, array('TYPE_ID', 'VALUE'));
         while ($multiFields = $dbRes->Fetch()) {
             if ($result['PHONE'] === '' && $multiFields['TYPE_ID'] === 'PHONE') {
                 $result['PHONE'] = $multiFields['VALUE'];
             } elseif ($result['EMAIL'] === '' && $multiFields['TYPE_ID'] === 'EMAIL') {
                 $result['EMAIL'] = $multiFields['VALUE'];
             }
             if ($result['PHONE'] !== '' && $result['EMAIL'] !== '') {
                 break;
             }
         }
     }
     return $result;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:25,代码来源:datagenerator.php


示例2: 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);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:19,代码来源:template_mapper.php


示例3: array

}
if ($arResult['ACTIVITY_ENTITY_LINK'] == 'Y') {
    if (isset($arCalList['LEAD']) && !empty($arCalList['LEAD'])) {
        $dbRes = CCrmLead::GetList(array('TITLE' => 'ASC', 'LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('ID' => array_keys($arCalList['LEAD'])));
        while ($arRes = $dbRes->Fetch()) {
            $arCalList['LEAD'][$arRes['ID']] = array('ENTITY_TITLE' => $arRes['TITLE'], 'ENTITY_LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_LEAD_SHOW'], array('lead_id' => $arRes['ID'])));
        }
    }
    if (isset($arCalList['CONTACT']) && !empty($arCalList['CONTACT'])) {
        $dbRes = CCrmContact::GetList(array('LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('ID' => array_keys($arCalList['CONTACT'])));
        while ($arRes = $dbRes->Fetch()) {
            $arCalList['CONTACT'][$arRes['ID']] = array('ENTITY_TITLE' => $arRes['LAST_NAME'] . ' ' . $arRes['NAME'], 'ENTITY_LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_CONTACT_SHOW'], array('contact_id' => $arRes['ID'])));
        }
    }
    if (isset($arCalList['COMPANY']) && !empty($arCalList['COMPANY'])) {
        $dbRes = CCrmCompany::GetList(array('TITLE' => 'ASC'), array('ID' => array_keys($arCalList['COMPANY'])));
        while ($arRes = $dbRes->Fetch()) {
            $arCalList['COMPANY'][$arRes['ID']] = array('ENTITY_TITLE' => $arRes['TITLE'], 'ENTITY_LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_COMPANY_SHOW'], array('company_id' => $arRes['ID'])));
        }
    }
    if (isset($arCalList['DEAL']) && !empty($arCalList['DEAL'])) {
        $dbRes = CCrmDeal::GetList(array('TITLE' => 'ASC'), array('ID' => array_keys($arCalList['DEAL'])));
        while ($arRes = $dbRes->Fetch()) {
            $arCalList['DEAL'][$arRes['ID']] = array('ENTITY_TITLE' => $arRes['TITLE'], 'ENTITY_LINK' => CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_DEAL_SHOW'], array('deal_id' => $arRes['ID'])));
        }
    }
    foreach ($arResult['CAL'] as $key => $ar) {
        $arResult['CAL'][$key]['ENTITY_TITLE'] = htmlspecialcharsbx($arCalList[$ar['ENTITY_TYPE']][$ar['ENTITY_ID']]['ENTITY_TITLE']);
        $arResult['CAL'][$key]['ENTITY_LINK'] = $arCalList[$ar['ENTITY_TYPE']][$ar['ENTITY_ID']]['ENTITY_LINK'];
    }
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


示例4: array

             if (!is_array($arProduct)) {
                 continue;
             }
             CCrmLead::SaveProductRows($leadID, array(array('PRODUCT_ID' => intval($arProduct['ID']), 'PRICE' => doubleval($arProduct['PRICE']), 'QUANTITY' => 1)));
         }
     }
 }
 // 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;
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:index.php


示例5: array

     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) {
     }
 }
 // FIX FOR CALENDAR EVENT BINBINGS-->
 if (COption::GetOptionString('crm', '~CRM_CAL_EVENT_BINDING_12_0_4', 'N') !== 'Y') {
     try {
         if ($DB->TableExists('b_crm_act')) {
             CCrmActivity::RefreshCalendarBindings();
             COption::SetOptionString('crm', '~CRM_CAL_EVENT_BINDING_12_0_4', 'Y');
         }
     } catch (Exception $e) {
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:include.php


示例6: isset

             $sSelected = 'N';
         }
         if ($hasNameFormatter) {
             $title = CCrmContact::PrepareFormattedName(array('HONORIFIC' => isset($arRes['HONORIFIC']) ? $arRes['HONORIFIC'] : '', 'NAME' => isset($arRes['NAME']) ? $arRes['NAME'] : '', 'SECOND_NAME' => isset($arRes['SECOND_NAME']) ? $arRes['SECOND_NAME'] : '', 'LAST_NAME' => isset($arRes['LAST_NAME']) ? $arRes['LAST_NAME'] : ''));
         } else {
             $title = isset($arRes['FULL_NAME']) ? $arRes['FULL_NAME'] : '';
         }
         $ar[] = array('title' => $title, 'desc' => empty($arRes['COMPANY_TITLE']) ? '' : $arRes['COMPANY_TITLE'], 'id' => $arRes['SID'], 'url' => CComponentEngine::MakePathFromTemplate(COption::GetOptionString('crm', 'path_to_contact_show'), array('contact_id' => $arRes['ID'])), 'image' => $arImg['src'], 'type' => 'contact', 'selected' => $sSelected);
     }
     $arResult['ELEMENT'] = array_merge($ar, $arResult['ELEMENT']);
 }
 if ($arSettings['COMPANY'] == 'Y' && isset($arSelected['COMPANY']) && !empty($arSelected['COMPANY'])) {
     $arCompanyTypeList = CCrmStatus::GetStatusListEx('COMPANY_TYPE');
     $arCompanyIndustryList = CCrmStatus::GetStatusListEx('INDUSTRY');
     $arSelect = array('ID', 'TITLE', 'COMPANY_TYPE', 'INDUSTRY', 'LOGO');
     $obRes = CCrmCompany::GetList(array('ID' => 'DESC'), array('ID' => $arSelected['COMPANY']), $arSelect);
     $arFiles = array();
     $ar = array();
     while ($arRes = $obRes->Fetch()) {
         $arImg = array();
         if (!empty($arRes['LOGO']) && !isset($arFiles[$arRes['LOGO']])) {
             if (intval($arRes['LOGO']) > 0) {
                 $arImg = CFile::ResizeImageGet($arRes['LOGO'], array('width' => 25, 'height' => 25), BX_RESIZE_IMAGE_EXACT);
             }
             $arFiles[$arRes['LOGO']] = $arImg['src'];
         }
         $arRes['SID'] = $arResult['PREFIX'] == 'Y' ? 'CO_' . $arRes['ID'] : $arRes['ID'];
         if (isset($arResult['SELECTED'][$arRes['SID']])) {
             unset($arResult['SELECTED'][$arRes['SID']]);
             $sSelected = 'Y';
         } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:result_modifier.php


示例7: GetEntityList

 public static function GetEntityList($entityTypeID, $userID, $sortOrder, array $filter, $navParams = false)
 {
     $entityTypeID = (int) $entityTypeID;
     $userID = (int) $userID;
     $userIDs = array(0);
     if ($userID > 0) {
         $userIDs[] = $userID;
     }
     $lb = null;
     if ($entityTypeID === CCrmOwnerType::Lead) {
         $lb = CCrmLead::CreateListBuilder();
     } else {
         if ($entityTypeID === CCrmOwnerType::Deal) {
             $lb = CCrmDeal::CreateListBuilder();
         } else {
             if ($entityTypeID === CCrmOwnerType::Contact) {
                 $lb = CCrmContact::CreateListBuilder();
             } else {
                 if ($entityTypeID === CCrmOwnerType::Company) {
                     $lb = CCrmCompany::CreateListBuilder();
                 }
             }
         }
     }
     if (!$lb) {
         return null;
     }
     $fields = $lb->GetFields();
     $entityAlias = $lb->GetTableAlias();
     $join = 'LEFT JOIN ' . CCrmActivity::USER_ACTIVITY_TABLE_NAME . ' UA ON UA.USER_ID IN (' . implode(',', $userIDs) . ') AND UA.OWNER_ID = ' . $entityAlias . '.ID AND UA.OWNER_TYPE_ID = ' . $entityTypeID;
     $fields['ACTIVITY_USER_ID'] = array('FIELD' => 'MAX(UA.USER_ID)', 'TYPE' => 'int', 'FROM' => $join);
     $fields['ACTIVITY_SORT'] = array('FIELD' => 'MAX(UA.SORT)', 'TYPE' => 'string', 'FROM' => $join);
     $lb->SetFields($fields);
     $sortOrder = strtoupper($sortOrder);
     if ($sortOrder !== 'DESC' && $sortOrder !== 'ASC') {
         $sortOrder = 'ASC';
     }
     $options = array('PERMISSION_SQL_TYPE' => 'FROM', 'PERMISSION_SQL_UNION' => 'DISTINCT');
     return $lb->Prepare(array('ACTIVITY_USER_ID' => 'DESC', 'ACTIVITY_SORT' => $sortOrder, 'ID' => $sortOrder), $filter, array('ID'), $navParams, array('ID'), $options);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:40,代码来源:crm_activity.php


示例8: array

    $matches = array();
    if (preg_match('/^\\[(\\d+?)]/i', $search, $matches)) {
        $matches[1] = intval($matches[1]);
        if ($matches[1] > 0) {
            $dbRes = CCrmCompany::GetList(array('TITLE' => 'ASC', 'LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('ID' => $matches[1]));
            if ($arRes = $dbRes->Fetch()) {
                $arData = array(array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', $arRes['TITLE']), 'READY' => 'Y'));
                Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
                echo CUtil::PhpToJsObject($arData);
                die;
            }
        }
    }
    $arData = array();
    $dbRes = CCrmCompany::GetList(array('TITLE' => 'ASC', 'LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('TITLE' => '%' . trim($search) . '%'));
    while ($arRes = $dbRes->Fetch()) {
        $arData[] = array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', $arRes['TITLE']), 'READY' => 'Y');
    }
    if (empty($arData)) {
        $dbRes = CCrmCompany::GetList(array('TITLE' => 'ASC', 'LAST_NAME' => 'ASC', 'NAME' => 'ASC'), array('ID' => intval($search)));
        if ($arRes = $dbRes->Fetch()) {
            $arData = array(array('ID' => $arRes['ID'], 'NAME' => str_replace(array(';', ','), ' ', $arRes['TITLE']), 'READY' => 'Y'));
            Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
            echo CUtil::PhpToJsObject($arData);
            die;
        }
    }
    Header('Content-Type: application/x-javascript; charset=' . LANG_CHARSET);
    echo CUtil::PhpToJsObject($arData);
    die;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


示例9: __CrmMobileFileEndResonse

        die;
    }
}
if (CModule::IncludeModule('compression')) {
    CCompress::Disable2048Spaces();
}
CUtil::JSPostUnescape();
if (!CModule::IncludeModule('crm')) {
    __CrmMobileFileEndResonse(array('error' => 'Could not include "crm" module.'));
}
if (!(check_bitrix_sessid() && CCrmSecurityHelper::IsAuthorized())) {
    __CrmMobileFileEndResonse(array('error' => 'Access denied.'));
}
global $APPLICATION;
if ($_SERVER['REQUEST_METHOD'] === 'POST' && is_array($_FILES) && !empty($_FILES)) {
    $ID = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
    $hasPermission = $ID > 0 ? CCrmCompany::CheckUpdatePermission($ID) : CCrmCompany::CheckCreatePermission();
    if (!$hasPermission) {
        __CrmMobileFileEndResonse(array('error' => 'Access denied.'));
    } else {
        $result = array();
        if (!CCrmMobileHelper::TryUploadFile($result, array('OWNER_TYPE_ID' => CCrmOwnerType::Company, 'OWNER_ID' => $ID, 'SCOPE' => 'I', 'MAX_FILE_SIZE' => 5242880))) {
            __CrmMobileFileEndResonse(array('error' => $result['ERROR_MESSAGE']));
        } else {
            $fileID = $result['FILE_ID'];
            $fileInfo = CFile::ResizeImageGet($fileID, array('width' => 55, 'height' => 55), BX_RESIZE_IMAGE_EXACT, false, false, true);
            __CrmMobileFileEndResonse(array('fileId' => $fileID, 'showUrl' => is_array($fileInfo) && isset($fileInfo['src']) ? $fileInfo['src'] : ''));
        }
    }
}
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_after.php';
开发者ID:pitnan,项目名称:u136056,代码行数:31,代码来源:file.php


示例10: 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'];
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:26,代码来源:crm_document.php


示例11: fillFilterReferenceColumn

 public static function fillFilterReferenceColumn(&$filterElement, &$field)
 {
     if ($field->getRefEntityName() == '\\Bitrix\\Crm\\Company') {
         // CrmCompany
         if ($filterElement['value']) {
             $entity = CCrmCompany::GetById($filterElement['value']);
             if ($entity) {
                 $filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_COMPANY_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     } elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Contact') {
         // CrmContact
         if ($filterElement['value']) {
             $entity = CCrmContact::GetById($filterElement['value']);
             if ($entity) {
                 $filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['FULL_NAME']);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_CONTACT_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     } elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Invoice') {
         // CrmInvoice
         if ($filterElement['value']) {
             $entity = CCrmInvoice::GetById($filterElement['value']);
             if ($entity) {
                 $filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['ORDER_TOPIC']);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_INVOICE_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     } elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Deal') {
         // CrmDeal
         if ($filterElement['value']) {
             $entity = CCrmDeal::GetById($filterElement['value']);
             if ($entity) {
                 $filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_DEAL_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     } elseif ($field->getRefEntityName() == '\\Bitrix\\Crm\\Lead') {
         // CrmLead
         if ($filterElement['value']) {
             $entity = CCrmLead::GetById($filterElement['value']);
             if ($entity) {
                 $filterElement['value'] = array('id' => $entity['ID'], 'name' => $entity['TITLE']);
             } else {
                 $filterElement['value'] = array('id' => $filterElement['value'], 'name' => GetMessage('CRM_LEAD_NOT_FOUND'));
             }
         } else {
             $filterElement['value'] = array('id' => '');
         }
     }
     parent::fillFilterReferenceColumn($filterElement, $field);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:65,代码来源:crm_report_helper.php


示例12: UpdateDocument

 public static function UpdateDocument($documentId, $arFields)
 {
     global $DB;
     $arDocumentID = self::GetDocumentInfo($documentId);
     if (empty($arDocumentID)) {
         throw new CBPArgumentNullException('documentId');
     }
     $dbDocumentList = CCrmCompany::GetList(array(), array('ID' => $arDocumentID['ID'], "CHECK_PERMISSIONS" => "N"), array('ID'));
     $arResult = $dbDocumentList->Fetch();
     if (!$arResult) {
         throw new Exception(GetMessage('CRM_DOCUMENT_ELEMENT_IS_NOT_FOUND'));
     }
     $arDocumentFields = self::GetDocumentFields($arDocumentID['TYPE']);
     $arKeys = array_keys($arFields);
     foreach ($arKeys as $key) {
         if (!array_key_exists($key, $arDocumentFields)) {
             //Fix for issue #40374
             unset($arFields[$key]);
             continue;
         }
         $fieldType = $arDocumentFields[$key]["Type"];
         if (in_array($fieldType, array("phone", "email", "im", "web"), true)) {
             CCrmDocument::PrepareEntityMultiFields($arFields, strtoupper($fieldType));
             continue;
         }
         $arFields[$key] = is_array($arFields[$key]) && !CBPHelper::IsAssociativeArray($arFields[$key]) ? $arFields[$key] : array($arFields[$key]);
         if ($fieldType == "user") {
             $ar = array();
             foreach ($arFields[$key] as $v1) {
                 if (substr($v1, 0, strlen("user_")) == "user_") {
                     $ar[] = substr($v1, strlen("user_"));
                 } else {
                     $a1 = self::GetUsersFromUserGroup($v1, $documentId);
                     foreach ($a1 as $a11) {
                         $ar[] = $a11;
                     }
                 }
             }
             $arFields[$key] = $ar;
         } elseif ($fieldType == "select" && substr($key, 0, 3) == "UF_") {
             self::InternalizeEnumerationField('CRM_COMPANY', $arFields, $key);
         } elseif ($fieldType == "file") {
             $arFileOptions = array('ENABLE_ID' => true);
             foreach ($arFields[$key] as &$value) {
                 //Issue #40380. Secure URLs and file IDs are allowed.
                 $file = false;
                 CCrmFileProxy::TryResolveFile($value, $file, $arFileOptions);
                 $value = $file;
             }
             unset($value);
         } elseif ($fieldType == "S:HTML") {
             foreach ($arFields[$key] as &$value) {
                 $value = array("VALUE" => $value);
             }
             unset($value);
         }
         if (!$arDocumentFields[$key]["Multiple"] && is_array($arFields[$key])) {
             if (count($arFields[$key]) > 0) {
                 $a = array_values($arFields[$key]);
                 $arFields[$key] = $a[0];
             } else {
                 $arFields[$key] = null;
             }
         }
     }
     if (isset($arFields['CONTACT_ID']) && !is_array($arFields['CONTACT_ID'])) {
         $arFields['CONTACT_ID'] = array($arFields['CONTACT_ID']);
     }
     if (isset($arFields['COMMENTS']) && $arFields['COMMENTS'] !== '') {
         $arFields['COMMENTS'] = preg_replace("/[\r\n]+/" . BX_UTF_PCRE_MODIFIER, "<br/>", $arFields['COMMENTS']);
     }
     $DB->StartTransaction();
     $CCrmEntity = new CCrmCompany(false);
     $res = $CCrmEntity->Update($arDocumentID['ID'], $arFields);
     if (!$res) {
         $DB->Rollback();
         throw new Exception($CCrmEntity->LAST_ERROR);
     }
     if (COption::GetOptionString("crm", "start_bp_within_bp", "N") == "Y") {
         $CCrmBizProc = new CCrmBizProc('COMPANY');
         if (false === $CCrmBizProc->CheckFields($arDocumentID['ID'], true)) {
             throw new Exception($CCrmBizProc->LAST_ERROR);
         }
         if ($res && !$CCrmBizProc->StartWorkflow($arDocumentID['ID'])) {
             $DB->Rollback();
             throw new Exception($CCrmBizProc->LAST_ERROR);
         }
     }
     if ($res) {
         $DB->Commit();
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:92,代码来源:crm_document_company.php


示例13: __CrmCompanyShowEndJsonResonse

 if (count($fieldNames) == 0) {
     __CrmCompanyShowEndJsonResonse(array('ERROR' => 'FIELD_NAME IS NOT DEFINED!'));
 }
 $fieldValues = array();
 if (isset($_POST['FIELD_VALUE'])) {
     if (is_array($_POST['FIELD_VALUE'])) {
         $fieldValues = $_POST['FIELD_VALUE'];
     } else {
         $fieldValues[] = $_POST['FIELD_VALUE'];
     }
 }
 $dbResult = CCrmCompany::GetListEx(array(), array('=ID' => $ID, 'CHECK_PERMISSIONS' => 'N'), false, false, array('*', 'UF_*'));
 $arFields = is_object($dbResult) ? $dbResult->Fetch() : null;
 if (is_array($arFields)) {
     CCrmInstantEditorHelper::PrepareUpdate(CCrmOwnerType::Company, $arFields, $fieldNames, $fieldValues);
     $CCrmCompany = new CCrmCompany();
     $disableUserFieldCheck = !$hasUserFields && isset($_POST['DISABLE_USER_FIELD_CHECK']) && strtoupper($_POST['DISABLE_USER_FIELD_CHECK']) === 'Y';
     if ($CCrmCompany->Update($ID, $arFields, true, true, array('REGISTER_SONET_EVENT' => true, 'DISABLE_USER_FIELD_CHECK' => $disableUserFieldCheck))) {
         $arErrors = array();
         CCrmBizProcHelper::AutoStartWorkflows(CCrmOwnerType::Company, $ID, CCrmBizProcEventType::Edit, $arErrors);
         $result = array();
         $count = count($fieldNames);
         for ($i = 0; $i < $count; $i++) {
             $fieldName = $fieldNames[$i];
             if (strpos($fieldName, 'FM.') === 0) {
                 //Filed name like 'FM.PHONE.WORK.1279'
                 $fieldParams = explode('.', $fieldName);
                 if (count($fieldParams) >= 3) {
                     $result[$fieldName] = array('VIEW_HTML' => CCrmViewHelper::PrepareMultiFieldHtml($fieldParams[1], array('VALUE_TYPE_ID' => $fieldParams[2], 'VALUE' => isset($fieldValues[$i]) ? $fieldValues[$i] : '')));
                 }
             }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php


示例14: CompareFields

 public static function CompareFields($arFieldsOrig, $arFieldsModif, $bCheckPerms = true)
 {
     $arMsg = array();
     if (isset($arFieldsOrig['TITLE']) && isset($arFieldsModif['TITLE']) && $arFieldsOrig['TITLE'] != $arFieldsModif['TITLE']) {
         $arMsg[] = array('ENTITY_FIELD' => 'TITLE', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_TITLE'), 'EVENT_TEXT_1' => $arFieldsOrig['TITLE'], 'EVENT_TEXT_2' => $arFieldsModif['TITLE']);
     }
     if (isset($arFieldsOrig['COMPANY_ID']) && isset($arFieldsModif['COMPANY_ID']) && (int) $arFieldsOrig['COMPANY_ID'] != (int) $arFieldsModif['COMPANY_ID']) {
         $arCompany = array();
         $arFilterTmp = array('ID' => array($arFieldsOrig['COMPANY_ID'], $arFieldsModif['COMPANY_ID']));
         if (!$bCheckPerms) {
             $arFilterTmp["CHECK_PERMISSIONS"] = "N";
         }
         $dbRes = CCrmCompany::GetList(array('TITLE' => 'ASC'), $arFilterTmp);
         while ($arRes = $dbRes->Fetch()) {
             $arCompany[$arRes['ID']] = $arRes['TITLE'];
         }
         $arMsg[] = array('ENTITY_FIELD' => 'COMPANY_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_COMPANY_ID'), 'EVENT_TEXT_1' => CrmCompareFieldsList($arCompany, $arFieldsOrig['COMPANY_ID']), 'EVENT_TEXT_2' => CrmCompareFieldsList($arCompany, $arFieldsModif['COMPANY_ID']));
     }
     if (isset($arFieldsOrig['CONTACT_ID']) && isset($arFieldsModif['CONTACT_ID']) && (int) $arFieldsOrig['CONTACT_ID'] != (int) $arFieldsModif['CONTACT_ID']) {
         $arContact = array();
         $arFilterTmp = array('ID' => array($arFieldsOrig['CONTACT_ID'], $arFieldsModif['CONTACT_ID']));
         if (!$bCheckPerms) {
             $arFilterTmp["CHECK_PERMISSIONS"] = "N";
         }
         $dbRes = CCrmContact::GetList(array('LAST_NAME' => 'ASC', 'NAME' => 'ASC'), $arFilterTmp);
         while ($arRes = $dbRes->Fetch()) {
             $arContact[$arRes['ID']] = $arRes['LAST_NAME'] . ' ' . $arRes['NAME'];
         }
         $arMsg[] = array('ENTITY_FIELD' => 'CONTACT_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_CONTACT_ID'), 'EVENT_TEXT_1' => CrmCompareFieldsList($arContact, $arFieldsOrig['CONTACT_ID']), 'EVENT_TEXT_2' => CrmCompareFieldsList($arContact, $arFieldsModif['CONTACT_ID']));
     }
     if (isset($arFieldsOrig['ASSIGNED_BY_ID']) && isset($arFieldsModif['ASSIGNED_BY_ID']) && (int) $arFieldsOrig['ASSIGNED_BY_ID'] != (int) $arFieldsModif['ASSIGNED_BY_ID']) {
         $arUser = array();
         $dbUsers = CUser::GetList($sort_by = 'last_name', $sort_dir = 'asc', array('ID' => implode('|', array(intval($arFieldsOrig['ASSIGNED_BY_ID']), intval($arFieldsModif['ASSIGNED_BY_ID'])))), array('SELECT' => array('NAME', 'SECOND_NAME', 'LAST_NAME', 'LOGIN', 'EMAIL')));
         while ($arRes = $dbUsers->Fetch()) {
             $arUser[$arRes['ID']] = CUser::FormatName(CSite::GetNameFormat(false), $arRes);
         }
         $arMsg[] = array('ENTITY_FIELD' => 'ASSIGNED_BY_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_ASSIGNED_BY_ID'), 'EVENT_TEXT_1' => CrmCompareFieldsList($arUser, $arFieldsOrig['ASSIGNED_BY_ID']), 'EVENT_TEXT_2' => CrmCompareFieldsList($arUser, $arFieldsModif['ASSIGNED_BY_ID']));
     }
     if (isset($arFieldsOrig['STAGE_ID']) && isset($arFieldsModif['STAGE_ID']) && $arFieldsOrig['STAGE_ID'] != $arFieldsModif['STAGE_ID']) {
         $arStatus = CCrmStatus::GetStatusList('DEAL_STAGE');
         $arMsg[] = array('ENTITY_FIELD' => 'STAGE_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_DEAL_STAGE'), 'EVENT_TEXT_1' => htmlspecialcharsbx(CrmCompareFieldsList($arStatus, $arFieldsOrig['STAGE_ID'])), 'EVENT_TEXT_2' => htmlspecialcharsbx(CrmCompareFieldsList($arStatus, $arFieldsModif['STAGE_ID'])));
     }
     /*
     if (isset($arFieldsOrig['STATE_ID']) && isset($arFieldsModif['STATE_ID'])
     	&& $arFieldsOrig['STATE_ID'] != $arFieldsModif['STATE_ID'])
     {
     	$CCrmStatus = new CCrmStatus('DEAL_STATE');
     	$arStatusOrig = $CCrmStatus->GetStatusByStatusId($arFieldsOrig['STATE_ID']);
     	$arStatusModif = $CCrmStatus->GetStatusByStatusId($arFieldsModif['STATE_ID']);
     
     	$arMsg[] = Array(
     		'ENTITY_FIELD' => 'STATE_ID',
     		'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_DEAL_STATE'),
     		'EVENT_TEXT_1' => isset($arStatusOrig['NAME'])? $arStatusOrig['NAME']: GetMessage('CRM_FIELD_COMPARE_EMPTY'),
     		'EVENT_TEXT_2' => isset($arStatusModif['NAME'])? $arStatusModif['NAME']: GetMessage('CRM_FIELD_COMPARE_EMPTY'),
     	);
     }
     */
     if (isset($arFieldsOrig['TYPE_ID']) && isset($arFieldsModif['TYPE_ID']) && $arFieldsOrig['TYPE_ID'] != $arFieldsModif['TYPE_ID']) {
         $arStatus = CCrmStatus::GetStatusList('DEAL_TYPE');
         $arMsg[] = array('ENTITY_FIELD' => 'TYPE_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_DEAL_TYPE'), 'EVENT_TEXT_1' => htmlspecialcharsbx(CrmCompareFieldsList($arStatus, $arFieldsOrig['TYPE_ID'])), 'EVENT_TEXT_2' => htmlspecialcharsbx(CrmCompareFieldsList($arStatus, $arFieldsModif['TYPE_ID'])));
     }
     if (isset($arFieldsOrig['COMMENTS']) && isset($arFieldsModif['COMMENTS']) && $arFieldsOrig['COMMENTS'] != $arFieldsModif['COMMENTS']) {
         $arMsg[] = array('ENTITY_FIELD' => 'COMMENTS', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_COMMENTS'), 'EVENT_TEXT_1' => !empty($arFieldsOrig['COMMENTS']) ? $arFieldsOrig['COMMENTS'] : GetMessage('CRM_FIELD_COMPARE_EMPTY'), 'EVENT_TEXT_2' => !empty($arFieldsModif['COMMENTS']) ? $arFieldsModif['COMMENTS'] : GetMessage('CRM_FIELD_COMPARE_EMPTY'));
     }
     //		if (isset($arFieldsOrig['PRODUCT_ID']) && isset($arFieldsModif['PRODUCT_ID'])
     //			&& $arFieldsOrig['PRODUCT_ID'] != $arFieldsModif['PRODUCT_ID'])
     //		{
     //			$arStatus = CCrmStatus::GetStatusList('PRODUCT');
     //			$arMsg[] = Array(
     //				'ENTITY_FIELD' => 'PRODUCT_ID',
     //				'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_PRODUCT'),
     //				'EVENT_TEXT_1' => CrmCompareFieldsList($arStatus, $arFieldsOrig['PRODUCT_ID']),
     //				'EVENT_TEXT_2' => CrmCompareFieldsList($arStatus, $arFieldsModif['PRODUCT_ID'])
     //			);
     //		}
     if (isset($arFieldsOrig['OPPORTUNITY']) && isset($arFieldsModif['OPPORTUNITY']) && $arFieldsOrig['OPPORTUNITY'] != $arFieldsModif['OPPORTUNITY'] || isset($arFieldsOrig['CURRENCY_ID']) && isset($arFieldsModif['CURRENCY_ID']) && $arFieldsOrig['CURRENCY_ID'] != $arFieldsModif['CURRENCY_ID']) {
         $arStatus = CCrmCurrencyHelper::PrepareListItems();
         $arMsg[] = array('ENTITY_FIELD' => 'OPPORTUNITY', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_OPPORTUNITY'), 'EVENT_TEXT_1' => floatval($arFieldsOrig['OPPORTUNITY']) . (($val = CrmCompareFieldsList($arStatus, $arFieldsOrig['CURRENCY_ID'], '')) != '' ? ' (' . $val . ')' : ''), 'EVENT_TEXT_2' => floatval($arFieldsModif['OPPORTUNITY']) . (($val = CrmCompareFieldsList($arStatus, $arFieldsModif['CURRENCY_ID'], '')) != '' ? ' (' . $val . ')' : ''));
     }
     if (isset($arFieldsOrig['TAX_VALUE']) && isset($arFieldsModif['TAX_VALUE']) && $arFieldsOrig['TAX_VALUE'] != $arFieldsModif['TAX_VALUE'] || isset($arFieldsOrig['CURRENCY_ID']) && isset($arFieldsModif['CURRENCY_ID']) && $arFieldsOrig['CURRENCY_ID'] != $arFieldsModif['CURRENCY_ID']) {
         $arStatus = CCrmCurrencyHelper::PrepareListItems();
         $arMsg[] = array('ENTITY_FIELD' => 'TAX_VALUE', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_TAX_VALUE'), 'EVENT_TEXT_1' => floatval($arFieldsOrig['TAX_VALUE']) . (($val = CrmCompareFieldsList($arStatus, $arFieldsOrig['CURRENCY_ID'], '')) != '' ? ' (' . $val . ')' : ''), 'EVENT_TEXT_2' => floatval($arFieldsModif['TAX_VALUE']) . (($val = CrmCompareFieldsList($arStatus, $arFieldsModif['CURRENCY_ID'], '')) != '' ? ' (' . $val . ')' : ''));
     }
     if (isset($arFieldsOrig['PROBABILITY']) && isset($arFieldsModif['PROBABILITY']) && $arFieldsOrig['PROBABILITY'] != $arFieldsModif['PROBABILITY']) {
         $arMsg[] = array('ENTITY_FIELD' => 'PROBABILITY', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_PROBABILITY'), 'EVENT_TEXT_1' => intval($arFieldsOrig['PROBABILITY']) . '%', 'EVENT_TEXT_2' => intval($arFieldsModif['PROBABILITY']) . '%');
     }
     if (array_key_exists('BEGINDATE', $arFieldsOrig) && array_key_exists('BEGINDATE', $arFieldsModif) && ConvertTimeStamp(strtotime($arFieldsOrig['BEGINDATE'])) != $arFieldsModif['BEGINDATE'] && $arFieldsOrig['BEGINDATE'] != $arFieldsModif['BEGINDATE']) {
         $arMsg[] = array('ENTITY_FIELD' => 'BEGINDATE', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_BEGINDATE'), 'EVENT_TEXT_1' => !empty($arFieldsOrig['BEGINDATE']) ? ConvertTimeStamp(strtotime($arFieldsOrig['BEGINDATE'])) : GetMessage('CRM_FIELD_COMPARE_EMPTY'), 'EVENT_TEXT_2' => !empty($arFieldsModif['BEGINDATE']) ? $arFieldsModif['BEGINDATE'] : GetMessage('CRM_FIELD_COMPARE_EMPTY'));
     }
     if (array_key_exists('CLOSEDATE', $arFieldsOrig) && array_key_exists('CLOSEDATE', $arFieldsModif) && ConvertTimeStamp(strtotime($arFieldsOrig['CLOSEDATE'])) != $arFieldsModif['CLOSEDATE'] && $arFieldsOrig['CLOSEDATE'] != $arFieldsModif['CLOSEDATE']) {
         $arMsg[] = array('ENTITY_FIELD' => 'CLOSEDATE', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_CLOSEDATE'), 'EVENT_TEXT_1' => !empty($arFieldsOrig['CLOSEDATE']) ? ConvertTimeStamp(strtotime($arFieldsOrig['CLOSEDATE'])) : GetMessage('CRM_FIELD_COMPARE_EMPTY'), 'EVENT_TEXT_2' => !empty($arFieldsModif['CLOSEDATE']) ? $arFieldsModif['CLOSEDATE'] : GetMessage('CRM_FIELD_COMPARE_EMPTY'));
     }
     if (array_key_exists('EVENT_DATE', $arFieldsOrig) && array_key_exists('EVENT_DATE', $arFieldsModif) && ConvertTimeStamp(strtotime($arFieldsOrig['EVENT_DATE'])) != $arFieldsModif['EVENT_DATE'] && $arFieldsOrig['EVENT_DATE'] != $arFieldsModif['EVENT_DATE']) {
         $arMsg[] = array('ENTITY_FIELD' => 'EVENT_DATE', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_EVENT_DATE'), 'EVENT_TEXT_1' => !empty($arFieldsOrig['EVENT_DATE']) ? ConvertTimeStamp(strtotime($arFieldsOrig['EVENT_DATE'])) : GetMessage('CRM_FIELD_COMPARE_EMPTY'), 'EVENT_TEXT_2' => !empty($arFieldsModif['EVENT_DATE']) ? $arFieldsModif['EVENT_DATE'] : GetMessage('CRM_FIELD_COMPARE_EMPTY'));
     }
     if (isset($arFieldsOrig['EVENT_ID']) && isset($arFieldsModif['EVENT_ID']) && $arFieldsOrig['EVENT_ID'] != $arFieldsModif['EVENT_ID']) {
         $arStatus = CCrmStatus::GetStatusList('EVENT_TYPE');
         $arMsg[] = array('ENTITY_FIELD' => 'EVENT_ID', 'EVENT_NAME' => GetMessage('CRM_FIELD_COMPARE_EVENT_ID'), 'EVENT_TEXT_1' => CrmCompareFieldsList($arStatus, $arFieldsOrig['EVENT_ID']), 'EVENT_TEXT_2' => CrmCompareFieldsList($arStatus, $arFieldsModif['EVENT_ID']));
     }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:crm_deal.php


示例15: while

// page count
$arResult['PAGER_PARAM'] = "PAGEN_{$arResult['PAGE_NAVNUM']}";
$arResult['PAGE_NEXT_NUMBER'] = $arResult['PAGE_NUMBER'] + 1;
while ($item = $dbRes->Fetch()) {
    $itemID = intval($item['ID']);
    $ownerID = intval($item['OWNER_ID']);
    $ownerTypeID = intval($item['OWNER_TYPE_ID']);
    CCrmMobileHelper::PrepareActivityItem($item, $arParams, array('ENABLE_COMMUNICATIONS' => false));
    $arResult['ITEMS'][] =& $item;
    unset($item);
}
if ($arResult['PAGE_NEXT_NUMBER'] > $arResult['PAGE_NAVCOUNT']) {
    $arResult['NEXT_PAGE_URL'] = '';
} else {
    $arResult['NEXT_PAGE_URL'] = $APPLICATION->GetCurPageParam('AJAX_CALL=Y&PAGING=Y&FORMAT=json&' . $arResult['PAGER_PARAM'] . '=' . $arResult['PAGE_NEXT_NUMBER'], array('AJAX_CALL', 'PAGING', 'FORMAT', 'SEARCH', $arResult['PAGER_PARAM']));
}
$arResult['SEARCH_PAGE_URL'] = $APPLICATION->GetCurPageParam('AJAX_CALL=Y&SEARCH=Y&FORMAT=json&apply_filter=Y&save=Y', array('AJAX_CALL', 'SEARCH', 'FORMAT', 'save', 'apply_filter', 'clear_filter'));
$arResult['SERVICE_URL'] = SITE_DIR . 'bitrix/components/bitrix/mobile.crm.activity.list/ajax.php?siteID=' . SITE_ID . '&' . bitrix_sessid_get();
$arResult['IS_FILTERED'] = !empty($filter);
$arResult['CREATE_CALL_URL'] = $arParams['ACTIVITY_CREATE_URL_TEMPLATE'] !== '' ? CComponentEngine::makePathFromTemplate($arParams['ACTIVITY_CREATE_URL_TEMPLATE'], array('owner_type' => $entityTypeName, 'owner_id' => $entityID, 'type_id' => CCrmActivityType::Call)) : '';
$arResult['CREATE_MEETING_URL'] = $arParams['ACTIVITY_CREATE_URL_TEMPLATE'] !== '' ? CComponentEngine::makePathFromTemplate($arParams['ACTIVITY_CREATE_URL_TEMPLATE'], array('owner_type' => $entityTypeName, 'owner_id' => $entityID, 'type_id' => CCrmActivityType::Meeting)) : '';
$arResult['CREATE_EMAIL_URL'] = $arParams['ACTIVITY_CREATE_URL_TEMPLATE'] !== '' ? CComponentEngine::makePathFromTemplate($arParams['ACTIVITY_CREATE_URL_TEMPLATE'], array('owner_type' => $entityTypeName, 'owner_id' => $entityID, 'type_id' => CCrmActivityType::Email)) : '';
$arResult['RELOAD_URL'] = $APPLICATION->GetCurPageParam('AJAX_CALL=Y&FORMAT=json', array('AJAX_CALL', 'SEARCH', 'FORMAT', 'save', 'apply_filter', 'clear_filter'));
//Require any update permission
$arResult['PERMISSIONS'] = array('CREATE' => CCrmLead::CheckUpdatePermission(0, $userPerms) || CCrmCompany::CheckUpdatePermission(0, $userPerms) || CCrmContact::CheckUpdatePermission(0, $userPerms) || CCrmDeal::CheckUpdatePermission(0, $userPerms));
$format = isset($_REQUEST['FORMAT']) ? strtolower($_REQUEST['FORMAT']) : '';
// Only JSON format is supported
if ($format !== '' && $format !== 'json') {
    $format = '';
}
$this->IncludeComponentTemplate($format);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php


示例16: showField


//.........这里部分代码省略.........
                if (intval($arField["VALUE"]) > 0) {
                    $strResult .= "#row_begin#";
                    $strResult .= "#cell_begin_left#";
                    $strResult .= $arField["TITLE"] . ":";
                    $strResult .= "#cell_end#";
                    $strResult .= "#cell_begin_right#";
                    $strResult .= '<span class="crm-feed-info-text-padding">';
                    $strResult .= CCrmViewHelper::PrepareEntityBaloonHtml(array('ENTITY_TYPE_ID' => CCrmOwnerType::Deal, 'ENTITY_ID' => $arField["VALUE"], 'PREFIX' => "", 'CLASS_NAME' => '', 'CHECK_PERMISSIONS' => 'N'));
                    $strResult .= '</span>';
                    $strResult .= "#cell_end#";
                    $strResult .= "#row_end#";
                }
                break;
            case "COMMUNICATIONS":
                if (is_array($arField["VALUE"]) && count($arField["VALUE"]) > 0) {
                    $arCommunication = $arField["VALUE"][0];
                    $strResult .= "#row_begin#";
                    $strResult .= "#cell_begin_left#";
                    $strResult .= $arField["TITLE"] . ":";
                    $strResult .= "#cell_end#";
                    $strResult .= "#cell_begin_right#";
                    $strResult .= '<div class="crm-feed-client-block">';
                    if (in_array($arCommunication["ENTITY_TYPE_ID"], array(CCrmOwnerType::Company, CCrmOwnerType::Contact, CCrmOwnerType::Lead))) {
                        $strResult .= '<span class="feed-com-avatar crm-feed-user-avatar">';
                        if ($arCommunication["ENTITY_TYPE_ID"] == CCrmOwnerType::Contact) {
                            $dbRes = CCrmContact::GetListEx(array(), array('=ID' => $arCommunication["ENTITY_ID"], 'CHECK_PERMISSIONS' => 'N'), false, false, array('PHOTO'));
                            if (($arRes = $dbRes->Fetch()) && intval($arRes["PHOTO"]) > 0) {
                                $arFileTmp = CFile::ResizeImageGet($arRes["PHOTO"], array('width' => 39, 'height' => 39), BX_RESIZE_IMAGE_EXACT, false);
                                if (is_array($arFileTmp) && isset($arFileTmp["src"])) {
                                    $strResult .= '<img width="39" height="39" src="' . $arFileTmp['src'] . '" alt="">';
                                }
                            }
                        } elseif ($arCommunication["ENTITY_TYPE_ID"] == CCrmOwnerType::Company) {
                            $dbRes = CCrmCompany::GetListEx(array(), array('=ID' => $arCommunication[ 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CCrmContact类代码示例发布时间:2022-05-23
下一篇:
PHP CCourse类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap