unset($countQuery); $totalCount = (int) $totalCount['CNT']; if ($totalCount > 0) { $totalPages = ceil($totalCount / $navyParams['SIZEN']); if ($navyParams['PAGEN'] > $totalPages) { $navyParams['PAGEN'] = $totalPages; } $getListParams['limit'] = $navyParams['SIZEN']; $getListParams['offset'] = $navyParams['SIZEN'] * ($navyParams['PAGEN'] - 1); } else { $navyParams['PAGEN'] = 1; $getListParams['limit'] = $navyParams['SIZEN']; $getListParams['offset'] = 0; } } $couponIterator = new CAdminSubResult(Internals\DiscountCouponTable::getList($getListParams), $adminListTableID, $adminList->GetListUrl(true)); if ($usePageNavigation) { $couponIterator->NavStart($getListParams['limit'], $navyParams['SHOW_ALL'], $navyParams['PAGEN']); $couponIterator->NavRecordCount = $totalCount; $couponIterator->NavPageCount = $totalPages; $couponIterator->NavPageNomer = $navyParams['PAGEN']; } else { $couponIterator->NavStart(); } $adminList->NavText($couponIterator->GetNavPrint(Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_NAV'))); while ($coupon = $couponIterator->Fetch()) { $coupon['ID'] = (int) $coupon['ID']; $coupon['MAX_USE'] = (int) $coupon['MAX_USE']; $coupon['USE_COUNT'] = (int) $coupon['USE_COUNT']; if ($selectFieldsMap['CREATED_BY']) { $coupon['CREATED_BY'] = (int) $coupon['CREATED_BY'];
$arFilter, false, // Array("nPageSize"=>CAdminResult::GetNavSize($sTableID)), false, $arSelectedFields ); $rsData->SetTableID($sTableID); $wf_status_id = false; } */ if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "excel") { $arNavParams = false; } else { $arNavParams = array("nPageSize" => CAdminSubResult::GetNavSize($sTableID, 20, $lAdmin->GetListUrl(true))); } $rsData = CIBlockElement::GetList(array($by => $order), $arFilter, false, $arNavParams, $arSelectedFields); $rsData = new CAdminSubResult($rsData, $sTableID, $lAdmin->GetListUrl(true)); $wf_status_id = false; $rsData->NavStart(); $lAdmin->NavText($rsData->GetNavPrint(htmlspecialcharsbx($arSubIBlock["ELEMENTS_NAME"]))); function GetElementName($ID) { $ID = intval($ID); static $cache = array(); if (!array_key_exists($ID, $cache)) { $rsElement = CIBlockElement::GetList(array(), array("ID" => $ID, "SHOW_HISTORY" => "Y"), false, false, array("ID", "IBLOCK_ID", "NAME")); $cache[$ID] = $rsElement->GetNext(); } return $cache[$ID]; } function GetIBlockTypeID($intSubIBlockID) {
$arSelectFields[] = 'ID'; } $arSelectFields = array_values($arSelectFields); $arSelectFieldsMap = array_fill_keys($arSelectFields, true); $arCouponType = CCatalogDiscountCoupon::GetCoupontTypes(true); $arUserList = array(); $arUserID = array(); $strNameFormat = CSite::GetNameFormat(true); if (!(false == B_ADMIN_SUBCOUPONS_LIST && $bCopy)) { if (array_key_exists("mode", $_REQUEST) && $_REQUEST["mode"] == "excel") { $arNavParams = false; } else { $arNavParams = array("nPageSize" => CAdminSubResult::GetNavSize($sTableID, 20, $lAdmin->GetListUrl(true))); } $dbResultList = CCatalogDiscountCoupon::GetList(array($by => $order), $arFilter, false, $arNavParams, $arSelectFields); $dbResultList = new CAdminSubResult($dbResultList, $sTableID, $lAdmin->GetListUrl(true)); $dbResultList->NavStart(); $lAdmin->NavText($dbResultList->GetNavPrint(htmlspecialcharsbx(GetMessage("DSC_NAV")))); $arRows = array(); while ($arCouponDiscount = $dbResultList->Fetch()) { $edit_url = '/bitrix/admin/cat_subcoupon_edit.php?ID=' . $arCouponDiscount['ID'] . '&DISCOUNT_ID=' . $intDiscountID . '&lang=' . LANGUAGE_ID . '&TMP_ID=' . $strSubTMP_ID; $arCouponDiscount['ID'] = intval($arCouponDiscount['ID']); if (array_key_exists('CREATED_BY', $arSelectFieldsMap)) { $arCouponDiscount['CREATED_BY'] = intval($arCouponDiscount['CREATED_BY']); if (0 < $arCouponDiscount['CREATED_BY']) { $arUserID[$arCouponDiscount['CREATED_BY']] = true; } } if (array_key_exists('MODIFIED_BY', $arSelectFieldsMap)) { $arCouponDiscount['MODIFIED_BY'] = intval($arCouponDiscount['MODIFIED_BY']); if (0 < $arCouponDiscount['MODIFIED_BY']) {
if (!(false == B_ADMIN_SUBCOUPONS_LIST && $bCopy)) { $arNavParams = (isset($_REQUEST['mode']) && 'excel' == $_REQUEST["mode"] ? false : array("nPageSize" => CAdminSubResult::GetNavSize($sTableID, 20, $lAdmin->GetListUrl(true))) ); $dbResultList = CCatalogDiscountCoupon::GetList( array($by => $order), $arFilter, false, $arNavParams, $arSelectFields ); $dbResultList = new CAdminSubResult($dbResultList, $sTableID, $lAdmin->GetListUrl(true)); $dbResultList->NavStart(); $lAdmin->NavText($dbResultList->GetNavPrint(htmlspecialcharsbx(GetMessage("DSC_NAV")))); $arRows = array(); while ($arCouponDiscount = $dbResultList->Fetch()) { $edit_url = '/bitrix/admin/cat_subcoupon_edit.php?ID='.$arCouponDiscount['ID'].'&DISCOUNT_ID='.$intDiscountID.'&lang='.LANGUAGE_ID.'&TMP_ID='.$strSubTMP_ID; $arCouponDiscount['ID'] = (int)$arCouponDiscount['ID']; if ($arSelectFieldsMap['CREATED_BY']) { $arCouponDiscount['CREATED_BY'] = (int)$arCouponDiscount['CREATED_BY']; if (0 < $arCouponDiscount['CREATED_BY']) $arUserID[$arCouponDiscount['CREATED_BY']] = true;
{ $totalPages = ceil($totalCount/$navyParams['SIZEN']); if ($navyParams['PAGEN'] > $totalPages) $navyParams['PAGEN'] = $totalPages; $getListParams['limit'] = $navyParams['SIZEN']; $getListParams['offset'] = $navyParams['SIZEN']*($navyParams['PAGEN']-1); } else { $navyParams['PAGEN'] = 1; $getListParams['limit'] = $navyParams['SIZEN']; $getListParams['offset'] = 0; } } $couponIterator = new CAdminSubResult(Internals\DiscountCouponTable::getList($getListParams), $adminListTableID, $adminList->GetListUrl(true)); if ($usePageNavigation) { $couponIterator->NavStart($getListParams['limit'], $navyParams['SHOW_ALL'], $navyParams['PAGEN']); $couponIterator->NavRecordCount = $totalCount; $couponIterator->NavPageCount = $totalPages; $couponIterator->NavPageNomer = $navyParams['PAGEN']; } else { $couponIterator->NavStart(); } $adminList->NavText($couponIterator->GetNavPrint(Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_NAV'))); while ($coupon = $couponIterator->Fetch()) {
function NavStart($nPageSize = 20, $bShowAll = true, $iNumPage = false) { $nSize = CAdminSubResult::GetNavSize($this->table_id, $nPageSize, $this->list_url . ('' != $this->list_url_params ? '?' . $this->list_url_params : '')); if (!is_array($nPageSize)) { $nPageSize = array(); } $nPageSize["nPageSize"] = $nSize; if ($_REQUEST["mode"] == "excel") { $nPageSize["NavShowAll"] = true; } $this->nInitialSize = $nPageSize["nPageSize"]; parent::NavStart($nPageSize, $bShowAll, $iNumPage); }