}
 }
 if ($selectFieldsMap['MODIFIED_BY']) {
     $coupon['MODIFIED_BY'] = (int) $coupon['MODIFIED_BY'];
     if ($coupon['MODIFIED_BY'] > 0) {
         $userIDs[$coupon['MODIFIED_BY']] = true;
     }
 }
 if ($selectFieldsMap['USER_ID']) {
     $coupon['USER_ID'] = (int) $coupon['USER_ID'];
     if ($coupon['USER_ID'] > 0) {
         $userIDs[$coupon['USER_ID']] = true;
     }
 }
 $urlEdit = '/bitrix/admin/sale_discount_coupon_edit.php?ID=' . $coupon['ID'] . '&DISCOUNT_ID=' . $discountID . '&lang=' . LANGUAGE_ID . '&bxpublic=Y';
 $rowList[$coupon['ID']] = $row =& $adminList->AddRow($coupon['ID'], $coupon, $urlEdit, Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_EDIT_COUPON'), true);
 $row->AddViewField('ID', $coupon['ID']);
 if ($selectFieldsMap['DATE_CREATE']) {
     $row->AddViewField('DATE_CREATE', $coupon['DATE_CREATE']);
 }
 if ($selectFieldsMap['TIMESTAMP_X']) {
     $row->AddViewField('TIMESTAMP_X', $coupon['TIMESTAMP_X']);
 }
 if ($selectFieldsMap['MAX_USE']) {
     $row->AddViewField('MAX_USE', $coupon['MAX_USE'] > 0 ? $coupon['MAX_USE'] : '');
 }
 if ($selectFieldsMap['USE_COUNT']) {
     $row->AddViewField('USE_COUNT', $coupon['USE_COUNT'] > 0 ? $coupon['USE_COUNT'] : '');
 }
 if ($selectFieldsMap['TYPE']) {
     $row->AddViewField('TYPE', $couponTypeList[$coupon['TYPE']]);
 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']) {
             $arUserID[$arCouponDiscount['MODIFIED_BY']] = true;
         }
     }
     $arRows[$arCouponDiscount['ID']] = $row =& $lAdmin->AddRow($arCouponDiscount['ID'], $arCouponDiscount, $edit_url, '', true);
     if (array_key_exists('DATE_CREATE', $arSelectFieldsMap)) {
         $row->AddViewField("DATE_CREATE", $arCouponDiscount['DATE_CREATE']);
     }
     if (array_key_exists('TIMESTAMP_X', $arSelectFieldsMap)) {
         $row->AddViewField("TIMESTAMP_X", $arCouponDiscount['TIMESTAMP_X']);
     }
     $row->AddField("ID", $arCouponDiscount['ID']);
     if (array_key_exists('DISCOUNT_NAME', $arSelectFieldsMap)) {
         $row->AddEditField("DISCOUNT_NAME", false);
     }
     if ($boolCouponsReadOnly) {
         if (array_key_exists('ACTIVE', $arSelectFieldsMap)) {
             $row->AddCheckField("ACTIVE", false);
         }
         if (array_key_exists('ACTIVE', $arSelectFieldsMap)) {
Exemple #3
0
         $f_ID = $arRes_orig["ID"];
     }
     $lockStatus = $arRes_orig['LOCK_STATUS'];
 } elseif ($boolSubBizproc) {
     $lockStatus = CIBlockDocument::IsDocumentLocked($f_ID, "") ? "red" : "green";
 } else {
     $lockStatus = "";
 }
 if (in_array("CATALOG_QUANTITY_TRACE", $arSelectedFields)) {
     $arRes['CATALOG_QUANTITY_TRACE'] = $arRes['CATALOG_QUANTITY_TRACE_ORIG'];
     $f_CATALOG_QUANTITY_TRACE = $f_CATALOG_QUANTITY_TRACE_ORIG;
 }
 $arRes['lockStatus'] = $lockStatus;
 $arRes["orig"] = $arRes_orig;
 $edit_url = '/bitrix/admin/iblock_subelement_edit.php?WF=Y&type=' . urlencode($strSubIBlockType) . '&IBLOCK_ID=' . $intSubIBlockID . '&lang=' . LANGUAGE_ID . '&PRODUCT_ID=' . $ID . '&ID=' . $arRes_orig['ID'] . '&TMP_ID=' . $strSubTMP_ID . $sThisSectionUrl;
 $arRows[$f_ID] = $row = $lAdmin->AddRow($f_ID, $arRes, $edit_url, GetMessage("IB_SE_L_EDIT_ELEMENT"), true);
 $boolEditPrice = false;
 $boolEditPrice = CIBlockElementRights::UserHasRightTo($intSubIBlockID, $f_ID, "element_edit_price");
 $row->AddViewField("ID", $f_ID);
 if ($f_LOCKED_USER_NAME) {
     $row->AddViewField("LOCKED_USER_NAME", '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $f_WF_LOCKED_BY . '" title="' . GetMessage("IBEL_A_USERINFO") . '">' . $f_LOCKED_USER_NAME . '</a>');
 }
 if ($f_USER_NAME) {
     $row->AddViewField("USER_NAME", '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $f_MODIFIED_BY . '" title="' . GetMessage("IBEL_A_USERINFO") . '">' . $f_USER_NAME . '</a>');
 }
 $row->AddViewField("CREATED_USER_NAME", '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $f_CREATED_BY . '" title="' . GetMessage("IBEL_A_USERINFO") . '">' . $f_CREATED_USER_NAME . '</a>');
 if ($bSubWorkFlow || $bSubBizproc) {
     $lamp = "/bitrix/images/workflow/" . $lockStatus . ".gif";
     if ($lockStatus == "green") {
         $lamp_alt = GetMessage("IBLOCK_GREEN_ALT");
     } elseif ($lockStatus == "yellow") {
Exemple #4
0
$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);
                }
            }
            if (isset($arUserList[$arCouponDiscount['CREATED_BY']])) {
                $strCreatedBy = '<a href="/bitrix/admin/user_edit.php?lang=' . LANGUAGE_ID . '&ID=' . $arCouponDiscount['CREATED_BY'] . '">' . $arUserList[$arCouponDiscount['CREATED_BY']] . '</a>';