本文整理匯總了PHP中CCurrencyLang::Update方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCurrencyLang::Update方法的具體用法?PHP CCurrencyLang::Update怎麽用?PHP CCurrencyLang::Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCurrencyLang
的用法示例。
在下文中一共展示了CCurrencyLang::Update方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Array
WizardServices::IncludeServiceLang("step1.php", $langID);
$arFields["LANG"][] = Array("LID" => $langID, "NAME" => GetMessage("WIZ_SALE_STATUS_P"), "DESCRIPTION" => GetMessage("WIZ_SALE_STATUS_DESCRIPTION_P"));
}
CSaleStatus::Add($arFields);
}
if(CModule::IncludeModule("currency"))
{
$dbCur = CCurrency::GetList($by="currency", $o = "asc");
while($arCur = $dbCur->Fetch())
{
if($lang == "ru")
CCurrencyLang::Update($arCur["CURRENCY"], $lang, Array("DECIMALS" => 0));
elseif($arCur["CURRENCY"] == "EUR")
CCurrencyLang::Update($arCur["CURRENCY"], $lang, Array("DECIMALS" => 2, "FORMAT_STRING" => "€#"));
}
}
WizardServices::IncludeServiceLang("step1.php", $lang);
CModule::IncludeModule("catalog");
$dbVat = CCatalogVat::GetList(array(), Array("SITE_ID" => WIZARD_SITE_ID));
if(!($dbVat->Fetch()))
{
$arF = Array ("ACTIVE" => "Y", "SORT" => "100", "NAME" => GetMessage("WIZ_VAT_1"), "RATE" => 0);
CCatalogVat::Set($arF);
$arF = Array ("ACTIVE" => "Y", "SORT" => "200", "NAME" => GetMessage("WIZ_VAT_2"), "RATE" => GetMessage("WIZ_VAT_2_VALUE"));
CCatalogVat::Set($arF);
}
$dbResultList = CCatalogGroup::GetList(Array(), Array("CODE" => "BASE"));
if($arRes = $dbResultList->Fetch())
示例2: elseif
$param = 'THOUSANDS_SEP_' . $lid;
if (!isset($locFields['THOUSANDS_VARIANT']) && isset($_POST[$param])) {
$locFields['THOUSANDS_SEP'] = $_POST[$param];
}
if (count($locFields) == 0) {
continue;
}
if (!(isset($locFields['FULL_NAME']) && isset($locFields['FULL_NAME'][0]))) {
$locFields['FULL_NAME'] = $currencyID;
}
$currencyLocs[$k] = $locFields;
if ($result) {
$locFields['CURRENCY'] = $currencyID;
$locFields['LID'] = $k;
if (is_array(CCurrencyLang::GetByID($currencyID, $k))) {
CCurrencyLang::Update($currencyID, $k, $locFields);
} else {
$locFields['DECIMALS'] = 2;
//Default decimals
CCurrencyLang::Add($locFields);
}
}
}
if ($result) {
if ($currency['IS_ACCOUNTING_CURRENCY'] && $currencyID !== CCrmCurrency::GetAccountCurrencyID()) {
CCrmCurrency::SetAccountCurrencyID($currencyID);
} elseif (!$currency['IS_ACCOUNTING_CURRENCY'] && $currencyID === CCrmCurrency::GetAccountCurrencyID()) {
CCrmCurrency::SetAccountCurrencyID(CCrmCurrency::GetBaseCurrencyID());
}
if ($currency['IS_INVOICE_CURRENCY'] && $currencyID !== CCrmCurrency::getInvoiceDefault()) {
CCrmCurrency::setInvoiceDefault($currencyID);
示例3: SetCurrencyLocalizations
public static function SetCurrencyLocalizations($currencyID, $arItems)
{
if (!CModule::IncludeModule('currency')) {
return false;
}
$currencyID = self::NormalizeCurrencyID($currencyID);
$langsID = self::GetLanguagesID();
$allowedKeys = array_keys(self::GetCurrencyLocalizationFieldsInfo());
$processed = 0;
foreach ($langsID as $langID) {
$item = isset($arItems[$langID]) ? $arItems[$langID] : null;
if (!is_array($item)) {
continue;
}
$fields = array();
foreach ($allowedKeys as $key) {
if (isset($item[$key])) {
$fields[$key] = $item[$key];
}
}
if (empty($fields)) {
continue;
}
$fields['CURRENCY'] = $currencyID;
$fields['LID'] = $langID;
if (is_array(CCurrencyLang::GetByID($currencyID, $langID))) {
CCurrencyLang::Update($currencyID, $langID, $fields);
$processed++;
} else {
if (!isset($fields['DECIMALS'])) {
$fields['DECIMALS'] = 2;
}
CCurrencyLang::Add($fields);
$processed++;
}
}
return $processed > 0;
}
示例4: Update
public static function Update($currency, $arFields)
{
global $DB;
foreach (GetModuleEvents("currency", "OnBeforeCurrencyUpdate", true) as $arEvent) {
if (ExecuteModuleEventEx($arEvent, array($currency, &$arFields)) === false) {
return false;
}
}
$currency = Currency\CurrencyManager::checkCurrencyID($currency);
if (!CCurrency::CheckFields('UPDATE', $arFields, $currency)) {
return false;
}
$strUpdate = $DB->PrepareUpdate("b_catalog_currency", $arFields);
if (!empty($strUpdate)) {
$strSql = "update b_catalog_currency set " . $strUpdate . " where CURRENCY = '" . $DB->ForSql($currency) . "'";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
Currency\CurrencyManager::updateBaseRates($currency);
Currency\CurrencyManager::clearTagCache($currency);
if (isset(self::$currencyCache[$currency])) {
unset(self::$currencyCache[$currency]);
}
}
if (isset($arFields['LANG'])) {
foreach ($arFields['LANG'] as $lang => $settings) {
if ($settings['IS_EXIST'] == 'N') {
CCurrencyLang::Add($settings);
} else {
CCurrencyLang::Update($currency, $lang, $settings);
}
}
unset($settings, $lang);
}
if (!empty($strUpdate) || isset($arFields['LANG'])) {
Currency\CurrencyManager::clearCurrencyCache();
}
foreach (GetModuleEvents("currency", "OnCurrencyUpdate", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($currency, $arFields));
}
return $currency;
}
示例5: IntVal
$arFields["DEC_POINT"] = ${"DEC_POINT_".$arLangsLID[$i]};
$arFields["THOUSANDS_SEP"] = ${"THOUSANDS_SEP_".$arLangsLID[$i]};
$arFields["THOUSANDS_VARIANT"] = ${"THOUSANDS_VARIANT_".$arLangsLID[$i]};
$arFields["DECIMALS"] = IntVal(${"DECIMALS_".$arLangsLID[$i]});
$arFields["CURRENCY"] = $ID /*$arFields["CURRENCY"]*/;
$arFields["LID"] = $arLangsLID[$i];
if(strlen($arFields["THOUSANDS_VARIANT"]) > 0)
$arFields["THOUSANDS_SEP"] = false;
else
$arFields["THOUSANDS_VARIANT"] = false;
if (strlen($ID) > 0)
{
$db_result_lang = CCurrencyLang::GetByID($ID, $arLangsLID[$i]);
if ($db_result_lang)
CCurrencyLang::Update($ID, $arLangsLID[$i], $arFields);
else
CCurrencyLang::Add($arFields);
}
else
{
CCurrencyLang::Add($arFields);
}
}
if(strlen($apply)<=0)
LocalRedirect("/bitrix/admin/trigger_list.php?lang=". LANG);
LocalRedirect("/bitrix/admin/trigger_edit.php?ID=".$ID."&lang=".LANG);
}
}
示例6: array
}
if (!$bStatusP) {
$arFields = array("ID" => "P", "SORT" => 150);
foreach ($arLanguages as $langID) {
WizardServices::IncludeServiceLang("step1.php", $langID);
$arFields["LANG"][] = array("LID" => $langID, "NAME" => GetMessage("WIZ_SALE_STATUS_P"), "DESCRIPTION" => GetMessage("WIZ_SALE_STATUS_DESCRIPTION_P"));
}
CSaleStatus::Add($arFields);
}
if (CModule::IncludeModule("currency")) {
$dbCur = CCurrency::GetList($by = "currency", $o = "asc");
while ($arCur = $dbCur->Fetch()) {
if ($lang == "ru") {
CCurrencyLang::Update($arCur["CURRENCY"], $lang, array("youstoreLS" => 2, "HIDE_ZERO" => "Y"));
} elseif ($arCur["CURRENCY"] == "EUR") {
CCurrencyLang::Update($arCur["CURRENCY"], $lang, array("youstoreLS" => 2, "FORMAT_STRING" => "€#"));
}
}
}
WizardServices::IncludeServiceLang("step1.php", $lang);
if (CModule::IncludeModule("catalog")) {
$dbVat = CCatalogVat::GetListEx(array(), array('RATE' => 0), false, false, array('ID', 'RATE'));
if (!$dbVat->Fetch()) {
$arF = array("ACTIVE" => "Y", "SORT" => "100", "NAME" => GetMessage("WIZ_VAT_1"), "RATE" => 0);
CCatalogVat::Add($arF);
}
$dbVat = CCatalogVat::GetListEx(array(), array('RATE' => GetMessage("WIZ_VAT_2_VALUE")), false, false, array('ID', 'RATE'));
if (!$dbVat->Fetch()) {
$arF = array("ACTIVE" => "Y", "SORT" => "200", "NAME" => GetMessage("WIZ_VAT_2"), "RATE" => GetMessage("WIZ_VAT_2_VALUE"));
CCatalogVat::Add($arF);
}