Exemplo n.º 1
0
function getAdditionalColumns()
{
	static $arIblockIDs = false;
	static $arProps = false;

	$res = array();

	if (CModule::IncludeModule("catalog"))
	{
		// get iblock props from all catalog iblocks including sku iblocks
		if (false === $arIblockIDs)
		{
			$arIblockNames = array();
			$dbCatalog = CCatalog::GetList(
				array(),
				array(),
				false,
				false,
				array('IBLOCK_ID', 'PRODUCT_IBLOCK_ID', 'SKU_PROPERTY_ID', 'NAME')
			);
			while ($arCatalog = $dbCatalog->Fetch())
			{
				$arIblockIDs[] = $arCatalog["IBLOCK_ID"];
				$arIblockNames[$arCatalog["IBLOCK_ID"]] = $arCatalog["NAME"];
			}
		}

		// iblock props
		if (false === $arProps)
		{
			$arProps = array();
			foreach ($arIblockIDs as $iblockID)
			{
				$dbProps = CIBlockProperty::GetList(
					array("SORT"=>"ASC", "NAME"=>"ASC"),
					array(
						"IBLOCK_ID" => $iblockID,
						"ACTIVE" => "Y",
						"CHECK_PERMISSIONS" => "N",
					)
				);

				while ($arProp = $dbProps->GetNext())
					$arProps[] = $arProp;
			}
		}

		// create properties array where properties with the same codes are considered the same
		$arProp2Iblock = array();
		if (!empty($arProps))
		{
			foreach ($arProps as $id => $arProperty)
			{
				$arProp2Iblock["PROPERTY_".$arProperty["CODE"]][] = $arProperty["IBLOCK_ID"];

				if (getNameCount($arProperty["NAME"], $arProperty["CODE"], $arProps) > 1)
					$name = $arProperty["NAME"]." [".$arProperty["CODE"]."] ";
				else
					$name = $arProperty["NAME"];

				if (array_key_exists("PROPERTY_".$arProperty["CODE"], $res))
					$res["PROPERTY_".$arProperty["CODE"]]	= $name." (".getIblockNames($arProp2Iblock["PROPERTY_".$arProperty["CODE"]], $arIblockNames).")";
				else
					$res["PROPERTY_".$arProperty["CODE"]] = $name;
			}
		}
	}

	return $res;
}
Exemplo n.º 2
0
    // iblock props
    $arProps = array();
    foreach ($arIblockIDs as $iblockID) {
        $dbProps = CIBlockProperty::GetList(array("NAME" => "ASC", "SORT" => "ASC"), array("IBLOCK_ID" => $iblockID, "ACTIVE" => "Y", "CHECK_PERMISSIONS" => "N"));
        while ($arProp = $dbProps->GetNext()) {
            if ('CML2_LINK' == $arProp['XML_ID']) {
                continue;
            }
            $arProps[] = $arProp;
        }
    }
    // create properties array where properties with the same codes are considered the same
    $arTmpProperty2Iblock = array();
    foreach ($arProps as $id => $arProperty) {
        $arTmpProperty2Iblock["PROPERTY_" . $arProperty["CODE"]][] = $arProperty["IBLOCK_ID"];
        if (getNameCount($arProperty["NAME"], $arProperty["CODE"], $arProps) > 1) {
            $name = $arProperty["NAME"] . " [" . $arProperty["CODE"] . "] ";
        } else {
            $name = $arProperty["NAME"];
        }
        $name = htmlspecialcharsback($name);
        if (array_key_exists("PROPERTY_" . $arProperty["CODE"], $arColumns)) {
            $arColumns["PROPERTY_" . $arProperty["CODE"]] = $name . " (" . getIblockNames($arTmpProperty2Iblock["PROPERTY_" . $arProperty["CODE"]]) . ")";
        } else {
            $arColumns["PROPERTY_" . $arProperty["CODE"]] = $name;
        }
    }
}
$arComponentParameters = array("PARAMETERS" => array("PATH_TO_BASKET" => array("NAME" => GetMessage("SOA_PATH_TO_BASKET"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "basket.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_PERSONAL" => array("NAME" => GetMessage("SOA_PATH_TO_PERSONAL"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "index.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_PAYMENT" => array("NAME" => GetMessage("SOA_PATH_TO_PAYMENT"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "payment.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_AUTH" => array("NAME" => GetMessage("SOA_PATH_TO_AUTH"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "/auth/", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PAY_FROM_ACCOUNT" => array("NAME" => GetMessage("SOA_ALLOW_PAY_FROM_ACCOUNT"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "PARENT" => "BASE"), "ONLY_FULL_PAY_FROM_ACCOUNT" => array("NAME" => GetMessage("SOA_ONLY_FULL_PAY_FROM_ACCOUNT"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "PARENT" => "BASE"), "COUNT_DELIVERY_TAX" => array("NAME" => GetMessage("SOA_COUNT_DELIVERY_TAX"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "PARENT" => "BASE"), "ALLOW_AUTO_REGISTER" => array("NAME" => GetMessage("SOA_ALLOW_AUTO_REGISTER"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "PARENT" => "BASE"), "SEND_NEW_USER_NOTIFY" => array("NAME" => GetMessage("SOA_SEND_NEW_USER_NOTIFY"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "PARENT" => "BASE"), "DELIVERY_NO_AJAX" => array("NAME" => GetMessage("SOA_DELIVERY_NO_AJAX"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N", "PARENT" => "BASE"), "DELIVERY_NO_SESSION" => array("NAME" => GetMessage("SOA_DELIVERY_NO_SESSION"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N", "PARENT" => "BASE"), "TEMPLATE_LOCATION" => array("NAME" => GetMessage("SBB_TEMPLATE_LOCATION"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array(".default" => GetMessage("SBB_TMP_DEFAULT"), "popup" => GetMessage("SBB_TMP_POPUP")), "DEFAULT" => ".default", "COLS" => 25, "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "DELIVERY_TO_PAYSYSTEM" => array("NAME" => GetMessage("SBB_DELIVERY_PAYSYSTEM"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("d2p" => GetMessage("SBB_TITLE_PD"), "p2d" => GetMessage("SBB_TITLE_DP")), "PARENT" => "BASE"), "SET_TITLE" => array(), "USE_PREPAYMENT" => array("NAME" => GetMessage('SBB_USE_PREPAYMENT'), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "DISABLE_BASKET_REDIRECT" => array("NAME" => GetMessage('SOA_DISABLE_BASKET_REDIRECT'), "TYPE" => "CHECKBOX", "DEFAULT" => "N"), "PRODUCT_COLUMNS" => array("NAME" => GetMessage("SOA_PRODUCT_COLUMNS"), "TYPE" => "LIST", "MULTIPLE" => "Y", "COLS" => 25, "SIZE" => 7, "VALUES" => $arColumns, "DEFAULT" => array(), "ADDITIONAL_VALUES" => "N", "PARENT" => "ADDITIONAL_SETTINGS")));
if (CModule::IncludeModule("sale")) {
    $dbPerson = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"));