Skip to content

Commit cecb183

Browse files
committed
Merge remote-tracking branch 'mainline/develop' into MAGETWO-58251
2 parents d396f0b + 4d69ecb commit cecb183

File tree

297 files changed

+16957
-1924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+16957
-1924
lines changed

app/code/Magento/Authorizenet/Model/Source/Cctype.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Cctype extends PaymentCctype
1717
*/
1818
public function getAllowedTypes()
1919
{
20-
return ['VI', 'MC', 'AE', 'DI'];
20+
return ['VI', 'MC', 'AE', 'DI', 'JCB', 'DN'];
2121
}
2222
}

app/code/Magento/Authorizenet/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<payment>
1111
<authorizenet_directpost>
1212
<active>0</active>
13-
<cctypes>AE,VI,MC,DI</cctypes>
13+
<cctypes>AE,VI,MC,DI,JCB,DN</cctypes>
1414
<debug>0</debug>
1515
<email_customer>0</email_customer>
1616
<login backend_model="Magento\Config\Model\Config\Backend\Encrypted" />

app/code/Magento/Authorizenet/view/adminhtml/templates/directpost/info.phtml

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,12 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
3535
</label>
3636
<div class="admin__field-control">
3737
<select id="<?php /* @noEscape */ echo $code; ?>_cc_type" name="payment[cc_type]"
38-
class="required-entry validate-cc-type-select admin__control-select">
39-
<option value=""></option>
38+
class="admin__control-select"
39+
data-validate="{
40+
'required':true,
41+
'validate-cc-type-select':'#<?php /* @noEscape */ echo $code; ?>_cc_number'
42+
}">
43+
<option value=""><?php echo $block->escapeHtml(__('Please Select')); ?></option>
4044
<?php foreach ($block->getCcAvailableTypes() as $typeCode => $typeName): ?>
4145
<option value="<?php echo $block->escapeHtml($typeCode); ?>"
4246
<?php if ($typeCode == $ccType): ?>selected="selected"<?php endif; ?>>
@@ -46,27 +50,37 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
4650
</select>
4751
</div>
4852
</div>
53+
4954
<div class="admin__field _required">
5055
<label for="<?php /* @noEscape */ echo $code; ?>_cc_number" class="admin__field-label">
5156
<span><?php echo $block->escapeHtml(__('Credit Card Number')); ?></span>
5257
</label>
53-
5458
<div class="admin__field-control">
5559
<input type="text" id="<?php /* @noEscape */ echo $code; ?>_cc_number"
5660
name="payment[cc_number]"
57-
class="input-text required-entry validate-cc-number admin__control-text"
61+
data-validate="{
62+
'required-number':true,
63+
'validate-cc-number':'#<?php /* @noEscape */ echo $code; ?>_cc_type',
64+
'validate-cc-type':'#<?php /* @noEscape */ echo $code; ?>_cc_type'
65+
}"
66+
class="admin__control-text"
5867
value="<?php /* @noEscape */ echo $block->getInfoData('cc_number'); ?>"/>
5968
</div>
6069
</div>
61-
<div class="admin__field _required">
70+
71+
<div class="admin__field _required field-date" id="<?php /* @noEscape */ echo $code; ?>_cc_type_exp_div">
6272
<label for="<?php /* @noEscape */ echo $code; ?>_expiration" class="admin__field-label">
6373
<span><?php echo $block->escapeHtml(__('Expiration Date')); ?></span>
6474
</label>
6575

6676
<div class="admin__field-control">
6777
<select id="<?php /* @noEscape */ echo $code; ?>_expiration"
6878
name="payment[cc_exp_month]"
69-
class="validate-cc-exp required-entry admin__control-select admin__control-select-month">
79+
class="admin__control-select admin__control-select-month"
80+
data-validate="{
81+
'required':true,
82+
'validate-cc-exp':'#<?php /* @noEscape */ echo $code; ?>_expiration_yr'
83+
}">
7084
<?php foreach ($block->getCcMonths() as $k => $v): ?>
7185
<option value="<?php echo $block->escapeHtml($k); ?>"
7286
<?php if ($k == $ccExpMonth): ?>selected="selected"<?php endif; ?>>
@@ -76,7 +90,9 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
7690
</select>
7791
<select id="<?php /* @noEscape */ echo $code; ?>_expiration_yr"
7892
name="payment[cc_exp_year]"
79-
class="required-entry admin__control-select admin__control-select-year">
93+
class="admin__control-select admin__control-select-year"
94+
data-container="<?php /* @noEscape */ echo $code; ?>-cc-year"
95+
data-validate="{required:true}">
8096
<?php foreach ($block->getCcYears() as $k => $v): ?>
8197
<option value="<?php /* @noEscape */ echo $k ? $block->escapeHtml($k) : ''; ?>"
8298
<?php if ($k == $ccExpYear): ?>selected="selected"<?php endif; ?>>
@@ -86,17 +102,27 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
86102
</select>
87103
</div>
88104
</div>
105+
89106
<?php if ($block->hasVerification()): ?>
90-
<div class="admin__field _required">
91-
<label for="<?php /* @noEscape */ echo $code; ?>_cc_cid">
107+
<div class="admin__field _required field-cvv">
108+
<label class="admin__field-label"
109+
for="<?php /* @noEscape */ echo $code; ?>_cc_cid"
110+
id="<?php /* @noEscape */ echo $code; ?>_cc_type_cvv_div">
92111
<span><?php echo $block->escapeHtml(__('Card Verification Number')); ?></span>
93112
</label>
94113

95114
<div class="admin__field-control">
96115
<input type="text"
97-
class="required-entry input-text validate-cc-cvn admin__control-text"
116+
data-container="<?php /* @noEscape */ echo $code; ?>-cc-cvv"
117+
title="<?php echo $block->escapeHtml(__('Card Verification Number')); ?>"
118+
class="admin__control-text cvv"
98119
id="<?php /* @noEscape */ echo $code; ?>_cc_cid" name="payment[cc_cid]"
99-
value="<?php /* @noEscape */ echo $block->getInfoData('cc_cid') ?>"/>
120+
value="<?php /* @noEscape */ echo $block->getInfoData('cc_cid') ?>"
121+
data-validate="{
122+
'required-number':true,
123+
'validate-cc-cvn':'#<?php /* @noEscape */ echo $code; ?>_cc_type'
124+
}"
125+
autocomplete="off"/>
100126
</div>
101127
</div>
102128
<?php endif; ?>
@@ -105,7 +131,7 @@ $ccExpYear = $block->getInfoData('cc_exp_year');
105131
require([
106132
'prototype',
107133
'Magento_Sales/order/create/scripts',
108-
"Magento_Sales/order/create/form",
134+
'Magento_Sales/order/create/form',
109135
'Magento_Authorizenet/js/direct-post'
110136
], function(){
111137

app/code/Magento/Catalog/Controller/Adminhtml/Product/Initialization/Helper.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,16 @@ public function initializeFromData(\Magento\Catalog\Model\Product $product, arra
199199
$customOptions = [];
200200
foreach ($options as $customOptionData) {
201201
if (empty($customOptionData['is_delete'])) {
202+
if (empty($customOptionData['option_id'])) {
203+
$customOptionData['option_id'] = null;
204+
}
202205
if (isset($customOptionData['values'])) {
203206
$customOptionData['values'] = array_filter($customOptionData['values'], function ($valueData) {
204207
return empty($valueData['is_delete']);
205208
});
206209
}
207210
$customOption = $this->getCustomOptionFactory()->create(['data' => $customOptionData]);
208211
$customOption->setProductSku($product->getSku());
209-
$customOption->setOptionId(null);
210212
$customOptions[] = $customOption;
211213
}
212214
}
@@ -255,7 +257,7 @@ protected function setProductLinks(\Magento\Catalog\Model\Product $product)
255257

256258
foreach ($linkTypes as $linkType => $readonly) {
257259
if (isset($links[$linkType]) && !$readonly) {
258-
foreach ((array) $links[$linkType] as $linkData) {
260+
foreach ((array)$links[$linkType] as $linkData) {
259261
if (empty($linkData['id'])) {
260262
continue;
261263
}
@@ -321,9 +323,11 @@ public function mergeProductOptions($productOptions, $overwriteOptions)
321323

322324
if (isset($option['values']) && isset($overwriteOptions[$optionId]['values'])) {
323325
foreach ($option['values'] as $valueIndex => $value) {
324-
$valueId = $value['option_type_id'];
325-
$value = $this->overwriteValue($valueId, $value, $overwriteOptions[$optionId]['values']);
326-
$option['values'][$valueIndex] = $value;
326+
if (isset($value['option_type_id'])) {
327+
$valueId = $value['option_type_id'];
328+
$value = $this->overwriteValue($valueId, $value, $overwriteOptions[$optionId]['values']);
329+
$option['values'][$valueIndex] = $value;
330+
}
327331
}
328332
}
329333

@@ -347,6 +351,9 @@ private function overwriteValue($optionId, $option, $overwriteOptions)
347351
foreach ($overwriteOptions[$optionId] as $fieldName => $overwrite) {
348352
if ($overwrite && isset($option[$fieldName]) && isset($option['default_' . $fieldName])) {
349353
$option[$fieldName] = $option['default_' . $fieldName];
354+
if ('title' == $fieldName) {
355+
$option['is_delete_store_title'] = 1;
356+
}
350357
}
351358
}
352359
}

app/code/Magento/Catalog/Helper/Product/Compare.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ public function getPostDataRemove($product)
231231
$data = [
232232
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => '',
233233
'product' => $product->getId(),
234+
'confirmation' => true,
235+
'confirmationMessage' => __('Are you sure you want to remove this item from your Compare Products list?')
234236
];
235237
return $this->postHelper->getPostData($this->getRemoveUrl(), $data);
236238
}
@@ -254,6 +256,8 @@ public function getPostDataClearList()
254256
{
255257
$params = [
256258
\Magento\Framework\App\ActionInterface::PARAM_NAME_URL_ENCODED => '',
259+
'confirmation' => true,
260+
'confirmationMessage' => __('Are you sure you want to remove all items from your Compare Products list?'),
257261
];
258262
return $this->postHelper->getPostData($this->getClearListUrl(), $params);
259263
}

app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,11 @@ protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldS
221221

222222
unset($tables[$entityTableName]);
223223

224-
$allColumns = array_merge(['entity_id', 'type_id', 'attribute_set_id'], $columnsList);
224+
$allColumns = array_values(
225+
array_unique(
226+
array_merge(['entity_id', $linkField, 'type_id', 'attribute_set_id'], $columnsList)
227+
)
228+
);
225229

226230
/* @var $status \Magento\Eav\Model\Entity\Attribute */
227231
$status = $this->_productIndexerHelper->getAttribute('status');
@@ -263,7 +267,7 @@ protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldS
263267

264268
$select->joinLeft(
265269
$temporaryTableName,
266-
"e.entity_id = " . $temporaryTableName . ".entity_id",
270+
sprintf('e.%1$s = %2$s.%1$s', $linkField, $temporaryTableName),
267271
$columnsNames
268272
);
269273
$allColumns = array_merge($allColumns, $columnsNames);
@@ -277,7 +281,7 @@ protected function _fillTemporaryFlatTable(array $tables, $storeId, $valueFieldS
277281
if (!empty($columnValueNames)) {
278282
$select->joinLeft(
279283
$temporaryValueTableName,
280-
"e.${linkField} = " . $temporaryValueTableName . ".entity_id",
284+
sprintf('e.%1$s = %2$s.%1$s', $linkField, $temporaryTableName),
281285
$columnValueNames
282286
);
283287
$allColumns = array_merge($allColumns, $columnValueNames);
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Catalog\Model\Indexer\Product\Flat\Table;
7+
8+
/**
9+
* Class Builder
10+
*/
11+
class Builder implements BuilderInterface
12+
{
13+
/**
14+
* @var \Magento\Framework\DB\Ddl\Table
15+
*/
16+
private $tableInstance;
17+
18+
/**
19+
* Builder constructor.
20+
*
21+
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
22+
* @param string $tableName
23+
*/
24+
public function __construct(\Magento\Framework\DB\Adapter\AdapterInterface $connection, $tableName)
25+
{
26+
$this->tableInstance = $connection->newTable($tableName);
27+
}
28+
29+
/**
30+
* @inheritdoc
31+
*/
32+
public function addColumn($name, $type, $size = null, $options = [], $comment = null)
33+
{
34+
$this->tableInstance->addColumn($name, $type, $size, $options, $comment);
35+
return $this;
36+
}
37+
38+
/**
39+
* @inheritdoc
40+
*/
41+
public function getTable()
42+
{
43+
return $this->tableInstance;
44+
}
45+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\Catalog\Model\Indexer\Product\Flat\Table;
7+
8+
/**
9+
* Interface BuilderInterface
10+
*/
11+
interface BuilderInterface
12+
{
13+
/**
14+
* Adds column to table.
15+
*
16+
* $options contains additional options for columns. Supported values are:
17+
* - 'unsigned', for number types only. Default: FALSE.
18+
* - 'precision', for numeric and decimal only. Default: taken from $size, if not set there then 0.
19+
* - 'scale', for numeric and decimal only. Default: taken from $size, if not set there then 10.
20+
* - 'default'. Default: not set.
21+
* - 'nullable'. Default: TRUE.
22+
* - 'primary', add column to primary index. Default: do not add.
23+
* - 'primary_position', only for column in primary index. Default: count of primary columns + 1.
24+
* - 'identity' or 'auto_increment'. Default: FALSE.
25+
*
26+
* @param string $name the column name
27+
* @param string $type the column data type
28+
* @param string|int|array $size the column length
29+
* @param array $options array of additional options
30+
* @param string $comment column description
31+
* @return $this
32+
* @throws \Zend_Db_Exception
33+
*/
34+
public function addColumn($name, $type, $size = null, $options = [], $comment = null);
35+
36+
/**
37+
* @return \Magento\Framework\DB\Ddl\Table
38+
*/
39+
public function getTable();
40+
}

0 commit comments

Comments
 (0)