當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。