Ejemplo n.º 1
0
     if (0 > $intSubIBlockID) {
         $intSubIBlockID = 0;
     }
     static $cache = array();
     if (!array_key_exists($intSubIBlockID, $cache)) {
         $rsIBlock = CIBlock::GetByID($intSubIBlockID);
         if (!($cache[$intSubIBlockID] = $rsIBlock->GetNext())) {
             $cache[$intSubIBlockID] = array("IBLOCK_TYPE_ID" => "");
         }
     }
     return $cache[$intSubIBlockID]["IBLOCK_TYPE_ID"];
 }
 $arRows = array();
 $boolSubSearch = CModule::IncludeModule('search');
 $boolOldOffers = false;
 while ($arRes = $rsData->NavNext(true, "f_")) {
     $arRes_orig = $arRes;
     // in workflow mode show latest changes
     if ($boolSubWorkFlow) {
         $LAST_ID = CIBlockElement::WF_GetLast($arRes['ID']);
         if ($LAST_ID != $arRes['ID']) {
             $rsData2 = CIBlockElement::GetList(array(), array("ID" => $LAST_ID, "SHOW_HISTORY" => "Y"), false, array("nTopCount" => 1), $arSelectedFields);
             if (isset($arCatGroup)) {
                 $arRes_tmp = array();
                 foreach ($arRes as $vv => $vval) {
                     if (substr($vv, 0, 8) == "CATALOG_") {
                         $arRes_tmp[$vv] = $arRes[$vv];
                     }
                 }
             }
             $arRes = $rsData2->NavNext(true, "f_");
Ejemplo n.º 2
0
$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)));
$arVisibleColumns = $lAdmin->GetVisibleHeaderColumns();
$arUserList = array();
$strNameFormat = CSite::GetNameFormat(true);
$arCouponType = array('Y' => GetMessage('DSC_COUPON_TYPE_ONE_TIME'), 'O' => GetMessage('DSC_COUPON_TYPE_ONE_ORDER'), 'N' => GetMessage('DSC_COUPON_TYPE_NO_LIMIT'));
if (!(false == B_ADMIN_SUBCOUPONS_LIST && $bCopy)) {
    if (isset($_REQUEST["mode"]) && $_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, $arVisibleColumns);
    $dbResultList = new CAdminSubResult($dbResultList, $sTableID, $lAdmin->GetListUrl(true));
    $dbResultList->NavStart();
    $lAdmin->NavText($dbResultList->GetNavPrint(htmlspecialcharsbx(GetMessage("DSC_NAV"))));
    while ($arCouponDiscount = $dbResultList->NavNext(true, "f_")) {
        $edit_url = '/bitrix/admin/cat_subcoupon_edit.php?ID=' . $arCouponDiscount['ID'] . '&DISCOUNT_ID=' . $intDiscountID . '&lang=' . LANGUAGE_ID . '&TMP_ID=' . $strSubTMP_ID;
        $row =& $lAdmin->AddRow($f_ID, $arCouponDiscount, $edit_url, '', true);
        $row->AddField("ID", $f_ID);
        $row->AddViewField("DISCOUNT_NAME", $f_DISCOUNT_NAME);
        $strCreatedBy = '';
        $strModifiedBy = '';
        $arCouponDiscount['CREATED_BY'] = intval($arCouponDiscount['CREATED_BY']);
        if (0 < $arCouponDiscount['CREATED_BY']) {
            if (!array_key_exists($arCouponDiscount['CREATED_BY'], $arUserList)) {
                $rsUsers = CUser::GetList($by2 = 'ID', $order2 = 'ASC', array('ID_EQUAL_EXACT' => $arCouponDiscount['CREATED_BY']), array('FIELDS' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME')));
                if ($arOneUser = $rsUsers->Fetch()) {
                    $arOneUser['ID'] = intval($arOneUser['ID']);
                    $arUserList[$arOneUser['ID']] = CUser::FormatName($strNameFormat, $arOneUser);
                }
            }