} if (!isset($_GET['AJAX_CALL'])) { LocalRedirect($bInternal ? '?' . $arParams['FORM_ID'] . '_active_tab=tab_product' : ''); } } $gridOptions = new CCrmGridOptions($arResult['GRID_ID']); $gridSorting = $gridOptions->GetSorting(array('sort' => array('NAME' => 'asc'), 'vars' => array('by' => 'by', 'order' => 'order'))); $sort = $arResult['SORT'] = $gridSorting['sort']; $arResult['SORT_VARS'] = $gridSorting['vars']; $arLangs = array(); $dbLangsList = CSite::GetList($b = "sort", $o = "asc"); while ($arLang = $dbLangsList->Fetch()) { $arLangs[$arLang["LID"]] = "[" . $arLang["LID"] . "] " . $arLang["NAME"]; } $taxies = array(); $allTaxies = CCrmTax::GetAll(); foreach ($allTaxies as $k => $v) { $tax = array(); $tax['ID'] = $tax['~ID'] = $k; // Key is Currency ID $tax['TIMESTAMP_X'] = $tax['~TIMESTAMP_X'] = CCrmComponentHelper::TrimDateTimeString(FormatDate('FULL', MakeTimeStamp($v['TIMESTAMP_X']))); $tax['LID'] = $arLangs[$v['LID']]; $tax['NAME'] = $v['NAME']; $tax['CODE'] = $v['CODE']; $tax['PATH_TO_TAX_SHOW'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_TAX_SHOW'], array('tax_id' => $k)); $tax['PATH_TO_TAX_EDIT'] = CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_TAX_EDIT'], array('tax_id' => $k)); $tax['PATH_TO_TAX_SHOW_RATES'] = CHTTP::urlAddParams($tax['PATH_TO_TAX_EDIT'], array("FORM_ID" => $arResult['EDIT_FORM_ID'], $arResult['EDIT_FORM_ID'] . "_active_tab" => 'tab_rateslist')); $tax['PATH_TO_TAX_DELETE'] = CHTTP::urlAddParams(CComponentEngine::MakePathFromTemplate($arParams['PATH_TO_TAX_LIST'], array('tax_id' => $k)), array('action_' . $arResult['GRID_ID'] => 'delete', 'ID' => $k, 'sessid' => bitrix_sessid())); $rateNum = 0; $dbRes = CSaleTaxRate::GetList(array(), array("TAX_ID" => $tax['ID'])); while ($dbRes->Fetch()) {