当前位置: 首页>>代码示例>>PHP>>正文


PHP CSaleLocation::isLocationProEnabled方法代码示例

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


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

示例1: prepareParamsForSaving

 protected static function prepareParamsForSaving(array $params = array(), $deliveryId = 0)
 {
     if ($deliveryId > 0) {
         $arLocation = array();
         if (!!\CSaleLocation::isLocationProEnabled()) {
             if (strlen($params["LOCATION"]['L'])) {
                 $LOCATION1 = explode(':', $params["LOCATION"]['L']);
             }
             if (strlen($params["LOCATION"]['G'])) {
                 $LOCATION2 = explode(':', $params["LOCATION"]['G']);
             }
         }
         if (isset($LOCATION1) && is_array($LOCATION1) && count($LOCATION1) > 0) {
             $arLocation["L"] = array();
             $locationCount = count($LOCATION1);
             for ($i = 0; $i < $locationCount; $i++) {
                 if (strlen($LOCATION1[$i])) {
                     $arLocation["L"][] = $LOCATION1[$i];
                 }
             }
         }
         if (isset($LOCATION2) && is_array($LOCATION2) && count($LOCATION2) > 0) {
             $arLocation["G"] = array();
             $locationCount = count($LOCATION2);
             for ($i = 0; $i < $locationCount; $i++) {
                 if (strlen($LOCATION2[$i])) {
                     $arLocation["G"][] = $LOCATION2[$i];
                 }
             }
         }
         DeliveryLocationTable::resetMultipleForOwner($deliveryId, $arLocation);
     }
     return array();
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:34,代码来源:bylocation.php

示例2: IncludeModuleLangFile

use Bitrix\Sale\Location;
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions < "W") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
IncludeModuleLangFile(__FILE__);
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/include.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/sale/prolog.php";
$ID = IntVal($ID);
ClearVars();
ClearVars("fp_");
$strError = "";
$bInitVars = false;
$lpEnabled = CSaleLocation::isLocationProEnabled();
if ((strlen($save) > 0 || strlen($apply) > 0) && $REQUEST_METHOD == "POST" && $saleModulePermissions == "W" && check_bitrix_sessid()) {
    $TAX_ID = IntVal($TAX_ID);
    if ($TAX_ID <= 0) {
        $strError .= GetMessage("ERROR_NO_TAX_ID") . "<br>";
    }
    $VALUE = str_replace(",", ".", $VALUE);
    $VALUE = DoubleVal($VALUE);
    if ($VALUE <= 0) {
        $strError .= GetMessage("ERROR_NO_VALUE") . "<br>";
    }
    if ($IS_IN_PRICE != "Y") {
        $IS_IN_PRICE = "N";
    }
    if ($ACTIVE != "Y") {
        $ACTIVE = "N";
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:30,代码来源:tax_rate_edit.php

示例3: function

			transition : BX.easing.makeEaseOut(BX.easing.transitions.quart),
			step : function(state){
				pFormCont.style.height = state.height + "px";
				pFormCont.style.opacity = state.opacity / 100;
			},
			complete : function(){
					BX('sale_order_props').style.display = display;
					BX('sale_order_props').style.height = '';

					pFormCont.style.overflow = "visible";
			}
		})).animate();
	}
</script>

<?if(!CSaleLocation::isLocationProEnabled()):?>
	<div style="display:none;">

		<?$APPLICATION->IncludeComponent(
			"bitrix:sale.ajax.locations",
			$arParams["TEMPLATE_LOCATION"],
			array(
				"AJAX_CALL" => "N",
				"COUNTRY_INPUT_NAME" => "COUNTRY_tmp",
				"REGION_INPUT_NAME" => "REGION_tmp",
				"CITY_INPUT_NAME" => "tmp",
				"CITY_OUT_LOCATION" => "Y",
				"LOCATION_VALUE" => "",
				"ONCITYCHANGE" => "submitForm()",
			),
			null,
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:31,代码来源:props.php

示例4: PrintPropsForm


//.........这里部分代码省略.........
echo $arProperties["FIELD_NAME"];
?>
"
											id="<?php 
echo $arProperties["FIELD_NAME"];
?>
_<?php 
echo $arVariants["VALUE"];
?>
"
											value="<?php 
echo $arVariants["VALUE"];
?>
" <?if($arVariants["CHECKED"] == "Y") echo " checked";?> />

										<label for="<?php 
echo $arProperties["FIELD_NAME"];
?>
_<?php 
echo $arVariants["VALUE"];
?>
"><?php 
echo $arVariants["NAME"];
?>
</label></br>
									<?
									endforeach;
								}
								?>

								<?
								if (strlen(trim($arProperties["DESCRIPTION"])) > 0):
								?>
								<div class="bx_description">
									<?php 
echo $arProperties["DESCRIPTION"];
?>
								</div>
								<?
								endif;
								?>
							</div>
							<div style="clear: both;"></div>
							<?
						}
						elseif ($arProperties["TYPE"] == "FILE")
						{
							?>
							<br/>
							<div class="bx_block r1x3 pt8">
								<?php 
echo $arProperties["NAME"];
?>
								<?if ($arProperties["REQUIED_FORMATED"]=="Y"):?>
									<span class="bx_sof_req">*</span>
								<?endif;?>
							</div>

							<div class="bx_block r3x1">
								<?php 
echo showFilePropertyField("ORDER_PROP_" . $arProperties["ID"], $arProperties, $arProperties["VALUE"], $arProperties["SIZE1"]);
?>

								<?
								if (strlen(trim($arProperties["DESCRIPTION"])) > 0):
								?>
								<div class="bx_description">
									<?php 
echo $arProperties["DESCRIPTION"];
?>
								</div>
								<?
								endif;
								?>
							</div>

							<div style="clear: both;"></div><br/>
							<?
						}
						?>
						</div>

						<?if(CSaleLocation::isLocationProEnabled()):?>
							<script>

								(window.top.BX || BX).saleOrderAjax.addPropertyDesc(<?php 
echo CUtil::PhpToJSObject(array('id' => intval($arProperties["ID"]), 'attributes' => $propertyAttributes));
?>
);

							</script>
						<?endif?>

						<?
					}
					?>
				</div>
			<?
		}
	}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:101,代码来源:props_format.php

示例5: getOrderPropFormated


//.........这里部分代码省略.........
		while ($arVariants = $dbVariants->GetNext())
		{
			if ((is_array($curVal) && in_array($arVariants["VALUE"], $curVal)) || (!isset($curVal) && in_array($arVariants["VALUE"], $arDefVal)))
			{
				$arVariants["SELECTED"] = "Y";
				if ($i > 0)
					$arProperties["VALUE_FORMATED"] .= ", ";
				$arProperties["VALUE_FORMATED"] .= $arVariants["NAME"];
				$setValue[] = $arVariants["VALUE"];
				$i++;
			}
			$arProperties["VARIANTS"][] = $arVariants;
		}

		if ($isProfileChanged || $isEmptyUserResult)
		{
			$arUserResult["ORDER_PROP"][$arProperties["ID"]] = $setValue;
		}
	}
	elseif ($arProperties["TYPE"] == "TEXTAREA")
	{
		$arProperties["SIZE2"] = ((intval($arProperties["SIZE2"]) > 0) ? $arProperties["SIZE2"] : 4);
		$arProperties["SIZE1"] = ((intval($arProperties["SIZE1"]) > 0) ? $arProperties["SIZE1"] : 40);
		$arProperties["VALUE"] = htmlspecialcharsEx(isset($curVal) ? $curVal : $arProperties["DEFAULT_VALUE"]);
		$arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];

		if ($isProfileChanged || $isEmptyUserResult)
		{
			$arUserResult["ORDER_PROP"][$arProperties["ID"]] = $arProperties["VALUE"];
		}
	}
	elseif ($arProperties["TYPE"] == "LOCATION")
	{
		if(CSaleLocation::isLocationProEnabled())
		{
			$arProperties["VALUE"] = $curVal;

			// variants
			$locationFound = false;
			$dbVariants = CSaleLocation::GetList(
					array("SORT" => "ASC", "COUNTRY_NAME_LANG" => "ASC", "CITY_NAME_LANG" => "ASC"),
					array("LID" => LANGUAGE_ID),
					false,
					false,
					array("ID", "COUNTRY_NAME", "CITY_NAME", "SORT", "COUNTRY_NAME_LANG", "CITY_NAME_LANG", "CITY_ID")
				);
			while ($arVariants = $dbVariants->GetNext())
			{
				if (intval($arVariants["ID"]) == intval($curVal) || (!isset($curVal) && intval($arVariants["ID"]) == intval($arProperties["DEFAULT_VALUE"])) || (strlen($curLocation) > 0 && ToUpper($curLocation) == ToUpper($arVariants["CITY_NAME"])))
				{
					// set formatted value
					$arProperties["VALUE_FORMATED"] = $arVariants["COUNTRY_NAME"].((strlen($arVariants["CITY_NAME"]) > 0) ? " - " : "").$arVariants["CITY_NAME"];

					// location found, set it as DELIVERY_LOCATION and TAX_LOCATION

					$arUserResult["DELIVERY_LOCATION"] = $arVariants['ID'];
					if($arProperties["IS_LOCATION4TAX"]=="Y")
						$arUserResult["TAX_LOCATION"] = $arVariants['ID'];

					$locationFound = $arVariants;
					$arVariants["SELECTED"] = "Y";

					if ($isProfileChanged || $isEmptyUserResult)
					{
						$arUserResult["ORDER_PROP"][$arProperties["ID"]] = $arVariants['ID'];
					}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:67,代码来源:functions.php

示例6: getOrderPropFormated


//.........这里部分代码省略.........
		for ($i = 0; $i < $countDefVal; $i++)
			$arDefVal[$i] = Trim($arDefVal[$i]);

		$dbVariants = CSaleOrderPropsVariant::GetList(
				array("SORT" => "ASC"),
				array("ORDER_PROPS_ID" => $arProperties["ID"]),
				false,
				false,
				array("*")
			);
		$i = 0;
		while ($arVariants = $dbVariants->GetNext())
		{
			if ((is_array($curVal) && in_array($arVariants["VALUE"], $curVal)) || (!isset($curVal) && in_array($arVariants["VALUE"], $arDefVal)))
			{
				$arVariants["SELECTED"] = "Y";
				if ($i > 0)
					$arProperties["VALUE_FORMATED"] .= ", ";
				$arProperties["VALUE_FORMATED"] .= $arVariants["NAME"];
				$i++;
			}
			$arProperties["VARIANTS"][] = $arVariants;
		}
	}
	elseif ($arProperties["TYPE"] == "TEXTAREA")
	{
		$arProperties["SIZE2"] = ((intval($arProperties["SIZE2"]) > 0) ? $arProperties["SIZE2"] : 4);
		$arProperties["SIZE1"] = ((intval($arProperties["SIZE1"]) > 0) ? $arProperties["SIZE1"] : 40);
		$arProperties["VALUE"] = htmlspecialcharsEx(isset($curVal) ? $curVal : $arProperties["DEFAULT_VALUE"]);
		$arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];
	}
	elseif ($arProperties["TYPE"] == "LOCATION")
	{
		if(CSaleLocation::isLocationProEnabled())
		{
			if(!strlen($curVal) && strlen($arProperties["DEFAULT_VALUE"]))
				$curVal = CSaleLocation::getLocationIDbyCODE($arProperties["DEFAULT_VALUE"]);

			//enable location town text
			if ($_REQUEST["is_ajax_post"] == "Y" && $arProperties["IS_LOCATION"] == "Y" && intval($arProperties["INPUT_FIELD_LOCATION"]) > 0 && isset($_REQUEST["ORDER_PROP_".$arProperties["ID"]]))
			{
				if(isset($arResult['LOCATION_ALT_PROP_DISPLAY_MANUAL'][$arProperties["ID"]])) // look at the manual flag
				{
					if($arResult['LOCATION_ALT_PROP_DISPLAY_MANUAL'][$arProperties["ID"]]) // if it set to TRUE, show alt location
						unset($arDeleteFieldLocation[$arProperties["ID"]]);
					else
						$arDeleteFieldLocation[$arProperties["ID"]] = $arProperties["INPUT_FIELD_LOCATION"]; // otherwise, hide
				}
				else
				{
					// now we have no had-coded type-table for locations, so turn this logic on only when there is "CITY" type
					if(!CSaleLocation::checkLocationIsAboveCity($curVal))
					{
						$arDeleteFieldLocation[$arProperties["ID"]] = $arProperties["INPUT_FIELD_LOCATION"]; // remove by default
					}
					else
					{
						unset($arDeleteFieldLocation[$arProperties["ID"]]);
					}
				}
			}
			elseif ($arProperties["IS_LOCATION"] == "Y" && intval($arProperties["INPUT_FIELD_LOCATION"]) > 0)
			{
				$arDeleteFieldLocation[$arProperties["ID"]] = $arProperties["INPUT_FIELD_LOCATION"];
			}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:66,代码来源:functions.php

示例7: ExportOrders2Xml


//.........这里部分代码省略.........
                }
                $arProp["CRM"]["CLIENT"] = $clientInfo;
                unset($clientInfo);
            }
            if (IntVal($arOrder["PAY_SYSTEM_ID"]) > 0) {
                $arProp["ORDER"]["PAY_SYSTEM_NAME"] = $paySystems[$arOrder["PAY_SYSTEM_ID"]];
            }
            if (strlen($arOrder["DELIVERY_ID"]) > 0) {
                $arProp["ORDER"]["DELIVERY_NAME"] = $delivery[$arOrder["DELIVERY_ID"]];
            }
            $dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
            $locationStreetPropertyValue = '';
            while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
                if ($arOrderPropVals["PROP_TYPE"] == "CHECKBOX") {
                    if ($arOrderPropVals["VALUE"] == "Y") {
                        $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "true";
                    } else {
                        $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "false";
                    }
                } elseif ($arOrderPropVals["PROP_TYPE"] == "TEXT" || $arOrderPropVals["PROP_TYPE"] == "TEXTAREA") {
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"];
                } elseif ($arOrderPropVals["PROP_TYPE"] == "SELECT" || $arOrderPropVals["PROP_TYPE"] == "RADIO") {
                    $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["VALUE"]);
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arVal["NAME"];
                } elseif ($arOrderPropVals["PROP_TYPE"] == "MULTISELECT") {
                    $curVal = explode(",", $arOrderPropVals["VALUE"]);
                    foreach ($curVal as $vm) {
                        $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $vm);
                        $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] .= ", " . $arVal["NAME"];
                    }
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = substr($arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]], 2);
                } elseif ($arOrderPropVals["PROP_TYPE"] == "LOCATION") {
                    $arVal = CSaleLocation::GetByID($arOrderPropVals["VALUE"], LANGUAGE_ID);
                    if (CSaleLocation::isLocationProEnabled()) {
                        if (intval($arVal['ID'])) {
                            try {
                                $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($arVal['ID'], array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID)));
                                $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached();
                                $path = array();
                                while ($item = $res->fetch()) {
                                    // copy street to STREET property
                                    if ($types['ID2CODE'][$item['TYPE_ID']] == 'STREET') {
                                        $locationStreetPropertyValue = $item['LNAME'];
                                    }
                                    $path[] = $item['LNAME'];
                                }
                                $locationString = implode(' - ', $path);
                            } catch (\Bitrix\Main\SystemException $e) {
                                $locationString = '';
                            }
                        } else {
                            $locationString = '';
                        }
                    } else {
                        $locationString = $arVal["COUNTRY_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["REGION_NAME"]) <= 0 ? "" : " - ") . $arVal["REGION_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["CITY_NAME"]) <= 0 ? "" : " - ") . $arVal["CITY_NAME"];
                    }
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $locationString;
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_CITY"] = $arVal["CITY_NAME"];
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_COUNTRY"] = $arVal["COUNTRY_NAME"];
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_REGION"] = $arVal["REGION_NAME"];
                } else {
                    $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"];
                }
            }
            $resShipment = \Bitrix\Sale\Internals\ShipmentTable::getList(array('select' => array('DELIVERY_ID', 'ALLOW_DELIVERY', 'DEDUCTED', 'DATE_ALLOW_DELIVERY', 'DATE_DEDUCTED'), 'filter' => array('ORDER_ID' => $arOrder['ID'], '=SYSTEM' => 'N'), 'limit' => array(1)));
            $arShipment = $resShipment->fetch();
开发者ID:Satariall,项目名称:izurit,代码行数:67,代码来源:export.php

示例8: array

<?php

if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die;
}
global $APPLICATION;
$APPLICATION->IncludeComponent('bitrix:crm.control_panel', '', array('ID' => 'LOC_EDIT', 'ACTIVE_ITEM_ID' => '', 'PATH_TO_COMPANY_LIST' => isset($arResult['PATH_TO_COMPANY_LIST']) ? $arResult['PATH_TO_COMPANY_LIST'] : '', 'PATH_TO_COMPANY_EDIT' => isset($arResult['PATH_TO_COMPANY_EDIT']) ? $arResult['PATH_TO_COMPANY_EDIT'] : '', 'PATH_TO_CONTACT_LIST' => isset($arResult['PATH_TO_CONTACT_LIST']) ? $arResult['PATH_TO_CONTACT_LIST'] : '', 'PATH_TO_CONTACT_EDIT' => isset($arResult['PATH_TO_CONTACT_EDIT']) ? $arResult['PATH_TO_CONTACT_EDIT'] : '', 'PATH_TO_DEAL_LIST' => isset($arResult['PATH_TO_DEAL_LIST']) ? $arResult['PATH_TO_DEAL_LIST'] : '', 'PATH_TO_DEAL_EDIT' => isset($arResult['PATH_TO_DEAL_EDIT']) ? $arResult['PATH_TO_DEAL_EDIT'] : '', 'PATH_TO_LEAD_LIST' => isset($arResult['PATH_TO_LEAD_LIST']) ? $arResult['PATH_TO_LEAD_LIST'] : '', 'PATH_TO_LEAD_EDIT' => isset($arResult['PATH_TO_LEAD_EDIT']) ? $arResult['PATH_TO_LEAD_EDIT'] : '', 'PATH_TO_QUOTE_LIST' => isset($arResult['PATH_TO_QUOTE_LIST']) ? $arResult['PATH_TO_QUOTE_LIST'] : '', 'PATH_TO_QUOTE_EDIT' => isset($arResult['PATH_TO_QUOTE_EDIT']) ? $arResult['PATH_TO_QUOTE_EDIT'] : '', 'PATH_TO_INVOICE_LIST' => isset($arResult['PATH_TO_INVOICE_LIST']) ? $arResult['PATH_TO_INVOICE_LIST'] : '', 'PATH_TO_INVOICE_EDIT' => isset($arResult['PATH_TO_INVOICE_EDIT']) ? $arResult['PATH_TO_INVOICE_EDIT'] : '', 'PATH_TO_REPORT_LIST' => isset($arResult['PATH_TO_REPORT_LIST']) ? $arResult['PATH_TO_REPORT_LIST'] : '', 'PATH_TO_DEAL_FUNNEL' => isset($arResult['PATH_TO_DEAL_FUNNEL']) ? $arResult['PATH_TO_DEAL_FUNNEL'] : '', 'PATH_TO_EVENT_LIST' => isset($arResult['PATH_TO_EVENT_LIST']) ? $arResult['PATH_TO_EVENT_LIST'] : '', 'PATH_TO_PRODUCT_LIST' => isset($arResult['PATH_TO_PRODUCT_LIST']) ? $arResult['PATH_TO_PRODUCT_LIST'] : ''), $component);
$APPLICATION->IncludeComponent('bitrix:crm.config.locations.menu', '', array('PATH_TO_LOCATIONS_LIST' => $arResult['PATH_TO_LOCATIONS_LIST'], 'PATH_TO_LOCATIONS_EDIT' => $arResult['PATH_TO_LOCATIONS_EDIT'], 'PATH_TO_LOCATIONS_ADD' => $arResult['PATH_TO_LOCATIONS_ADD'], 'PATH_TO_LOCATIONS_IMPORT' => $arResult['PATH_TO_LOCATIONS_IMPORT'], 'LOC_ID' => $arResult['VARIABLES']['loc_id'], 'TYPE' => 'edit'), $component);
$APPLICATION->IncludeComponent('bitrix:crm.config.locations.edit' . (CSaleLocation::isLocationProEnabled() ? '.v2' : ''), '', array('PATH_TO_LOCATIONS_LIST' => $arResult['PATH_TO_LOCATIONS_LIST'], 'PATH_TO_LOCATIONS_EDIT' => $arResult['PATH_TO_LOCATIONS_EDIT'], 'PATH_TO_LOCATIONS_ADD' => $arResult['PATH_TO_LOCATIONS_ADD'], 'LOC_ID' => $arResult['VARIABLES']['loc_id']), $component);
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:9,代码来源:locations_edit.php

示例9: getLocationCODEbyID

	public static function getLocationCODEbyID($id)
	{
		if(CSaleLocation::isLocationProEnabled() && intval($id))
		{
			// we must convert ID to CODE
			$item = Location\LocationTable::getById($id)->fetch();

			if(empty($item))
				return '';

			return $item['CODE'];
		}

		return $id;
	}
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:15,代码来源:location.php

示例10: obtainProps

 /**
  * Function gets order properties from database
  * @param mixed[] $cached Cached data taken from obtainDataCachedStructure()
  * @return void
  */
 protected function obtainProps(&$cached)
 {
     if (empty($this->dbResult["ID"])) {
         return;
     }
     $props = array();
     $dbOrderProps = CSaleOrderPropsValue::GetOrderProps($this->dbResult["ID"]);
     $iGroup = -1;
     while ($arOrderProps = $dbOrderProps->Fetch()) {
         if (empty($this->arParams["PROP_" . $this->dbResult["PERSON_TYPE_ID"]]) || !in_array($arOrderProps["ORDER_PROPS_ID"], $this->arParams["PROP_" . $this->dbResult["PERSON_TYPE_ID"]])) {
             if ($arOrderProps["ACTIVE"] == "Y" && $arOrderProps["UTIL"] == "N") {
                 $arOrderPropsTmp = $arOrderProps;
                 if ($iGroup != intval($arOrderProps["PROPS_GROUP_ID"])) {
                     $arOrderPropsTmp["SHOW_GROUP_NAME"] = "Y";
                     $iGroup = intval($arOrderProps["PROPS_GROUP_ID"]);
                 }
                 if ($arOrderProps["TYPE"] == "SELECT" || $arOrderProps["TYPE"] == "RADIO") {
                     $arVal = CSaleOrderPropsVariant::GetByValue($arOrderProps["ORDER_PROPS_ID"], $arOrderProps["VALUE"]);
                     $arOrderPropsTmp["VALUE"] = htmlspecialcharsEx($arVal["NAME"]);
                 } elseif ($arOrderProps["TYPE"] == "MULTISELECT") {
                     $arOrderPropsTmp["VALUE"] = "";
                     $curVal = explode(",", $arOrderProps["VALUE"]);
                     for ($i = 0, $intCount = count($curVal); $i < $intCount; $i++) {
                         $arVal = CSaleOrderPropsVariant::GetByValue($arOrderProps["ORDER_PROPS_ID"], $curVal[$i]);
                         if ($i > 0) {
                             $arOrderPropsTmp["VALUE"] .= ", ";
                         }
                         $arOrderPropsTmp["VALUE"] .= htmlspecialcharsEx($arVal["NAME"]);
                     }
                 } elseif ($arOrderProps["TYPE"] == "LOCATION") {
                     $locationName = "";
                     if (CSaleLocation::isLocationProEnabled()) {
                         $locationName = Location\Admin\LocationHelper::getLocationPathDisplay($arOrderProps["VALUE"]);
                     } else {
                         if (CSaleLocation::isLocationProMigrated()) {
                             $arOrderProps["VALUE"] = CSaleLocation::getLocationIDbyCODE($arOrderProps["VALUE"]);
                         }
                         $arVal = CSaleLocation::GetByID($arOrderProps["VALUE"], LANGUAGE_ID);
                         $locationName .= !strlen($arVal["COUNTRY_NAME"]) ? "" : $arVal["COUNTRY_NAME"];
                         if (strlen($arVal["COUNTRY_NAME"]) && strlen($arVal["REGION_NAME"])) {
                             $locationName .= " - " . $arVal["REGION_NAME"];
                         } elseif (strlen($arVal["REGION_NAME"])) {
                             $locationName .= $arVal["REGION_NAME"];
                         }
                         if (strlen($arVal["COUNTRY_NAME"]) || strlen($arVal["REGION_NAME"])) {
                             $locationName .= " - " . $arVal["CITY_NAME"];
                         } elseif (strlen($arVal["CITY_NAME"])) {
                             $locationName .= $arVal["CITY_NAME"];
                         }
                     }
                     $arOrderPropsTmp["VALUE"] = $locationName;
                 } elseif ($arOrderProps["TYPE"] == "FILE") {
                     if (strpos($arOrderProps["VALUE"], ",") !== false) {
                         $fileValue = "";
                         $values = explode(",", $arOrderProps["VALUE"]);
                         if (self::isNonemptyArray($values)) {
                             foreach ($values as $fileId) {
                                 $fileValue .= CFile::ShowFile(trim($fileId), 0, 90, 90, true) . "<br/>";
                             }
                         }
                         $arOrderPropsTmp["VALUE"] = $fileValue;
                     } else {
                         $arOrderPropsTmp["VALUE"] = CFile::ShowFile($arOrderProps["VALUE"], 0, 90, 90, true);
                     }
                 }
                 $props[] = $arOrderPropsTmp;
             }
         }
     }
     $cached["ORDER_PROPS"] = $props;
 }
开发者ID:ASDAFF,项目名称:1C_Bitrix_info_site,代码行数:76,代码来源:class.php

示例11: getSaleProperties


//.........这里部分代码省略.........
         }
         $arProp["CRM"]["CLIENT"] = $clientInfo;
         unset($clientInfo);
     }
     if (IntVal($arOrder["PAY_SYSTEM_ID"]) > 0) {
         $arProp["ORDER"]["PAY_SYSTEM_NAME"] = $paySystems[$arOrder["PAY_SYSTEM_ID"]];
     }
     if (strlen($arOrder["DELIVERY_ID"]) > 0) {
         $arProp["ORDER"]["DELIVERY_NAME"] = $delivery[$arOrder["DELIVERY_ID"]];
     }
     $dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
     $locationStreetPropertyValue = '';
     while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
         if ($arOrderPropVals["PROP_TYPE"] == "CHECKBOX") {
             if ($arOrderPropVals["VALUE"] == "Y") {
                 $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "true";
             } else {
                 $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = "false";
             }
         } elseif ($arOrderPropVals["PROP_TYPE"] == "TEXT" || $arOrderPropVals["PROP_TYPE"] == "TEXTAREA") {
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"];
         } elseif ($arOrderPropVals["PROP_TYPE"] == "SELECT" || $arOrderPropVals["PROP_TYPE"] == "RADIO") {
             $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["VALUE"]);
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arVal["NAME"];
         } elseif ($arOrderPropVals["PROP_TYPE"] == "MULTISELECT") {
             $curVal = explode(",", $arOrderPropVals["VALUE"]);
             foreach ($curVal as $vm) {
                 $arVal = CSaleOrderPropsVariant::GetByValue($arOrderPropVals["ORDER_PROPS_ID"], $vm);
                 $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] .= ", " . $arVal["NAME"];
             }
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = substr($arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]], 2);
         } elseif ($arOrderPropVals["PROP_TYPE"] == "LOCATION") {
             $arVal = CSaleLocation::GetByID($arOrderPropVals["VALUE"], LANGUAGE_ID);
             if (CSaleLocation::isLocationProEnabled()) {
                 if (intval($arVal['ID'])) {
                     try {
                         $res = \Bitrix\Sale\Location\LocationTable::getPathToNode($arVal['ID'], array('select' => array('LNAME' => 'NAME.NAME', 'TYPE_ID'), 'filter' => array('=NAME.LANGUAGE_ID' => LANGUAGE_ID)));
                         $types = \Bitrix\Sale\Location\Admin\TypeHelper::getTypeCodeIdMapCached();
                         $path = array();
                         while ($item = $res->fetch()) {
                             // copy street to STREET property
                             if ($types['ID2CODE'][$item['TYPE_ID']] == 'STREET') {
                                 $locationStreetPropertyValue = $item['LNAME'];
                             }
                             $path[] = $item['LNAME'];
                         }
                         $locationString = implode(' - ', $path);
                     } catch (\Bitrix\Main\SystemException $e) {
                         $locationString = '';
                     }
                 } else {
                     $locationString = '';
                 }
             } else {
                 $locationString = $arVal["COUNTRY_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["REGION_NAME"]) <= 0 ? "" : " - ") . $arVal["REGION_NAME"] . (strlen($arVal["COUNTRY_NAME"]) <= 0 || strlen($arVal["CITY_NAME"]) <= 0 ? "" : " - ") . $arVal["CITY_NAME"];
             }
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $locationString;
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_CITY"] = $arVal["CITY_NAME"];
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_COUNTRY"] = $arVal["COUNTRY_NAME"];
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"] . "_REGION"] = $arVal["REGION_NAME"];
         } else {
             $arProp["PROPERTY"][$arOrderPropVals["ORDER_PROPS_ID"]] = $arOrderPropVals["VALUE"];
         }
     }
     foreach ($agentParams as $k => $v) {
         if (strpos($k, "REKV_") !== false) {
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:67,代码来源:export.php

示例12: array

if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die;
}
use Bitrix\Main\Loader;
global $APPLICATION;
$APPLICATION->SetAdditionalCSS('/bitrix/js/crm/css/crm.css');
$APPLICATION->SetAdditionalCSS("/bitrix/themes/.default/crm-entity-show.css");
$arResult['GRID_DATA'] = $arColumns = array();
foreach ($arResult['HEADERS'] as $arHead) {
    $arColumns[$arHead['id']] = false;
}
foreach ($arResult['TAX_RATES'] as $key => &$arTaxRate) {
    $arActions = array();
    if ($arResult['CAN_EDIT']) {
        if (Loader::includeModule('sale') && CSaleLocation::isLocationProEnabled()) {
            $width = 1024;
            $height = 768;
            $resizable = 'true';
        } else {
            $width = 498;
            $height = 275;
            $resizable = 'false';
        }
        $taxRateEditDialog = "javascript:(new BX.CDialog({'content_url':'/bitrix/components/bitrix/crm.config.tax.rate.edit/box.php?FORM_ID=" . $arParams['TAX_FORM_ID'] . "&TAX_ID=" . $arResult['TAX_ID'] . "&ID=" . $key . "', 'width':'" . $width . "', 'height':'" . $height . "', 'resizable':" . $resizable . " })).Show(); return false;";
        $arActions[] = array('ICONCLASS' => 'edit', 'TITLE' => GetMessage('CRM_TAXRATE_EDIT_TITLE'), 'TEXT' => GetMessage('CRM_TAXRATE_EDIT'), 'ONCLICK' => $taxRateEditDialog, 'DEFAULT' => true);
    }
    if ($arResult['CAN_DELETE']) {
        $arActions[] = array('SEPARATOR' => true);
        $arActions[] = array('ICONCLASS' => 'delete', 'TITLE' => GetMessage('CRM_TAXRATE_DELETE_TITLE'), 'TEXT' => GetMessage('CRM_TAXRATE_DELETE'), 'ONCLICK' => 'crm_taxrate_delete_grid(\'' . CUtil::JSEscape(GetMessage('CRM_TAXRATE_DELETE_TITLE')) . '\', \'' . CUtil::JSEscape(sprintf(GetMessage('CRM_TAXRATE_DELETE_CONFIRM'), htmlspecialcharsbx($arTaxRate['NAME']))) . '\', \'' . CUtil::JSEscape(GetMessage('CRM_TAXRATE_DELETE')) . '\', \'' . CUtil::JSEscape($arTaxRate['PATH_TO_TAXRATE_DELETE']) . '\')');
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:30,代码来源:template.php

示例13: setJS

    public static function setJS($arErrors = array())
    {
        ?>
        <link href="<?= COption::GetOptionString(self::$module_id, 'url_static_css', 'test', SITE_ID) ?>" type="text/css" rel="stylesheet"/>
        <script type="text/javascript" src="<?= COption::GetOptionString(self::$module_id, 'url_static_js', 'testjs', SITE_ID) ?>"></script>
        <script type="text/javascript">
            <? $arFieldValues = unserialize(COption::GetOptionString(self::$module_id, 'mapping', "", SITE_ID));
            ?>
            var dadataReady = true;
            dadataSearchLocation = function (city, region, country, objectid) {
                <?if(!CSaleLocation::isLocationProEnabled()):?>
                function getLocationDaData(country_id, region_id, city_id, objectid) {
                    BX.showWait();

                    property_id = objectid;
                    innercity_id = city_id;

                    function getLocationResultDaData(res) {
                        BX.closeWait();

                        var obContainer = document.getElementById('LOCATION_' + property_id);
                        if (obContainer) {
                            obContainer.innerHTML = res;
                            var idObject = BX(objectid);
                            if (idObject != null)
                                idObject.value = innercity_id;
                        }
                    }

                    var arParams = {
                        'COUNTRY_INPUT_NAME': 'COUNTRY',
                        'REGION_INPUT_NAME': 'REGION',
                        'CITY_INPUT_NAME': 'ORDER_PROP_6',
                        'CITY_OUT_LOCATION': 'Y',
                        'ALLOW_EMPTY_CITY': 'Y',
                        'COUNTRY': parseInt(country_id),
                        'REGION': parseInt(region_id),
                        'SITE_ID': "<?=SITE_ID?>"
                    };

                    var url = '/bitrix/components/bitrix/sale.ajax.locations/templates/.default/ajax.php';
                    BX.ajax.post(url, arParams, getLocationResultDaData)
                };
                <?endif?>

                PShowWaitMessage('wait_container', true);
                var TID = CPHttpRequest.InitThread();
                dadataReady = false;
                CPHttpRequest.SetAction(
                    TID,
                    function (data) {
                        var result = {};

                        eval('result = ' + data);
                        if (result.length > 0) {
                            <?if(CSaleLocation::isLocationProEnabled()):?>
                            var idObject = $('[name=' + objectid + ']');
                            if (idObject != null && idObject.length > 0)
                                idObject.val(result[0]['ID']);
                            <?else:?>
                            var idObject = BX("COUNTRY" + objectid);
                            if (idObject != null)
                                idObject.value = result[0]['COUNTRY_ID'];
                            idObject = BX.findNextSibling(idObject, {"name": "REGION" + objectid});
                            if (idObject != null) {
                                idObject.value = result[0]['REGION_ID'];
                                getLocationDaData(result[0]['COUNTRY_ID'], result[0]['REGION_ID'], result[0]['ID'], objectid)
                            }
                            idObject = BX(objectid);
                            if (idObject != null)
                                idObject.value = result[0]['ID'];
                            <?endif?>

                            var locationArray = [];
                            if (result[0]['NAME']) locationArray.push(result[0]['NAME']);
                            if (result[0]['REGION_NAME']) locationArray.push(result[0]['REGION_NAME']);
                            if (result[0]['COUNTRY_NAME']) locationArray.push(result[0]['COUNTRY_NAME']);

                            <?if(CSaleLocation::isLocationProEnabled()):?>
                            var textObject = $('[name=' + objectid + ']');
                            if (textObject != null && textObject.length > 0) {
                                textObject = textObject.parent().find('.bx-ui-sls-fake');
                                if (textObject != null && textObject.length > 0) {
                                    textObject.attr('title', locationArray.join(', '));
                                }
                            }
                            <?else:?>
                            var textObject = BX(objectid + '_val');
                            if (textObject != null)
                                textObject.value = locationArray.join(', ');
                            <?endif?>


                        }
                        PCloseWaitMessage('wait_container', true);
                        <?if(CSaleLocation::isLocationProEnabled()):?>
                        submitForm();
                        <?endif?>
                        dadataReady = true;
                    }
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:suggestions-bitrix,代码行数:101,代码来源:dadataclass.php

示例14: PrintPropsForm


//.........这里部分代码省略.........
								<label for="<?php 
echo $arProperties["FIELD_NAME"];
?>
_<?php 
echo $arVariants["VALUE"];
?>
"><?php 
echo $arVariants["NAME"];
?>
</label></br>
							<?
							endforeach;
						}
						?>

						<?
						if (strlen(trim($arProperties["DESCRIPTION"])) > 0):
						?>
						<div class="bx_description">
							<?php 
echo $arProperties["DESCRIPTION"];
?>
						</div>
						<?
						endif;
						?>
					</div>
					<div style="clear: both;"></div>
					<?
				}
				elseif ($arProperties["TYPE"] == "FILE")
				{
					?>
					<br/>
					<div class="bx_block r1x3 pt8">
						<?php 
echo $arProperties["NAME"];
?>
						<?if ($arProperties["REQUIED_FORMATED"]=="Y"):?>
							<span class="bx_sof_req">*</span>
						<?endif;?>
					</div>

					<div class="bx_block r3x1">
						<?php 
echo showFilePropertyField("ORDER_PROP_" . $arProperties["ID"], $arProperties, $arProperties["VALUE"], $arProperties["SIZE1"]);
?>

						<?
						if (strlen(trim($arProperties["DESCRIPTION"])) > 0):
						?>
						<div class="bx_description">
							<?php 
echo $arProperties["DESCRIPTION"];
?>
						</div>
						<?
						endif;
						?>
					</div>

					<div style="clear: both;"></div><br/>
					<?
				}
				?>
				</div>

				<?if(CSaleLocation::isLocationProEnabled()):?>

					<?
					$propertyAttributes = array(
						'type' => $arProperties["TYPE"],
						'valueSource' => $arProperties['SOURCE'] == 'DEFAULT' ? 'default' : 'form' // value taken from property DEFAULT_VALUE or it`s a user-typed value?
					);

					if(intval($arProperties['IS_ALTERNATE_LOCATION_FOR']))
						$propertyAttributes['isAltLocationFor'] = intval($arProperties['IS_ALTERNATE_LOCATION_FOR']);

					if(intval($arProperties['CAN_HAVE_ALTERNATE_LOCATION']))
						$propertyAttributes['altLocationPropId'] = intval($arProperties['CAN_HAVE_ALTERNATE_LOCATION']);

					if($arProperties['IS_ZIP'] == 'Y')
						$propertyAttributes['isZip'] = true;
					?>

					<script>

						<?// add property info to have client-side control on it?>
						(window.top.BX || BX).saleOrderAjax.addPropertyDesc(<?php 
echo CUtil::PhpToJSObject(array('id' => intval($arProperties["ID"]), 'attributes' => $propertyAttributes));
?>
);

					</script>
				<?endif?>

				<?
			}
		}
	}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:101,代码来源:props_format.php

示例15: PrintPropsForm


//.........这里部分代码省略.........
                            ?>
</label></br>
									<?php 
                        }
                    }
                    ?>

								<?php 
                    if (strlen(trim($arProperties["DESCRIPTION"])) > 0) {
                        ?>
								<div class="bx_description">
									<?php 
                        echo $arProperties["DESCRIPTION"];
                        ?>
								</div>
								<?php 
                    }
                    ?>
							</div>
							<div style="clear: both;"></div>
							<?php 
                } elseif ($arProperties["TYPE"] == "FILE") {
                    ?>
							<br/>
							<div class="bx_block r1x3 pt8">
								<?php 
                    echo $arProperties["NAME"];
                    ?>
								<?php 
                    if ($arProperties["REQUIED_FORMATED"] == "Y") {
                        ?>
									<span class="bx_sof_req">*</span>
								<?php 
                    }
                    ?>
							</div>

							<div class="bx_block r3x1">
								<?php 
                    echo showFilePropertyField("ORDER_PROP_" . $arProperties["ID"], $arProperties, $arProperties["VALUE"], $arProperties["SIZE1"]);
                    ?>

								<?php 
                    if (strlen(trim($arProperties["DESCRIPTION"])) > 0) {
                        ?>
								<div class="bx_description">
									<?php 
                        echo $arProperties["DESCRIPTION"];
                        ?>
								</div>
								<?php 
                    }
                    ?>
							</div>

							<div style="clear: both;"></div><br/>
							<?php 
                }
                ?>
						</div>

						<?php 
                if (CSaleLocation::isLocationProEnabled()) {
                    ?>

							<?php 
                    $propertyAttributes = array('type' => $arProperties["TYPE"], 'valueSource' => $arProperties['SOURCE'] == 'DEFAULT' ? 'default' : 'form');
                    if (intval($arProperties['IS_ALTERNATE_LOCATION_FOR'])) {
                        $propertyAttributes['isAltLocationFor'] = intval($arProperties['IS_ALTERNATE_LOCATION_FOR']);
                    }
                    if (intval($arProperties['CAN_HAVE_ALTERNATE_LOCATION'])) {
                        $propertyAttributes['altLocationPropId'] = intval($arProperties['CAN_HAVE_ALTERNATE_LOCATION']);
                    }
                    if ($arProperties['IS_ZIP'] == 'Y') {
                        $propertyAttributes['isZip'] = true;
                    }
                    ?>

							<script>

								<?php 
                    // add property info to have client-side control on it
                    ?>
								(window.top.BX || BX).saleOrderAjax.addPropertyDesc(<?php 
                    echo CUtil::PhpToJSObject(array('id' => intval($arProperties["ID"]), 'attributes' => $propertyAttributes));
                    ?>
);

							</script>
						<?php 
                }
                ?>

						<?php 
            }
            ?>
				</div>
			<?php 
        }
    }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:props_format.php


注:本文中的CSaleLocation::isLocationProEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。