Example #1
0
    $sectionListItems = array();
    $rsSection = CIBlockSection::GetByID($productSectionID);
    if ($arSection = $rsSection->Fetch()) {
        $productSectionName = $arSection['NAME'];
    }
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'SECTION', 'name' => GetMessage('CRM_FIELD_SECTION'), 'type' => 'label', 'value' => htmlspecialcharsbx(empty($productSectionName) ? GetMessage('CRM_SECTION_NOT_SELECTED') : $productSectionName), 'isTactile' => true);
$arResult['FIELDS']['tab_1'][] = array('id' => 'SORT', 'name' => GetMessage('CRM_FIELD_SORT'), 'type' => 'label', 'params' => array(), 'value' => isset($product['SORT']) ? $product['SORT'] : '', 'isTactile' => true);
$arFields = array('PREVIEW_PICTURE' => GetMessage('CRM_PRODUCT_FIELD_PREVIEW_PICTURE'), 'DETAIL_PICTURE' => GetMessage('CRM_PRODUCT_FIELD_DETAIL_PICTURE'));
$html = '';
$obFileControl = $obFile = null;
foreach ($arFields as $fieldID => $fieldName) {
    if (isset($product['~' . $fieldID])) {
        $obFile = new CCrmProductFile($arResult['PRODUCT_ID'], $fieldID, $product['~' . $fieldID]);
        $obFileControl = new CCrmProductFileControl($obFile, $fieldID);
        $html = '<nobr>' . $obFileControl->GetHTML(array('show_input' => false, 'max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams['PATH_TO_PRODUCT_FILE'], 'a_title' => GetMessage('CRM_PRODUCT_PROP_ENLARGE'), 'download_text' => GetMessage("CRM_PRODUCT_PROP_DOWNLOAD"))) . '</nobr>';
        $arResult['FIELDS']['tab_1'][] = array('id' => $fieldID, 'name' => $fieldName, 'type' => 'custom', 'value' => $html, 'isTactile' => true);
    }
}
unset($arFields, $fieldID, $fieldName, $obFile, $obFileControl, $html);
/*if($FIELD_ID == "PREVIEW_PICTURE" || $FIELD_ID == "DETAIL_PICTURE")
{
	$obFile = new CListFile(
		$arResult["IBLOCK_ID"],
		0, //section_id
		$arRow["data"]["ID"],
		$FIELD_ID,
		$value
	);
	$obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
Example #2
0
$arResult['FIELDS']['tab_1'][] = array('id' => 'CURRENCY', 'name' => GetMessage('CRM_FIELD_CURRENCY'), 'type' => 'list', 'items' => CCrmCurrencyHelper::PrepareListItems(), 'value' => isset($product['CURRENCY_ID']) ? $product['CURRENCY_ID'] : $baseCurrencyID);
$arResult['FIELDS']['tab_1'][] = array('id' => 'PRICE', 'name' => GetMessage('CRM_FIELD_PRICE'), 'type' => 'text', 'params' => array(), 'value' => isset($product['PRICE']) ? strval(round(doubleval($product['PRICE']), 2)) : '');
if ($bVatMode) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'VAT_ID', 'name' => GetMessage('CRM_FIELD_VAT_ID'), 'type' => 'list', 'items' => $arVatRatesListItems, 'value' => isset($product['VAT_ID']) ? $product['VAT_ID'] : '');
    $arResult['FIELDS']['tab_1'][] = array('id' => 'VAT_INCLUDED', 'name' => GetMessage('CRM_FIELD_VAT_INCLUDED'), 'type' => 'checkbox', 'value' => isset($product['VAT_INCLUDED']) ? $product['VAT_INCLUDED'] : '');
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'MEASURE', 'name' => GetMessage('CRM_FIELD_MEASURE'), 'type' => 'list', 'items' => $arResult['MEASURE_LIST_ITEMS'], 'value' => isset($product['MEASURE']) ? $product['MEASURE'] : '');
$arResult['FIELDS']['tab_1'][] = array('id' => 'SECTION', 'name' => GetMessage('CRM_FIELD_SECTION'), 'type' => 'list', 'items' => CCrmProductHelper::PrepareSectionListItems($catalogID, true), 'value' => isset($product['SECTION_ID']) ? $product['SECTION_ID'] : '');
$arResult['FIELDS']['tab_1'][] = array('id' => 'SORT', 'name' => GetMessage('CRM_FIELD_SORT'), 'type' => 'text', 'params' => array(), 'value' => isset($product['SORT']) ? $product['SORT'] : '100');
$arFields = array('PREVIEW_PICTURE' => GetMessage('CRM_PRODUCT_FIELD_PREVIEW_PICTURE'), 'DETAIL_PICTURE' => GetMessage('CRM_PRODUCT_FIELD_DETAIL_PICTURE'));
$html = '';
$obFileControl = $obFile = null;
foreach ($arFields as $fieldID => $fieldName) {
    $obFile = new CCrmProductFile($arResult['PRODUCT_ID'], $fieldID, $product['~' . $fieldID]);
    $obFileControl = new CCrmProductFileControl($obFile, $fieldID);
    $html = $obFileControl->GetHTML(array('max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams['PATH_TO_PRODUCT_FILE'], 'a_title' => GetMessage('CRM_PRODUCT_PROP_ENLARGE'), 'download_text' => GetMessage('CRM_PRODUCT_PROP_DOWNLOAD')));
    $arResult['FIELDS']['tab_1'][] = array('id' => $fieldID, 'name' => $fieldName, 'type' => 'custom', 'value' => $html);
}
unset($arFields, $fieldID, $fieldName, $obFile, $obFileControl, $html);
// Product properties
$propsFormData = array();
foreach ($arProps as $propID => $arProp) {
    if (isset($arProp['USER_TYPE']) && !empty($arProp['USER_TYPE'])) {
        if ($bVarsFromForm && isset($_POST[$propID])) {
            $propsFormData[$propID] = $_POST[$propID];
        } else {
            if ($arResult['PRODUCT_ID']) {
                if (isset($arResult['PRODUCT_PROPS'][$arProp['ID']])) {
                    $propsFormData[$propID] = $arResult['PRODUCT_PROPS'][$arProp['ID']]['FULL_VALUES'];
                    if ($arProp['MULTIPLE'] == 'Y') {
                        $propsFormData[$propID]['n0'] = array('VALUE' => '', 'DESCRIPTION' => '');