Esempio n. 1
0
        } elseif ($k === 'ASSIGNED_BY_ID') {
            $entityData['ASSIGNED_BY_ID'] = __CrmQuickPanelViewPrepareResponsible($entityFields, $userProfilePath, $nameTemplate, $enableInstantEdit, $arResult['INSTANT_EDITOR_ID'], $arResult['SERVICE_URL']);
        } elseif ($k === 'COMMENTS') {
            $entityData[$k] = array('type' => 'html', 'editable' => $enableInstantEdit, 'data' => array('html' => $entityFields["~{$k}"], 'serviceUrl' => $arResult['SERVICE_URL']));
        } elseif ($k === 'ADDRESS') {
            $entityData[$k] = array('type' => 'address', 'editable' => false, 'data' => array('lines' => CompanyAddressFormatter::prepareLines($entityFields, array('TYPE_ID' => EntityAddress::Primary, 'NL2BR' => true))));
        } elseif ($k === 'ADDRESS_LEGAL' || $k === 'REG_ADDRESS') {
            $entityData[$k] = array('type' => 'address', 'editable' => false, 'data' => array('lines' => CompanyAddressFormatter::prepareLines($entityFields, array('TYPE_ID' => EntityAddress::Registered, 'NL2BR' => true))));
        } elseif ($k === 'BANKING_DETAILS') {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('text' => $entityFields["~{$k}"], 'multiline' => true));
        } else {
            $entityData[$k] = array('type' => 'text', 'editable' => $enableInstantEdit, 'data' => array('text' => $entityFields["~{$k}"]));
        }
        $caption = isset($formFieldNames[$k]) ? $formFieldNames[$k] : '';
        if ($caption === '') {
            $caption = CCrmCompany::GetFieldCaption($k);
        }
        $entityData[$k]['caption'] = $caption;
    }
    if (isset($entityFields['~LOGO'])) {
        $fileInfo = $file->ResizeImageGet($entityFields['~LOGO'], array('width' => 79, 'height' => 33), BX_RESIZE_IMAGE_PROPORTIONAL_ALT);
        $arResult['HEAD_IMAGE_URL'] = isset($fileInfo['src']) ? $fileInfo['src'] : $defaultCompanyLogoUrl;
    } else {
        $arResult['HEAD_IMAGE_URL'] = $defaultCompanyLogoUrl;
    }
    $arResult['HEAD_TITLE'] = isset($entityFields['TITLE']) ? $entityFields['TITLE'] : '';
    $arResult['HEAD_TITLE_FIELD_ID'] = 'TITLE';
} elseif ($entityTypeID === CCrmOwnerType::Deal) {
    if ($enableDefaultConfig) {
        $config['left'] = 'TYPE_ID,OPPORTUNITY,CURRENCY_ID,PROBABILITY';
        $config['center'] = 'CONTACT_ID,COMPANY_ID';