本文整理汇总了PHP中CSalePersonType::GetByID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSalePersonType::GetByID方法的具体用法?PHP CSalePersonType::GetByID怎么用?PHP CSalePersonType::GetByID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSalePersonType
的用法示例。
在下文中一共展示了CSalePersonType::GetByID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckFields
function CheckFields($ACTION, &$arFields)
{
global $DB, $USER;
if ((is_set($arFields, "NAME") || $ACTION=="ADD") && strlen($arFields["NAME"]) <= 0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGPSA_NO_NAME"), "ERROR_NO_NAME");
return false;
}
if ((is_set($arFields, "PAY_SYSTEM_ID") || $ACTION=="ADD") && IntVal($arFields["PAY_SYSTEM_ID"]) <= 0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGPSA_NO_CODE"), "ERROR_NO_PAY_SYSTEM_ID");
return false;
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION=="ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGPSA_NO_ID_TYPE"), "ERROR_NO_PERSON_TYPE_ID");
return false;
}
if (is_set($arFields, "NEW_WINDOW") && $arFields["NEW_WINDOW"] != "Y")
$arFields["NEW_WINDOW"] = "N";
if (is_set($arFields, "HAVE_PAYMENT") && $arFields["HAVE_PAYMENT"] != "Y")
$arFields["HAVE_PAYMENT"] = "N";
if (is_set($arFields, "HAVE_ACTION") && $arFields["HAVE_ACTION"] != "Y")
$arFields["HAVE_ACTION"] = "N";
if (is_set($arFields, "HAVE_RESULT") && $arFields["HAVE_RESULT"] != "Y")
$arFields["HAVE_RESULT"] = "N";
if (is_set($arFields, "HAVE_PREPAY") && $arFields["HAVE_PREPAY"] != "Y")
$arFields["HAVE_PREPAY"] = "N";
if (is_set($arFields, "HAVE_RESULT_RECEIVE") && $arFields["HAVE_RESULT_RECEIVE"] != "Y")
$arFields["HAVE_RESULT_RECEIVE"] = "N";
if (is_set($arFields, "ENCODING") && strlen($arFields["ENCODING"]) <= 0)
$arFields["ENCODING"] = false;
if (is_set($arFields, "PAY_SYSTEM_ID"))
{
if (!($arPaySystem = CSalePaySystem::GetByID($arFields["PAY_SYSTEM_ID"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PAY_SYSTEM_ID"], GetMessage("SKGPSA_NO_PS")), "ERROR_NO_PAY_SYSTEM");
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID"))
{
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGPSA_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
return True;
}
示例2: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SALE_EXPORT_NO_PERSON_TYPE_ID"), "EMPTY_PERSON_TYPE_ID");
return false;
}
if (is_set($arFields, "PERSON_TYPE_ID")) {
$arResult = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]);
if (!$arResult) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SALE_EXPORT_ERROR_PERSON_TYPE_ID")), "ERROR_NO_PERSON_TYPE_ID");
return false;
}
}
return True;
}
示例3: CheckFields
function CheckFields($ACTION, &$arFields)
{
global $DB;
if ((is_set($arFields, "TAX_ID") || $ACTION == "ADD") && IntVal($arFields["TAX_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGTR_EMPTY_TAX_ID"), "ERROR_NO_TAX_ID");
return false;
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$arFields["PERSON_TYPE_ID"] = false;
}
if (is_set($arFields, "VALUE") || $ACTION == "ADD") {
$arFields["VALUE"] = str_replace(",", ".", $arFields["VALUE"]);
$arFields["VALUE"] = DoubleVal($arFields["VALUE"]);
}
if ((is_set($arFields, "IS_PERCENT") || $ACTION == "ADD") && $arFields["IS_PERCENT"] != "N") {
$arFields["IS_PERCENT"] = "Y";
}
if ($arFields["IS_PERCENT"] == "Y") {
$arFields["CURRENCY"] = false;
} elseif ($arFields["IS_PERCENT"] == "N" && (!is_set($arFields, "CURRENCY") || strlen($arFields["CURRENCY"]) <= 0)) {
return False;
} elseif (!is_set($arFields, "IS_PERCENT") && (is_set($arFields, "CURRENCY") && $arFields["CURRENCY"] !== false)) {
return False;
}
if (is_set($arFields, "TAX_ID")) {
if (!($arTax = CSaleTax::GetByID($arFields["TAX_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["TAX_ID"], GetMessage("SKGTR_NO_TAX")), "ERROR_NO_TAX");
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID") && $arFields["PERSON_TYPE_ID"] !== false) {
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGTR_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
if ((is_set($arFields, "IS_IN_PRICE") || $ACTION == "ADD") && $arFields["IS_IN_PRICE"] != "Y") {
$arFields["IS_IN_PRICE"] = "N";
}
if ((is_set($arFields, "ACTIVE") || $ACTION == "ADD") && $arFields["ACTIVE"] != "N") {
$arFields["ACTIVE"] = "Y";
}
if ((is_set($arFields, "APPLY_ORDER") || $ACTION == "ADD") && IntVal($arFields["APPLY_ORDER"]) <= 0) {
$arFields["APPLY_ORDER"] = "100";
}
return true;
}
示例4: FormatInvoicePersonTypeChanged
public static function FormatInvoicePersonTypeChanged($arData)
{
$info = GetMessage("CRM_INVOICE_EVENT_INFO_PERSON_TYPE_CHANGED");
foreach ($arData as $param => $value) {
if ($param == "PERSON_TYPE_ID") {
$res = CSalePersonType::GetByID($value);
$value = "\"" . $res["NAME"] . "\"";
if ($res["NAME"] === 'CRM_CONTACT') {
$value = '"' . GetMessage('CRM_PERSON_TYPE_CONTACT') . '"';
} else {
if ($res["NAME"] === 'CRM_COMPANY') {
$value = '"' . GetMessage('CRM_PERSON_TYPE_COMPANY') . '"';
}
}
}
$info = str_replace("#" . $param . "#", $value, $info);
}
return array("INFO" => $info);
}
示例5: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $DB, $USER;
if (is_set($arFields, "PERSON_TYPE_ID") && $ACTION != "ADD") {
unset($arFields["PERSON_TYPE_ID"]);
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPG_EMPTY_PERS_TYPE"), "ERROR_NO_PERSON_TYPE");
return false;
}
if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOPG_EMPTY_GROUP"), "ERROR_NO_NAME");
return false;
}
if (is_set($arFields, "PERSON_TYPE_ID")) {
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGOPG_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
return True;
}
示例6: Trim
$errorMessage .= "Error. ";
}
}
$LID = Trim($LID);
if (strlen($LID) <= 0) {
$errorMessage .= GetMessage("SOE_EMPTY_SITE") . ". ";
}
$USER_ID = IntVal($USER_ID);
if ($USER_ID <= 0) {
$errorMessage .= GetMessage("SOE_EMPTY_USER") . ". ";
}
$PERSON_TYPE_ID = IntVal($PERSON_TYPE_ID);
if ($PERSON_TYPE_ID <= 0) {
$errorMessage .= GetMessage("SOE_EMPTY_PERS_TYPE") . ". ";
}
if ($PERSON_TYPE_ID > 0 && !($arPersonType = CSalePersonType::GetByID($PERSON_TYPE_ID))) {
$errorMessage .= GetMessage("SOE_PERSON_NOT_FOUND") . "<br>";
}
$STATUS_ID = Trim($STATUS_ID);
if (strlen($STATUS_ID) > 0) {
if ($saleModulePermissions < "W") {
$dbStatusList = CSaleStatus::GetList(array(), array("GROUP_ID" => $GLOBALS["USER"]->GetUserGroupArray(), "PERM_STATUS" => "Y", "ID" => $STATUS_ID), array("ID", "MAX" => "PERM_STATUS"), false, array("ID"));
if (!$dbStatusList->Fetch()) {
$errorMessage .= str_replace("#STATUS_ID#", $STATUS_ID, GetMessage("SOE_NO_STATUS_PERMS")) . ". ";
}
}
}
$CANCELED = $CANCELED == "Y" ? "Y" : "N";
$PAYED = $PAYED == "Y" ? "Y" : "N";
$ALLOW_DELIVERY = $ALLOW_DELIVERY == "Y" ? "Y" : "N";
$BASE_LANG_CURRENCY = CSaleLang::GetLangCurrency($LID);
示例7: htmlspecialcharsbx
{
if(!$bInitVars)
$arResult = $arUserProps;
else
{
foreach($_POST as $k => $v)
{
$arResult[$k] = htmlspecialcharsbx($v);
$arResult['~'.$k] = $v;
}
}
$arResult["ERROR_MESSAGE"] = $errorMessage;
$arResult["TITLE"] = str_replace("#ID#", $arUserProps["ID"], GetMessage("SPPD_PROFILE_NO"));
$arResult["PERSON_TYPE"] = CSalePersonType::GetByID($arUserProps["PERSON_TYPE_ID"]);
$arResult["PERSON_TYPE"]["NAME"] = htmlspecialcharsEx($arResult["PERSON_TYPE"]["NAME"]);
// get prop description
$arrayTmp = Array();
$propsOfTypeLocation = array();
$dbOrderPropsGroup = CSaleOrderPropsGroup::GetList(
array("SORT" => "ASC", "NAME" => "ASC"),
array("PERSON_TYPE_ID" => $arUserProps["PERSON_TYPE_ID"]),
false,
false,
array("ID", "PERSON_TYPE_ID", "NAME", "SORT")
);
while ($arOrderPropsGroup = $dbOrderPropsGroup->GetNext())
{
$arrayTmp[$arOrderPropsGroup["ID"]] = $arOrderPropsGroup;
示例8: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
if (is_set($arFields, "SITE_ID") && strlen($arFields["SITE_ID"]) > 0) {
$arFields["LID"] = $arFields["SITE_ID"];
}
if ((is_set($arFields, "LID") || $ACTION == "ADD") && strlen($arFields["LID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_SITE"), "EMPTY_SITE_ID");
return false;
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_PERS_TYPE"), "EMPTY_PERSON_TYPE_ID");
return false;
}
if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_USER_ID"), "EMPTY_USER_ID");
return false;
}
if (is_set($arFields, "PAYED") && $arFields["PAYED"] != "Y") {
$arFields["PAYED"] = "N";
}
if (is_set($arFields, "CANCELED") && $arFields["CANCELED"] != "Y") {
$arFields["CANCELED"] = "N";
}
if (is_set($arFields, "STATUS_ID") && strlen($arFields["STATUS_ID"]) <= 0) {
$arFields["STATUS_ID"] = "N";
}
if (is_set($arFields, "ALLOW_DELIVERY") && $arFields["ALLOW_DELIVERY"] != "Y") {
$arFields["ALLOW_DELIVERY"] = "N";
}
if (is_set($arFields, "PRICE") || $ACTION == "ADD") {
$arFields["PRICE"] = str_replace(",", ".", $arFields["PRICE"]);
$arFields["PRICE"] = DoubleVal($arFields["PRICE"]);
}
if (is_set($arFields, "PRICE_DELIVERY") || $ACTION == "ADD") {
$arFields["PRICE_DELIVERY"] = str_replace(",", ".", $arFields["PRICE_DELIVERY"]);
$arFields["PRICE_DELIVERY"] = DoubleVal($arFields["PRICE_DELIVERY"]);
}
if (is_set($arFields, "SUM_PAID") || $ACTION == "ADD") {
$arFields["SUM_PAID"] = str_replace(",", ".", $arFields["SUM_PAID"]);
$arFields["SUM_PAID"] = DoubleVal($arFields["SUM_PAID"]);
}
if (is_set($arFields, "DISCOUNT_VALUE") || $ACTION == "ADD") {
$arFields["DISCOUNT_VALUE"] = str_replace(",", ".", $arFields["DISCOUNT_VALUE"]);
$arFields["DISCOUNT_VALUE"] = DoubleVal($arFields["DISCOUNT_VALUE"]);
}
if (is_set($arFields, "TAX_VALUE") || $ACTION == "ADD") {
$arFields["TAX_VALUE"] = str_replace(",", ".", $arFields["TAX_VALUE"]);
$arFields["TAX_VALUE"] = DoubleVal($arFields["TAX_VALUE"]);
}
if (!is_set($arFields, "LOCKED_BY") && (!is_set($arFields, "UPDATED_1C") || is_set($arFields, "UPDATED_1C") && $arFields["UPDATED_1C"] != "Y")) {
$arFields["UPDATED_1C"] = "N";
}
if ((is_set($arFields, "CURRENCY") || $ACTION == "ADD") && strlen($arFields["CURRENCY"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_CURRENCY"), "EMPTY_CURRENCY");
return false;
}
if (is_set($arFields, "CURRENCY")) {
if (!($arCurrency = CCurrency::GetByID($arFields["CURRENCY"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["CURRENCY"], GetMessage("SKGO_WRONG_CURRENCY")), "ERROR_NO_CURRENCY");
return false;
}
}
if (is_set($arFields, "LID")) {
$dbSite = CSite::GetByID($arFields["LID"]);
if (!$dbSite->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["LID"], GetMessage("SKGO_WRONG_SITE")), "ERROR_NO_SITE");
return false;
}
}
if (is_set($arFields, "USER_ID")) {
$dbUser = CUser::GetByID($arFields["USER_ID"]);
if (!$dbUser->Fetch()) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["USER_ID"], GetMessage("SKGO_WRONG_USER")), "ERROR_NO_USER_ID");
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID")) {
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGO_WRONG_PERSON_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
if (is_set($arFields, "PAY_SYSTEM_ID") && IntVal($arFields["PAY_SYSTEM_ID"]) > 0) {
if (!($arPaySystem = CSalePaySystem::GetByID(IntVal($arFields["PAY_SYSTEM_ID"])))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PAY_SYSTEM_ID"], GetMessage("SKGO_WRONG_PS")), "ERROR_NO_PAY_SYSTEM");
return false;
}
}
if (is_set($arFields, "DELIVERY_ID") && (strpos($arFields["DELIVERY_ID"], ":") !== false || IntVal($arFields["DELIVERY_ID"]) > 0)) {
if (strpos($arFields["DELIVERY_ID"], ":") !== false) {
$arId = explode(":", $arFields["DELIVERY_ID"]);
$obDelivery = new CSaleDeliveryHandler();
if ($arDelivery = $obDelivery->GetBySID($arId[0])) {
if ($arDelivery = $arDelivery->Fetch()) {
if (!is_set($arDelivery["PROFILES"], $arId[1])) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["DELIVERY_ID"], GetMessage("SKGO_WRONG_DELIVERY")), "ERROR_NO_DELIVERY");
return false;
}
}
} else {
//.........这里部分代码省略.........
示例9: intval
$btnNewBuyer = "N";
if ($btnTypeBuyer == "btnBuyerNew")
$btnNewBuyer = "Y";
$useStores = (isset($_POST["storeCount"]) && intval($_POST["storeCount"]) > 0) ? true : false;
if (strlen($LID) <= 0)
$errorMessage .= GetMessage("SOE_EMPTY_SITE")."<br>";
$BASE_LANG_CURRENCY = CSaleLang::GetLangCurrency($LID);
$str_PERSON_TYPE_ID = intval($buyer_type_id);
if ($str_PERSON_TYPE_ID <= 0)
$errorMessage .= GetMessage("SOE_EMPTY_PERS_TYPE")."<br>";
if (($str_PERSON_TYPE_ID > 0) && !($arPersonType = CSalePersonType::GetByID($str_PERSON_TYPE_ID)))
$errorMessage .= GetMessage("SOE_PERSON_NOT_FOUND")."<br>";
$str_STATUS_ID = trim($STATUS_ID);
if (strlen($str_STATUS_ID) > 0)
{
if ($saleModulePermissions < "W")
{
$dbStatusList = CSaleStatus::GetList(
array(),
array(
"GROUP_ID" => $arUserGroups,
"PERM_STATUS" => "Y",
"ID" => $str_STATUS_ID
),
array("ID", "MAX" => "PERM_STATUS"),
示例10: htmlspecialcharsEx
<td valign="middle"><?
$strBuyerProfileUrl = '';
if (CBXFeatures::IsFeatureEnabled('SaleAccounts'))
{
$strBuyerProfileUrl = '/bitrix/admin/sale_buyers_profile.php?USER_ID='.$arOrder["USER_ID"].'&lang='.LANGUAGE_ID;
}
else
{
$strBuyerProfileUrl = '/bitrix/admin/user_edit.php?ID='.$arOrder["USER_ID"].'&lang='.LANGUAGE_ID;
}
?><a href="<? echo $strBuyerProfileUrl; ?>"><? echo htmlspecialcharsEx($arUser["LOGIN"]); ?></a></td>
</tr>
<tr>
<td valign="top"><?echo GetMessage("P_ORDER_PERS_TYPE")?>:</td>
<td valign="middle"><?
$arPersonType = CSalePersonType::GetByID($arOrder["PERSON_TYPE_ID"]);
echo htmlspecialcharsEx($arPersonType["NAME"]);
?>
</td>
</tr>
<?
//disabled town
$arTownOrderProps = array();
$dbProperties = CSaleOrderProps::GetList(
array(),
array(
"ORDER_ID" => $ID,
"PERSON_TYPE_ID" => $arPersonType["ID"],
"ACTIVE" => "Y",
">INPUT_FIELD_LOCATION" => 0
示例11: getOrderInfoDetail
function getOrderInfoDetail($orderId)
{
if (!$orderId) {
return false;
}
if (!$GLOBALS["USER"]->IsAuthorized()) {
return false;
}
$arFilter["ID"] = $orderId;
$saleModulePermissions = $GLOBALS["APPLICATION"]->GetGroupRight("sale");
if ($saleModulePermissions == "D") {
$arFilter["USER_ID"] = IntVal($GLOBALS["USER"]->GetID());
} elseif ($saleModulePermissions != "W") {
$arFilter["STATUS_PERMS_GROUP_ID"] = $GLOBALS["USER"]->GetUserGroupArray();
$arFilter[">=STATUS_PERMS_PERM_VIEW"] = "Y";
}
$arOrder = array();
$dbOrder = CSaleOrder::GetList(array(), $arFilter);
$arOrder = $dbOrder->GetNext();
if (!$arOrder) {
return false;
}
$arOrder["STATUS"] = CSaleStatus::GetLangByID($arOrder["STATUS_ID"]);
$arOrder["STATUS_NAME"] = $arOrder["STATUS"]["NAME"];
$arOrder["PRICE_IN_ALL_NUM"] = floatval($arOrder["~PRICE"] + floatval($arOrder["~PRICE_DELIVERY"]));
$arOrder["PRICE_IN_ALL"] = SaleFormatCurrency($arOrder["PRICE_IN_ALL_NUM"], $arOrder["CURRENCY"]);
$arOrder["PRICE_STR"] = SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]);
$arOrder["PERSON_TYPE"] = CSalePersonType::GetByID($arOrder["PERSON_TYPE_ID"]);
$arOrder["PERSON_TYPE_NAME"] = htmlspecialcharsbx($arOrder["PERSON_TYPE"]["NAME"]);
$arOrder = self::getOrderProps($arOrder);
$arOrder["DELIVERY_NAME"] = self::getDeliveriesInfo(array($arOrder["DELIVERY_ID"]));
$arOrder["DELIVERY_NAME"] = $arOrder["DELIVERY_NAME"][$arOrder["DELIVERY_ID"]];
$arPaySys = CSalePaySystem::GetByID($arOrder["PAY_SYSTEM_ID"], $arOrder["PERSON_TYPE_ID"]);
$arOrder["PAY_SYSTEM_NAME"] = $arPaySys["NAME"];
$dbUserAccount = CSaleUserAccount::GetList(array(), array("USER_ID" => $arOrder["USER_ID"], "CURRENCY" => $arOrder["CURRENCY"], "LOCKED" => "N"));
$arUserAccount = $dbUserAccount->GetNext();
$arOrder["CURRENT_BUDGET"] = $arUserAccount["CURRENT_BUDGET"] ? $arUserAccount["CURRENT_BUDGET"] : 0;
$arOrder["CURRENT_BUDGET_STRING"] = SaleFormatCurrency($arOrder["CURRENT_BUDGET"], $arOrder["CURRENCY"]);
return $arOrder;
}
示例12: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $USER_FIELD_MANAGER, $DB, $APPLICATION;
if (is_set($arFields, "SITE_ID") && strlen($arFields["SITE_ID"]) > 0) {
$arFields["LID"] = $arFields["SITE_ID"];
}
if ((is_set($arFields, "LID") || $ACTION == "ADD") && strlen($arFields["LID"]) <= 0) {
$APPLICATION->ThrowException(Loc::getMessage("SKGO_EMPTY_SITE"), "EMPTY_SITE_ID");
return false;
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$APPLICATION->ThrowException(Loc::getMessage("SKGO_EMPTY_PERS_TYPE"), "EMPTY_PERSON_TYPE_ID");
return false;
}
if ((is_set($arFields, "USER_ID") || $ACTION == "ADD") && IntVal($arFields["USER_ID"]) <= 0) {
$APPLICATION->ThrowException(Loc::getMessage("SKGO_EMPTY_USER_ID"), "EMPTY_USER_ID");
return false;
}
if (is_set($arFields, "PAYED") && $arFields["PAYED"] != "Y") {
$arFields["PAYED"] = "N";
}
if (is_set($arFields, "CANCELED") && $arFields["CANCELED"] != "Y") {
$arFields["CANCELED"] = "N";
}
if (is_set($arFields, "STATUS_ID") && strlen($arFields["STATUS_ID"]) <= 0) {
$arFields["STATUS_ID"] = "N";
}
if (is_set($arFields, "ALLOW_DELIVERY") && $arFields["ALLOW_DELIVERY"] != "Y") {
$arFields["ALLOW_DELIVERY"] = "N";
}
if (is_set($arFields, "EXTERNAL_ORDER") && $arFields["EXTERNAL_ORDER"] != "Y") {
$arFields["EXTERNAL_ORDER"] = "N";
}
if (is_set($arFields, "PRICE") || $ACTION == "ADD") {
$arFields["PRICE"] = str_replace(",", ".", $arFields["PRICE"]);
$arFields["PRICE"] = DoubleVal($arFields["PRICE"]);
}
if (is_set($arFields, "PRICE_DELIVERY") || $ACTION == "ADD") {
$arFields["PRICE_DELIVERY"] = str_replace(",", ".", $arFields["PRICE_DELIVERY"]);
$arFields["PRICE_DELIVERY"] = DoubleVal($arFields["PRICE_DELIVERY"]);
}
if (is_set($arFields, "SUM_PAID") || $ACTION == "ADD") {
$arFields["SUM_PAID"] = str_replace(",", ".", $arFields["SUM_PAID"]);
$arFields["SUM_PAID"] = DoubleVal($arFields["SUM_PAID"]);
}
if (is_set($arFields, "DISCOUNT_VALUE") || $ACTION == "ADD") {
$arFields["DISCOUNT_VALUE"] = str_replace(",", ".", $arFields["DISCOUNT_VALUE"]);
$arFields["DISCOUNT_VALUE"] = DoubleVal($arFields["DISCOUNT_VALUE"]);
}
if (is_set($arFields, "TAX_VALUE") || $ACTION == "ADD") {
$arFields["TAX_VALUE"] = str_replace(",", ".", $arFields["TAX_VALUE"]);
$arFields["TAX_VALUE"] = DoubleVal($arFields["TAX_VALUE"]);
}
if (!is_set($arFields, "LOCKED_BY") && (!is_set($arFields, "UPDATED_1C") || is_set($arFields, "UPDATED_1C") && $arFields["UPDATED_1C"] != "Y")) {
$arFields["UPDATED_1C"] = "N";
$arFields["~VERSION"] = "VERSION+0+1";
}
if ((is_set($arFields, "CURRENCY") || $ACTION == "ADD") && strlen($arFields["CURRENCY"]) <= 0) {
$APPLICATION->ThrowException(Loc::getMessage("SKGO_EMPTY_CURRENCY"), "EMPTY_CURRENCY");
return false;
}
if (is_set($arFields, "CURRENCY")) {
if (!($arCurrency = CCurrency::GetByID($arFields["CURRENCY"]))) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["CURRENCY"], Loc::getMessage("SKGO_WRONG_CURRENCY")), "ERROR_NO_CURRENCY");
return false;
}
}
if (is_set($arFields, "LID")) {
$dbSite = CSite::GetByID($arFields["LID"]);
if (!$dbSite->Fetch()) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["LID"], Loc::getMessage("SKGO_WRONG_SITE")), "ERROR_NO_SITE");
return false;
}
}
if (is_set($arFields, "USER_ID")) {
$dbUser = CUser::GetByID($arFields["USER_ID"]);
if (!$dbUser->Fetch()) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["USER_ID"], Loc::getMessage("SKGO_WRONG_USER")), "ERROR_NO_USER_ID");
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID")) {
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], Loc::getMessage("SKGO_WRONG_PERSON_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
if (is_set($arFields, "PAY_SYSTEM_ID") && IntVal($arFields["PAY_SYSTEM_ID"]) > 0) {
if (!($arPaySystem = CSalePaySystem::GetByID(IntVal($arFields["PAY_SYSTEM_ID"])))) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["PAY_SYSTEM_ID"], Loc::getMessage("SKGO_WRONG_PS")), "ERROR_NO_PAY_SYSTEM");
return false;
}
}
if (is_set($arFields, "DELIVERY_ID") && IntVal($arFields["DELIVERY_ID"]) > 0) {
if (!($delivery = \Bitrix\Sale\Delivery\Services\Table::getById($arFields["DELIVERY_ID"]))) {
$APPLICATION->ThrowException(str_replace("#ID#", $arFields["DELIVERY_ID"], Loc::getMessage("SKGO_WRONG_DELIVERY")), "ERROR_NO_DELIVERY");
return false;
}
}
if (is_set($arFields, "STATUS_ID")) {
//.........这里部分代码省略.........
示例13: CheckFields
function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $DB, $USER;
if (is_set($arFields, "PERSON_TYPE_ID") && $ACTION != "ADD") {
unset($arFields["PERSON_TYPE_ID"]);
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION == "ADD") && IntVal($arFields["PERSON_TYPE_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_EMPTY_PERS_TYPE"), "ERROR_NO_PERSON_TYPE");
return false;
}
if ((is_set($arFields, "NAME") || $ACTION == "ADD") && strlen($arFields["NAME"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_EMPTY_PROP_NAME"), "ERROR_NO_NAME");
return false;
}
if ((is_set($arFields, "TYPE") || $ACTION == "ADD") && strlen($arFields["TYPE"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_EMPTY_PROP_TYPE"), "ERROR_NO_TYPE");
return false;
}
if (is_set($arFields, "REQUIED") && $arFields["REQUIED"] != "Y") {
$arFields["REQUIED"] = "N";
}
if (is_set($arFields, "USER_PROPS") && $arFields["USER_PROPS"] != "Y") {
$arFields["USER_PROPS"] = "N";
}
if (is_set($arFields, "IS_LOCATION") && $arFields["IS_LOCATION"] != "Y") {
$arFields["IS_LOCATION"] = "N";
}
if (is_set($arFields, "IS_LOCATION4TAX") && $arFields["IS_LOCATION4TAX"] != "Y") {
$arFields["IS_LOCATION4TAX"] = "N";
}
if (is_set($arFields, "IS_EMAIL") && $arFields["IS_EMAIL"] != "Y") {
$arFields["IS_EMAIL"] = "N";
}
if (is_set($arFields, "IS_PROFILE_NAME") && $arFields["IS_PROFILE_NAME"] != "Y") {
$arFields["IS_PROFILE_NAME"] = "N";
}
if (is_set($arFields, "IS_PAYER") && $arFields["IS_PAYER"] != "Y") {
$arFields["IS_PAYER"] = "N";
}
if (is_set($arFields, "IS_FILTERED") && $arFields["IS_FILTERED"] != "Y") {
$arFields["IS_FILTERED"] = "N";
}
if (is_set($arFields, "IS_ZIP") && $arFields["IS_ZIP"] != "Y") {
$arFields["IS_ZIP"] = "N";
}
if (is_set($arFields, "IS_LOCATION") && is_set($arFields, "TYPE") && $arFields["IS_LOCATION"] == "Y" && $arFields["TYPE"] != "LOCATION") {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_WRONG_PROP_TYPE"), "ERROR_WRONG_TYPE1");
return false;
}
if (is_set($arFields, "IS_LOCATION4TAX") && is_set($arFields, "TYPE") && $arFields["IS_LOCATION4TAX"] == "Y" && $arFields["TYPE"] != "LOCATION") {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_WRONG_PROP_TYPE"), "ERROR_WRONG_TYPE2");
return false;
}
if ((is_set($arFields, "PROPS_GROUP_ID") || $ACTION == "ADD") && IntVal($arFields["PROPS_GROUP_ID"]) <= 0) {
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGOP_EMPTY_PROP_GROUP"), "ERROR_NO_GROUP");
return false;
}
if (is_set($arFields, "PERSON_TYPE_ID")) {
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"]))) {
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGOP_NO_PERS_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
return True;
}
示例14: FormatOrderPersonTypeChanged
public static function FormatOrderPersonTypeChanged($arData)
{
$info = GetMessage("SOC_ORDER_PERSON_TYPE_CHANGED_INFO");
foreach ($arData as $param => $value) {
if ($param == "PERSON_TYPE_ID") {
$res = CSalePersonType::GetByID($value);
$value = "\"" . $res["NAME"] . "\"";
}
$info = str_replace("#" . $param . "#", $value, $info);
}
return array("NAME" => GetMessage("SOC_ORDER_PERSON_TYPE_CHANGED"), "INFO" => $info);
}
示例15: CheckFields
public static function CheckFields($ACTION, &$arFields, $ID = 0)
{
global $USER_FIELD_MANAGER, $DB;
if (is_set($arFields, "SITE_ID") && strlen($arFields["SITE_ID"]) > 0)
$arFields["LID"] = $arFields["SITE_ID"];
if ((is_set($arFields, "LID") || $ACTION=="ADD") && strlen($arFields["LID"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_SITE"), "EMPTY_SITE_ID");
return false;
}
if ((is_set($arFields, "PERSON_TYPE_ID") || $ACTION=="ADD") && IntVal($arFields["PERSON_TYPE_ID"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_PERS_TYPE"), "EMPTY_PERSON_TYPE_ID");
return false;
}
if ((is_set($arFields, "USER_ID") || $ACTION=="ADD") && IntVal($arFields["USER_ID"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_USER_ID"), "EMPTY_USER_ID");
return false;
}
if (is_set($arFields, "PAYED") && $arFields["PAYED"]!="Y")
$arFields["PAYED"]="N";
if (is_set($arFields, "CANCELED") && $arFields["CANCELED"]!="Y")
$arFields["CANCELED"]="N";
if (is_set($arFields, "STATUS_ID") && strlen($arFields["STATUS_ID"])<=0)
$arFields["STATUS_ID"]="N";
if (is_set($arFields, "ALLOW_DELIVERY") && $arFields["ALLOW_DELIVERY"]!="Y")
$arFields["ALLOW_DELIVERY"]="N";
if (is_set($arFields, "PRICE") || $ACTION=="ADD")
{
$arFields["PRICE"] = str_replace(",", ".", $arFields["PRICE"]);
$arFields["PRICE"] = DoubleVal($arFields["PRICE"]);
}
if (is_set($arFields, "PRICE_DELIVERY") || $ACTION=="ADD")
{
$arFields["PRICE_DELIVERY"] = str_replace(",", ".", $arFields["PRICE_DELIVERY"]);
$arFields["PRICE_DELIVERY"] = DoubleVal($arFields["PRICE_DELIVERY"]);
}
if (is_set($arFields, "SUM_PAID") || $ACTION=="ADD")
{
$arFields["SUM_PAID"] = str_replace(",", ".", $arFields["SUM_PAID"]);
$arFields["SUM_PAID"] = DoubleVal($arFields["SUM_PAID"]);
}
if (is_set($arFields, "DISCOUNT_VALUE") || $ACTION=="ADD")
{
$arFields["DISCOUNT_VALUE"] = str_replace(",", ".", $arFields["DISCOUNT_VALUE"]);
$arFields["DISCOUNT_VALUE"] = DoubleVal($arFields["DISCOUNT_VALUE"]);
}
if (is_set($arFields, "TAX_VALUE") || $ACTION=="ADD")
{
$arFields["TAX_VALUE"] = str_replace(",", ".", $arFields["TAX_VALUE"]);
$arFields["TAX_VALUE"] = DoubleVal($arFields["TAX_VALUE"]);
}
if(!is_set($arFields, "LOCKED_BY") && (!is_set($arFields, "UPDATED_1C") || (is_set($arFields, "UPDATED_1C") && $arFields["UPDATED_1C"] != "Y")))
{
$arFields["UPDATED_1C"] = "N";
}
if ((is_set($arFields, "CURRENCY") || $ACTION=="ADD") && strlen($arFields["CURRENCY"])<=0)
{
$GLOBALS["APPLICATION"]->ThrowException(GetMessage("SKGO_EMPTY_CURRENCY"), "EMPTY_CURRENCY");
return false;
}
if (is_set($arFields, "CURRENCY"))
{
if (!($arCurrency = CCurrency::GetByID($arFields["CURRENCY"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["CURRENCY"], GetMessage("SKGO_WRONG_CURRENCY")), "ERROR_NO_CURRENCY");
return false;
}
}
if (is_set($arFields, "LID"))
{
$dbSite = CSite::GetByID($arFields["LID"]);
if (!$dbSite->Fetch())
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["LID"], GetMessage("SKGO_WRONG_SITE")), "ERROR_NO_SITE");
return false;
}
}
if (is_set($arFields, "USER_ID"))
{
$dbUser = CUser::GetByID($arFields["USER_ID"]);
if (!$dbUser->Fetch())
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["USER_ID"], GetMessage("SKGO_WRONG_USER")), "ERROR_NO_USER_ID");
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID"))
{
//.........这里部分代码省略.........