Beispiel #1
0
		},
		prepareTitleBar : function()
		{
			return ({
				content: BX.create(
					'span',
					{
						html : 'Some title'
					}
				)
			});
		},
		prepareContent : function(pData)
		{
			var html = '<?php 
echo CUtil::jsEscape($html);
?>
';

			return html;
		}
	};

	BX.Tasks.lwPopup.buildForm(oEngine.objForm.formIndex, {}, 113);

	oEngine.renderer = {
		serialId    : 0,
		oEngine     : oEngine,
		bFormShowed : false,

    public static function getScripts()
    {
        \Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_additional_info.js");
        return '<script type="text/javascript">' . 'BX.message({
				SALE_ORDER_ADDITIONAL_INFO_COMMENT_EDIT: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_COMMENT_EDIT")) . '",
				SALE_ORDER_ADDITIONAL_INFO_COMMENT_SAVE: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_COMMENT_SAVE")) . '",
				SALE_ORDER_ADDITIONAL_INFO_NO_COMMENT: "' . \CUtil::jsEscape(Loc::getMessage("SALE_ORDER_ADDITIONAL_INFO_NO_COMMENT")) . '"
			})' . '</script>';
    }
Beispiel #3
0
    /**
     * @return string
     */
    public function getScripts()
    {
        if (!static::$jsInited) {
            \Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_basket.js");
            static::$jsInited = true;
        }
        $data = static::prepareData();
        $totalPrices = OrderEdit::getTotalPrices($this->order, $this, false);
        $langPhrases = array("SALE_ORDER_BASKET_TURN", "SALE_ORDER_BASKET_EXPAND", "SALE_ORDER_BASKET_UP_RATIO", "SALE_ORDER_BASKET_PROD_EDIT", "SALE_ORDER_BASKET_DOWN_RATIO", "SALE_ORDER_BASKET_PROD_COUNT", "SALE_ORDER_BASKET_NO_PICTURE", "SALE_ORDER_BASKET_PROD_CREATE", "SALE_ORDER_BASKET_ROW_SETTINGS", "SALE_ORDER_BASKET_PROD_MENU_EDIT", "SALE_ORDER_BASKET_PROD_MENU_DELETE", "SALE_ORDER_BASKET_BASE_CATALOG_PRICE", "SALE_ORDER_BASKET_PROD_EDIT_ITEM_SAVE", "SALE_ORDER_BASKET_KG", "SALE_ORDER_BASKET_COUPON", "SALE_ORDER_BASKET_COUPON_STATUS", "SALE_ORDER_BASKET_COUPON_APPLY", "SALE_ORDER_BASKET_COUPON_DELETE", "SALE_ORDER_BASKET_POSITION_EXISTS");
        $result = '<script type="text/javascript">';
        foreach ($langPhrases as $phrase) {
            $result .= ' BX.message({' . $phrase . ': "' . \CUtil::jsEscape(Loc::getMessage($phrase)) . '"});';
        }
        if ($this->mode == self::EDIT_MODE) {
            $result .= '
				BX.ready(function(){
					' . $this->jsObjName . '= new BX.Sale.Admin.OrderBasketEdit({
						tableId: "' . $this->idPrefix . 'sale_order_edit_product_table",
						idPrefix: "' . $this->idPrefix . '",
						productsOrder: ' . \CUtil::phpToJSObject($data["ITEMS_ORDER"]) . ',
						products: ' . \CUtil::phpToJSObject($data["ITEMS"]) . ',
						visibleColumns: ' . \CUtil::phpToJSObject($this->visibleColumns) . ',
						objName: "' . $this->jsObjName . '",
						createProductBasement: ' . ($this->createProductBasement ? 'true' : 'false') . ',
						columnsCount: ' . count($this->visibleColumns) . ',
						createBasketBottom: true,
						iblocksSkuParams: ' . \CUtil::phpToJSObject($data["IBLOCKS_SKU_PARAMS"]) . ',
						productsOffersSkuParams: ' . \CUtil::phpToJSObject($data["PRODUCTS_OFFERS_SKU"]) . ',
						isShowXmlId: ' . ($this->isShowXmlId ? 'true' : 'false') . ',
						discounts: ' . \CUtil::phpToJSObject(OrderEdit::getOrderedDiscounts($this->order, false)) . ',
						mode: "edit",
						unRemovableFields: ["PRICE", "QUANTITY"],
						' . $this->getTotalBlockFieldsJs($totalPrices, $data) . '
					});

					BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( ' . $this->jsObjName . '.getFieldsUpdaters() );
					BX.Sale.Admin.OrderBasketCoupons.statusCouponApplyed = ' . DiscountCouponsManager::STATUS_APPLYED . ';
					BX.Sale.Admin.OrderBasketCoupons.mode = BX.Sale.Admin.OrderBasketCoupons.MODES_LIST.' . ($this->order->getId() > 0 ? 'EDIT' : 'CREATE') . ';
					BX.Sale.Admin.OrderBasketCoupons.setCoupons(' . \CUtil::phpToJSObject(OrderEdit::getCouponList($this->order, false)) . ');
				});';
            $result .= $this->settingsDialog->getScripts();
        } else {
            $result .= '
				BX.ready(function(){
					' . $this->jsObjName . '= new BX.Sale.Admin.OrderBasket({
						tableId: "' . $this->idPrefix . 'sale_order_view_product_table",
						idPrefix: "' . $this->idPrefix . '",
						productsOrder: ' . \CUtil::phpToJSObject($data["ITEMS_ORDER"]) . ',
						products: ' . \CUtil::phpToJSObject($data["ITEMS"]) . ',
						visibleColumns: ' . \CUtil::phpToJSObject($this->visibleColumns) . ',
						objName: "' . $this->jsObjName . '",
						createProductBasement: ' . ($this->createProductBasement ? 'true' : 'false') . ',
						iblocksSkuParams: ' . \CUtil::phpToJSObject($data["IBLOCKS_SKU_PARAMS"]) . ',
						columnsCount: ' . count($this->visibleColumns) . ',
						isShowXmlId: ' . ($this->isShowXmlId ? 'true' : 'false') . ',
						discounts: ' . \CUtil::phpToJSObject(OrderEdit::getOrderedDiscounts($this->order, false)) . ',
						createBasketBottom: true,
						mode: "view",
						' . $this->getTotalBlockFieldsJs($totalPrices, $data) . '
					});

					BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( ' . $this->jsObjName . '.getFieldsUpdaters() );
					BX.Sale.Admin.OrderBasketCoupons.mode = BX.Sale.Admin.OrderBasketCoupons.MODES_LIST.VIEW;
					BX.Sale.Admin.OrderBasketCoupons.setCoupons(' . \CUtil::phpToJSObject(OrderEdit::getCouponList($this->order, false)) . ');
				});';
            $result .= $this->settingsDialog->getScripts();
        }
        $result .= '</script>';
        return $result;
    }
Beispiel #4
0
    public static function getScripts()
    {
        \Bitrix\Main\Page\Asset::getInstance()->addJs("/bitrix/js/sale/admin/order_buyer.js");
        \Bitrix\Main\Page\Asset::getInstance()->addJs('/bitrix/js/sale/input.js');
        \Bitrix\Sale\PropertyValueCollection::initJs();
        $langPhrases = array("SALE_ORDER_BUYER_CREATE_NEW");
        $result = '<script type="text/javascript">';
        foreach ($langPhrases as $phrase) {
            $result .= ' BX.message({' . $phrase . ': "' . \CUtil::jsEscape(Loc::getMessage($phrase)) . '"});';
        }
        $result .= '
				BX.ready(function(){
					BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( BX.Sale.Admin.OrderBuyer.getFieldsUpdaters() );
				});
			</script>
		';
        return $result;
    }
Beispiel #5
0
 /**
  * Adds A/B-test related buttons to Control Panel
  * 
  * @return void
  */
 public static function onPanelCreate()
 {
     global $USER, $APPLICATION;
     if ($USER->canDoOperation('view_other_settings')) {
         if ($context = Helper::getContext()) {
             $baseUri = \CHTTP::urlDeleteParams($APPLICATION->getCurPage(), array('abtest_mode'));
             $groupAUri = \CHTTP::urlAddParams($baseUri, array('abtest_mode' => intval($context['abtest']) . '|A'));
             $groupBUri = \CHTTP::urlAddParams($baseUri, array('abtest_mode' => intval($context['abtest']) . '|B'));
             $resetUri = \CHTTP::urlAddParams($baseUri, array('abtest_mode' => 'reset'));
             $APPLICATION->addPanelButton(array('ID' => 'abtest_options', 'SRC' => $context['section'] == 'B' ? '/bitrix/images/abtest/ab-icon-b.png' : '/bitrix/images/abtest/ab-icon-a.png', 'TEXT' => str_replace('#ID#', intval($context['abtest']), Localization\Loc::getMessage('ABTEST_PANEL_MENU_BTN')), 'TYPE' => 'BIG', 'MAIN_SORT' => 900, 'SORT' => 10, 'MENU' => array(array('ACTION' => "jsUtils.Redirect([], '" . \CUtil::jsEscape($groupAUri) . "'); ", 'TEXT' => Localization\Loc::getMessage('ABTEST_PANEL_MENU_MODE_A'), 'CHECKED' => $context['section'] == 'A' ? true : false), array('ACTION' => "jsUtils.Redirect([], '" . \CUtil::jsEscape($groupBUri) . "'); ", 'TEXT' => Localization\Loc::getMessage('ABTEST_PANEL_MENU_MODE_B'), 'CHECKED' => $context['section'] == 'B' ? true : false), array('ACTION' => "jsUtils.Redirect([], '" . \CUtil::jsEscape($resetUri) . "'); ", 'TEXT' => Localization\Loc::getMessage('ABTEST_PANEL_MENU_RESET')))));
         }
     }
 }
Beispiel #6
0
						if (json.result != 'error')
						{
							new_value.value = json.result;
							ABTestList.Item.handle(new_value, true);
						}
						else
						{
							alert(json.error);
						}

						ABTestList.Item.toggleCopy(old_value);
					},
					onfailure: function()
					{
						alert('<?php 
echo CUtil::jsEscape(getMessage('ABTEST_AJAX_ERROR'));
?>
');

						ABTestList.Item.toggleCopy(old_value);
					}
				});
			},
			edit: function(btn)
			{
				if (BX.hasClass(btn, 'adm-btn-disabled'))
					return false;

				var value = BX.findChild(btn.parentNode, {'class': 'value-input'}, false);

				if (value.style.color != '')