Esempio n. 1
0
        } elseif ($k === 'COMPANY_ID') {
            $entityData['COMPANY_ID'] = __CrmQuickPanelViewPrepareClientInfo(CCrmOwnerType::CompanyName, $entityContext);
        } elseif ($k === 'CONTACT_ID') {
            $entityData['CONTACT_ID'] = __CrmQuickPanelViewPrepareClientInfo(CCrmOwnerType::ContactName, $entityContext);
        } elseif ($k === 'ASSIGNED_BY_ID') {
            $entityData['ASSIGNED_BY_ID'] = __CrmQuickPanelViewPrepareResponsible($entityFields, $userProfilePath, $nameTemplate, $enableInstantEdit, $arResult['INSTANT_EDITOR_ID'], $arResult['SERVICE_URL']);
        } elseif ($k === 'PROBABILITY') {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('baseType' => 'int', 'text' => $entityFields["~{$k}"]));
        } elseif ($k === 'COMMENTS') {
            $entityData[$k] = array('type' => 'html', 'editable' => $enableInstantEdit, 'data' => array('html' => $entityFields["~{$k}"], 'serviceUrl' => $arResult['SERVICE_URL']));
        } else {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('text' => $entityFields["~{$k}"]));
        }
        $caption = isset($formFieldNames[$k]) ? $formFieldNames[$k] : '';
        if ($caption === '') {
            $caption = CCrmDeal::GetFieldCaption($k);
        }
        $entityData[$k]['caption'] = $caption;
    }
    $arResult['HEAD_TITLE'] = isset($entityFields['TITLE']) ? $entityFields['TITLE'] : '';
    $arResult['HEAD_TITLE_FIELD_ID'] = 'TITLE';
} elseif ($entityTypeID === CCrmOwnerType::Lead) {
    $entityContext['SIP_MANAGER_CONFIG'][CCrmOwnerType::LeadName] = array('ENTITY_TYPE' => CCrmOwnerType::LeadName, 'SERVICE_URL' => '/bitrix/components/bitrix/crm.lead.show/ajax.php?' . bitrix_sessid_get());
    $ufEntityID = CCrmLead::$sUFEntityID;
    $fieldKeys = array('TITLE' => true, 'COMPANY_TITLE' => true, 'NAME' => true, 'SECOND_NAME' => true, 'LAST_NAME' => true, 'STATUS_ID' => true, 'STATUS_DESCRIPTION' => true, 'SOURCE_ID' => true, 'SOURCE_DESCRIPTION' => true, 'CURRENCY_ID' => true, 'OPPORTUNITY' => true, 'POST' => true, 'ADDRESS' => true, 'BIRTHDATE' => true, 'OPENED' => true, 'ASSIGNED_BY_ID' => true, 'COMMENTS' => true);
    if ($enableDefaultConfig) {
        $config['left'] = 'SOURCE_ID,SOURCE_DESCRIPTION';
        $config['center'] = 'PHONE,EMAIL,IM';
        $config['right'] = 'ASSIGNED_BY_ID';
        $config['bottom'] = 'COMMENTS';
    }