Example #1
0
	function PrintPropsForm($arSource=Array(), $PRINT_TITLE = "", $arParams)
	{
		if (!empty($arSource))
		{
			if (strlen($PRINT_TITLE) > 0)
			{
				?>
				<b><?php 
echo $PRINT_TITLE;
?>
</b><br /><br />
				<?
			}
			?>
			<table class="sale_order_full_table">
			<?
			foreach($arSource as $arProperties)
			{
				if($arProperties["SHOW_GROUP_NAME"] == "Y")
				{
					?>
					<tr>
						<td colspan="2" align="center">
							<b><?php 
echo $arProperties["GROUP_NAME"];
?>
</b>
						</td>
					</tr>
					<?
				}
				?>
				<tr>
					<td align="right" valign="top">
						<?php 
echo $arProperties["NAME"];
?>
:<?
						if($arProperties["REQUIED_FORMATED"]=="Y")
						{
							?><span class="sof-req">*</span><?
						}
						?>
					</td>
					<td>
						<?
						if($arProperties["TYPE"] == "CHECKBOX")
						{
							?>
							<input type="checkbox" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" value="Y"<?if ($arProperties["CHECKED"]=="Y") echo " checked";?>>
							<?
						}
						elseif($arProperties["TYPE"] == "TEXT")
						{
							?>
							<input type="text" maxlength="250" size="<?php 
echo $arProperties["SIZE1"];
?>
" value="<?php 
echo $arProperties["VALUE"];
?>
" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
">
							<?
						}
						elseif($arProperties["TYPE"] == "SELECT")
						{
							?>
							<select name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
							<?
							foreach($arProperties["VARIANTS"] as $arVariants)
							{
								?>
								<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
								<?
							}
							?>
							</select>
							<?
						}
						elseif ($arProperties["TYPE"] == "MULTISELECT")
						{
							?>
							<select multiple name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
							<?
							foreach($arProperties["VARIANTS"] as $arVariants)
							{
								?>
								<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
								<?
							}
							?>
							</select>
							<?
						}
						elseif ($arProperties["TYPE"] == "TEXTAREA")
						{
							?>
							<textarea rows="<?php 
echo $arProperties["SIZE2"];
?>
" cols="<?php 
echo $arProperties["SIZE1"];
?>
" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
"><?php 
echo $arProperties["VALUE"];
?>
</textarea>
							<?
						}
						elseif ($arProperties["TYPE"] == "LOCATION")
						{
							$value = 0;
							foreach ($arProperties["VARIANTS"] as $arVariant)
							{
								if ($arVariant["SELECTED"] == "Y")
								{
									$value = $arVariant["ID"];
									break;
								}
							}

							if ($arParams["USE_AJAX_LOCATIONS"] == "Y"):

								CSaleLocation::proxySaleAjaxLocationsComponent(
									array(
										"AJAX_CALL" => "N",
										"COUNTRY_INPUT_NAME" => "COUNTRY_".$arProperties["FIELD_NAME"],
										"REGION_INPUT_NAME" => "REGION_".$arProperties["FIELD_NAME"],
										"CITY_INPUT_NAME" => $arProperties["FIELD_NAME"],
										"CITY_OUT_LOCATION" => "Y",
										"LOCATION_VALUE" => $value,
										"ORDER_PROPS_ID" => $arProperties["ID"],
										"ONCITYCHANGE" => "",
									),
									array(
										"ID" => "",
										"CODE" => $arProperties["VALUE"],
										"PROVIDE_LINK_BY" => "code",
									)
								);

							else:
							?>
							<select name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
							<?
							foreach($arProperties["VARIANTS"] as $arVariants)
							{
								?>
								<option value="<?php 
echo $arVariants["ID"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
								<?
							}
							?>
							</select>
							<?
							endif;
						}
						elseif ($arProperties["TYPE"] == "RADIO")
						{
							foreach($arProperties["VARIANTS"] as $arVariants)
							{
								?>
								<input type="radio" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
_<?php 
echo $arVariants["ID"];
?>
" value="<?php 
echo $arVariants["VALUE"];
?>
"<?if($arVariants["CHECKED"] == "Y") echo " checked";?>> <label for="<?php 
echo $arProperties["FIELD_NAME"];
?>
_<?php 
echo $arVariants["ID"];
?>
"><?php 
echo $arVariants["NAME"];
?>
</label><br />
								<?
							}
						}

						if (strlen($arProperties["DESCRIPTION"]) > 0)
						{
							?><br /><small><?echo $arProperties["DESCRIPTION"] ?></small><?
						}
						?>

					</td>
				</tr>
				<?
			}
			?>
			</table>
			<?
			return true;
		}
		return false;
	}
Example #2
0
    $arResult['FIELDS']['tab_1'][] = array('id' => 'DEAL_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_DEAL_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'DEAL', 'INPUT_NAME' => 'DEAL_ID', 'NEW_INPUT_NAME' => '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['DEAL_ID']) ? $arResult['ELEMENT']['DEAL_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
$arResult['FIELDS']['tab_1'][] = array('id' => 'OPENED', 'name' => GetMessage('CRM_QUOTE_FIELD_OPENED'), 'type' => 'vertical_checkbox', 'params' => array(), 'value' => isset($arResult['ELEMENT']['OPENED']) ? $arResult['ELEMENT']['OPENED'] : true, 'title' => GetMessage('CRM_QUOTE_FIELD_OPENED_TITLE'));
$arResult['FIELDS']['tab_1'][] = array('id' => 'section_contact_info', 'name' => GetMessage('CRM_SECTION_CLIENT_INFO'), 'type' => 'section');
if (CCrmContact::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'CONTACT_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_CONTACT_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'CONTACT', 'INPUT_NAME' => 'CONTACT_ID', 'NEW_INPUT_NAME' => CCrmContact::CheckCreatePermission() ? 'NEW_CONTACT_ID' : '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['CONTACT_ID']) ? $arResult['ELEMENT']['CONTACT_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
if (CCrmCompany::CheckReadPermission()) {
    $arResult['FIELDS']['tab_1'][] = array('id' => 'COMPANY_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_COMPANY_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'COMPANY', 'INPUT_NAME' => 'COMPANY_ID', 'NEW_INPUT_NAME' => CCrmCompany::CheckCreatePermission() ? 'NEW_COMPANY_ID' : '', 'INPUT_VALUE' => isset($arResult['ELEMENT']['COMPANY_ID']) ? $arResult['ELEMENT']['COMPANY_ID'] : '', 'FORM_NAME' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()));
}
if ($bTaxMode) {
    // CLIENT LOCATION
    $sLocationHtml = '';
    $locValue = isset($arResult['ELEMENT']['LOCATION_ID']) ? $arResult['ELEMENT']['LOCATION_ID'] : '';
    ob_start();
    CSaleLocation::proxySaleAjaxLocationsComponent(array('AJAX_CALL' => 'N', 'COUNTRY_INPUT_NAME' => 'LOC_COUNTRY', 'REGION_INPUT_NAME' => 'LOC_REGION', 'CITY_INPUT_NAME' => 'LOC_CITY', 'CITY_OUT_LOCATION' => 'Y', 'LOCATION_VALUE' => $locValue, 'ORDER_PROPS_ID' => 'QUOTE_' . $arResult['ELEMENT']['ID'], 'ONCITYCHANGE' => 'BX.onCustomEvent(\'CrmProductRowSetLocation\', [\'LOC_CITY\']);', 'SHOW_QUICK_CHOOSE' => 'N'), array("CODE" => $locValue, "ID" => "", "PROVIDE_LINK_BY" => "code", "JS_CALLBACK" => 'CrmProductRowSetLocation'), 'popup');
    $sLocationHtml = ob_get_contents();
    ob_end_clean();
    $locationField = array('id' => 'LOCATION_ID', 'name' => GetMessage('CRM_QUOTE_FIELD_LOCATION_ID'), 'type' => 'custom', 'value' => $sLocationHtml . '<div>' . '<span class="bx-crm-edit-content-location-description">' . GetMessage('CRM_QUOTE_FIELD_LOCATION_ID_DESCRIPTION') . '</span>' . '</div>', 'required' => true);
    $arResult['FIELDS']['tab_1'][] = $locationField;
    $arResult['FORM_FIELDS_TO_ADD']['LOCATION_ID'] = $locationField;
    unset($locationField);
}
// Rewrite client fields
if (!($bEdit || $bCopy || !empty($arResult['ERROR_MESSAGE']))) {
    CCrmQuote::RewriteClientFields($arResult['ELEMENT']);
}
// person type
$arResult['ELEMENT']['PERSON_TYPE_ID'] = 0;
$arResult['PERSON_TYPE'] = 'CONTACT';
if (isset($arPersonTypes['CONTACT']) && (!isset($arResult['ELEMENT']['COMPANY_ID']) || intval($arResult['ELEMENT']['COMPANY_ID']) <= 0)) {
Example #3
0
function getOrderPropertiesHTML($arOrderProps, $arPropValues = array(), $LID, $USER_ID = '', $ORDER_ID = 0, $formVarsSubmit = false)
{
	$propertyGroupID = -1;
	$arDisableFieldForLocation = array();
	$resultHtml = "<table id=\"order_related_props\">";

	// get order properties values
	if ($formVarsSubmit)
	{
		$locationIndexForm = "";
		foreach ($_POST as $key => $value)
		{
			if (substr($key, 0, strlen("CITY_ORDER_PROP_")) == "CITY_ORDER_PROP_")
			{
				$arPropValues[intval(substr($key, strlen("CITY_ORDER_PROP_")))] = htmlspecialcharsbx($value);
				$locationIndexForm = intval(substr($key, strlen("CITY_ORDER_PROP_")));
			}
			if (substr($key, 0, strlen("ORDER_PROP_")) == "ORDER_PROP_")
			{
				if ($locationIndexForm != intval(substr($key, strlen("ORDER_PROP_"))))
				{
					if (!is_array($value))
						$arPropValues[intval(substr($key, strlen("ORDER_PROP_")))] = htmlspecialcharsbx($value);
					else
					{
						$arValues = array();
						foreach ($value as $k => $v)
							$arValues[$key] = htmlspecialcharsbx($v);

						$arPropValues[intval(substr($key, strlen("ORDER_PROP_")))] = $arValues;
					}
				}
			}
		}
	}

	// iterate over list of properties
	if (is_array($arOrderProps))
	{
		foreach ($arOrderProps as $arProperties)
		{
			if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID)
			{
				$resultHtml .= "<tr><td colspan=\"2\" style=\"text-align:center;font-weight:bold;font-size:14px;color:rgb(75, 98, 103);\" >".htmlspecialcharsEx($arProperties["GROUP_NAME"])."\n</td>\n</tr>";
				$propertyGroupID = intval($arProperties["PROPS_GROUP_ID"]);
			}

			if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID)
				$propertyGroupID = intval($arProperties["PROPS_GROUP_ID"]);

			$adit = "";
			$requiredField = "";
			if ($arProperties["REQUIED"] == "Y" || $arProperties["IS_PROFILE_NAME"] == "Y" || $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" || $arProperties["IS_PAYER"] == "Y" || $arProperties["IS_ZIP"] == "Y")
			{
				$adit = " class=\"adm-detail-required-field\"";
				$requiredField = " class=\"adm-detail-content-cell-l\"";
			}

			//delete town from location
			if (in_array($arProperties["ID"], $arDisableFieldForLocation))
				$resultHtml .= "<tr style=\"display:none;\" id=\"town_location_".$arProperties["ID"]."\"".$adit.">\n";
			else
				$resultHtml .= "<tr id=\"town_location_".$arProperties["ID"]."\"".$adit.">\n";

			if(($arProperties["TYPE"] == "MULTISELECT" || $arProperties["TYPE"] == "TEXTAREA") || ($ORDER_ID <= 0 && $arProperties["IS_PROFILE_NAME"] == "Y") )
				$resultHtml .= "<td valign=\"top\" class=\"adm-detail-content-cell-l\" width=\"40%\">\n";
			else
				$resultHtml .= "<td align=\"right\" width=\"40%\" ".$requiredField.">\n";

			$resultHtml .= $arProperties["NAME"].":</td>";

			$curVal = $arPropValues[intval($arProperties["ID"])];

			if($arProperties["IS_EMAIL"] == "Y" || $arProperties["IS_PAYER"] == "Y")
			{
				if(strlen($arProperties["DEFAULT_VALUE"]) <= 0 && intval($USER_ID) > 0)
				{
					$rsUser = CUser::GetByID($USER_ID);
					if ($arUser = $rsUser->Fetch())
					{
						if($arProperties["IS_EMAIL"] == "Y")
							$arProperties["DEFAULT_VALUE"] = $arUser["EMAIL"];
						else
						{
							if (strlen($arUser["LAST_NAME"]) > 0)
								$arProperties["DEFAULT_VALUE"] .= $arUser["LAST_NAME"];
							if (strlen($arUser["NAME"]) > 0)
								$arProperties["DEFAULT_VALUE"] .= " ".$arUser["NAME"];
							if (strlen($arUser["SECOND_NAME"]) > 0 AND strlen($arUser["NAME"]) > 0)
								$arProperties["DEFAULT_VALUE"] .= " ".$arUser["SECOND_NAME"];
						}
					}
				}
			}

			$resultHtml .= "<td class=\"adm-detail-content-cell-r\" width=\"60%\">";

			if ($arProperties["TYPE"] == "CHECKBOX")
			{
				$resultHtml .= '<input type="checkbox" class="inputcheckbox" ';
				$resultHtml .= 'name="ORDER_PROP_'.$arProperties["ID"].'" value="Y"';
				$resultHtml .= 'id="ORDER_PROP_'.$arProperties["ID"].'" ';
				if ($curVal=="Y" || !isset($curVal) && $arProperties["DEFAULT_VALUE"]=="Y")
					$resultHtml .= " checked";
				$resultHtml .= '>';
			}
			elseif ($arProperties["TYPE"] == "TEXT")
			{
				$change = "";
				if ($arProperties["IS_ZIP"] == "Y")
				{
					$DELIVERY_LOCATION_ZIP = $curVal;
					$resultHtml .= '<script> locationZipID = \''.$arProperties["ID"].'\';</script>';
					$locationZipID = ((isset($curVal)) ? htmlspecialcharsEx($curVal) : htmlspecialcharsex($arProperties["DEFAULT_VALUE"]));
				}

				if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
				{
					$resultHtml .= '<div id="BREAK_NAME"';
					if ($ORDER_ID > 0 || ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist"))
						$resultHtml .= ' style="display:none"';
					$resultHtml .= '>';

					$BREAK_LAST_NAME_TMP = GetMessage('NEWO_BREAK_LAST_NAME');
					if (isset($_REQUEST["BREAK_LAST_NAME"]) && strlen($_REQUEST["BREAK_LAST_NAME"]) > 0)
						$BREAK_LAST_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_LAST_NAME"]));

					$NEWO_BREAK_NAME_TMP = GetMessage('NEWO_BREAK_NAME');
					if (isset($_REQUEST["BREAK_NAME"]) && strlen($_REQUEST["BREAK_NAME"]) > 0)
						$NEWO_BREAK_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_NAME"]));

					$BREAK_SECOND_NAME_TMP = GetMessage('NEWO_BREAK_SECOND_NAME');
					if (isset($_REQUEST["BREAK_SECOND_NAME"]) && strlen($_REQUEST["BREAK_SECOND_NAME"]) > 0)
						$BREAK_SECOND_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_SECOND_NAME"]));

					$resultHtml .= "<div class=\"fio newo_break_active\"><input onblur=\"if (this.value==''){this.value='".CUtil::JSEscape(GetMessage('NEWO_BREAK_LAST_NAME'))."';BX.addClass(this.parentNode,'newo_break_active');}\" onfocus=\"if (this.value=='".CUtil::JSEscape(GetMessage('NEWO_BREAK_LAST_NAME'))."') {this.value='';BX.removeClass(this.parentNode,'newo_break_active');}\" type=\"text\" name=\"BREAK_LAST_NAME\" id=\"BREAK_LAST_NAME\" size=\"30\" value=\"".$BREAK_LAST_NAME_TMP."\" /></div>";
					$resultHtml .= "<div class=\"fio newo_break_active\"><input onblur=\"if (this.value==''){this.value='".CUtil::JSEscape(GetMessage('NEWO_BREAK_NAME'))."';BX.addClass(this.parentNode,'newo_break_active');}\" onfocus=\"if (this.value=='".CUtil::JSEscape(GetMessage('NEWO_BREAK_NAME'))."') {this.value='';BX.removeClass(this.parentNode,'newo_break_active');}\" type=\"text\" name=\"BREAK_NAME\" id=\"BREAK_NAME_BUYER\" size=\"30\" value=\"".$NEWO_BREAK_NAME_TMP."\" /></div>";
					$resultHtml .= "<div class=\"fio newo_break_active\"><input onblur=\"if (this.value==''){this.value='".CUtil::JSEscape(GetMessage('NEWO_BREAK_SECOND_NAME'))."';BX.addClass(this.parentNode,'newo_break_active');}\" onfocus=\"if (this.value=='".CUtil::JSEscape(GetMessage('NEWO_BREAK_SECOND_NAME'))."') {this.value='';BX.removeClass(this.parentNode,'newo_break_active');}\" type=\"text\" name=\"BREAK_SECOND_NAME\" id=\"BREAK_SECOND_NAME\" size=\"30\" value=\"".$BREAK_SECOND_NAME_TMP."\" /></div>";
					$resultHtml .= '</div>';

					$resultHtml .= '<div id="NO_BREAK_NAME"';
					if ($ORDER_ID <= 0)
						$tmpNone = ' style="display:none"';
					if ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist")
						$tmpNone = ' style="display:block"';
					$resultHtml .= $tmpNone.'>';
				}

				$resultHtml .= '<input type="text" maxlength="250" ';
				$resultHtml .= 'size="30" ';
				$resultHtml .= 'value="'.((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE"]).'" ';
				$resultHtml .= 'name="ORDER_PROP_'.$arProperties["ID"].'" ';
				$resultHtml .= 'id="ORDER_PROP_'.$arProperties["ID"].'" '.$change.'>';

				if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
					$resultHtml .= '</div>';
			}
			elseif ($arProperties["TYPE"] == "SELECT")
			{
				$size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;

				$resultHtml .= '<select name="ORDER_PROP_'.$arProperties["ID"].'" ';
				$resultHtml .= 'id="ORDER_PROP_'.$arProperties["ID"].'" ';
				$resultHtml .= 'size='.$size.' ';
				$resultHtml .= 'class="typeselect">';
				$dbVariants = CSaleOrderPropsVariant::GetList(
					array("SORT" => "ASC"),
					array("ORDER_PROPS_ID" => $arProperties["ID"]),
					false,
					false,
					array("*")
				);
				while ($arVariants = $dbVariants->Fetch())
				{
					$resultHtml .= '<option value="'.htmlspecialcharsex($arVariants["VALUE"]).'"';
					if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
						$resultHtml .= " selected";
					$resultHtml .= '>'.htmlspecialcharsEx($arVariants["NAME"]).'</option>';
				}
				$resultHtml .= '</select>';
			}
			elseif ($arProperties["TYPE"] == "MULTISELECT")
			{
				$size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;

				$resultHtml .= '<select multiple name="ORDER_PROP_'.$arProperties["ID"].'[]" ';
				$resultHtml .= 'id="ORDER_PROP_'.$arProperties["ID"].'" ';
				$resultHtml .= 'size='.$size.' ';
				$resultHtml .= 'class="typeselect" type="multyselect">';

				if (!is_array($curVal))
				{
					if (strlen($curVal) > 0 OR $ORDER_ID != "")
						$curVal = explode(",", $curVal);
					else
						$curVal = explode(",", $arProperties["DEFAULT_VALUE"]);

					$arCurVal = array();
					$countCurVal = count($curVal);
					for ($i = 0; $i < $countCurVal; $i++)
						$arCurVal[$i] = Trim($curVal[$i]);
				}
				else
					$arCurVal = $curVal;

				$dbVariants = CSaleOrderPropsVariant::GetList(
					array("SORT" => "ASC"),
					array("ORDER_PROPS_ID" => $arProperties["ID"]),
					false,
					false,
					array("*")
				);
				while ($arVariants = $dbVariants->Fetch())
				{
					$resultHtml .= '<option value="'.htmlspecialcharsex($arVariants["VALUE"]).'"';
					if (in_array($arVariants["VALUE"], $arCurVal))
						$resultHtml .= " selected";
					$resultHtml .= '>'.htmlspecialcharsEx($arVariants["NAME"]).'</option>';
				}
				$resultHtml .= '</select>';
			}
			elseif ($arProperties["TYPE"] == "TEXTAREA")
			{
				$resultHtml .= '<textarea ';
				$resultHtml .= 'rows="4" ';
				$resultHtml .= 'cols="40" ';
				$resultHtml .= 'name="ORDER_PROP_'.$arProperties["ID"].'" ';
				$resultHtml .= 'id="ORDER_PROP_'.$arProperties["ID"].'" type="textarea">';
				$resultHtml .= ((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE"]);
				$resultHtml .= '</textarea>';
			}
			elseif ($arProperties["TYPE"] == "LOCATION")
			{
				$countryID = "";
				$cityID = "";
				$cityList = "";
				$DELIVERY_LOCATION = $arPropValues[intval($arProperties["ID"])];
				$locationID = $curVal;
				$tmpLocation = '';

				ob_start();

				CSaleLocation::proxySaleAjaxLocationsComponent(
					array(
						"SITE_ID" => $LID,
						"AJAX_CALL" => "N",
						"COUNTRY_INPUT_NAME" => "ORDER_PROP_".$arProperties["ID"],
						"REGION_INPUT_NAME" => "REGION_ORDER_PROP_".$arProperties["ID"],
						"CITY_INPUT_NAME" => "CITY_ORDER_PROP_".$arProperties["ID"],
						"CITY_OUT_LOCATION" => "Y",
						"ALLOW_EMPTY_CITY" => "Y",
						"LOCATION_VALUE" => $curVal,
						"COUNTRY" => "",
						"ONCITYCHANGE" => "",
						"PUBLIC" => "N",
					),
					array(
						"ID" => "",
						"CODE" => $curVal,
						"PROVIDE_LINK_BY" => "code",
					)
				);

				$tmpLocation = ob_get_contents();
				ob_end_clean();

				$resultHtml .= '<script>var locationID = \''.$arProperties["ID"].'\';</script>';
				$resultHtml .= $tmpLocation;
			}
			elseif ($arProperties["TYPE"] == "RADIO")
			{
				$dbVariants = CSaleOrderPropsVariant::GetList(
					array("SORT" => "ASC"),
					array("ORDER_PROPS_ID" => $arProperties["ID"]),
					false,
					false,
					array("*")
				);
				$resultHtml .= '<div id="ORDER_PROP_'.$arProperties["ID"].'">';// type="radio"
				while ($arVariants = $dbVariants->Fetch())
				{
					$resultHtml .= '<input type="radio" class="inputradio" ';
					$resultHtml .= 'name="ORDER_PROP_'.$arProperties["ID"].'" ';
					$resultHtml .= 'value="'.htmlspecialcharsex($arVariants["VALUE"]).'"';
					if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
						$resultHtml .= " checked";
					$resultHtml .= '>'.htmlspecialcharsEx($arVariants["NAME"]).'<br>';
				}
				$resultHtml .= '</div>';
			}
			elseif ($arProperties["TYPE"] == "FILE")
			{
				$arValues = array();
				$arTmpValues = array();
				if (isset($arPropValues[$arProperties["ID"]]) && !is_array($arPropValues[$arProperties["ID"]]))
				{
					$arTmpValues = explode(", ", $arPropValues[$arProperties["ID"]]);
					foreach ($arTmpValues as $key => $value)
						$arValues[$value] = $value;
				}

				$resultHtml .= fShowFilePropertyField("ORDER_PROP_".$arProperties["ID"], $arProperties, $arValues, $arProperties["SIZE1"], $formVarsSubmit);
			}

			if (strlen($arProperties["DESCRIPTION"]) > 0)
			{
				$resultHtml .= "<br><small>".htmlspecialcharsEx($arProperties["DESCRIPTION"])."</small>";
			}
			$resultHtml .= "\n</td>\n</tr>";

		}//end while
	}

	$resultHtml .= "</table>";

	return $resultHtml;
}
Example #4
0
    function PrintPropsForm($arSource = array(), $locationTemplate = ".default")
    {
        if (!empty($arSource)) {
            ?>
				<div>
					<?php 
            foreach ($arSource as $arProperties) {
                ?>
						<div data-property-id-row="<?php 
                echo intval(intval($arProperties["ID"]));
                ?>
">

						<?php 
                if ($arProperties["TYPE"] == "CHECKBOX") {
                    ?>
							<input type="hidden" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" value="">

							<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 r1x3 pt8">
								<input type="checkbox" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" value="Y"<?php 
                    if ($arProperties["CHECKED"] == "Y") {
                        echo " checked";
                    }
                    ?>
>

								<?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"] == "TEXT") {
                    ?>
							<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">
								<input type="text" maxlength="250" size="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
" value="<?php 
                    echo $arProperties["VALUE"];
                    ?>
" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" />

								<?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 
                } elseif ($arProperties["TYPE"] == "SELECT") {
                    ?>
							<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">
								<select name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" size="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
">
									<?php 
                    foreach ($arProperties["VARIANTS"] as $arVariants) {
                        ?>
										<option value="<?php 
                        echo $arVariants["VALUE"];
                        ?>
"<?php 
                        if ($arVariants["SELECTED"] == "Y") {
                            echo " selected";
                        }
                        ?>
><?php 
                        echo $arVariants["NAME"];
                        ?>
</option>
									<?php 
                    }
                    ?>
								</select>

								<?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"] == "MULTISELECT") {
                    ?>
							<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">
								<select multiple name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" size="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
">
									<?php 
                    foreach ($arProperties["VARIANTS"] as $arVariants) {
                        ?>
										<option value="<?php 
                        echo $arVariants["VALUE"];
                        ?>
"<?php 
                        if ($arVariants["SELECTED"] == "Y") {
                            echo " selected";
                        }
                        ?>
><?php 
                        echo $arVariants["NAME"];
                        ?>
</option>
									<?php 
                    }
                    ?>
								</select>

								<?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"] == "TEXTAREA") {
                    $rows = $arProperties["SIZE2"] > 10 ? 4 : $arProperties["SIZE2"];
                    ?>
							<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">
								<textarea rows="<?php 
                    echo $rows;
                    ?>
" cols="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
"><?php 
                    echo $arProperties["VALUE"];
                    ?>
</textarea>

								<?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"] == "LOCATION") {
                    ?>
							<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 
                    $value = 0;
                    if (is_array($arProperties["VARIANTS"]) && count($arProperties["VARIANTS"]) > 0) {
                        foreach ($arProperties["VARIANTS"] as $arVariant) {
                            if ($arVariant["SELECTED"] == "Y") {
                                $value = $arVariant["ID"];
                                break;
                            }
                        }
                    }
                    // here we can get '' or 'popup'
                    // map them, if needed
                    if (CSaleLocation::isLocationProMigrated()) {
                        $locationTemplateP = $locationTemplate == 'popup' ? 'search' : 'steps';
                        $locationTemplateP = $_REQUEST['PERMANENT_MODE_STEPS'] == 1 ? 'steps' : $locationTemplateP;
                        // force to "steps"
                    }
                    ?>

								<?php 
                    if ($locationTemplateP == 'steps') {
                        ?>
									<input type="hidden" id="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
                        echo intval($arProperties["ID"]);
                        ?>
]" name="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
                        echo intval($arProperties["ID"]);
                        ?>
]" value="<?php 
                        echo $_REQUEST['LOCATION_ALT_PROP_DISPLAY_MANUAL'][intval($arProperties["ID"])] ? '1' : '0';
                        ?>
" />
								<?php 
                    }
                    ?>

								<?php 
                    CSaleLocation::proxySaleAjaxLocationsComponent(array("AJAX_CALL" => "N", "COUNTRY_INPUT_NAME" => "COUNTRY", "REGION_INPUT_NAME" => "REGION", "CITY_INPUT_NAME" => $arProperties["FIELD_NAME"], "CITY_OUT_LOCATION" => "Y", "LOCATION_VALUE" => $value, "ORDER_PROPS_ID" => $arProperties["ID"], "ONCITYCHANGE" => $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" ? "submitForm()" : "", "SIZE1" => $arProperties["SIZE1"]), array("ID" => $value, "CODE" => "", "SHOW_DEFAULT_LOCATIONS" => "Y", "JS_CALLBACK" => "submitFormProxy", "JS_CONTROL_DEFERRED_INIT" => intval($arProperties["ID"]), "JS_CONTROL_GLOBAL_ID" => intval($arProperties["ID"]), "DISABLE_KEYBOARD_INPUT" => "Y", "PRECACHE_LAST_LEVEL" => "Y", "PRESELECT_TREE_TRUNK" => "Y", "SUPPRESS_ERRORS" => "Y"), $locationTemplateP, true, 'location-block-wrapper');
                    ?>

								<?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"] == "RADIO") {
                    ?>
							<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 
                    if (is_array($arProperties["VARIANTS"])) {
                        foreach ($arProperties["VARIANTS"] as $arVariants) {
                            ?>
										<input
											type="radio"
											name="<?php 
                            echo $arProperties["FIELD_NAME"];
                            ?>
"
											id="<?php 
                            echo $arProperties["FIELD_NAME"];
                            ?>
_<?php 
                            echo $arVariants["VALUE"];
                            ?>
"
											value="<?php 
                            echo $arVariants["VALUE"];
                            ?>
" <?php 
                            if ($arVariants["CHECKED"] == "Y") {
                                echo " checked";
                            }
                            ?>
 />

										<label for="<?php 
                            echo $arProperties["FIELD_NAME"];
                            ?>
_<?php 
                            echo $arVariants["VALUE"];
                            ?>
"><?php 
                            echo $arVariants["NAME"];
                            ?>
</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 
        }
    }
Example #5
0
			$location = intval($location);

		ob_start();

		CSaleLocation::proxySaleAjaxLocationsComponent(
			array(
				"SITE_ID" => $LID,
				"AJAX_CALL" => "Y",
				"COUNTRY_INPUT_NAME" => "ORDER_PROP_".$locid,
				"REGION_INPUT_NAME" => "REGION_ORDER_PROP_".$locid,
				"CITY_INPUT_NAME" => "CITY_ORDER_PROP_".$locid,
				"CITY_OUT_LOCATION" => "Y",
				"ALLOW_EMPTY_CITY" => "Y",
				"LOCATION_VALUE" => $location,
				"COUNTRY" => "",
				"ONCITYCHANGE" => "fChangeLocationCity();",
			),
			array(
				"ID" => "",
				"CODE" => $location,
				"JS_CALLBACK" => 'fChangeLocationCity',
				"SHOW_DEFAULT_LOCATIONS" => 'Y',
				"JS_CONTROL_GLOBAL_ID" => 'saleOrderNew',
			),
			'',
			true,
			'location-block-wrapper'
		);

		$tmpLocation = ob_get_contents();
		ob_end_clean();
Example #6
0
	function PrintPropsForm($arSource = array(), $locationTemplate = ".default")
	{
		if (!empty($arSource))
		{
			?>
				<div>
					<?
					foreach ($arSource as $arProperties)
					{
						if(CSaleLocation::isLocationProMigrated())
						{
							$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;
						}
						?>
						<div data-property-id-row="<?php 
echo intval(intval($arProperties["ID"]));
?>
">

						<?
						if ($arProperties["TYPE"] == "CHECKBOX")
						{
							?>
							<input type="hidden" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" value="">

							<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 r1x3 pt8">
								<input type="checkbox" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" value="Y"<?if ($arProperties["CHECKED"]=="Y") echo " checked";?>>

								<?
								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"] == "TEXT")
						{
							?>
							<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">
								<input type="text" maxlength="250" size="<?php 
echo $arProperties["SIZE1"];
?>
" value="<?php 
echo $arProperties["VALUE"];
?>
" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" />

								<?
								if (strlen(trim($arProperties["DESCRIPTION"])) > 0):
								?>
								<div class="bx_description">
									<?php 
echo $arProperties["DESCRIPTION"];
?>
								</div>
								<?
								endif;
								?>
							</div>
							<div style="clear: both;"></div><br/>
							<?
						}
						elseif ($arProperties["TYPE"] == "SELECT")
						{
							?>
							<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">
								<select name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
									<?
									foreach($arProperties["VARIANTS"] as $arVariants):
									?>
										<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
									<?
									endforeach;
									?>
								</select>

								<?
								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"] == "MULTISELECT")
						{
							?>
							<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">
								<select multiple name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
									<?
									foreach($arProperties["VARIANTS"] as $arVariants):
									?>
										<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
									<?
									endforeach;
									?>
								</select>

								<?
								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"] == "TEXTAREA")
						{
							$rows = ($arProperties["SIZE2"] > 10) ? 4 : $arProperties["SIZE2"];
							?>
							<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">
								<textarea rows="<?php 
echo $rows;
?>
" cols="<?php 
echo $arProperties["SIZE1"];
?>
" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
"><?php 
echo $arProperties["VALUE"];
?>
</textarea>

								<?
								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"] == "LOCATION")
						{
							?>
							<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">

								<?
								$value = 0;
								if (is_array($arProperties["VARIANTS"]) && count($arProperties["VARIANTS"]) > 0)
								{
									foreach ($arProperties["VARIANTS"] as $arVariant)
									{
										if ($arVariant["SELECTED"] == "Y")
										{
											$value = $arVariant["ID"];
											break;
										}
									}
								}

								// here we can get '' or 'popup'
								// map them, if needed
								if(CSaleLocation::isLocationProMigrated())
								{
									$locationTemplate = $locationTemplate == 'popup' ? 'search' : 'steps';
									$locationTemplate = $_REQUEST['PERMANENT_MODE_STEPS'] == 1 ? 'steps' : $locationTemplate; // force to "steps"
								}
								?>

								<?if($locationTemplate == 'steps'):?>
									<input type="hidden" id="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
echo intval($arProperties["ID"]);
?>
]" name="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
echo intval($arProperties["ID"]);
?>
]" value="<?php 
echo $_REQUEST['LOCATION_ALT_PROP_DISPLAY_MANUAL'][intval($arProperties["ID"])] ? '1' : '0';
?>
" />
								<?endif?>

								<?CSaleLocation::proxySaleAjaxLocationsComponent(array(
									"AJAX_CALL" => "N",
									"COUNTRY_INPUT_NAME" => "COUNTRY",
									"REGION_INPUT_NAME" => "REGION",
									"CITY_INPUT_NAME" => $arProperties["FIELD_NAME"],
									"CITY_OUT_LOCATION" => "Y",
									"LOCATION_VALUE" => $value,
									"ORDER_PROPS_ID" => $arProperties["ID"],
									"ONCITYCHANGE" => ($arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y") ? "submitForm()" : "",
									"SIZE1" => $arProperties["SIZE1"],
								),
								array(
									"ID" => $value,
									"CODE" => "",
									"SHOW_DEFAULT_LOCATIONS" => "Y",

									// function called on each location change caused by user or by program
									// it may be replaced with global component dispatch mechanism coming soon
									"JS_CALLBACK" => "submitFormProxy", //($arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y") ? "submitFormProxy" : "",

									// function window.BX.locationsDeferred['X'] will be created and lately called on each form re-draw.
									// it may be removed when sale.order.ajax will use real ajax form posting with BX.ProcessHTML() and other stuff instead of just simple iframe transfer
									"JS_CONTROL_DEFERRED_INIT" => intval($arProperties["ID"]),

									// an instance of this control will be placed to window.BX.locationSelectors['X'] and lately will be available from everywhere
									// it may be replaced with global component dispatch mechanism coming soon
									"JS_CONTROL_GLOBAL_ID" => intval($arProperties["ID"]),

									"DISABLE_KEYBOARD_INPUT" => 'Y',
									"PRECACHE_LAST_LEVEL" => "Y",
								),
								$locationTemplate,
								true,
								'location-block-wrapper'
								)?>

								<?
								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"] == "RADIO")
						{
							?>
							<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">
								<?
								if (is_array($arProperties["VARIANTS"]))
								{
									foreach($arProperties["VARIANTS"] as $arVariants):
									?>
										<input
											type="radio"
											name="<?php 
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>
			<?
		}
	}
Example #7
0
    function PrintPropsForm($arSource = array(), $locationTemplate = ".default")
    {
        if (!empty($arSource)) {
            foreach ($arSource as $arProperties) {
                if ($arProperties["SHOW_GROUP_NAME"] == "Y") {
                    ?>
				<tr>
					<td colspan="2">
						<b><?php 
                    echo $arProperties["GROUP_NAME"];
                    ?>
</b>
					</td>
				</tr>
				<?php 
                }
                ?>
			<tr>
				<td align="right" valign="top" width="25%">
					
					<?php 
                if ($arProperties["REQUIED_FORMATED"] == "Y") {
                    ?>
<span class="sof-req">*</span><?php 
                }
                ?>
					<?php 
                echo $arProperties["NAME"];
                ?>
:
				</td>
				<td class="props">
					<?php 
                if ($arProperties["TYPE"] == "CHECKBOX") {
                    ?>
						
						<input type="hidden" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" value="">
						<input type="checkbox" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" value="Y"<?php 
                    if ($arProperties["CHECKED"] == "Y") {
                        echo " checked";
                    }
                    ?>
>
						<?php 
                } elseif ($arProperties["TYPE"] == "TEXT") {
                    if ($arProperties["IS_ZIP"] == "Y") {
                        ?>
							<input type="hidden" name="CHANGE_ZIP" id="change_zip_val" value="" />
							<input onChange="fChangeZip();" type="text" maxlength="250" size="<?php 
                        echo $arProperties["SIZE1"];
                        ?>
" value="<?php 
                        echo $arProperties["VALUE"];
                        ?>
" name="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
" id="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
">
							<script>
								function fChangeZip () 
								{
									document.getElementById("change_zip_val").value = "Y";
									submitForm();
								}
							</script>
						<?php 
                    } else {
                        ?>
							<input type="text" maxlength="250" size="<?php 
                        echo $arProperties["SIZE1"];
                        ?>
" value="<?php 
                        echo $arProperties["VALUE"];
                        ?>
" name="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
" id="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
">
						<?php 
                    }
                } elseif ($arProperties["TYPE"] == "SELECT") {
                    ?>
						<select name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" size="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
">
						<?php 
                    foreach ($arProperties["VARIANTS"] as $arVariants) {
                        ?>
							<option value="<?php 
                        echo $arVariants["VALUE"];
                        ?>
"<?php 
                        if ($arVariants["SELECTED"] == "Y") {
                            echo " selected";
                        }
                        ?>
><?php 
                        echo $arVariants["NAME"];
                        ?>
</option>
							<?php 
                    }
                    ?>
						</select>
						<?php 
                } elseif ($arProperties["TYPE"] == "MULTISELECT") {
                    ?>
						<select multiple name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" size="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
">
						<?php 
                    foreach ($arProperties["VARIANTS"] as $arVariants) {
                        ?>
							<option value="<?php 
                        echo $arVariants["VALUE"];
                        ?>
"<?php 
                        if ($arVariants["SELECTED"] == "Y") {
                            echo " selected";
                        }
                        ?>
><?php 
                        echo $arVariants["NAME"];
                        ?>
</option>
							<?php 
                    }
                    ?>
						</select>
						<?php 
                } elseif ($arProperties["TYPE"] == "TEXTAREA") {
                    ?>
						<textarea rows="<?php 
                    echo $arProperties["SIZE2"];
                    ?>
" cols="<?php 
                    echo $arProperties["SIZE1"];
                    ?>
" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
"><?php 
                    echo $arProperties["VALUE"];
                    ?>
</textarea>
						<?php 
                } elseif ($arProperties["TYPE"] == "LOCATION") {
                    $value = 0;
                    foreach ($arProperties["VARIANTS"] as $arVariant) {
                        if ($arVariant["SELECTED"] == "Y") {
                            $value = $arVariant["ID"];
                            break;
                        }
                    }
                    CSaleLocation::proxySaleAjaxLocationsComponent(array("AJAX_CALL" => "N", "COUNTRY_INPUT_NAME" => "COUNTRY_" . $arProperties["FIELD_NAME"], "REGION_INPUT_NAME" => "REGION_" . $arProperties["FIELD_NAME"], "CITY_INPUT_NAME" => $arProperties["FIELD_NAME"], "CITY_OUT_LOCATION" => "Y", "LOCATION_VALUE" => $value, "ORDER_PROPS_ID" => $arProperties["ID"], "ONCITYCHANGE" => $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" ? "submitForm()" : "", "SIZE1" => $arProperties["SIZE1"]), array("ID" => $value, "CODE" => "", "SHOW_DEFAULT_LOCATIONS" => "Y", "INITIALIZE_BY_GLOBAL_EVENT" => 'sboa-init-loc-selector', "GLOBAL_EVENT_SCOPE" => 'window', "JS_CALLBACK" => $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" ? "submitFormProxy()" : "", "DISABLE_KEYBOARD_INPUT" => "Y", "PRECACHE_LAST_LEVEL" => "Y", "PRESELECT_TREE_TRUNK" => "Y", "SUPPRESS_ERRORS" => "Y"), $locationTemplate, true, 'location-block-wrapper');
                } elseif ($arProperties["TYPE"] == "RADIO") {
                    foreach ($arProperties["VARIANTS"] as $arVariants) {
                        ?>
							<input type="radio" name="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
" id="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
_<?php 
                        echo $arVariants["VALUE"];
                        ?>
" value="<?php 
                        echo $arVariants["VALUE"];
                        ?>
"<?php 
                        if ($arVariants["CHECKED"] == "Y") {
                            echo " checked";
                        }
                        ?>
> <label for="<?php 
                        echo $arProperties["FIELD_NAME"];
                        ?>
_<?php 
                        echo $arVariants["VALUE"];
                        ?>
"><?php 
                        echo $arVariants["NAME"];
                        ?>
</label><br />
							<?php 
                    }
                }
                if (strlen($arProperties["DESCRIPTION"]) > 0) {
                    ?>
<br /><small><?php 
                    echo $arProperties["DESCRIPTION"];
                    ?>
</small><?php 
                }
                ?>
					
				</td>
			</tr>
			<?php 
            }
            ?>
		<?php 
            return true;
        }
        return false;
    }
Example #8
0
								<textarea rows="<?echo (IntVal($vval["SIZE2"])>0)?$vval["SIZE2"]:4; ?>" cols="<?echo (IntVal($vval["SIZE1"])>0)?$vval["SIZE1"]:40; ?>" name="<?php 
echo $name;
?>
"><?echo (isset($currentValue)) ? $currentValue : $vval["DEFAULT_VALUE"];?></textarea>
							<?elseif ($vval["TYPE"]=="LOCATION"):?>
								<?if ($arParams['USE_AJAX_LOCATIONS'] == 'Y'):?>

								<?$locationValue = isset($currentValue) ? $currentValue : $vval["DEFAULT_VALUE"];?>

								<?CSaleLocation::proxySaleAjaxLocationsComponent(
									array(
										"AJAX_CALL" => "N",
										'CITY_OUT_LOCATION' => 'Y',
										'COUNTRY_INPUT_NAME' => $name.'_COUNTRY',
										'CITY_INPUT_NAME' => $name,
										'LOCATION_VALUE' => $locationValue,
									),
									array(
									),
									$locationTemplate,
									true,
									'location-block-wrapper'
								)?>

								<?
								else:
								?>
								<select name="<?php 
echo $name;
?>
" size="<?echo (IntVal($vval["SIZE1"])>0)?$vval["SIZE1"]:1; ?>">
									<?foreach($vval["VALUES"] as $vvval):?>
				</td>
			</tr>
			<?php 
            $tabControl->EndCustomField("CODE_" . $arProperties["ID"]);
        } elseif ($arProperties["TYPE"] == "LOCATION") {
            $tabControl->BeginCustomField("CODE_" . $arProperties["ID"], $arProperties["NAME"], $shure);
            ?>
			<tr<?php 
            $shure ? " class=\"adm-detail-required-field\"" : "";
            ?>
>
				<td width="40%">
					<?php 
            echo htmlspecialcharsEx($arProperties["NAME"]);
            ?>
:
				</td>
				<td width="60%">
					<?php 
            CSaleLocation::proxySaleAjaxLocationsComponent(array("SITE_ID" => $LID, "AJAX_CALL" => "N", "COUNTRY_INPUT_NAME" => "COUNTRY_" . $arProperties["ID"], "REGION_INPUT_NAME" => "REGION_" . $arProperties["ID"], "CITY_INPUT_NAME" => "LOCATION_" . $arProperties["ID"], "CITY_OUT_LOCATION" => "Y", "ALLOW_EMPTY_CITY" => "Y", "LOCATION_VALUE" => $fieldValue, "COUNTRY" => "", "ONCITYCHANGE" => "", "PUBLIC" => "N"), array("ID" => $fieldValue, "CODE" => "", "PROVIDE_LINK_BY" => "id"));
            ?>
				</td>
			</tr>
		<?php 
            $tabControl->EndCustomField("CODE_" . $arProperties["ID"]);
        }
    }
    $tabControl->Buttons(array("back_url" => "/bitrix/admin/sale_buyers_profile.php?lang=" . LANGUAGE_ID . "&USER_ID=" . $USER_ID));
    $tabControl->Show();
}
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/epilog_admin.php';
Example #10
0
function PrintPropsForm($arSource = array(), $locationTemplate = ".default")
{
    if (!empty($arSource)) {
        ?>

		<?php 
        foreach ($arSource as $arProperties) {
            /*if($arProperties["SHOW_GROUP_NAME"] == "Y")
            		{
            			?>
            			<tr>
            				<td colspan="2">
            					<b><?= $arProperties["GROUP_NAME"] ?></b>
            				</td>
            			</tr>
            			<?
            		}    */
            ?>

					<span class="inputtext">
					<?php 
            echo $arProperties["NAME"];
            ?>
:<?php 
            if ($arProperties["REQUIED_FORMATED"] == "Y") {
                ?>
<span class="sof-req">*</span><?php 
            }
            ?>
					</span>

					<?php 
            if ($arProperties["TYPE"] == "CHECKBOX") {
                ?>

						<input type="hidden" name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" value="">
						<input type="checkbox" name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" id="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" value="Y"<?php 
                if ($arProperties["CHECKED"] == "Y") {
                    echo " checked";
                }
                ?>
>
						<?php 
            } elseif ($arProperties["TYPE"] == "TEXT") {
                ?>
						<input type="text" maxlength="250" size="<?php 
                echo $arProperties["SIZE1"];
                ?>
" value="<?php 
                echo $arProperties["VALUE"];
                ?>
" name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" id="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
">
						<?php 
            } elseif ($arProperties["TYPE"] == "SELECT") {
                ?>
						<select name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" id="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" size="<?php 
                echo $arProperties["SIZE1"];
                ?>
">
						<?php 
                foreach ($arProperties["VARIANTS"] as $arVariants) {
                    ?>
							<option value="<?php 
                    echo $arVariants["VALUE"];
                    ?>
"<?php 
                    if ($arVariants["SELECTED"] == "Y") {
                        echo " selected";
                    }
                    ?>
><?php 
                    echo $arVariants["NAME"];
                    ?>
</option>
							<?php 
                }
                ?>
						</select>
						<?php 
            } elseif ($arProperties["TYPE"] == "MULTISELECT") {
                ?>
						<select multiple name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" id="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" size="<?php 
                echo $arProperties["SIZE1"];
                ?>
">
						<?php 
                foreach ($arProperties["VARIANTS"] as $arVariants) {
                    ?>
							<option value="<?php 
                    echo $arVariants["VALUE"];
                    ?>
"<?php 
                    if ($arVariants["SELECTED"] == "Y") {
                        echo " selected";
                    }
                    ?>
><?php 
                    echo $arVariants["NAME"];
                    ?>
</option>
							<?php 
                }
                ?>
						</select>
						<?php 
            } elseif ($arProperties["TYPE"] == "TEXTAREA") {
                ?>
						<textarea style="max-height:100px" rows="<?php 
                echo $arProperties["SIZE2"];
                ?>
" cols="<?php 
                echo $arProperties["SIZE1"];
                ?>
" name="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
" id="<?php 
                echo $arProperties["FIELD_NAME"];
                ?>
"><?php 
                echo $arProperties["VALUE"];
                ?>
</textarea>
						<?php 
            } elseif ($arProperties["TYPE"] == "LOCATION") {
                //_print_r('L: '.$arProperties["VALUE"].' ------------ '.rand(99, 9999));
                $value = 0;
                if (is_array($arProperties["VARIANTS"]) && count($arProperties["VARIANTS"]) > 0) {
                    foreach ($arProperties["VARIANTS"] as $arVariant) {
                        if ($arVariant["SELECTED"] == "Y") {
                            $value = $arVariant["ID"];
                            break;
                        }
                    }
                }
                CSaleLocation::proxySaleAjaxLocationsComponent(array("AJAX_CALL" => "N", "COUNTRY_INPUT_NAME" => "COUNTRY", "REGION_INPUT_NAME" => "REGION", "CITY_INPUT_NAME" => $arProperties["FIELD_NAME"], "CITY_OUT_LOCATION" => "Y", "SHOW_QUICK_CHOOSE" => "N", "LOCATION_VALUE" => $value, "ORDER_PROPS_ID" => $arProperties["ID"], "ONCITYCHANGE" => $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" ? "submitForm()" : "", "SIZE1" => $arProperties["SIZE1"]), array("CODE" => "", "ID" => $arProperties["VALUE"], "JS_CALLBACK" => $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" ? "submitFormProxy" : ""), $locationTemplate, true, 'locationpro-selector-wrapper');
            } elseif ($arProperties["TYPE"] == "RADIO") {
                foreach ($arProperties["VARIANTS"] as $arVariants) {
                    ?>
							<input type="radio" name="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
" id="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
_<?php 
                    echo $arVariants["VALUE"];
                    ?>
" value="<?php 
                    echo $arVariants["VALUE"];
                    ?>
"<?php 
                    if ($arVariants["CHECKED"] == "Y") {
                        echo " checked";
                    }
                    ?>
> <label for="<?php 
                    echo $arProperties["FIELD_NAME"];
                    ?>
_<?php 
                    echo $arVariants["VALUE"];
                    ?>
"><?php 
                    echo $arVariants["NAME"];
                    ?>
</label><br />
							<?php 
                }
            }
            if (strlen($arProperties["DESCRIPTION"]) > 0) {
                ?>
<br /><small><?php 
                echo $arProperties["DESCRIPTION"];
                ?>
</small><?php 
            }
            ?>
			<?php 
        }
        ?>

		<?php 
        return true;
    }
    return false;
}
Example #11
0
	function PrintPropsForm($arSource = array(), $locationTemplate = ".default", $arContactGroup)
	{
		if (!empty($arSource))
		{
			foreach ($arSource as $arProperties)
			{
				/*echo '<pre>';
				print_r($arContactGroup);
				echo '</pre>';
				echo $arProperties["PROPS_GROUP_ID"];
				if (count($arContactGroup) > 0 && !in_array($arProperties["PROPS_GROUP_ID"], $arContactGroup))
					continue;*/
				?>
				<div class="table-field" data-property-id-row="<?php 
echo intval(intval($arProperties["ID"]));
?>
">

				<?
				if ($arProperties["TYPE"] == "CHECKBOX")
				{
					?>
					<input type="hidden" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" value="">

					<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 r1x3 pt8">
						<input type="checkbox" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" value="Y"<?if ($arProperties["CHECKED"]=="Y") echo " checked";?>>

						<?
						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"] == "TEXT")
				{
					$type = 'text';
					$checkEmail = false;
					if ($arProperties["CODE"] == "PHONE")
						$type = 'tel';
					elseif ($arProperties["CODE"] == "EMAIL"){
						$type = 'email';
						global $USER;
						if(!$USER->IsAuthorized())
							$checkEmail = true;
					}

					?>
					<?/*<pre><?print_r($arProperties)?></pre>*/?>
					<label class="label"><?php 
echo $arProperties["NAME"];
?>
</label>
					<div class="field">
						<input type="<?php 
echo $type;
?>
" 
							maxlength="250" 
							size="<?php 
echo $arProperties["SIZE1"];
?>
" 
							<?if ($checkEmail):?>onchange="checkUserEmail(this);"<?endif;?> 
							value="<?php 
echo $arProperties["VALUE"];
?>
" 
							name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" 
							class="PROP_INPUT_<?php 
echo $arProperties["CODE"];
?>
 <?if($type == 'tel'):?>numbers<?endif;?> <?if ($arProperties["REQUIED"] == "Y"):?>required<?endif;?>" 
							id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" <?/*if ($arProperties["REQUIED"] == "Y"):?>required<?endif;*/?> 
						/>
                    <?if ($checkEmail):?>
                        <span class="input-loader" style="display:none;">
                            <div>
                                <img src="/local/templates/zakrepi/images/svg/loader.svg" width="25"/>
                            </div>
                        </span>
                    <?endif;?>
                        <span class="error-text error-required error-pattern"><?php 
echo $arProperties['DESCRIPTION'];
?>
</span>
                    </div>
					<?
				}
				elseif ($arProperties["TYPE"] == "SELECT")
				{
					?>
					<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">
						<select name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
							<?
							foreach($arProperties["VARIANTS"] as $arVariants):
							?>
								<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
							<?
							endforeach;
							?>
						</select>

						<?
						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"] == "MULTISELECT")
				{
					?>
					<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">
						<select multiple name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
" size="<?php 
echo $arProperties["SIZE1"];
?>
">
							<?
							foreach($arProperties["VARIANTS"] as $arVariants):
							?>
								<option value="<?php 
echo $arVariants["VALUE"];
?>
"<?if ($arVariants["SELECTED"] == "Y") echo " selected";?>><?php 
echo $arVariants["NAME"];
?>
</option>
							<?
							endforeach;
							?>
						</select>

						<?
						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"] == "TEXTAREA")
				{
					$rows = ($arProperties["SIZE2"] > 10) ? 4 : $arProperties["SIZE2"];
					?>
					<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">
						<textarea rows="<?php 
echo $rows;
?>
" cols="<?php 
echo $arProperties["SIZE1"];
?>
" name="<?php 
echo $arProperties["FIELD_NAME"];
?>
" id="<?php 
echo $arProperties["FIELD_NAME"];
?>
"><?php 
echo $arProperties["VALUE"];
?>
</textarea>

						<?
						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"] == "LOCATION")
				{
					?>
					<div style="display:none">
					<input type="hidden" name="location_prop_id" value="<?php 
echo $arProperties["ID"];
?>
" />

					<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">

						<?
						$value = 0;
						if (is_array($arProperties["VARIANTS"]) && count($arProperties["VARIANTS"]) > 0)
						{
							foreach ($arProperties["VARIANTS"] as $arVariant)
							{
								if ($arVariant["SELECTED"] == "Y")
								{
									$value = $arVariant["ID"];
									break;
								}
							}
						}

						// here we can get '' or 'popup'
						// map them, if needed
						if(CSaleLocation::isLocationProMigrated())
						{
							$locationTemplateP = $locationTemplate == 'popup' ? 'search' : 'steps';
							$locationTemplateP = $_REQUEST['PERMANENT_MODE_STEPS'] == 1 ? 'steps' : $locationTemplateP; // force to "steps"
						}
						?>

						<?if($locationTemplateP == 'steps'):?>
							<input type="hidden" id="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
echo intval($arProperties["ID"]);
?>
]" name="LOCATION_ALT_PROP_DISPLAY_MANUAL[<?php 
echo intval($arProperties["ID"]);
?>
]" value="<?php 
echo $_REQUEST['LOCATION_ALT_PROP_DISPLAY_MANUAL'][intval($arProperties["ID"])] ? '1' : '0';
?>
" />
						<?endif?>

						<?CSaleLocation::proxySaleAjaxLocationsComponent(array(
							"AJAX_CALL" => "N",
							"COUNTRY_INPUT_NAME" => "COUNTRY",
							"REGION_INPUT_NAME" => "REGION",
							"CITY_INPUT_NAME" => $arProperties["FIELD_NAME"],
							"CITY_OUT_LOCATION" => "Y",
							"LOCATION_VALUE" => $value,
							"ORDER_PROPS_ID" => $arProperties["ID"],
							"ONCITYCHANGE" => ($arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y") ? "submitForm()" : "",
							"SIZE1" => $arProperties["SIZE1"],
						),
						array(
							"ID" => $value,
							"CODE" => "",
							"SHOW_DEFAULT_LOCATIONS" => "Y",

							// function called on each location change caused by user or by program
							// it may be replaced with global component dispatch mechanism coming soon
							"JS_CALLBACK" => "submitFormProxy",

							// function window.BX.locationsDeferred['X'] will be created and lately called on each form re-draw.
							// it may be removed when sale.order.ajax will use real ajax form posting with BX.ProcessHTML() and other stuff instead of just simple iframe transfer
							"JS_CONTROL_DEFERRED_INIT" => intval($arProperties["ID"]),

							// an instance of this control will be placed to window.BX.locationSelectors['X'] and lately will be available from everywhere
							// it may be replaced with global component dispatch mechanism coming soon
							"JS_CONTROL_GLOBAL_ID" => intval($arProperties["ID"]),

							"DISABLE_KEYBOARD_INPUT" => "Y",
							"PRECACHE_LAST_LEVEL" => "Y",
							"PRESELECT_TREE_TRUNK" => "Y",
							"SUPPRESS_ERRORS" => "Y"
						),
						$locationTemplateP,
						true,
						'location-block-wrapper'
						)?>

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

					</div>
					<div style="clear: both;"></div>
					</div>
					<?
				}
				elseif ($arProperties["TYPE"] == "RADIO")
				{
					?>
					<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">
						<?
						if (is_array($arProperties["VARIANTS"]))
						{
							foreach($arProperties["VARIANTS"] as $arVariants):
							?>
								<input
									type="radio"
									name="<?php 
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()):?>

					<?
					$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?>

				<?
			}
		}
	}
Example #12
0
    $contactPersonValue = '';
    if (intval($arResult['ELEMENT']['UF_COMPANY_ID']) > 0) {
        $contactPersonValue = intval($arResult['ELEMENT']['UF_CONTACT_ID']);
    }
    $arResult['FIELDS']['tab_1'][] = array('id' => 'UF_CONTACT_ID', 'name' => GetMessage('CRM_FIELD_CONTACT_PERSON_ID'), 'type' => 'crm_entity_selector', 'componentParams' => array('ENTITY_TYPE' => 'CONTACT', 'INPUT_NAME' => 'UF_CONTACT_ID', 'NEW_INPUT_NAME' => 'UF_CONTACT_ID_NEW', 'INPUT_VALUE' => $contactPersonValue, 'FORM_ID' => $arResult['FORM_ID'], 'MULTIPLE' => 'N', 'NAME_TEMPLATE' => \Bitrix\Crm\Format\PersonNameFormatter::getFormat()), 'persistent' => true);
    $arResult['CONTACT_PERSON_CONTAINER_ID'] = "{$arResult['FORM_ID']}_FIELD_CONTAINER_UF_CONTACT_ID";
    $arResult['CONTACT_PERSON_ENTITY_EDITOR_ID'] = "{$arResult['FORM_ID']}_UF_CONTACT_ID";
    unset($contactPersonValue);
}
if ($bTaxMode) {
    // PAYER LOCATION
    $sLocationHtml = '';
    CModule::IncludeModule('sale');
    $locValue = isset($arResult['ELEMENT']['PR_LOCATION']) ? $arResult['ELEMENT']['PR_LOCATION'] : '';
    ob_start();
    CSaleLocation::proxySaleAjaxLocationsComponent(array('AJAX_CALL' => 'N', 'COUNTRY_INPUT_NAME' => 'LOC_COUNTRY', 'REGION_INPUT_NAME' => 'LOC_REGION', 'CITY_INPUT_NAME' => 'LOC_CITY', 'CITY_OUT_LOCATION' => 'Y', 'LOCATION_VALUE' => $locValue, 'ORDER_PROPS_ID' => $arInvoiceProperties['FIELDS']['ID'], 'ONCITYCHANGE' => 'BX.onCustomEvent(\'CrmProductRowSetLocation\', [\'LOC_CITY\']);', 'SHOW_QUICK_CHOOSE' => 'N'), array("CODE" => "", "ID" => $locValue, "PROVIDE_LINK_BY" => "id", "JS_CALLBACK" => 'CrmProductRowSetLocation'), 'popup', true, 'locationpro-selector-wrapper');
    $sLocationHtml = ob_get_contents();
    ob_end_clean();
    $arResult['FIELDS']['tab_1'][] = array('id' => 'LOCATION_ID', 'name' => GetMessage('CRM_FIELD_LOCATION'), 'type' => 'custom', 'value' => $sLocationHtml . '<div>' . '<span class="bx-crm-edit-content-location-description">' . GetMessage('CRM_FIELD_LOCATION_DESCRIPTION') . '</span>' . '</div>', 'required' => true);
}
// Rewrite payer information (invoice properties) from contact or company
$companyId = intval($arResult['ELEMENT']['UF_COMPANY_ID']);
$contactId = intval($arResult['ELEMENT']['UF_CONTACT_ID']);
if (!$bEdit && !$bCopy && !$bCreateFromQuote && empty($arResult['ERROR_MESSAGE'])) {
    CCrmInvoice::__RewritePayerInfo($companyId, $contactId, $arInvoiceProperties);
}
if ($bCreateFromQuote && empty($arResult['ERROR_MESSAGE'])) {
    // Rewrite payer information from quote fields
    if ($companyId > 0) {
        foreach ($arInvoiceProperties as $propertyKey => $property) {
            if ($property['FIELDS']['PERSON_TYPE_ID'] == $personTypeId) {