当前位置: 首页>>代码示例>>PHP>>正文


PHP CCurrency::Update方法代码示例

本文整理汇总了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;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:21,代码来源:crm_currency.php

示例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'];
        }
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:currencies.php

示例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);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:currency_edit.php


注:本文中的CCurrency::Update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。