1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
discount_coupon_list.php
См. документацию.
1<?
10
11if (!defined('B_ADMIN_SUBCOUPONS') || B_ADMIN_SUBCOUPONS != 1 || !defined('B_ADMIN_SUBCOUPONS_LIST'))
12 return;
13
14$prologAbsent = (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true);
15if (B_ADMIN_SUBCOUPONS_LIST === false && $prologAbsent)
16 return;
17
18$selfFolderUrl = (defined("SELF_FOLDER_URL") ? SELF_FOLDER_URL : "/bitrix/admin/");
19
21{
22 require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_admin_before.php');
23 Loader::includeModule('sale');
24
25 $discountID = 0;
26 if (isset($_REQUEST['find_discount_id']))
27 $discountID = (int)$_REQUEST['find_discount_id'];
28 $couponsAjaxPath = '/bitrix/tools/sale/discount_coupon_list.php?lang='.LANGUAGE_ID.'&find_discount_id='.$discountID;
29 $saleModulePermissions = $APPLICATION->GetGroupRight('sale');
30 $couponsReadOnly = ($saleModulePermissions < 'W');
31}
32if (!isset($discountID) || $discountID <= 0 || !isset($couponsAjaxPath) || empty($couponsAjaxPath))
33 return;
34
35if (isset($_REQUEST['mode']) && ($_REQUEST['mode'] == 'list' || $_REQUEST['mode'] == 'frame'))
37
39 $USER->CanDoOperation('view_subordinate_users')
40 || $USER->CanDoOperation('view_all_users')
41 || $USER->CanDoOperation('edit_all_users')
42 || $USER->CanDoOperation('edit_subordinate_users')
43);
44
45Loc::loadMessages(__FILE__);
46
47require_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/iblock/classes/general/subelement.php');
48
49$adminListTableID = 'tbl_sale_sub_coupons_'.md5($discountID);
50
51$hideFields = array('DISCOUNT_ID');
52$adminSort = new CAdminSubSorting($adminListTableID, 'ID', 'ASC', 'by', 'order', $couponsAjaxPath);
54$adminList->setDialogParams(array('from_module' => 'sale'));
55unset($hideFields);
56
57if (!isset($by))
58 $by = 'ID';
59if (!isset($order))
60 $order = 'ASC';
61
63 '=DISCOUNT_ID' => $discountID
64);
66 'find_discount_id'
67);
68$adminList->InitFilter($filterFields);
69
70if (!$couponsReadOnly && $adminList->EditAction())
71{
72 if (isset($FIELDS) && is_array($FIELDS))
73 {
74 $conn = Application::getConnection();
76 foreach ($FIELDS as $couponID => $fields)
77 {
78 $couponID = (int)$couponID;
79 if ($couponID <= 0 || !$adminList->IsUpdated($couponID))
80 continue;
81 unset($fields['DISCOUNT_ID']);
82
83 $conn->startTransaction();
85 if ($result->isSuccess())
86 $result = Internals\DiscountCouponTable::update($couponID, $fields);
87
88 if ($result->isSuccess())
89 {
90 $conn->commitTransaction();
91 }
92 else
93 {
94 $conn->rollbackTransaction();
95 $adminList->AddUpdateError(implode('<br>', $result->getErrorMessages()), $couponID);
96 }
97 unset($result);
98 }
99 unset($fields, $couponID);
101 }
102}
103
104if (!$couponsReadOnly && ($listID = $adminList->GroupAction()))
105{
106 $checkUseCoupons = ($_REQUEST['action'] == 'delete');
108 if ($_REQUEST['action_target'] == 'selected')
109 {
110 $listID = array();
111 $couponIterator = Internals\DiscountCouponTable::getList(array(
112 'select' => array('ID'),
113 'filter' => $filter
114 ));
115 while ($coupon = $couponIterator->fetch())
116 {
117 $listID[] = $coupon['ID'];
118 }
119 }
120
121 $listID = array_filter($listID);
122 if (!empty($listID))
123 {
124 switch ($_REQUEST['action'])
125 {
126 case 'activate':
127 case 'deactivate':
129 $fields = array(
130 'ACTIVE' => ($_REQUEST['action'] == 'activate' ? 'Y' : 'N')
131 );
132 foreach ($listID as &$couponID)
133 {
134 $result = Internals\DiscountCouponTable::update($couponID, $fields);
135 if (!$result->isSuccess())
136 $adminList->AddGroupError(implode('<br>', $result->getErrorMessages()), $couponID);
137 unset($result);
138 }
139 unset($couponID, $fields);
141 break;
142 case 'delete':
145 foreach ($listID as &$couponID)
146 {
147 $result = Internals\DiscountCouponTable::delete($couponID);
148 if (!$result->isSuccess())
149 $adminList->AddGroupError(implode('<br>', $result->getErrorMessages()), $couponID);
150 unset($result);
151 }
152 unset($couponID);
155 break;
156 }
157 }
158 unset($listID);
159}
160
161CJSCore::Init(array('date'));
162
165 'id' => 'ID',
166 'content' => 'ID',
167 'sort' => 'ID',
168 'default' => true
169);
170$headerList['COUPON'] = array(
171 'id' => 'COUPON',
172 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_COUPON'),
173 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_COUPON'),
174 'sort' => 'COUPON',
175 'default' => true
176);
177$headerList['ACTIVE'] = array(
178 'id' => 'ACTIVE',
179 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE'),
180 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE'),
181 'sort' => 'ACTIVE',
182 'default' => true
183);
184$headerList['ACTIVE_FROM'] = array(
185 'id' => 'ACTIVE_FROM',
186 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE_FROM'),
187 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE_FROM'),
188 'sort' => 'ACTIVE_FROM',
189 'default' => true
190);
191$headerList['ACTIVE_TO'] = array(
192 'id' => 'ACTIVE_TO',
193 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_ACTIVE_TO'),
194 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_ACTIVE_TO'),
195 'sort' => 'ACTIVE_TO',
196 'default' => true
197);
199 'id' => 'TYPE',
200 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_TYPE'),
201 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_TYPE'),
202 'sort' => 'TYPE',
203 'default' => true
204);
205$headerList['MAX_USE'] = array(
206 'id' => 'MAX_USE',
207 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_MAX_USE'),
208 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_MAX_USE'),
209 'sort' => 'MAX_USE',
210 'default' => true
211);
212$headerList['USE_COUNT'] = array(
213 'id' => 'USE_COUNT',
214 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_USE_COUNT'),
215 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_USE_COUNT'),
216 'sort' => 'USE_COUNT',
217 'default' => true
218);
219$headerList['USER_ID'] = array(
220 'id' => 'USER_ID',
221 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_USER_ID'),
222 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_USER_ID'),
223 'sort' => 'USER_ID',
224 'default' => true
225);
226$headerList['DATE_APPLY'] = array(
227 'id' => 'DATE_APPLY',
228 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DATE_APPLY'),
229 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DATE_APPLY'),
230 'sort' => 'DATE_APPLY',
231 'default' => true
232);
233$headerList['MODIFIED_BY'] = array(
234 'id' => 'MODIFIED_BY',
235 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_MODIFIED_BY'),
236 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_MODIFIED_BY'),
237 'sort' => 'MODIFIED_BY',
238 'default' => true
239);
240$headerList['TIMESTAMP_X'] = array(
241 'id' => 'TIMESTAMP_X',
242 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_TIMESTAMP_X'),
243 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_TIMESTAMP_X'),
244 'sort' => 'TIMESTAMP_X',
245 'default' => true
246);
247$headerList['CREATED_BY'] = array(
248 'id' => 'CREATED_BY',
249 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_CREATED_BY'),
250 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_CREATED_BY'),
251 'sort' => 'CREATED_BY',
252 'default' => false
253);
254$headerList['DATE_CREATE'] = array(
255 'id' => 'DATE_CREATE',
256 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DATE_CREATE'),
257 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DATE_CREATE'),
258 'sort' => 'DATE_CREATE',
259 'default' => false
260);
261$headerList['DESCRIPTION'] = array(
262 'id' => 'DESCRIPTION',
263 'content' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_NAME_DESCRIPTION'),
264 'title' => Loc::getMessage('SALE_ADM_DSC_CPN_HEADER_TITLE_DESCRIPTION'),
265 'default' => false
266);
267$adminList->AddHeaders($headerList);
268
269$selectFields = array_fill_keys($adminList->GetVisibleHeaderColumns(), true);
270$selectFields['ID'] = true;
271$selectFields['ACTIVE'] = true;
272$selectFields['TYPE'] = true;
273$selectFieldsMap = array_fill_keys(array_keys($headerList), false);
275
278$nameFormat = CSite::GetNameFormat(true);
279
281
283
286if (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'excel')
287{
288 $usePageNavigation = false;
289}
290else
291{
292 $navyParams = CDBResult::GetNavParams(CAdminResult::GetNavSize($adminListTableID, array('nPageSize' => 20, 'sNavID' => $adminList->GetListUrl(true))));
293 if ($navyParams['SHOW_ALL'])
294 {
295 $usePageNavigation = false;
296 }
297 else
298 {
299 $navyParams['PAGEN'] = (int)$navyParams['PAGEN'];
300 $navyParams['SIZEN'] = (int)$navyParams['SIZEN'];
301 }
302}
303if ($selectFields['TYPE'])
304 $selectFields['USE_COUNT'] = true;
305
306$selectFields = array_keys($selectFields);
307
309 'select' => $selectFields,
310 'filter' => $filter,
311 'order' => array($by => $order)
312);
315{
316 $countQuery = new Main\Entity\Query(Internals\DiscountCouponTable::getEntity());
317 $countQuery->addSelect(new Main\Entity\ExpressionField('CNT', 'COUNT(1)'));
318 $countQuery->setFilter($getListParams['filter']);
319 $totalCount = $countQuery->setLimit(null)->setOffset(null)->exec()->fetch();
320 unset($countQuery);
321 $totalCount = (int)$totalCount['CNT'];
322 if ($totalCount > 0)
323 {
324 $totalPages = ceil($totalCount/$navyParams['SIZEN']);
325 if ($navyParams['PAGEN'] > $totalPages)
326 $navyParams['PAGEN'] = $totalPages;
327 $getListParams['limit'] = $navyParams['SIZEN'];
328 $getListParams['offset'] = $navyParams['SIZEN']*($navyParams['PAGEN']-1);
329 }
330 else
331 {
332 $navyParams['PAGEN'] = 1;
333 $getListParams['limit'] = $navyParams['SIZEN'];
334 $getListParams['offset'] = 0;
335 }
336}
337
338$couponIterator = new CAdminSubResult(Internals\DiscountCouponTable::getList($getListParams), $adminListTableID, $adminList->GetListUrl(true));
340{
341 $couponIterator->NavStart($getListParams['limit'], $navyParams['SHOW_ALL'], $navyParams['PAGEN']);
342 $couponIterator->NavRecordCount = $totalCount;
343 $couponIterator->NavPageCount = $totalPages;
344 $couponIterator->NavPageNomer = $navyParams['PAGEN'];
345}
346else
347{
348 $couponIterator->NavStart();
349}
350$adminList->NavText($couponIterator->GetNavPrint(Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_NAV')));
351
352while ($coupon = $couponIterator->Fetch())
353{
354 $coupon['ID'] = (int)$coupon['ID'];
355 if ($selectFieldsMap['MAX_USE'])
356 $coupon['MAX_USE'] = (int)$coupon['MAX_USE'];
357 if ($selectFieldsMap['USE_COUNT'])
358 $coupon['USE_COUNT'] = (int)$coupon['USE_COUNT'];
359 if ($coupon['TYPE'] != Internals\DiscountCouponTable::TYPE_MULTI_ORDER)
360 {
361 $coupon['MAX_USE'] = 0;
362 $coupon['USE_COUNT'] = 0;
363 }
364 if ($selectFieldsMap['CREATED_BY'])
365 {
366 $coupon['CREATED_BY'] = (int)$coupon['CREATED_BY'];
367 if ($coupon['CREATED_BY'] > 0)
368 $userIDs[$coupon['CREATED_BY']] = true;
369 }
370 if ($selectFieldsMap['MODIFIED_BY'])
371 {
372 $coupon['MODIFIED_BY'] = (int)$coupon['MODIFIED_BY'];
373 if ($coupon['MODIFIED_BY'] > 0)
374 $userIDs[$coupon['MODIFIED_BY']] = true;
375 }
376 if ($selectFieldsMap['USER_ID'])
377 {
378 $coupon['USER_ID'] = (int)$coupon['USER_ID'];
379 if ($coupon['USER_ID'] > 0)
380 $userIDs[$coupon['USER_ID']] = true;
381 }
382 $urlEdit = $selfFolderUrl.'sale_discount_coupon_edit.php?ID='.$coupon['ID'].'&DISCOUNT_ID='.$discountID.'&lang='.LANGUAGE_ID.'&bxpublic=Y';
383
384 $rowList[$coupon['ID']] = $row = &$adminList->AddRow(
385 $coupon['ID'],
386 $coupon,
387 $urlEdit,
388 Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_EDIT_COUPON'),
389 true
390 );
391 $row->AddViewField('ID', $coupon['ID']);
392
393 if ($selectFieldsMap['DATE_CREATE'])
394 $row->AddViewField('DATE_CREATE', $coupon['DATE_CREATE']);
395 if ($selectFieldsMap['TIMESTAMP_X'])
396 $row->AddViewField('TIMESTAMP_X', $coupon['TIMESTAMP_X']);
397
398 if ($selectFieldsMap['MAX_USE'])
399 $row->AddViewField('MAX_USE', ($coupon['MAX_USE'] > 0 ? $coupon['MAX_USE'] : ''));
400 if ($selectFieldsMap['USE_COUNT'])
401 $row->AddViewField('USE_COUNT', ($coupon['USE_COUNT'] > 0 ? $coupon['USE_COUNT'] : ''));
402 if ($selectFieldsMap['TYPE'])
403 $row->AddViewField('TYPE', $couponTypeList[$coupon['TYPE']]);
404 if ($selectFieldsMap['DESCRIPTION'])
405 $row->AddViewField('DESCRIPTION', htmlspecialcharsbx($coupon['DESCRIPTION']));
406 if (!$couponsReadOnly)
407 {
408 if ($selectFieldsMap['COUPON'])
409 $row->AddInputField('COUPON', array('size' => 32));
410 if ($selectFieldsMap['ACTIVE'])
411 $row->AddCheckField('ACTIVE');
412 if ($selectFieldsMap['ACTIVE_FROM'])
413 $row->AddCalendarField('ACTIVE_FROM');
414 if ($selectFieldsMap['ACTIVE_TO'])
415 $row->AddCalendarField('ACTIVE_TO');
416 }
417 else
418 {
419 if ($selectFieldsMap['COUPON'])
420 $row->AddInputField('COUPON', false);
421 if ($selectFieldsMap['ACTIVE'])
422 $row->AddCheckField('ACTIVE', false);
423 if ($selectFieldsMap['ACTIVE_FROM'])
424 $row->AddCalendarField('ACTIVE_FROM', false);
425 if ($selectFieldsMap['ACTIVE_TO'])
426 $row->AddCalendarField('ACTIVE_TO');
427 }
428
429 $actions = array();
430 $actions[] = array(
431 'ICON' => 'edit',
432 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_EDIT'),
433 'ACTION' => "(new BX.CAdminDialog({
434 'content_url': '".CUtil::JSEscape($urlEdit)."',
435 'content_post': 'bxpublic=Y',
436 'draggable': true,
437 'resizable': true,
438 'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]
439 })).Show();",
440 'DEFAULT' => true
441 );
442 if (!$couponsReadOnly)
443 {
444 $actions[] = array(
445 'ICON' => 'copy',
446 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_COPY'),
447 'ACTION'=>"(new BX.CAdminDialog({
448 'content_url': '".CUtil::JSEscape($urlEdit.'&action=copy')."',
449 'content_post': 'bxpublic=Y',
450 'draggable': true,
451 'resizable': true,
452 'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]
453 })).Show();",
454 'DEFAULT' => false,
455 );
456 if ($coupon['ACTIVE'] == 'Y')
457 {
458 $actions[] = array(
459 'ICON' => 'deactivate',
460 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DEACTIVATE'),
461 'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'deactivate'),
462 'DEFAULT' => false,
463 );
464 }
465 else
466 {
467 $actions[] = array(
468 'ICON' => 'activate',
469 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_ACTIVATE'),
470 'ACTION' => $adminList->ActionDoGroup($coupon['ID'], 'activate'),
471 'DEFAULT' => false,
472 );
473 }
474 $actions[] = array('SEPARATOR' => true);
475 $actions[] = array(
476 'ICON' =>'delete',
477 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DELETE'),
478 'ACTION' => "if(confirm('".Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_CONTEXT_DELETE_CONFIRM')."')) ".$adminList->ActionDoGroup($coupon['ID'], 'delete')
479 );
480 }
481 $row->AddActions($actions);
482 unset($actions, $row);
483}
484
485if (!empty($rowList) && ($selectFieldsMap['CREATED_BY'] || $selectFieldsMap['MODIFIED_BY'] || $selectFieldsMap['USER_ID']))
486{
487 if (!empty($userIDs))
488 {
489 $userIterator = UserTable::getList(array(
490 'select' => array('ID', 'LOGIN', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'EMAIL'),
491 'filter' => array('@ID' => array_keys($userIDs)),
492 ));
493 while ($oneUser = $userIterator->fetch())
494 {
495 $oneUser['ID'] = (int)$oneUser['ID'];
496 if ($canViewUserList && !$adminSidePanelHelper->isPublicSidePanel())
497 $userList[$oneUser['ID']] = '<a href="/bitrix/admin/user_edit.php?lang='.LANGUAGE_ID.'&ID='.$oneUser['ID'].'">'.CUser::FormatName($nameFormat, $oneUser).'</a>';
498 else
499 $userList[$oneUser['ID']] = CUser::FormatName($nameFormat, $oneUser);
500 }
501 unset($oneUser, $userIterator);
502 }
503
504 foreach ($rowList as &$row)
505 {
506 if ($selectFieldsMap['CREATED_BY'])
507 {
508 $userName = '';
509 if ($row->arRes['CREATED_BY'] > 0 && isset($userList[$row->arRes['CREATED_BY']]))
510 $userName = $userList[$row->arRes['CREATED_BY']];
511 $row->AddViewField('CREATED_BY', $userName);
512 }
513 if ($selectFieldsMap['MODIFIED_BY'])
514 {
515 $userName = '';
516 if ($row->arRes['MODIFIED_BY'] > 0 && isset($userList[$row->arRes['MODIFIED_BY']]))
517 $userName = $userList[$row->arRes['MODIFIED_BY']];
518 $row->AddViewField('MODIFIED_BY', $userName);
519 }
520 if ($selectFieldsMap['USER_ID'])
521 {
522 $userName = '';
523 if ($row->arRes['USER_ID'] > 0 && isset($userList[$row->arRes['USER_ID']]))
524 $userName = $userList[$row->arRes['USER_ID']];
525 $row->AddViewField('USER_ID', $userName);
526 }
527 unset($userName);
528 }
529 unset($row);
530}
531
532$adminList->AddFooter(
533 array(
534 array(
535 'title' => Loc::getMessage('MAIN_ADMIN_LIST_SELECTED'),
536 'value' => $couponIterator->SelectedRowsCount()
537 ),
538 array(
539 'counter' => true,
540 'title' => Loc::getMessage('MAIN_ADMIN_LIST_CHECKED'),
541 'value' => 0
542 ),
543 )
544);
545if (!$couponsReadOnly)
546{
547 $adminList->AddGroupActionTable(
548 array(
549 'delete' => Loc::getMessage('MAIN_ADMIN_LIST_DELETE'),
550 'activate' => Loc::getMessage('MAIN_ADMIN_LIST_ACTIVATE'),
551 'deactivate' => Loc::getMessage('MAIN_ADMIN_LIST_DEACTIVATE'),
552 )
553 );
554}
555if (!isset($_REQUEST["mode"]) || ($_REQUEST["mode"] != 'excel' && $_REQUEST["mode"] != 'subsettings'))
556{
557 ?><script>
558 function ShowNewCoupons(id, multi)
559 {
560 var PostParams = {
561 lang: '<? echo LANGUAGE_ID; ?>',
562 DISCOUNT_ID: id,
563 MULTI: multi,
564 ID: 0,
565 bxpublic: 'Y',
566 sessid: BX.bitrix_sessid()
567 };
568 (new BX.CAdminDialog({
569 'content_url': '<?=$selfFolderUrl?>sale_discount_coupon_edit.php',
570 'content_post': PostParams,
571 'draggable': true,
572 'resizable': true,
573 'width': 800,
574 'height': 500,
575 'buttons': [BX.CAdminDialog.btnSave, BX.CAdminDialog.btnCancel]
576 })).Show();
577 }
578 </script><?
579 $aContext = array();
580 if (!$couponsReadOnly)
581 {
582 $addSubMenu = array();
583 $addSubMenu[] = array(
584 'TEXT' => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_ADD_ONE_COUPON'),
585 'TITLE' => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_ADD_ONE_COUPON_TITLE'),
586 'LINK' => "javascript:ShowNewCoupons(".$discountID.", 'N')",
587 'SHOW_TITLE' => true
588 );
589 $addSubMenu[] = array(
590 'TEXT' => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_ADD_MULTI_COUPON'),
591 'TITLE' => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_ADD_MULTI_COUPON_TITLE'),
592 'LINK' => "javascript:ShowNewCoupons(".$discountID.", 'Y')",
593 'SHOW_TITLE' => true
594 );
595
596 $aContext[] = array(
597 'TEXT' => Loc::getMessage('BT_SALE_DISCOUNT_COUPONT_LIST_MESS_NEW_COUPON'),
598 'TITLE' => Loc::getMessage('BT_SALE_DISCOUNT_COUPON_LIST_MESS_NEW_COUPON_TITLE'),
599 'ICON' => 'btn_new',
600 'MENU' => $addSubMenu,
601 );
602 }
603
604 $aContext[] = array(
605 'TEXT' => htmlspecialcharsbx(Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_REFRESH')),
606 'TITLE' => Loc::getMessage('BX_SALE_DISCOUNT_COUPON_LIST_REFRESH_TITLE'),
607 'ICON' => 'btn_sub_refresh',
608 'LINK' => "javascript:".$adminList->ActionAjaxReload($adminList->GetListUrl(true)),
609 );
610
611 $adminList->AddAdminContextMenu($aContext);
612}
613$adminList->CheckListMode();
614
615$adminList->DisplayList(B_ADMIN_SUBCOUPONS_LIST);
616
617if ($prologAbsent)
618 require($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/epilog_popup_admin.php');
global $APPLICATION
Определения include.php:80
static getCouponTypes($extendedMode=false)
Определения discountcoupon.php:486
Определения loader.php:13
Определения user.php:48
static prepareCouponData(&$fields)
Определения discountcoupon.php:957
static setDiscountCheckList($discountList)
Определения discountcoupon.php:477
static GetNavSize($table_id=false, $nPageSize=20)
Определения admin_lib.php:2097
Определения subelement.php:52
Определения subelement.php:1861
Определения subelement.php:10
static FormatName($NAME_TEMPLATE, $arUser, $bUseLogin=false, $bHTMLSpec=true, $enabledEmptyNameStub=true)
Определения user.php:5614
static DisableJSFunction($b=true)
Определения file.php:1665
static Init($arExt=array(), $bReturn=false)
Определения jscore.php:66
$couponTypeList
Определения discount_coupon_list.php:282
$userIDs
Определения discount_coupon_list.php:277
if($usePageNavigation) $couponIterator
Определения discount_coupon_list.php:338
$nameFormat
Определения discount_coupon_list.php:278
$userList
Определения discount_coupon_list.php:276
$canViewUserList
Определения discount_coupon_list.php:38
$selfFolderUrl
Определения discount_coupon_list.php:18
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$result
Определения get_property_values.php:14
$prologAbsent
Определения iblock_catalog_list.php:17
if($selectFieldsMap['VAT_ID']) $usePageNavigation
Определения iblock_catalog_list.php:181
$getListParams
Определения iblock_catalog_list.php:210
if($usePageNavigation) $totalPages
Определения iblock_catalog_list.php:234
$hideFields
Определения iblock_catalog_list.php:42
$adminSort
Определения iblock_catalog_list.php:43
$navyParams
Определения iblock_catalog_list.php:182
$adminListTableID
Определения iblock_catalog_list.php:40
$adminList
Определения iblock_catalog_list.php:44
if(! $readOnly &&$adminList->EditAction()) if(! $readOnly &&($listID=$adminList->GroupAction()) $headerList)
Определения iblock_catalog_list.php:69
$filter
Определения iblock_catalog_list.php:54
$filterFields
Определения iblock_catalog_list.php:55
$rowList
Определения iblock_catalog_list.php:273
$selectFields
Определения iblock_catalog_list.php:160
$selectFieldsMap
Определения iblock_catalog_list.php:164
global $adminSidePanelHelper
Определения init_admin.php:7
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
URL bitrix admin public_file_edit php bxpublic
Определения structure.php:440
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
Определения tools.php:2701
Определения ufield.php:9
$order
Определения payment.php:8
lang
Определения options.php:182
else $userName
Определения order_form.php:75
$saleModulePermissions
Определения tools.php:21
$totalCount
Определения subscription_card_product.php:51
$fields
Определения yandex_run.php:501