Example #1
0
}
if ($CURRENCY_RIGHT == "W" && ($arID = $lAdmin->GroupAction())) {
    if ($_REQUEST['action_target'] == 'selected') {
        $rsData = CCurrency::GetList($by, $order);
        while ($arRes = $rsData->Fetch()) {
            $arID[] = $arRes['ID'];
        }
    }
    foreach ($arID as $ID) {
        if (strlen($ID) <= 0) {
            continue;
        }
        switch ($_REQUEST['action']) {
            case "delete":
                if ($CURRENCY_RIGHT == "W") {
                    if (!CCurrency::Delete($ID)) {
                        if ($ex = $APPLICATION->GetException()) {
                            $lAdmin->AddGroupError($ex->GetString(), $ID);
                        } else {
                            $lAdmin->AddGroupError(GetMessage("currency_err1"), $ID);
                        }
                    }
                }
                break;
        }
    }
}
$rsData = CCurrency::GetList($by, $order);
$rsData = new CAdminResult($rsData, $sTableID);
$rsData->NavStart();
$lAdmin->NavText($rsData->GetNavPrint(GetMessage("CURRENCY_TITLE")));
Example #2
0
 public static function Delete($ID)
 {
     if (!CModule::IncludeModule('currency')) {
         self::$LAST_ERROR = GetMessage('CRM_CURRERCY_MODULE_IS_NOT_INSTALLED');
         return false;
     }
     IncludeModuleLangFile(__FILE__);
     global $APPLICATION;
     $ID = strval($ID);
     if (strlen($ID) !== 3) {
         //Invalid ID is supplied. Are you A.Krasichkov?
         //self::$LAST_ERROR = GetMessage('CRM_CURRERCY_MODULE_INVALID_ID');
         return false;
     }
     if ($ID === self::GetBaseCurrencyID()) {
         self::$LAST_ERROR = GetMessage('CRM_CURRERCY_ERR_DELETION_OF_BASE_CURRENCY');
         return false;
     }
     if ($ID === self::GetAccountCurrencyID()) {
         self::$LAST_ERROR = GetMessage('CRM_CURRERCY_ERR_DELETION_OF_ACCOUNTING_CURRENCY');
         return false;
     }
     if (!CCurrency::Delete($ID)) {
         $ex = $APPLICATION->GetException();
         if ($ex) {
             self::$LAST_ERROR = $ex->GetString();
         }
         return false;
     }
     self::ClearCache();
     return true;
 }