本文整理汇总了PHP中CSaleOrderProps::GetList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderProps::GetList方法的具体用法?PHP CSaleOrderProps::GetList怎么用?PHP CSaleOrderProps::GetList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleOrderProps
的用法示例。
在下文中一共展示了CSaleOrderProps::GetList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DoSaveUserProfile
static function DoSaveUserProfile($userId, $profileId, $profileName, $personTypeId, $orderProps, &$arErrors)
{
$profileId = intval($profileId);
$arIDs = array();
if ($profileId > 0) {
$dbProfile = CSaleOrderUserProps::GetList(array(), array("ID" => $profileId), false, false, array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID"));
$arProfile = $dbProfile->Fetch();
if (!$arProfile) {
$arErrors[] = array("CODE" => "PROFILE_NOT_FOUND", "TEXT" => GetMessage('SKGOUP_PROFILE_NOT_FOUND'));
return false;
}
if ($arProfile["USER_ID"] != $userId || $arProfile["PERSON_TYPE_ID"] != $personTypeId) {
$arErrors[] = array("CODE" => "PARAM", "TEXT" => GetMessage('SKGOUP_PARRAMS_ERROR'));
return false;
}
//if (strlen($profileName) > 0 && $profileName != $arProfile["NAME"])
if (strlen($profileName) > 0) {
$arFields = array("NAME" => $profileName, "USER_ID" => $userId);
CSaleOrderUserProps::Update($profileId, $arFields);
}
$dbUserPropsValues = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" => $profileId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arUserPropsValue = $dbUserPropsValues->Fetch()) {
$arIDs[$arUserPropsValue["ORDER_PROPS_ID"]] = $arUserPropsValue["ID"];
}
}
if (!is_array($orderProps)) {
$dbOrderPropsValues = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => intval($orderProps)), false, false, array("ORDER_PROPS_ID", "VALUE"));
$orderProps = array();
while ($arOrderPropsValue = $dbOrderPropsValues->Fetch()) {
$orderProps[$arOrderPropsValue["ORDER_PROPS_ID"]] = $arOrderPropsValue["VALUE"];
}
}
$dbOrderProperties = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y", "UTIL" => "N", "USER_PROPS" => "Y"), false, false, array("ID", "TYPE", "NAME", "CODE"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $orderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if (strlen($curVal) > 0) {
if ($profileId <= 0) {
if (strlen($profileName) <= 0) {
$profileName = GetMessage("SOA_PROFILE") . " " . Date("Y-m-d");
}
$arFields = array("NAME" => $profileName, "USER_ID" => $userId, "PERSON_TYPE_ID" => $personTypeId);
$profileId = CSaleOrderUserProps::Add($arFields);
}
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
$arFields = array("NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
$arFields = array("USER_PROPS_ID" => $profileId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderUserPropsValue::Delete($id);
}
}
示例2: GetOrderPropId
public static function GetOrderPropId($code)
{
$id = 0;
if (CModule::IncludeModule('sale')) {
$db_props = CSaleOrderProps::GetList(array("SORT" => "ASC"), array("CODE" => $code), false, false, array("ID"));
if ($props = $db_props->Fetch()) {
$id = $props["ID"];
}
} else {
Trace("Error: can't include module sale");
}
return $id;
}
示例3: getOrderProps
protected function getOrderProps()
{
if ($this->orderProps === null) {
$this->orderProps = array();
if (isset($this->formData["PERSON_TYPE"])) {
$db_props = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $this->formData["PERSON_TYPE"]));
while ($prop = $db_props->Fetch()) {
$this->orderProps[] = $prop;
}
}
}
return $this->orderProps;
}
示例4: Delete
function Delete($ID)
{
global $DB;
$ID = IntVal($ID);
$db_orderProps = CSaleOrderProps::GetList($by = "PROPS_GROUP_ID", $order = "ASC", array("PROPS_GROUP_ID" => $ID));
while ($arOrderProps = $db_orderProps->Fetch()) {
$DB->Query("DELETE FROM b_sale_order_props_variant WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
$DB->Query("UPDATE b_sale_order_props_value SET ORDER_PROPS_ID = NULL WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
$DB->Query("DELETE FROM b_sale_user_props_value WHERE ORDER_PROPS_ID = " . $arOrderProps["ID"] . "", true);
}
$DB->Query("DELETE FROM b_sale_order_props WHERE PROPS_GROUP_ID = " . $ID . "", true);
CSaleOrderUserProps::ClearEmpty();
return $DB->Query("DELETE FROM b_sale_order_props_group WHERE ID = " . $ID . "", true);
}
示例5: getOrderProps
public static function getOrderProps($id = false)
{
static $result = null;
static $resultById = null;
static $resultByCode = null;
if($result === null)
{
$rs = \CSaleOrderProps::GetList(array(), array(), false, false, array('ID', 'NAME', 'CODE'));
while($ar = $rs->GetNext(true, false))
{
$obj = new OrderProp($ar);
$resultById[ $ar['ID'] ] = &$obj;
$resultByCode[ $ar['CODE'] ] = &$obj;
$result[] = &$obj;
unset($obj);
}
}
return $id ? (isset($resultById[$id]) ? $resultById[$id] : (isset($resultByCode[$id]) ? $resultByCode[$id] : false)) : $result;
}
示例6: Update
static function Update($profileID, $arFields) {
global $DB;
$result = new WS_SaleUserProfilesErrorsContainer();
if (empty($profileID)) {
return $result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_required_id"));
}
$DB->StartTransaction();
if (!empty($arFields["PROPS"])) {
$props = $arFields["PROPS"];
unset($arFields["PROPS"]);
}
// сохраняем поля
if (!empty($arFields)) {
if(!$profileID = CSaleOrderUserProps::Update($profileID, $arFields)){
$result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_save_fields"));
} else {
$arFields = CSaleOrderUserProps::GetByID($profileID);
}
}
// сохраняем свойства
if (!empty($props) && !$result->getErrorsAsString()) {
// удаляем все свойства
CSaleOrderUserPropsValue::DeleteAll($profileID);
$res = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $arFields["PERSON_TYPE_ID"], "USER_PROPS" => "Y"), false, false, array());
while ($arRes = $res->Fetch()) {
if ($arRes['REQUIED'] === 'Y' && empty($props[$arRes['ID']])) {
$result->addErrorString(GetMessage("ws.saleuserprofiles_save_error_required_field") . "\"" . $arRes["NAME"] . "\"");
continue;
}
$arValueTemp = $props[$arRes['ID']];
if (is_array($arValueTemp)) {
$arValueTemp = "";
for ($i = 0; $i < count($props[$arRes['ID']]); $i++) {
if ($i > 0) {
$arValueTemp .= ",";
}
$arValueTemp .= $props[$arRes['ID']][$i];
}
}
$arProp = array(
"VALUE" => $arValueTemp,
"NAME" => $arRes["NAME"],
"ORDER_PROPS_ID" => $arRes['ID'],
"USER_PROPS_ID" => $profileID
);
CSaleOrderUserPropsValue::Add($arProp);
}
}
if ($result->getErrorsAsString()) {
$DB->Rollback();
} else {
$DB->Commit();
}
return $result;
}
示例7: getLocationPropertyInfo
public static function getLocationPropertyInfo()
{
static $info;
if ($info === null) {
$info = array();
if (CSaleLocation::isLocationProMigrated()) {
$res = CSaleOrderProps::GetList(array(), array('TYPE' => 'LOCATION'), false, false, array('ID', 'CODE'));
while ($item = $res->fetch()) {
$info['ID'][$item['ID']] = $item['CODE'];
$info['CODE'][$item['CODE']] = $item['ID'];
}
}
}
return $info;
}
示例8: array
<?php
$arPropValues = array();
if (!$bVarsFromForm || $PARTIAL_SUBMIT == "Y") {
$dbPropValuesList = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ID), false, false, array("ID", "ORDER_PROPS_ID", "NAME", "VALUE", "CODE"));
while ($arPropValuesList = $dbPropValuesList->Fetch()) {
$arPropValues[IntVal($arPropValuesList["ORDER_PROPS_ID"])] = $arPropValuesList["VALUE"];
}
} else {
foreach ($_REQUEST as $key => $value) {
if (substr($key, 0, strlen("ORDER_PROP_")) == "ORDER_PROP_") {
$arPropValues[IntVal(substr($key, strlen("ORDER_PROP_")))] = htmlspecialcharsEx($value);
}
}
}
$propertyGroupID = -1;
$dbProperties = CSaleOrderProps::GetList(array("GROUP_SORT" => "ASC", "PROPS_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), array("PERSON_TYPE_ID" => $str_PERSON_TYPE_ID), false, false, array("*"));
while ($arProperties = $dbProperties->Fetch()) {
if (IntVal($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID) {
?>
<tr class="heading">
<td colspan="2">
<?php
echo htmlspecialcharsEx($arProperties["GROUP_NAME"]);
?>
</td>
</tr>
<?php
$propertyGroupID = IntVal($arProperties["PROPS_GROUP_ID"]);
}
?>
<tr>
示例9: ShowStep
function ShowStep()
{
$wizard =& $this->GetWizard();
$paySystem = $wizard->GetVar("paySystem");
$siteID = $wizard->GetVar("siteID");
$personType = $wizard->GetVar("personType");
CModule::IncludeModule("sale");
function LocalGetPSActionParams($fileName)
{
$arPSCorrespondence = array();
if (file_exists($fileName) && is_file($fileName)) {
include $fileName;
}
return $arPSCorrespondence;
}
$dbPaySystem = CSalePaySystem::GetList(array("SORT" => "ASC"), array("ACTIVE" => "Y", "LID" => $siteID));
while ($arPaySystem = $dbPaySystem->GetNext()) {
$arPaySystems[$arPaySystem["ID"]] = $arPaySystem["NAME"];
}
$dbPersonType = CSalePersonType::GetList(array("SORT" => "ASC"), array("ACTIVE" => "Y", "LID" => $siteID));
while ($arPersonType = $dbPersonType->GetNext()) {
$arPersons[$arPersonType["ID"]] = $arPersonType["NAME"];
}
$arFieldsList["USER"] = array("ID" => GetMessage("SPS_USER_ID"), "LOGIN" => GetMessage("SPS_USER_LOGIN"), "NAME" => GetMessage("SPS_USER_NAME"), "LAST_NAME" => GetMessage("SPS_USER_LAST_NAME"), "EMAIL" => "EMail", "LID" => GetMessage("SPS_USER_SITE"), "PERSONAL_PROFESSION" => GetMessage("SPS_USER_PROF"), "PERSONAL_WWW" => GetMessage("SPS_USER_WEB"), "PERSONAL_ICQ" => GetMessage("SPS_USER_ICQ"), "PERSONAL_GENDER" => GetMessage("SPS_USER_SEX"), "PERSONAL_FAX" => GetMessage("SPS_USER_FAX"), "PERSONAL_MOBILE" => GetMessage("SPS_USER_PHONE"), "PERSONAL_STREET" => GetMessage("SPS_USER_ADDRESS"), "PERSONAL_MAILBOX" => GetMessage("SPS_USER_POST"), "PERSONAL_CITY" => GetMessage("SPS_USER_CITY"), "PERSONAL_STATE" => GetMessage("SPS_USER_STATE"), "PERSONAL_ZIP" => GetMessage("SPS_USER_ZIP"), "PERSONAL_COUNTRY" => GetMessage("SPS_USER_COUNTRY"), "WORK_COMPANY" => GetMessage("SPS_USER_COMPANY"), "WORK_DEPARTMENT" => GetMessage("SPS_USER_DEPT"), "WORK_POSITION" => GetMessage("SPS_USER_DOL"), "WORK_WWW" => GetMessage("SPS_USER_COM_WEB"), "WORK_PHONE" => GetMessage("SPS_USER_COM_PHONE"), "WORK_FAX" => GetMessage("SPS_USER_COM_FAX"), "WORK_STREET" => GetMessage("SPS_USER_COM_ADDRESS"), "WORK_MAILBOX" => GetMessage("SPS_USER_COM_POST"), "WORK_CITY" => GetMessage("SPS_USER_COM_CITY"), "WORK_STATE" => GetMessage("SPS_USER_COM_STATE"), "WORK_ZIP" => GetMessage("SPS_USER_COM_ZIP"), "WORK_COUNTRY" => GetMessage("SPS_USER_COM_COUNTRY"));
$arFieldsList["ORDER"] = array("ID" => GetMessage("SPS_ORDER_ID"), "DATE_INSERT" => GetMessage("SPS_ORDER_DATETIME"), "DATE_INSERT_DATE" => GetMessage("SPS_ORDER_DATE"), "SHOULD_PAY" => GetMessage("SPS_ORDER_PRICE"), "CURRENCY" => GetMessage("SPS_ORDER_CURRENCY"), "PRICE" => GetMessage("SPS_ORDER_SUM"), "LID" => GetMessage("SPS_ORDER_SITE"), "PRICE_DELIVERY" => GetMessage("SPS_ORDER_PRICE_DELIV"), "DISCOUNT_VALUE" => GetMessage("SPS_ORDER_DESCOUNT"), "USER_ID" => GetMessage("SPS_ORDER_USER_ID"), "PAY_SYSTEM_ID" => GetMessage("SPS_ORDER_PS"), "DELIVERY_ID" => GetMessage("SPS_ORDER_DELIV"), "TAX_VALUE" => GetMessage("SPS_ORDER_TAX"));
foreach ($personType as $personID) {
$dbOrderProps = CSaleOrderProps::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("PERSON_TYPE_ID" => $personID), false, false, array("ID", "CODE", "NAME", "TYPE", "SORT", "PERSON_TYPE_ID"));
while ($arOrderProps = $dbOrderProps->GetNext()) {
$arFieldsList["PROPERTY"][$arOrderProps["PERSON_TYPE_ID"]][strlen($arOrderProps["CODE"]) > 0 ? $arOrderProps["CODE"] : $arOrderProps["ID"]] = $arOrderProps["NAME"];
if ($arOrderProps["TYPE"] == "LOCATION") {
$arFieldsList["PROPERTY"][$arOrderProps["PERSON_TYPE_ID"]][(strlen($arOrderProps["CODE"]) > 0 ? $arOrderProps["CODE"] : $arOrderProps["ID"]) . "_COUNTRY"] = $arOrderProps["NAME"] . " (" . GetMessage("SPS_JCOUNTRY") . ")";
$arFieldsList["PROPERTY"][$arOrderProps["PERSON_TYPE_ID"]][(strlen($arOrderProps["CODE"]) > 0 ? $arOrderProps["CODE"] : $arOrderProps["ID"]) . "_CITY"] = $arOrderProps["NAME"] . " (" . GetMessage("SPS_JCITY") . ")";
}
}
}
?>
<script type="text/javascript">
var arUserFieldsList = new Array();
var arUserFieldsNameList = new Array();
var arOrderFieldsList = new Array();
var arOrderFieldsNameList = new Array();
var arPropFieldsList = new Array();
var arPropFieldsNameList = new Array();
<?php
$i = -1;
foreach ($arFieldsList["USER"] as $k => $v) {
$i++;
?>
arUserFieldsList[<?php
echo $i;
?>
] = "<?php
echo $k;
?>
";
arUserFieldsNameList[<?php
echo $i;
?>
] = "<?php
echo $v;
?>
";
<?php
}
$i = -1;
foreach ($arFieldsList["ORDER"] as $k => $v) {
$i++;
?>
arOrderFieldsList[<?php
echo $i;
?>
] = "<?php
echo $k;
?>
";
arOrderFieldsNameList[<?php
echo $i;
?>
] = "<?php
echo $v;
?>
";
<?php
}
$i = -1;
foreach ($arFieldsList["PROPERTY"] as $k => $v) {
?>
arPropFieldsList[<?php
echo $k;
?>
] = new Array();
arPropFieldsNameList[<?php
echo $k;
?>
] = new Array();
<?php
foreach ($v as $k1 => $v1) {
$i++;
?>
//.........这里部分代码省略.........
示例10: array
*/
$userProfile = $arResultProps["USER_PROFILES"];
$arPropValues = array();
$arPropValues = $userProfile[$PROFILE_ID]["VALUES"];
$arFilter = array("PERSON_TYPE_ID" => $PERSON_TYPE, "ACTIVE" => "Y", "UTIL" => "N");
$dbProperties = CSaleOrderProps::GetList(array("SORT" => "ASC"), $arFilter, false, false, array("ID", "NAME", "TYPE", "REQUIED", "DEFAULT_VALUE", "IS_LOCATION", "PROPS_GROUP_ID", "SIZE1", "SIZE2", "DESCRIPTION", "IS_EMAIL", "IS_PROFILE_NAME", "IS_PAYER", "IS_LOCATION4TAX", "CODE", "GROUP_NAME", "GROUP_SORT", "SORT", "USER_PROPS", "IS_ZIP", "INPUT_FIELD_LOCATION", "SUBSCRIBE"));
$locationZipID = "";
$locationID = "";
$profileName = "";
$payerName = "";
$payerEMail = "";
//load location for the index if isset index
$locationForZip = "";
if (isset($_REQUEST["CHANGE_ZIP"]) && $_REQUEST["CHANGE_ZIP"] == "Y") {
$arFilterZip = array("PERSON_TYPE_ID" => $PERSON_TYPE, "IS_ZIP" => "Y", "ACTIVE" => "Y", "UTIL" => "N");
$dbPropertiesZip = CSaleOrderProps::GetList(array("SORT" => "ASC"), $arFilterZip, false, false, array("ID"));
$arPropZip = $dbPropertiesZip->GetNext();
$zipCode = htmlspecialcharsEx($_POST["ORDER_PROP_" . $arPropZip["ID"]]);
$arZip = CSaleLocation::GetByZIP($zipCode);
if (is_array($arZip) && count($arZip) > 1) {
$locationForZip = intval($arZip["ID"]);
}
}
while ($arProperties = $dbProperties->GetNext()) {
if ((isset($_POST["BasketOrder"]) || $requestAjax || $_REQUEST["form"] == "Y") && $PROFILE_ID_OLD == $PROFILE_ID) {
$curVal = htmlspecialcharsEx($_REQUEST["ORDER_PROP_" . $arProperties["ID"]]);
if (intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]) > 0) {
$curVal = intval($_POST["NEW_LOCATION_" . $arProperties["ID"]]);
}
} else {
$curVal = $arPropValues[intval($arProperties["ID"])];
示例11: array
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
$arYesNo = array("Y" => GetMessage("SOF_DESC_YES"), "N" => GetMessage("SOF_DESC_NO"));
$arComponentParameters = array("PARAMETERS" => array("PATH_TO_BASKET" => array("NAME" => GetMessage("SOF_PATH_TO_BASKET"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "basket.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_PERSONAL" => array("NAME" => GetMessage("SOF_PATH_TO_PERSONAL"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "index.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_AUTH" => array("NAME" => GetMessage("SOF_PATH_TO_AUTH"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "/auth.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "PATH_TO_PAYMENT" => array("NAME" => GetMessage("SOF_PATH_TO_PAYMENT"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "payment.php", "COLS" => 25, "PARENT" => "ADDITIONAL_SETTINGS"), "ALLOW_PAY_FROM_ACCOUNT" => array("NAME" => GetMessage("SOF_ALLOW_PAY_FROM_ACCOUNT"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("N" => GetMessage("SOF_DESC_NO"), "Y" => GetMessage("SOF_DESC_YES")), "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "SHOW_MENU" => array("NAME" => GetMessage("SOF_SHOW_MENU"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("N" => GetMessage("SOF_DESC_NO"), "Y" => GetMessage("SOF_DESC_YES")), "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "USE_AJAX_LOCATIONS" => array("NAME" => GetMessage("SOF_USE_AJAX_LOCATIONS"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "Y", "PARENT" => "ADDITIONAL_SETTINGS"), "SHOW_AJAX_DELIVERY_LINK" => array("NAME" => GetMessage('SOF_SHOW_AJAX_DELIVERY_LINK'), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("Y" => GetMessage('SOF_SHOW_AJAX_DELIVERY_LINK_Y'), "N" => GetMessage('SOF_SHOW_AJAX_DELIVERY_LINK_N'), "S" => GetMessage('SOF_SHOW_AJAX_DELIVERY_LINK_S')), "DEFAULT" => "Y", "PARENT" => "ADDITIONAL_SETTINGS"), "CITY_OUT_LOCATION" => array("NAME" => GetMessage("SALE_SOF_PARAM_CITY_OUT_LOCATION"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N", "MULTIPLE" => "N", "PARENT" => "BASE"), "COUNT_DELIVERY_TAX" => array("NAME" => GetMessage("SOF_COUNT_DELIVERY_TAX"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("N" => GetMessage("SOF_DESC_NO"), "Y" => GetMessage("SOF_DESC_YES")), "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "COUNT_DISCOUNT_4_ALL_QUANTITY" => array("NAME" => GetMessage("SOF_COUNT_DISCOUNT_4_ALL_QUANTITY"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("N" => GetMessage("SOF_DESC_NO"), "Y" => GetMessage("SOF_DESC_YES")), "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "SET_TITLE" => array(), "PRICE_VAT_INCLUDE" => array("NAME" => GetMessage('SOF_VAT_INCLUDE'), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N", "PARENT" => "ADDITIONAL_SETTINGS"), "PRICE_VAT_SHOW_VALUE" => array("NAME" => GetMessage('SOF_VAT_SHOW_VALUE'), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N", "PARENT" => "ADDITIONAL_SETTINGS"), "ONLY_FULL_PAY_FROM_ACCOUNT" => array("NAME" => GetMessage("SOF_ONLY_FULL_PAY_FROM_ACCOUNT"), "TYPE" => "LIST", "MULTIPLE" => "N", "VALUES" => array("N" => GetMessage("SOF_DESC_NO"), "Y" => GetMessage("SOF_DESC_YES")), "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE"), "SEND_NEW_USER_NOTIFY" => array("NAME" => GetMessage("SOA_SEND_NEW_USER_NOTIFY"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "PARENT" => "BASE"), "DELIVERY_NO_SESSION" => array("NAME" => GetMessage("SOA_DELIVERY_NO_SESSION"), "TYPE" => "CHECKBOX", "MULTIPLE" => "N", "DEFAULT" => "N", "PARENT" => "BASE")));
if (CModule::IncludeModule("sale")) {
$dbPerson = CSalePersonType::GetList(array("SORT" => "ASC", "NAME" => "ASC"));
while ($arPerson = $dbPerson->GetNext()) {
$arPers2Prop = array("" => GetMessage("SOF_SHOW_ALL"));
$bProp = false;
$dbProp = CSaleOrderProps::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("PERSON_TYPE_ID" => $arPerson["ID"]));
while ($arProp = $dbProp->GetNext()) {
$arPers2Prop[$arProp["ID"]] = $arProp["NAME"];
$bProp = true;
}
if ($bProp) {
$arComponentParameters["PARAMETERS"]["PROP_" . $arPerson["ID"]] = array("NAME" => GetMessage("SOF_PROPS_NOT_SHOW") . " \"" . $arPerson["NAME"] . "\" (" . $arPerson["LID"] . ")", "TYPE" => "LIST", "MULTIPLE" => "Y", "VALUES" => $arPers2Prop, "DEFAULT" => "", "COLS" => 25, "ADDITIONAL_VALUES" => "N", "PARENT" => "BASE");
}
}
}
示例12: DoSaveOrderProps
static function DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors)
{
$arIDs = array();
$dbResult = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arResult = $dbResult->Fetch()) {
$arIDs[$arResult["ORDER_PROPS_ID"]] = $arResult["ID"];
}
$dbOrderProperties = CSaleOrderProps::GetList(array("SORT" => "ASC"), array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y"), false, false, array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $arOrderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if (strlen($curVal) > 0) {
$arFields = array("ORDER_ID" => $orderId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "CODE" => $arOrderProperty["CODE"], "VALUE" => $curVal);
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
CSaleOrderPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
CSaleOrderPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderPropsValue::Delete($id);
}
}
示例13: array
$tabControl->Begin(array("FORM_ACTION" => $APPLICATION->GetCurPage() . "?lang=" . LANG . $urlForm));
//TAB EDIT PROFILE
$tabControl->BeginNextFormTab();
if (!empty($arProfile) && !empty($arUser)) {
$dbPersonType = CSalePersonType::GetList(array(), array("ACTIVE" => "Y", "ID" => $PERSON_TYPE));
$arPersonType = $dbPersonType->GetNext();
$LID = $arPersonType["LID"];
$arFilterProps = array("PERSON_TYPE_ID" => $PERSON_TYPE, "ACTIVE" => "Y");
if ($saleModulePermissions >= "U" && $saleModulePermissions < "W") {
$arFilterProps["USER_PROPS"] = "Y";
$arFilterProps["UTIL"] = "N";
}
$tabControl->AddViewField("CODE_USER", GetMessage("BUYER_PE_USER") . ":", "[<a href=\"/bitrix/admin/user_edit.php?ID=" . $arUser["ID"] . "&lang=" . LANGUAGE_ID . "\">" . $arUser["ID"] . "</a>] (" . $arUser["LOGIN"] . ") " . $userFIO);
$tabControl->AddEditField("CODE_PROFILE_NAME", GetMessage("BUYER_PE_PROFILE_NAME") . ":", false, array("size" => 30, "maxlength" => 255), htmlspecialcharsEx($profileName));
$propertyGroupID = "";
$dbProperties = CSaleOrderProps::GetList(array("GROUP_SORT" => "ASC", "PROPS_GROUP_ID" => "ASC", "SORT" => "ASC", "NAME" => "ASC"), $arFilterProps, false, false, array("*"));
$userProfile = CSaleOrderUserProps::DoLoadProfiles($USER_ID, $PERSON_TYPE);
$curVal = "";
while ($arProperties = $dbProperties->Fetch()) {
$curVal = $userProfile[$ID]["VALUES"][IntVal($arProperties["ID"])];
$fieldValue = $curVal != "" ? $curVal : $arProperties["DEFAULT_VALUE"];
if (IntVal($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID) {
$tabControl->AddSection("SECTION_" . $arProperties["PROPS_GROUP_ID"], $arProperties["GROUP_NAME"]);
}
$shure = false;
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") {
$shure = true;
}
/*fields*/
if ($arProperties["TYPE"] == "TEXT") {
$tabControl->AddEditField("CODE_" . IntVal($arProperties["ID"]), $arProperties["NAME"] . ":", $shure, array("size" => 30, "maxlength" => 255), $fieldValue);
示例14: DoSaveOrderProps
static function DoSaveOrderProps($orderId, $personTypeId, $arOrderProps, &$arErrors, $paysystemId = 0, $deliveryId = "")
{
$arIDs = array();
$dbResult = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arResult = $dbResult->Fetch()) {
$arIDs[$arResult["ORDER_PROPS_ID"]] = $arResult["ID"];
}
$arFilter = array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y");
if ($paysystemId != 0) {
$arFilter["RELATED"]["PAYSYSTEM_ID"] = $paysystemId;
$arFilter["RELATED"]["TYPE"] = "WITH_NOT_RELATED";
}
if (strlen($deliveryId) > 0) {
$arFilter["RELATED"]["DELIVERY_ID"] = $deliveryId;
$arFilter["RELATED"]["TYPE"] = "WITH_NOT_RELATED";
}
$dbOrderProperties = CSaleOrderProps::GetList(array("SORT" => "ASC"), $arFilter, false, false, array("ID", "TYPE", "NAME", "CODE", "USER_PROPS", "SORT"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $arOrderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if ($arOrderProperty["TYPE"] == "FILE" && is_array($curVal)) {
$tmpVal = "";
foreach ($curVal as $index => $fileData) {
$bModify = true;
if (isset($fileData["file_id"])) {
if (isset($fileData["del"])) {
$arFile = CFile::MakeFileArray($fileData["file_id"]);
$arFile["del"] = $fileData["del"];
$arFile["old_file"] = $fileData["file_id"];
} else {
$bModify = false;
if (strlen($tmpVal) > 0) {
$tmpVal .= ", " . $fileData["file_id"];
} else {
$tmpVal = $fileData["file_id"];
}
}
} else {
// new file array
$arFile = $fileData;
}
if (isset($arFile["name"]) && strlen($arFile["name"]) > 0 && $bModify) {
$arFile["MODULE_ID"] = "sale";
$fid = CFile::SaveFile($arFile, "sale");
if (intval($fid) > 0) {
if (strlen($tmpVal) > 0) {
$tmpVal .= ", " . $fid;
} else {
$tmpVal = $fid;
}
}
}
}
$curVal = $tmpVal;
}
if (strlen($curVal) > 0) {
$arFields = array("ORDER_ID" => $orderId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "CODE" => $arOrderProperty["CODE"], "VALUE" => $curVal);
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
CSaleOrderPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
CSaleOrderPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderPropsValue::Delete($id);
}
}
示例15: getOrderPropFormated
function getOrderPropFormated($arProperties, $arResult, &$arUserResult, &$arDeleteFieldLocation = array())
{
global $USER;
$curVal = $arUserResult["ORDER_PROP"][$arProperties["ID"]];
$curLocation = false;
static $propertyGroupID = 0;
static $propertyUSER_PROPS = "";
// take data from user profile
if ($arUserResult["PROFILE_CHANGE"] == "Y" && intval($arUserResult["PROFILE_ID"]) > 0 && !($arResult["HAVE_PREPAYMENT"] && $arUserResult["PROFILE_DEFAULT"] == "Y" && !empty($arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]]))) {
$dbUserPropsValues = CSaleOrderUserPropsValue::GetList(array("SORT" => "ASC"), array("USER_PROPS_ID" => $arUserResult["PROFILE_ID"], "ORDER_PROPS_ID" => $arProperties["ID"], "USER_ID" => intval($USER->GetID())), false, false, array("VALUE", "PROP_TYPE", "VARIANT_NAME", "SORT", "ORDER_PROPS_ID"));
if ($arUserPropsValues = $dbUserPropsValues->Fetch()) {
$valueTmp = "";
if ($arUserPropsValues["PROP_TYPE"] == "MULTISELECT") {
$arUserPropsValues["VALUE"] = explode(",", $arUserPropsValues["VALUE"]);
}
$curVal = $arUserPropsValues["VALUE"];
}
} elseif ($arUserResult["PROFILE_CHANGE"] == "Y" && intval($arUserResult["PROFILE_ID"]) <= 0) {
if (isset($curVal)) {
unset($curVal);
}
} elseif (isset($arUserResult["ORDER_PROP"][$arProperties["ID"]])) {
$curVal = $arUserResult["ORDER_PROP"][$arProperties["ID"]];
} elseif ($arResult["HAVE_PREPAYMENT"] && !empty($arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]])) {
$curVal = $arResult["PREPAY_ORDER_PROPS"][$arProperties["CODE"]];
if ($arProperties["TYPE"] == "LOCATION") {
$curLocation = $curVal;
}
}
if (intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]) > 0) {
$curVal = intval($_REQUEST["NEW_LOCATION_" . $arProperties["ID"]]);
}
$arProperties["FIELD_NAME"] = "ORDER_PROP_" . $arProperties["ID"];
if (strlen($arProperties["CODE"]) > 0) {
$arProperties["FIELD_ID"] = "ORDER_PROP_" . $arProperties["CODE"];
} else {
$arProperties["FIELD_ID"] = "ORDER_PROP_" . $arProperties["ID"];
}
if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID || $propertyUSER_PROPS != $arProperties["USER_PROPS"]) {
$arProperties["SHOW_GROUP_NAME"] = "Y";
}
$propertyGroupID = $arProperties["PROPS_GROUP_ID"];
$propertyUSER_PROPS = $arProperties["USER_PROPS"];
if ($arProperties["REQUIED"] == "Y" || $arProperties["IS_EMAIL"] == "Y" || $arProperties["IS_PROFILE_NAME"] == "Y" || $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" || $arProperties["IS_PAYER"] == "Y" || $arProperties["IS_ZIP"] == "Y") {
$arProperties["REQUIED_FORMATED"] = "Y";
}
if ($arProperties["TYPE"] == "CHECKBOX") {
if ($curVal == "Y" || !isset($curVal) && $arProperties["DEFAULT_VALUE"] == "Y") {
$arProperties["CHECKED"] = "Y";
$arProperties["VALUE_FORMATED"] = GetMessage("SOA_Y");
} else {
$arProperties["VALUE_FORMATED"] = GetMessage("SOA_N");
}
$arProperties["SIZE1"] = intval($arProperties["SIZE1"]) > 0 ? $arProperties["SIZE1"] : 30;
} elseif ($arProperties["TYPE"] == "TEXT") {
if (strlen($curVal) <= 0) {
if (strlen($arProperties["DEFAULT_VALUE"]) > 0 && !isset($curVal)) {
$arProperties["VALUE"] = $arProperties["DEFAULT_VALUE"];
} elseif ($arProperties["IS_EMAIL"] == "Y") {
$arProperties["VALUE"] = $USER->GetEmail();
} elseif ($arProperties["IS_PAYER"] == "Y") {
//$arProperties["VALUE"] = $USER->GetFullName();
$rsUser = CUser::GetByID($USER->GetID());
$fio = "";
if ($arUser = $rsUser->Fetch()) {
$fio = CUser::FormatName(CSite::GetNameFormat(false), array("NAME" => $arUser["NAME"], "LAST_NAME" => $arUser["LAST_NAME"], "SECOND_NAME" => $arUser["SECOND_NAME"]), false, false);
}
$arProperties["VALUE"] = $fio;
}
} else {
$arProperties["VALUE"] = $curVal;
}
//select ZIP for LOCATION
if ($arProperties["IS_ZIP"] == "Y" && $arUserResult["PROFILE_CHANGE"] == "N") {
$dbPropertiesLoc = CSaleOrderProps::GetList(array("ID" => "DESC"), array("PERSON_TYPE_ID" => $arUserResult["PERSON_TYPE_ID"], "ACTIVE" => "Y", "UTIL" => "N", "IS_LOCATION" => "Y"), false, false, array("ID"));
$arPropertiesLoc = $dbPropertiesLoc->Fetch();
if ($arPropertiesLoc["ID"] > 0) {
$arZipLocation = array();
if (strlen($curVal) > 0) {
$arZipLocation = CSaleLocation::GetByZIP($curVal);
}
$rsZipList = CSaleLocation::GetLocationZIP($arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]]);
if ($arZip = $rsZipList->Fetch()) {
if (strlen($arZip["ZIP"]) > 0 && (empty($arZipLocation) || $arZipLocation["ID"] != $arUserResult["ORDER_PROP"][$arPropertiesLoc["ID"]])) {
$arProperties["VALUE"] = $arZip["ZIP"];
}
}
}
}
if ($arProperties["IS_ZIP"] == "Y") {
$arUserResult["DELIVERY_LOCATION_ZIP"] = $arProperties["VALUE"];
}
$arProperties["VALUE"] = htmlspecialcharsEx($arProperties["VALUE"]);
$arProperties["VALUE_FORMATED"] = $arProperties["VALUE"];
} elseif ($arProperties["TYPE"] == "SELECT") {
$arProperties["SIZE1"] = intval($arProperties["SIZE1"]) > 0 ? $arProperties["SIZE1"] : 1;
$dbVariants = CSaleOrderPropsVariant::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("ORDER_PROPS_ID" => $arProperties["ID"]), false, false, array("*"));
$flagDefault = "N";
$nameProperty = "";
while ($arVariants = $dbVariants->GetNext()) {
//.........这里部分代码省略.........