|
| 1 | +diff --git a/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php b/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php |
| 2 | +index 06f702316482..6fe209f6fac8 100644 |
| 3 | +--- a/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php |
| 4 | ++++ b/vendor/magento/module-advanced-checkout/Block/Adminhtml/Sku/AbstractSku.php |
| 5 | +@@ -1,11 +1,24 @@ |
| 6 | + <?php |
| 7 | +-/** |
| 8 | +- * Copyright © Magento, Inc. All rights reserved. |
| 9 | +- * See COPYING.txt for license details. |
| 10 | ++/************************************************************************ |
| 11 | ++ * |
| 12 | ++ * ADOBE CONFIDENTIAL |
| 13 | ++ * ___________________ |
| 14 | ++ * |
| 15 | ++ * Copyright 2014 Adobe |
| 16 | ++ * All Rights Reserved. |
| 17 | ++ * |
| 18 | ++ * NOTICE: All information contained herein is, and remains |
| 19 | ++ * the property of Adobe and its suppliers, if any. The intellectual |
| 20 | ++ * and technical concepts contained herein are proprietary to Adobe |
| 21 | ++ * and its suppliers and are protected by all applicable intellectual |
| 22 | ++ * property laws, including trade secret and copyright laws. |
| 23 | ++ * Dissemination of this information or reproduction of this material |
| 24 | ++ * is strictly forbidden unless prior written permission is obtained |
| 25 | ++ * from Adobe. |
| 26 | ++ * ************************************************************************ |
| 27 | + */ |
| 28 | ++ |
| 29 | + namespace Magento\AdvancedCheckout\Block\Adminhtml\Sku; |
| 30 | +-use Magento\Framework\App\ObjectManager; |
| 31 | +-use Magento\Framework\View\Helper\SecureHtmlRenderer; |
| 32 | + |
| 33 | + /** |
| 34 | + * Admin Checkout main form container |
| 35 | +@@ -22,7 +35,7 @@ abstract class AbstractSku extends \Magento\Backend\Block\Template |
| 36 | + /** |
| 37 | + * List type of current block |
| 38 | + */ |
| 39 | +- const LIST_TYPE = 'add_by_sku'; |
| 40 | ++ public const LIST_TYPE = 'add_by_sku'; |
| 41 | + |
| 42 | + /** |
| 43 | + * @var string |
| 44 | +@@ -34,27 +47,19 @@ abstract class AbstractSku extends \Magento\Backend\Block\Template |
| 45 | + */ |
| 46 | + protected $_jsonEncoder; |
| 47 | + |
| 48 | +- /** |
| 49 | +- * @var SecureHtmlRenderer |
| 50 | +- */ |
| 51 | +- private $secureRenderer; |
| 52 | +- |
| 53 | + /** |
| 54 | + * @codeCoverageIgnore |
| 55 | + * @param \Magento\Backend\Block\Template\Context $context |
| 56 | + * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder |
| 57 | + * @param array $data |
| 58 | +- * @param SecureHtmlRenderer|null $secureRenderer |
| 59 | + * @codeCoverageIgnore |
| 60 | + */ |
| 61 | + public function __construct( |
| 62 | + \Magento\Backend\Block\Template\Context $context, |
| 63 | + \Magento\Framework\Json\EncoderInterface $jsonEncoder, |
| 64 | +- array $data = [], |
| 65 | +- SecureHtmlRenderer $secureRenderer = null |
| 66 | ++ array $data = [] |
| 67 | + ) { |
| 68 | + $this->_jsonEncoder = $jsonEncoder; |
| 69 | +- $this->secureRenderer = $secureRenderer ?? ObjectManager::getInstance()->get(SecureHtmlRenderer::class); |
| 70 | + parent::__construct($context, $data); |
| 71 | + } |
| 72 | + |
| 73 | +@@ -79,33 +84,10 @@ protected function _construct() |
| 74 | + */ |
| 75 | + protected function _prepareLayout() |
| 76 | + { |
| 77 | +- //Delete button will be copied for each row so we need a listener that will work for duplicates. |
| 78 | +- $deleteButtonId = $this->mathRandom->getRandomString('8'); |
| 79 | +- $deleteButtonClass = 'admin-checkout-sku-delete-button-' . $deleteButtonId; |
| 80 | +- $deleteFunctionName = 'skuDeleteButtonListener' . $deleteButtonId; |
| 81 | +- $deleteActionScript = <<<SCRIPT |
| 82 | +- if (typeof($deleteFunctionName) == "undefined") { |
| 83 | +- $deleteFunctionName = function (event) { |
| 84 | +- addBySku.del(event.target); |
| 85 | +- }; |
| 86 | +- require(['jquery'], function($){ |
| 87 | +- $("body").on("click", ".$deleteButtonClass", $deleteFunctionName); |
| 88 | +- }); |
| 89 | +- } |
| 90 | +-SCRIPT; |
| 91 | + $this->addChild( |
| 92 | + 'deleteButton', |
| 93 | + \Magento\Backend\Block\Widget\Button::class, |
| 94 | +- [ |
| 95 | +- 'label' => '', |
| 96 | +- 'class' => 'action-delete ' . $deleteButtonClass, |
| 97 | +- 'before_html' => $this->secureRenderer->renderTag( |
| 98 | +- 'script', |
| 99 | +- ['type' => 'text/javascript'], |
| 100 | +- $deleteActionScript, |
| 101 | +- false |
| 102 | +- ), |
| 103 | +- ] |
| 104 | ++ ['label' => '', 'class' => 'action-delete'] |
| 105 | + ); |
| 106 | + |
| 107 | + $this->addChild( |
| 108 | +diff --git a/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml b/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml |
| 109 | +index c84b601f5df9..b85a7f5254b6 100644 |
| 110 | +--- a/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml |
| 111 | ++++ b/vendor/magento/module-advanced-checkout/view/adminhtml/templates/sku/add.phtml |
| 112 | +@@ -1,12 +1,28 @@ |
| 113 | + <?php |
| 114 | +-/** |
| 115 | +- * Copyright © Magento, Inc. All rights reserved. |
| 116 | +- * See COPYING.txt for license details. |
| 117 | ++/************************************************************************ |
| 118 | ++ * |
| 119 | ++ * ADOBE CONFIDENTIAL |
| 120 | ++ * ___________________ |
| 121 | ++ * |
| 122 | ++ * Copyright 2014 Adobe |
| 123 | ++ * All Rights Reserved. |
| 124 | ++ * |
| 125 | ++ * NOTICE: All information contained herein is, and remains |
| 126 | ++ * the property of Adobe and its suppliers, if any. The intellectual |
| 127 | ++ * and technical concepts contained herein are proprietary to Adobe |
| 128 | ++ * and its suppliers and are protected by all applicable intellectual |
| 129 | ++ * property laws, including trade secret and copyright laws. |
| 130 | ++ * Dissemination of this information or reproduction of this material |
| 131 | ++ * is strictly forbidden unless prior written permission is obtained |
| 132 | ++ * from Adobe. |
| 133 | ++ * ************************************************************************ |
| 134 | + */ |
| 135 | + // phpcs:disable Generic.Files.LineLength |
| 136 | + |
| 137 | + /** |
| 138 | + * @var \Magento\Framework\View\Helper\SecureHtmlRenderer $secureRenderer |
| 139 | ++ * @var \Magento\Framework\Escaper $escaper |
| 140 | ++ * @var \Magento\AdvancedCheckout\Block\Adminhtml\Sku\AbstractSku $block |
| 141 | + */ |
| 142 | + ?> |
| 143 | + <div class="add-by-sku-wrapper"> |
| 144 | +@@ -18,8 +34,8 @@ |
| 145 | + class="admin__control-table"> |
| 146 | + <thead> |
| 147 | + <tr class="headings"> |
| 148 | +- <th class="col-sku"><?= $block->escapeHtml(__('SKU number')) ?></th> |
| 149 | +- <th class="col-qty"><?= $block->escapeHtml(__('Qty')) ?></th> |
| 150 | ++ <th class="col-sku"><?= $escaper->escapeHtml(__('SKU number')) ?></th> |
| 151 | ++ <th class="col-qty"><?= $escaper->escapeHtml(__('Qty')) ?></th> |
| 152 | + <th class="col-actions last"> </th> |
| 153 | + </tr> |
| 154 | + </thead> |
| 155 | +@@ -51,10 +67,10 @@ |
| 156 | + </div> |
| 157 | + </div> |
| 158 | + <div class="admin__field add-sku-csv"> |
| 159 | +- <label class="admin__field-label" for="sku_upload"><?= $block->escapeHtml(__('Upload File')) ?></label> |
| 160 | ++ <label class="admin__field-label" for="sku_upload"><?= $escaper->escapeHtml(__('Upload File')) ?></label> |
| 161 | + <div class="admin__field-control"> |
| 162 | + <div class="admin__field-note"> |
| 163 | +- <span><?= $block->escapeHtml(__('Your csv file must include "sku" and "qty" columns.')) ?></span> |
| 164 | ++ <span><?= $escaper->escapeHtml(__('Your csv file must include "sku" and "qty" columns.')) ?></span> |
| 165 | + </div> |
| 166 | + <?php $inputName = \Magento\AdvancedCheckout\Model\Import::FIELD_NAME_SOURCE_FILE; ?> |
| 167 | + <input |
| 168 | +@@ -65,7 +81,7 @@ |
| 169 | + value="" /> |
| 170 | + <button type="button" |
| 171 | + class="action-default action-reset"> |
| 172 | +- <span><?= $block->escapeHtml(__('Reset')) ?></span> |
| 173 | ++ <span><?= $escaper->escapeHtml(__('Reset')) ?></span> |
| 174 | + </button> |
| 175 | + </div> |
| 176 | + <?= /* @noEscape */ |
| 177 | +@@ -79,7 +95,7 @@ |
| 178 | + </div> |
| 179 | + |
| 180 | + <?php |
| 181 | +-$adminCheckoutInstanceName = $block->escapeJs($block->getJsOrderObject()); |
| 182 | ++$adminCheckoutInstanceName = $escaper->escapeJs($block->getJsOrderObject()); |
| 183 | + $addBySkuData = $block->getAddBySkuDataJson(); |
| 184 | + $additionalJavaScript = $block->getAdditionalJavascript(); |
| 185 | + $contextSpecificJs = $block->getContextSpecificJs(); |
| 186 | +@@ -115,7 +131,7 @@ require([ |
| 187 | + } |
| 188 | + |
| 189 | + window.initSku = initSku; |
| 190 | +- $('sku_table').on('click', "[data-ui-id='sku-accordion-deletebutton']", function(event) { |
| 191 | ++ jQuery('#sku_table').on('click', '.action-delete', function(event) { |
| 192 | + addBySku.del(event.target); |
| 193 | + }); |
| 194 | + |
| 195 | + |
0 commit comments