Skip to content

Commit

Permalink
Merge pull request #103 from magento-webdev/PR-4
Browse files Browse the repository at this point in the history
[WebDev + FireDrakes] Bugfixes
  • Loading branch information
Korshenko, Olexii(okorshenko) committed Nov 3, 2015
2 parents 0834cd7 + df3d1fb commit 1326cf1
Show file tree
Hide file tree
Showing 24 changed files with 516 additions and 889 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Quote/Model/Quote/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ public function setCustomerId($customerId)
public function getEmail()
{
$email = $this->getData(self::KEY_EMAIL);
if (!$email) {
if (!$email && $this->getQuote()) {
$email = $this->getQuote()->getCustomerEmail();
$this->setEmail($email);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@

?>
<?php if ($block->getRating() && $block->getRating()->getSize()): ?>
<div class="nested">
<?php foreach ($block->getRating() as $_rating): ?>
<div class="field field-rating">
<label class="label"><span><?php echo $block->escapeHtml($_rating->getRatingCode()) ?></span></label>
<?php $_iterator = 1; ?>
<?php $_options = ($_rating->getRatingOptions()) ? $_rating->getRatingOptions() : $_rating->getOptions() ?>
<div class="control" data-widget="ratingControl">
<?php foreach (array_reverse($_options) as $_option): ?>
<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; ?> />
<label for="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>">&#9733;</label>
<?php $_iterator++ ?>
<?php endforeach; ?>
</div>
</div>
<?php foreach ($block->getRating() as $_rating): ?>
<div class="admin__field admin__field-rating">
<label class="admin__field-label"><span><?php echo $block->escapeHtml($_rating->getRatingCode()) ?></span></label>
<?php $_iterator = 1; ?>
<?php $_options = ($_rating->getRatingOptions()) ? $_rating->getRatingOptions() : $_rating->getOptions() ?>
<div class="admin__field-control" data-widget="ratingControl">
<?php foreach (array_reverse($_options) as $_option): ?>
<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; ?> />
<label for="<?php echo $block->escapeHtml($_rating->getRatingCode()) ?>_<?php /* @escapeNotVerified */ echo $_option->getValue() ?>">&#9733;</label>
<?php $_iterator++ ?>
<?php endforeach; ?>
<input type="hidden" name="validate_rating" class="validate-rating" value="" />
</div>
</div>
<?php endforeach; ?>
<input type="hidden" name="validate_rating" class="validate-rating" value="" />
<script>
require([
"jquery",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,7 @@ public function getDeliveryConfirmationTypes()
public function getPrintButton()
{
$data['shipment_id'] = $this->getShipment()->getId();
$url = $this->getUrl('adminhtml/order_shipment/printPackage', $data);
return $this->getLayout()->createBlock(
'Magento\Backend\Block\Widget\Button'
)->setData(
['label' => __('Print'), 'onclick' => 'setLocation(\'' . $url . '\')']
)->toHtml();
return $this->getUrl('adminhtml/order_shipment/printPackage', $data);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ protected function setUp()
$this->scopeConfig = $this->getMock('Magento\Framework\App\Config\ScopeConfigInterface');
$this->trackFactory = $this->getMockBuilder('Magento\Sales\Model\Order\Shipment\TrackFactory')
->disableOriginalConstructor()
->setMethods(['create'])
->getMock();
$this->filesystem = $this->getMockBuilder('Magento\Framework\Filesystem')
->disableOriginalConstructor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,58 @@

?>
<div class="grid">
<div class="hor-scroll">
<table class="data-table admin__table-primary">
<?php $randomId = rand(); ?>

This comment has been minimized.

Copy link
@ihor-sviziev

ihor-sviziev Nov 3, 2015

Contributor

@okorshenko Why it's needed? It's dirty hack!

<div class="admin__table-wrapper">
<table class="data-grid">
<thead>
<tr>
<th class="col-product no-link"><?php /* @escapeNotVerified */ echo __('Product Name') ?></th>
<th class="col-weight no-link"><?php /* @escapeNotVerified */ echo __('Weight') ?></th>
<th class="col-custom no-link" <?php echo $block->displayCustomsValue() ? '' : 'style="display: none;"' ?>>
<?php /* @escapeNotVerified */ echo __('Customs Value') ?>
</th>
<th class="col-select no-link">
<div class="admin__field admin__field-option">
<input type="checkbox"
name=""
onclick="packaging.checkAllItems(this);"
class="checkbox admin__control-checkbox"
title="<?php /* @escapeNotVerified */ echo __('Select All') ?>">
<label class="admin__field-label"></label>
</div>
</th>
<th class="col-qty no-link"><?php /* @escapeNotVerified */ echo __('Qty Ordered') ?></th>
<th class="col-qty-edit no-link last"><?php /* @escapeNotVerified */ echo __('Qty') ?></th>
</tr>
<tr>
<th class="data-grid-checkbox-cell">
<label class="data-grid-checkbox-cell-inner">
<input type="checkbox"
id="select-items-<?php /* @noEscape */ echo $randomId; ?>"
onchange="packaging.checkAllItems(this);"
class="checkbox admin__control-checkbox"
title="<?php /* @escapeNotVerified */ echo __('Select All') ?>">
<label for="select-items-<?php /* @noEscape */ echo $randomId; ?>"></label>
</label>
</th>
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Product Name') ?></th>
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Weight') ?></th>
<th class="data-grid-th" <?php echo $block->displayCustomsValue() ? '' : 'style="display: none;"' ?>>
<?php /* @escapeNotVerified */ echo __('Customs Value') ?>
</th>
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Qty Ordered') ?></th>
<th class="data-grid-th"><?php /* @escapeNotVerified */ echo __('Qty') ?></th>
</tr>
</thead>

<tbody>
<?php $i=0; ?>
<?php foreach ($block->getCollection() as $item): ?>
<?php $_order = $block->getShipment()->getOrder() ?>
<?php $_orderItem = $_order->getItemById($item->getOrderItemId()); ?>
<?php
$_order = $block->getShipment()->getOrder();
$_orderItem = $_order->getItemById($item->getOrderItemId());
?>
<?php if ($item->getIsVirtual()
|| ($_orderItem->isShipSeparately() && !($_orderItem->getParentItemId() || $_orderItem->getParentItem()))
|| (!$_orderItem->isShipSeparately() && ($_orderItem->getParentItemId() || $_orderItem->getParentItem()))): ?>
<?php continue; ?>
<?php endif; ?>
<tr title="#" id="" class="">
<td class="col-product name">
<tr class="data-grid-controls-row data-row <?php echo ($i++ % 2 != 0) ? '_odd-row' : ''; ?>">
<td class="data-grid-checkbox-cell">
<?php $id = $item->getId() ? $item->getId() : $item->getOrderItemId(); ?>
<label class="data-grid-checkbox-cell-inner">
<input type="checkbox"
name=""
id="select-item-<?php /* @noEscape */ echo $randomId . '-' . $id; ?>"
value="<?php /* @escapeNotVerified */ echo $id; ?>"
class="checkbox admin__control-checkbox">
<label for="select-item-<?php /* @noEscape */ echo $randomId . '-' . $id; ?>"></label>
</label>
</td>
<td>
<?php /* @escapeNotVerified */ echo $item->getName(); ?>
</td>
<td class="col-weight weight ">
<td data-role="item-weight">
<?php /* @escapeNotVerified */ echo $item->getWeight(); ?>
</td>
<?php
Expand All @@ -56,6 +70,7 @@
$customsValueDisplay = ' style="display: none;" ';
$customsValueValidation = '';
}

?>
<td <?php /* @escapeNotVerified */ echo $customsValueDisplay ?>>
<input type="text"
Expand All @@ -65,25 +80,16 @@
size="10"
onblur="packaging.recalcContainerWeightAndCustomsValue(this);">
</td>
<td class="col-select">
<div class="admin__field admin__field-option">
<input type="checkbox"
name=""
value="<?php /* @escapeNotVerified */ echo $item->getId() ? $item->getId() : $item->getOrderItemId(); ?>"
class="checkbox admin__control-checkbox">
<label class="admin__field-label"></label>
</div>
</td>
<td class="col-qty">
<td>
<?php /* @escapeNotVerified */ echo $item->getOrderItem()->getQtyOrdered()*1; ?>
</td>
<td class="col-qty-edit last">
<td>
<input type="hidden" name="price" value="<?php /* @escapeNotVerified */ echo $item->getPrice(); ?>">
<input type="text"
name="qty"
value="<?php /* @escapeNotVerified */ echo $item->getQty()*1; ?>"
class="input-text admin__control-text qty<?php if ($item->getOrderItem()->getIsQtyDecimal()): ?> qty-decimal<?php endif ?>">&nbsp;
<button type="button" class="action-delete delete icon-btn" onclick="packaging.deleteItem(this);" style="display:none;">
<button type="button" class="action-delete" data-action="package-delete-item" onclick="packaging.deleteItem(this);" style="display:none;">
<span><?php /* @escapeNotVerified */ echo __('Delete') ?></span>
</button>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,19 +157,14 @@
jQuery('#packed_window').modal('openModal');
}
</script>
<?php
$printLocation = $block->getUrl(
'adminhtml/order_shipment/printPackage',
array('shipment_id' => $block->getShipment()->getId())
);
?>

<script type="text/x-magento-init">
{
"#packed_window": {
"Magento_Shipping/js/packages":{
"type":"slide",
"title":"<?= /* @escapeNotVerified */ __('Packages') ?>",
"url": "<?= /* @escapeNotVerified */ $printLocation ?>"
"url": "<?= /* @escapeNotVerified */ $block->getPrintButton(); ?>"
}
}
}
Expand Down
Loading

0 comments on commit 1326cf1

Please sign in to comment.