本文整理汇总了PHP中CCurrency::Update方法的典型用法代码示例。如果您正苦于以下问题:PHP CCurrency::Update方法的具体用法?PHP CCurrency::Update怎么用?PHP CCurrency::Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCurrency
的用法示例。
在下文中一共展示了CCurrency::Update方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Update
public static function Update($ID, $arFields)
{
if (!CModule::IncludeModule('currency')) {
self::$LAST_ERROR = GetMessage('CRM_CURRERCY_MODULE_IS_NOT_INSTALLED');
return false;
}
global $APPLICATION;
$arFields['CURRENCY'] = $ID;
if (!self::CheckFields('UPDATE', $arFields, $ID)) {
return false;
}
if (!CCurrency::Update($ID, $arFields)) {
$ex = $APPLICATION->GetException();
if ($ex) {
self::$LAST_ERROR = $ex->GetString();
}
return false;
}
self::ClearCache();
return true;
}
示例2: __IncludeLang
$CURRENCY_RIGHT = $APPLICATION->GetGroupRight("currency");
if ($CURRENCY_RIGHT == "D") {
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
__IncludeLang(GetLangFileName($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/currency/lang/", "/currencies.php"));
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/currency/prolog.php";
$sTableID = "t_currencies";
$oSort = new CAdminSorting($sTableID, "sort", "asc");
$lAdmin = new CAdminList($sTableID, $oSort);
if ($lAdmin->EditAction() && $CURRENCY_RIGHT == "W") {
foreach ($FIELDS as $ID => $arFields) {
$ID = substr($ID, 0, 3);
if (!$lAdmin->IsUpdated($ID)) {
continue;
}
if (!CCurrency::Update($ID, $arFields)) {
if ($ex = $APPLICATION->GetException()) {
$lAdmin->AddUpdateError(GetMessage("CURRENCY_SAVE_ERR", array("#ID#" => $ID, "#ERROR_TEXT#" => $ex->GetString())), $ID);
} else {
$lAdmin->AddUpdateError(GetMessage("CURRENCY_SAVE_ERR2", array("#ID#" => $ID)), $ID);
}
}
}
}
if ($CURRENCY_RIGHT == "W" && ($arID = $lAdmin->GroupAction())) {
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CCurrency::GetList($by, $order);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
示例3: array
if (!$ID && isset($_POST['CURRENCY'])) {
$arFields['CURRENCY'] = $_POST['CURRENCY'];
}
$strAction = $ID ? 'UPDATE' : 'ADD';
$langSettings = array();
foreach ($langID as &$oneLang) {
if (isset($_POST['LANG_' . $oneLang])) {
$langSettings[$oneLang] = $_POST['LANG_' . $oneLang];
}
}
unset($oneLang);
$arFields['LANG'] = $langSettings;
unset($langSettings);
$DB->StartTransaction();
if ($ID) {
$res = CCurrency::Update($ID, $arFields);
} else {
$ID = (string) CCurrency::Add($arFields);
$res = $ID !== '';
}
if (!$res) {
$DB->Rollback();
if ($ex = $APPLICATION->GetException()) {
$errorMessage[] = $ex->GetString();
} else {
$errorMessage[] = ($ID ? str_replace('#ID#', $ID, GetMessage('BT_CURRENCY_EDIT_ERR_UPDATE')) : GetMessage('BT_CURRENCY_EDIT_ERR_ADD')) . "<br>";
}
} else {
$DB->Commit();
if (empty($_POST['apply'])) {
LocalRedirect('/bitrix/admin/currencies.php?lang=' . LANGUAGE_ID);