當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CSaleLang::Update方法代碼示例

本文整理匯總了PHP中CSaleLang::Update方法的典型用法代碼示例。如果您正苦於以下問題:PHP CSaleLang::Update方法的具體用法?PHP CSaleLang::Update怎麽用?PHP CSaleLang::Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CSaleLang的用法示例。


在下文中一共展示了CSaleLang::Update方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: OnPostForm

 function OnPostForm()
 {
     $wizard =& $this->GetWizard();
     if ($wizard->IsNextButtonClick()) {
         $arResult = $wizard->GetVars(true);
         COption::SetOptionString("sale", "order_email", $arResult["orderEmail"]);
         COption::SetOptionString("sale", "delete_after", $arResult["saveBasket"]);
         COption::SetOptionString("sale", "default_currency", $arResult["currencyID"]);
         $arFields["LID"] = $arResult["siteID"];
         $arFields["CURRENCY"] = $arResult["currencyID"];
         CSaleLang::Update($arResult["siteID"], array("LID" => $arResult["siteID"], "CURRENCY" => $arResult["currencyID"]));
         CSaleGroupAccessToSite::DeleteBySite($arResult["siteID"]);
         foreach ($arResult["groupID"] as $v) {
             CSaleGroupAccessToSite::Add(array("SITE_ID" => $arResult["siteID"], "GROUP_ID" => $v));
         }
         if (!empty($arResult["1C_GROUP_PERMISSIONS"])) {
             COption::SetOptionString("catalog", "1C_GROUP_PERMISSIONS", implode(",", $arResult["1C_GROUP_PERMISSIONS"]));
         }
         COption::SetOptionString("catalog", "1C_ELEMENT_ACTION", $arResult["1C_ELEMENT_ACTION"]);
         COption::SetOptionString("catalog", "1C_SECTION_ACTION", $arResult["1C_SECTION_ACTION"]);
         COption::SetOptionString("catalog", "1C_INTERVAL", $arResult["1C_INTERVAL"]);
         COption::SetOptionString("catalog", "1C_FILE_SIZE_LIMIT", $arResult["1C_FILE_SIZE_LIMIT"]);
         COption::SetOptionString("catalog", "1C_SITE_LIST", $arResult["siteID"]);
         if (!empty($arResult["1C_GROUP_PERMISSIONS"])) {
             COption::SetOptionString("sale", "1C_SALE_GROUP_PERMISSIONS", implode(",", $arResult["1C_GROUP_PERMISSIONS"]));
         }
         COption::SetOptionString("sale", "1C_EXPORT_PAYED_ORDERS", $arResult["1C_EXPORT_PAYED_ORDERS"]);
         COption::SetOptionString("sale", "1C_EXPORT_ALLOW_DELIVERY_ORDERS", $arResult["1C_EXPORT_ALLOW_DELIVERY_ORDERS"]);
         COption::SetOptionString("sale", "1C_EXPORT_FINAL_ORDERS", $arResult["1C_EXPORT_FINAL_ORDERS"]);
         COption::SetOptionString("sale", "1C_FINAL_STATUS_ON_DELIVERY", $arResult["1C_FINAL_STATUS_ON_DELIVERY"]);
         COption::SetOptionString("sale", "1C_SALE_SITE_LIST", $arResult["siteID"]);
         foreach ($arResult["groupID"] as $v) {
             $perm = $GLOBALS["APPLICATION"]->GetGroupRight("sale", $v);
             if ($perm != "W") {
                 $GLOBALS["APPLICATION"]->SetGroupRight("sale", $v, "U");
             }
         }
         $dbStatus = CSaleStatus::GetList(array("SORT" => "ASC"), array("LID" => $arResult["siteID"]), false, false, array("ID", "LID", "SORT"));
         while ($arStatus = $dbStatus->Fetch()) {
             $arPerms = array();
             foreach ($arResult["groupID"] as $v) {
                 $arPerms[] = array("GROUP_ID" => $v, "PERM_VIEW" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_DELETE"] == "Y" || $arResult["perm"][$arStatus["ID"]][$v]["PERM_UPDATE"] == "Y" || $arResult["perm"][$arStatus["ID"]][$v]["PERM_PAYMENT"] == "Y" || $arResult["perm"][$arStatus["ID"]][$v]["PERM_DELIVERY"] == "Y" || $arResult["perm"][$arStatus["ID"]][$v]["PERM_CANCEL"] == "Y" ? "Y" : $arResult["perm"][$arStatus["ID"]][$v]["PERM_VIEW"], "PERM_CANCEL" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_CANCEL"], "PERM_MARK" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_MARK"], "PERM_DEDUCTION" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_DEDUCTION"], "PERM_DELIVERY" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_DELIVERY"], "PERM_PAYMENT" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_PAYMENT"], "PERM_STATUS" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_STATUS"], "PERM_STATUS_FROM" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_STATUS_FROM"], "PERM_UPDATE" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_UPDATE"], "PERM_DELETE" => $arResult["perm"][$arStatus["ID"]][$v]["PERM_DELETE"]);
             }
             CSaleStatus::Update($arStatus["ID"], array("PERMS" => $arPerms, "SORT" => $arStatus["SORT"]));
         }
         $paySystemID = array();
         $paySystem = array();
         foreach ($arResult["paySystem"] as $pType => $pSystem) {
             if (!empty($pSystem)) {
                 foreach ($pSystem as $v) {
                     $paySystem[$v][] = $pType;
                     if (!in_array($v, $paySystemID)) {
                         $paySystemID[] = $v;
                     }
                 }
             }
         }
         $dbPaySys = CSalePaySystem::GetList(array(), array("ACTIVE" => "Y"), false, false, array("ID", "ACTIVE"));
         while ($arPaySys = $dbPaySys->Fetch()) {
             if (!in_array($arPaySys["ID"], $paySystemID)) {
                 CSalePaySystem::Update($arPaySys["ID"], array("ACTIVE" => "N"));
             }
         }
         foreach ($paySystem as $pID => $value) {
             $dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $pID));
             while ($arPaySysAction = $dbPaySysAction->Fetch()) {
                 if (!in_array($arPaySysAction["PERSON_TYPE_ID"], $value)) {
                     CSalePaySystemAction::Delete($arPaySysAction["ID"]);
                 }
             }
         }
         function LocalGetPSActionParams($fileName)
         {
             $arPSCorrespondence = array();
             if (file_exists($fileName) && is_file($fileName)) {
                 include $fileName;
             }
             return $arPSCorrespondence;
         }
         foreach ($paySystem as $pID => $value) {
             foreach ($value as $personID) {
                 $arFields = array();
                 $arPaySysAction = "";
                 $dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $pID, "PERSON_TYPE_ID" => $personID));
                 if ($arPaySysAction = $dbPaySysAction->Fetch()) {
                     $pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysAction["ACTION_FILE"];
                 } else {
                     $dbPaySysAction = CSalePaySystemAction::GetList(array(), array("PAY_SYSTEM_ID" => $pID));
                     if ($arPaySysActionTmp = $dbPaySysAction->Fetch()) {
                         $pathToAction = $_SERVER["DOCUMENT_ROOT"] . $arPaySysActionTmp["ACTION_FILE"];
                     }
                 }
                 if (strlen($pathToAction) > 0) {
                     $arPSCorrespondence = LocalGetPSActionParams($pathToAction . "/.description.php");
                     $arParams = array();
                     foreach ($arPSCorrespondence as $k => $v) {
                         $typeTmp = $arResult[$pID . "_" . $k . "_" . $personID];
                         $valueTmp = $arResult["VALUE1_" . $pID . "_" . $k . "_" . $personID];
                         if (strlen($valueTmp) <= 0) {
                             $valueTmp = $arResult["VALUE2_" . $pID . "_" . $k . "_" . $personID];
//.........這裏部分代碼省略.........
開發者ID:Satariall,項目名稱:izurit,代碼行數:101,代碼來源:wizard.php

示例2: foreach

 }
 COption::SetOptionString("sale", "p2p_del_period", $p2p_del_period);
 if (intval($p2p_del_exp) <= 0) {
     $p2p_del_exp = 10;
 }
 COption::SetOptionString("sale", "p2p_del_exp", $p2p_del_exp);
 CAgent::AddAgent("Bitrix\\Sale\\Product2ProductTable::deleteOldProducts({$p2p_del_exp});", "sale", "N", 24 * 3600 * $p2p_del_period, "", "Y");
 foreach ($siteList as &$oneSite) {
     $valCurrency = trim(${"CURRENCY_" . $oneSite['ID']});
     if ($valCurrency == '') {
         $valCurrency = false;
     }
     $arFields = array('LID' => $oneSite['ID'], 'CURRENCY' => $valCurrency);
     if ($arRes = CSaleLang::GetByID($oneSite['ID'])) {
         if ($valCurrency !== false) {
             CSaleLang::Update($oneSite['ID'], $arFields);
         } else {
             CSaleLang::Delete($oneSite['ID']);
         }
     } else {
         if ($valCurrency !== false) {
             CSaleLang::Add($arFields);
         }
     }
     CSaleGroupAccessToSite::DeleteBySite($oneSite['ID']);
     if (isset(${"SITE_USER_GROUPS_" . $oneSite['ID']}) && is_array(${"SITE_USER_GROUPS_" . $oneSite['ID']})) {
         for ($i = 0, $intCount = count(${"SITE_USER_GROUPS_" . $oneSite['ID']}); $i < $intCount; $i++) {
             $groupID = intval(${"SITE_USER_GROUPS_" . $oneSite['ID']}[$i]);
             if ($groupID > 0) {
                 CSaleGroupAccessToSite::Add(array("SITE_ID" => $oneSite['ID'], "GROUP_ID" => $groupID));
             }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:options.php

示例3: array

		$shopNS = $wizard->GetVar("shopNS");
		COption::SetOptionString("eshop", "shopNS", $shopNS, false, WIZARD_SITE_ID);
		$shopBANK = $wizard->GetVar("shopBANK");
		COption::SetOptionString("eshop", "shopBANK", $shopBANK, false, WIZARD_SITE_ID);
		$shopBANKREKV = $wizard->GetVar("shopBANKREKV");
		COption::SetOptionString("eshop", "shopBANKREKV", $shopBANKREKV, false, WIZARD_SITE_ID);
		$shopKS = $wizard->GetVar("shopKS");
		COption::SetOptionString("eshop", "shopKS", $shopKS, false, WIZARD_SITE_ID);
		$siteStamp = $wizard->GetVar("siteStamp");
		if ($siteStamp == "" )
			$siteStamp = COption::GetOptionString("eshop", "siteStamp", "", WIZARD_SITE_ID);
	}
	elseif ($shopLocalization == "ua")
	{
		if (CSaleLang::GetByID(WIZARD_SITE_ID))
			CSaleLang::Update(WIZARD_SITE_ID, array("LID" => WIZARD_SITE_ID, "CURRENCY" => "UAH"));
		else
			CSaleLang::Add(array("LID" => WIZARD_SITE_ID, "CURRENCY" => "UAH"));

		$shopLocation = $wizard->GetVar("shopLocation_ua");
		COption::SetOptionString("eshop", "shopLocation_ua", $shopLocation, false, WIZARD_SITE_ID);
		$shopOfName = $wizard->GetVar("shopOfName_ua");
		COption::SetOptionString("eshop", "shopOfName_ua", $shopOfName, false, WIZARD_SITE_ID);
		$shopAdr = $wizard->GetVar("shopAdr_ua");
		COption::SetOptionString("eshop", "shopAdr_ua", $shopAdr, false, WIZARD_SITE_ID);

		$shopEGRPU_ua = $wizard->GetVar("shopEGRPU_ua");
		COption::SetOptionString("eshop", "shopEGRPU_ua", $shopEGRPU_ua, false, WIZARD_SITE_ID);
		$shopINN_ua = $wizard->GetVar("shopINN_ua");
		COption::SetOptionString("eshop", "shopINN_ua", $shopINN_ua, false, WIZARD_SITE_ID);
		$shopNDS_ua = $wizard->GetVar("shopNDS_ua");
開發者ID:ASDAFF,項目名稱:entask.ru,代碼行數:31,代碼來源:step1.php

示例4: Trim

			}
		}

		$db_result_lang = CLang::GetList(($by1="sort"), ($order1="asc"));
		while ($db_result_lang_array = $db_result_lang->Fetch())
		{
			$valCurrency = Trim(${"CURRENCY_".$db_result_lang_array["LID"]});
			UnSet($arFields);
			$arFields["LID"] = $db_result_lang_array["LID"];
			if (strlen($valCurrency)<=0) $valCurrency = false;
			$arFields["CURRENCY"] = $valCurrency;
			if ($arRes = CSaleLang::GetByID($db_result_lang_array["LID"]))
			{
				if ($valCurrency!==false)
				{
					CSaleLang::Update($db_result_lang_array["LID"], $arFields);
				}
				else
				{
					CSaleLang::Delete($db_result_lang_array["LID"]);
				}
			}
			else
			{
				if ($valCurrency!==false)
				{
					CSaleLang::Add($arFields);
				}
			}

			CSaleGroupAccessToSite::DeleteBySite($db_result_lang_array["LID"]);
開發者ID:ASDAFF,項目名稱:bxApiDocs,代碼行數:31,代碼來源:options.php


注:本文中的CSaleLang::Update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。