} $arCatExtra = array(); $db_extras = CExtra::GetList($by3 = "NAME", $order3 = "ASC"); while ($extras = $db_extras->Fetch()) { $arCatExtra[] = $extras; } } if ($boolSubBizproc) { $arWorkflowTemplates = CBPDocument::GetWorkflowTemplatesForDocumentType(array("iblock", "CIBlockDocument", "iblock_" . $intSubIBlockID)); foreach ($arWorkflowTemplates as $arTemplate) { $arHeader[] = array("id" => "WF_" . $arTemplate["ID"], "content" => $arTemplate["NAME"]); } $arHeader[] = array("id" => "BIZPROC", "content" => GetMessage("IBEL_A_BP_H")); $arHeader[] = array("id" => "BP_PUBLISHED", "content" => GetMessage("IBLOCK_FIELD_BP_PUBLISHED"), "sort" => "status", "default" => true); } $lAdmin->AddHeaders($arHeader); $arSelectedFields = $lAdmin->GetVisibleHeaderColumns(); $arSelectedProps = array(); foreach ($arProps as $i => $arProperty) { $k = array_search("PROPERTY_" . $arProperty['ID'], $arSelectedFields); if ($k !== false) { $arSelectedProps[] = $arProperty; if ($arProperty["PROPERTY_TYPE"] == "L") { $arSelect[$arProperty['ID']] = array(); $rs = CIBlockProperty::GetPropertyEnum($arProperty['ID']); while ($ar = $rs->GetNext()) { $arSelect[$arProperty['ID']][$ar["ID"]] = $ar["VALUE"]; } } elseif ($arProperty["PROPERTY_TYPE"] == "G") { $arSelect[$arProperty['ID']] = array(); $rs = CIBlockSection::GetTreeList(array("IBLOCK_ID" => $arProperty["LINK_IBLOCK_ID"]));
$headerList['ID'] = array('id' => 'ID', 'content' => 'ID', 'sort' => 'ID', 'default' => true); $headerList['COUPON'] = array('id' => 'COUPON', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_COUPON'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_COUPON'), 'sort' => 'COUPON', 'default' => true); $headerList['ACTIVE'] = array('id' => 'ACTIVE', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE'), 'sort' => 'ACTIVE', 'default' => true); $headerList['ACTIVE_FROM'] = array('id' => 'ACTIVE_FROM', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE_FROM'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE_FROM'), 'sort' => 'ACTIVE_FROM', 'default' => true); $headerList['ACTIVE_TO'] = array('id' => 'ACTIVE_TO', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE_TO'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE_TO'), 'sort' => 'ACTIVE_TO', 'default' => true); $headerList['TYPE'] = array('id' => 'TYPE', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_TYPE'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_TYPE'), 'sort' => 'TYPE', 'default' => true); $headerList['MAX_USE'] = array('id' => 'MAX_USE', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_MAX_USE'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_MAX_USE'), 'sort' => 'MAX_USE', 'default' => true); $headerList['USE_COUNT'] = array('id' => 'USE_COUNT', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_USE_COUNT'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_USE_COUNT'), 'sort' => 'USE_COUNT', 'default' => true); $headerList['USER_ID'] = array('id' => 'USER_ID', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_USER_ID'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_USER_ID'), 'sort' => 'USER_ID', 'default' => true); $headerList['DATE_APPLY'] = array('id' => 'DATE_APPLY', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DATE_APPLY'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DATE_APPLY'), 'sort' => 'DATE_APPLY', 'default' => true); $headerList['MODIFIED_BY'] = array('id' => 'MODIFIED_BY', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_MODIFIED_BY'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_MODIFIED_BY'), 'sort' => 'MODIFIED_BY', 'default' => true); $headerList['TIMESTAMP_X'] = array('id' => 'TIMESTAMP_X', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_TIMESTAMP_X'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_TIMESTAMP_X'), 'sort' => 'TIMESTAMP_X', 'default' => true); $headerList['CREATED_BY'] = array('id' => 'CREATED_BY', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_CREATED_BY'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_CREATED_BY'), 'sort' => 'CREATED_BY', 'default' => false); $headerList['DATE_CREATE'] = array('id' => 'DATE_CREATE', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DATE_CREATE'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DATE_CREATE'), 'sort' => 'DATE_CREATE', 'default' => false); $headerList['DESCRIPTION'] = array('id' => 'DESCRIPTION', 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DESCRIPTION'), 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DESCRIPTION'), 'default' => false); $adminList->AddHeaders($headerList); $selectFields = array_fill_keys($adminList->GetVisibleHeaderColumns(), true); $selectFields['ID'] = true; $selectFields['ACTIVE'] = true; $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 (!CCatalogDiscountCoupon::Update($ID, $arFields)) { if ($ex = $APPLICATION->GetException()) { $lAdmin->AddGroupError($ex->GetString(), $ID); } else { $lAdmin->AddGroupError(str_replace("#ID#", $ID, GetMessage("ERROR_UPDATE_DISCOUNT_CPN")), $ID); } } break; } } } $CAdminCalendar_ShowScript = ''; if (true == B_ADMIN_SUBCOUPONS_LIST) { $CAdminCalendar_ShowScript = CAdminCalendar::ShowScript(); } $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)));