$selectFieldsMap = array_fill_keys(array_keys($headerList), false);
$selectFieldsMap = array_merge($selectFieldsMap, $selectFields);
$userList = array();
$userIDs = array();
$nameFormat = CSite::GetNameFormat(true);
$rowList = array();
$couponTypeList = array();
if ($selectFieldsMap['TYPE']) {
    $couponTypeList = Internals\DiscountCouponTable::getCouponTypes(true);
}
$usePageNavigation = true;
$navyParams = array();
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'excel') {
    $usePageNavigation = false;
} else {
    $navyParams = CDBResult::GetNavParams(CAdminResult::GetNavSize($adminListTableID, array('nPageSize' => 20, 'sNavID' => $adminList->GetListUrl(true))));
    if ($navyParams['SHOW_ALL']) {
        $usePageNavigation = false;
    } else {
        $navyParams['PAGEN'] = (int) $navyParams['PAGEN'];
        $navyParams['SIZEN'] = (int) $navyParams['SIZEN'];
    }
}
if ($selectFields['TYPE']) {
    $selectFields['USE_COUNT'] = true;
}
$selectFields = array_keys($selectFields);
$getListParams = array('select' => $selectFields, 'filter' => $filter, 'order' => array($by => $order));
if ($usePageNavigation) {
    $countQuery = new Main\Entity\Query(Internals\DiscountCouponTable::getEntity());
    $countQuery->addSelect(new Main\Entity\ExpressionField('CNT', 'COUNT(1)'));
Example #2
0
 	{
 		$rsData = CIBlockElement::GetList(
 			Array($by=>$order),
 			$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];
$lAdmin->AddHeaders(array(array("id" => "ID", "content" => "ID", "sort" => "ID", "default" => true), array("id" => "ACTIVE", "content" => GetMessage("DSC_CPN_ACTIVE"), "sort" => "ACTIVE", "default" => true), array("id" => "COUPON", "content" => GetMessage("DSC_CPN_CPN"), "sort" => "COUPON", "default" => true), array("id" => "DATE_APPLY", "content" => GetMessage("DSC_CPN_DATE"), "sort" => "DATE_APPLY", "default" => true), array("id" => "ONE_TIME", "content" => GetMessage("DSC_CPN_TIME2"), "sort" => "ONE_TIME", "default" => true), array("id" => "DESCRIPTION", "content" => GetMessage("DSC_CPN_DESCRIPTION"), "sort" => "", "default" => false), array("id" => "MODIFIED_BY", "content" => GetMessage('DSC_MODIFIED_BY'), "sort" => "MODIFIED_BY", "default" => true), array("id" => "TIMESTAMP_X", "content" => GetMessage('DSC_TIMESTAMP_X'), "sort" => "TIMESTAMP_X", "default" => true), array("id" => "CREATED_BY", "content" => GetMessage('DSC_CREATED_BY'), "sort" => "CREATED_BY", "default" => false), array("id" => "DATE_CREATE", "content" => GetMessage('DSC_DATE_CREATE'), "sort" => "DATE_CREATE", "default" => false)));
$arSelectFields = $lAdmin->GetVisibleHeaderColumns();
if (!in_array('ID', $arSelectFields)) {
    $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;
            }
        }
	{
		$rsData = CIBlockElement::GetList(
			Array($by=>$order),
			$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)
	$arSelectFields[] = 'ID';

$arSelectFields = array_values($arSelectFields);
$arSelectFieldsMap = array_merge($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))
{
	$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();
$rowList = array();

$couponTypeList = array();
if ($selectFieldsMap['TYPE'])
	$couponTypeList = Internals\DiscountCouponTable::getCouponTypes(true);

$usePageNavigation = true;
$navyParams = array();
if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'excel')
{
	$usePageNavigation = false;
}
else
{
	$navyParams = CDBResult::GetNavParams(CAdminResult::GetNavSize($adminListTableID, array('nPageSize' => 20, 'sNavID' => $adminList->GetListUrl(true))));
	if ($navyParams['SHOW_ALL'])
	{
		$usePageNavigation = false;
	}
	else
	{
		$navyParams['PAGEN'] = (int)$navyParams['PAGEN'];
		$navyParams['SIZEN'] = (int)$navyParams['SIZEN'];
	}
}
if ($selectFields['TYPE'])
	$selectFields['USE_COUNT'] = true;

$selectFields = array_keys($selectFields);