Skip to content

Commit 1326cf1

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #103 from magento-webdev/PR-4
[WebDev + FireDrakes] Bugfixes
2 parents 0834cd7 + df3d1fb commit 1326cf1

File tree

24 files changed

+516
-889
lines changed

24 files changed

+516
-889
lines changed

app/code/Magento/Quote/Model/Quote/Address.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,7 @@ public function setCustomerId($customerId)
15621562
public function getEmail()
15631563
{
15641564
$email = $this->getData(self::KEY_EMAIL);
1565-
if (!$email) {
1565+
if (!$email && $this->getQuote()) {
15661566
$email = $this->getQuote()->getCustomerEmail();
15671567
$this->setEmail($email);
15681568
}

app/code/Magento/Review/view/adminhtml/templates/rating/detailed.phtml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,21 @@
88

99
?>
1010
<?php if ($block->getRating() && $block->getRating()->getSize()): ?>
11-
<div class="nested">
12-
<?php foreach ($block->getRating() as $_rating): ?>
13-
<div class="field field-rating">
14-
<label class="label"><span><?php echo $block->escapeHtml($_rating->getRatingCode()) ?></span></label>
15-
<?php $_iterator = 1; ?>
16-
<?php $_options = ($_rating->getRatingOptions()) ? $_rating->getRatingOptions() : $_rating->getOptions() ?>
17-
<div class="control" data-widget="ratingControl">
18-
<?php foreach (array_reverse($_options) as $_option): ?>
19-
<input type="radio" name="ratings[<?php /* @escapeNotVerified */ echo($_rating->getVoteId()) ? $_rating->getVoteId() : $_rating->getId() ?>]" id="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>" value="<?php /* @escapeNotVerified */ echo $_option->getId() ?>" <?php if ($block->isSelected($_option, $_rating)): ?>checked="checked"<?php endif; ?> />
20-
<label for="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>">&#9733;</label>
21-
<?php $_iterator++ ?>
22-
<?php endforeach; ?>
23-
</div>
24-
</div>
11+
<?php foreach ($block->getRating() as $_rating): ?>
12+
<div class="admin__field admin__field-rating">
13+
<label class="admin__field-label"><span><?php echo $block->escapeHtml($_rating->getRatingCode()) ?></span></label>
14+
<?php $_iterator = 1; ?>
15+
<?php $_options = ($_rating->getRatingOptions()) ? $_rating->getRatingOptions() : $_rating->getOptions() ?>
16+
<div class="admin__field-control" data-widget="ratingControl">
17+
<?php foreach (array_reverse($_options) as $_option): ?>
18+
<input type="radio" name="ratings[<?php /* @escapeNotVerified */ echo($_rating->getVoteId()) ? $_rating->getVoteId() : $_rating->getId() ?>]" id="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>" value="<?php /* @escapeNotVerified */ echo $_option->getId() ?>" <?php if ($block->isSelected($_option, $_rating)): ?>checked="checked"<?php endif; ?> />
19+
<label for="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>">&#9733;</label>
20+
<?php $_iterator++ ?>
2521
<?php endforeach; ?>
26-
<input type="hidden" name="validate_rating" class="validate-rating" value="" />
22+
</div>
2723
</div>
24+
<?php endforeach; ?>
25+
<input type="hidden" name="validate_rating" class="validate-rating" value="" />
2826
<script>
2927
require([
3028
"jquery",

app/code/Magento/Shipping/Block/Adminhtml/Order/Packaging.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,7 @@ public function getDeliveryConfirmationTypes()
307307
public function getPrintButton()
308308
{
309309
$data['shipment_id'] = $this->getShipment()->getId();
310-
$url = $this->getUrl('adminhtml/order_shipment/printPackage', $data);
311-
return $this->getLayout()->createBlock(
312-
'Magento\Backend\Block\Widget\Button'
313-
)->setData(
314-
['label' => __('Print'), 'onclick' => 'setLocation(\'' . $url . '\')']
315-
)->toHtml();
310+
return $this->getUrl('adminhtml/order_shipment/printPackage', $data);
316311
}
317312

318313
/**

app/code/Magento/Shipping/Test/Unit/Model/Shipping/LabelGeneratorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ protected function setUp()
6262
$this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface');
6363
$this->trackFactory = $this->getMockBuilder('Magento\Sales\Model\Order\Shipment\TrackFactory')
6464
->disableOriginalConstructor()
65+
->setMethods(['create'])
6566
->getMock();
6667
$this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')
6768
->disableOriginalConstructor()

app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/grid.phtml

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,58 @@
88

99
?>
1010
<div class="grid">
11-
<div class="hor-scroll">
12-
<table class="data-table admin__table-primary">
11+
<?php $randomId = rand(); ?>
12+
<div class="admin__table-wrapper">
13+
<table class="data-grid">
1314
<thead>
14-
<tr>
15-
<th class="col-product no-link"><?php /* @escapeNotVerified */ echo __('Product Name') ?></th>
16-
<th class="col-weight no-link"><?php /* @escapeNotVerified */ echo __('Weight') ?></th>
17-
<th class="col-custom no-link" <?php echo $block->displayCustomsValue() ? '' : 'style="display: none;"' ?>>
18-
<?php /* @escapeNotVerified */ echo __('Customs Value') ?>
19-
</th>
20-
<th class="col-select no-link">
21-
<div class="admin__field admin__field-option">
22-
<input type="checkbox"
23-
name=""
24-
onclick="packaging.checkAllItems(this);"
25-
class="checkbox admin__control-checkbox"
26-
title="<?php /* @escapeNotVerified */ echo __('Select All') ?>">
27-
<label class="admin__field-label"></label>
28-
</div>
29-
</th>
30-
<th class="col-qty no-link"><?php /* @escapeNotVerified */ echo __('Qty Ordered') ?></th>
31-
<th class="col-qty-edit no-link last"><?php /* @escapeNotVerified */ echo __('Qty') ?></th>
32-
</tr>
15+
<tr>
16+
<th class="data-grid-checkbox-cell">
17+
<label class="data-grid-checkbox-cell-inner">
18+
<input type="checkbox"
19+
id="select-items-<?php /* @noEscape */ echo $randomId; ?>"
20+
onchange="packaging.checkAllItems(this);"
21+
class="checkbox admin__control-checkbox"
22+
title="<?php /* @escapeNotVerified */ echo __('Select All') ?>">
23+
<label for="select-items-<?php /* @noEscape */ echo $randomId; ?>"></label>
24+
</label>
25+
</th>
26+
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Product Name') ?></th>
27+
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Weight') ?></th>
28+
<th class="data-grid-th" <?php echo $block->displayCustomsValue() ? '' : 'style="display: none;"' ?>>
29+
<?php /* @escapeNotVerified */ echo __('Customs Value') ?>
30+
</th>
31+
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Qty Ordered') ?></th>
32+
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Qty') ?></th>
33+
</tr>
3334
</thead>
34-
3535
<tbody>
36+
<?php $i=0; ?>
3637
<?php foreach ($block->getCollection() as $item): ?>
37-
<?php $_order = $block->getShipment()->getOrder() ?>
38-
<?php $_orderItem = $_order->getItemById($item->getOrderItemId()); ?>
38+
<?php
39+
$_order = $block->getShipment()->getOrder();
40+
$_orderItem = $_order->getItemById($item->getOrderItemId());
41+
?>
3942
<?php if ($item->getIsVirtual()
4043
|| ($_orderItem->isShipSeparately() && !($_orderItem->getParentItemId() || $_orderItem->getParentItem()))
4144
|| (!$_orderItem->isShipSeparately() && ($_orderItem->getParentItemId() || $_orderItem->getParentItem()))): ?>
4245
<?php continue; ?>
4346
<?php endif; ?>
44-
<tr title="#" id="" class="">
45-
<td class="col-product name">
47+
<tr class="data-grid-controls-row data-row <?php echo ($i++ % 2 != 0) ? '_odd-row' : ''; ?>">
48+
<td class="data-grid-checkbox-cell">
49+
<?php $id = $item->getId() ? $item->getId() : $item->getOrderItemId(); ?>
50+
<label class="data-grid-checkbox-cell-inner">
51+
<input type="checkbox"
52+
name=""
53+
id="select-item-<?php /* @noEscape */ echo $randomId . '-' . $id; ?>"
54+
value="<?php /* @escapeNotVerified */ echo $id; ?>"
55+
class="checkbox admin__control-checkbox">
56+
<label for="select-item-<?php /* @noEscape */ echo $randomId . '-' . $id; ?>"></label>
57+
</label>
58+
</td>
59+
<td>
4660
<?php /* @escapeNotVerified */ echo $item->getName(); ?>
4761
</td>
48-
<td class="col-weight weight ">
62+
<td data-role="item-weight">
4963
<?php /* @escapeNotVerified */ echo $item->getWeight(); ?>
5064
</td>
5165
<?php
@@ -56,6 +70,7 @@
5670
$customsValueDisplay = ' style="display: none;" ';
5771
$customsValueValidation = '';
5872
}
73+
5974
?>
6075
<td <?php /* @escapeNotVerified */ echo $customsValueDisplay ?>>
6176
<input type="text"
@@ -65,25 +80,16 @@
6580
size="10"
6681
onblur="packaging.recalcContainerWeightAndCustomsValue(this);">
6782
</td>
68-
<td class="col-select">
69-
<div class="admin__field admin__field-option">
70-
<input type="checkbox"
71-
name=""
72-
value="<?php /* @escapeNotVerified */ echo $item->getId() ? $item->getId() : $item->getOrderItemId(); ?>"
73-
class="checkbox admin__control-checkbox">
74-
<label class="admin__field-label"></label>
75-
</div>
76-
</td>
77-
<td class="col-qty">
83+
<td>
7884
<?php /* @escapeNotVerified */ echo $item->getOrderItem()->getQtyOrdered()*1; ?>
7985
</td>
80-
<td class="col-qty-edit last">
86+
<td>
8187
<input type="hidden" name="price" value="<?php /* @escapeNotVerified */ echo $item->getPrice(); ?>">
8288
<input type="text"
8389
name="qty"
8490
value="<?php /* @escapeNotVerified */ echo $item->getQty()*1; ?>"
8591
class="input-text admin__control-text qty<?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal<?php endif ?>">&nbsp;
86-
<button type="button" class="action-delete delete icon-btn" onclick="packaging.deleteItem(this);" style="display:none;">
92+
<button type="button" class="action-delete" data-action="package-delete-item" onclick="packaging.deleteItem(this);" style="display:none;">
8793
<span><?php /* @escapeNotVerified */ echo __('Delete') ?></span>
8894
</button>
8995
</td>

app/code/Magento/Shipping/view/adminhtml/templates/order/packaging/packed.phtml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,14 @@
157157
jQuery('#packed_window').modal('openModal');
158158
}
159159
</script>
160-
<?php
161-
$printLocation = $block->getUrl(
162-
'adminhtml/order_shipment/printPackage',
163-
array('shipment_id' => $block->getShipment()->getId())
164-
);
165-
?>
160+
166161
<script type="text/x-magento-init">
167162
{
168163
"#packed_window": {
169164
"Magento_Shipping/js/packages":{
170165
"type":"slide",
171166
"title":"<?= /* @escapeNotVerified */ __('Packages') ?>",
172-
"url": "<?= /* @escapeNotVerified */ $printLocation ?>"
167+
"url": "<?= /* @escapeNotVerified */ $block->getPrintButton(); ?>"
173168
}
174169
}
175170
}

0 commit comments

Comments
 (0)