123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- /**
- * Copyright © Magento, Inc. All rights reserved.
- * See COPYING.txt for license details.
- */
- namespace Magento\Sales\Block\Adminhtml\Order\View\Tab;
- /**
- * Order Shipments grid
- *
- * @api
- * @since 100.0.2
- */
- class Shipments extends \Magento\Framework\View\Element\Text\ListText implements
- \Magento\Backend\Block\Widget\Tab\TabInterface
- {
- /**
- * Core registry
- *
- * @var \Magento\Framework\Registry
- */
- protected $_coreRegistry = null;
- /**
- * Collection factory
- *
- * @param \Magento\Framework\View\Element\Context $context
- * @param \Magento\Framework\Registry $coreRegistry
- * @param array $data
- */
- public function __construct(
- \Magento\Framework\View\Element\Context $context,
- \Magento\Framework\Registry $coreRegistry,
- array $data = []
- ) {
- $this->_coreRegistry = $coreRegistry;
- parent::__construct($context, $data);
- }
- /**
- * Retrieve order model instance
- *
- * @return \Magento\Sales\Model\Order
- */
- public function getOrder()
- {
- return $this->_coreRegistry->registry('current_order');
- }
- /**
- * {@inheritdoc}
- */
- public function getTabLabel()
- {
- return __('Shipments');
- }
- /**
- * {@inheritdoc}
- */
- public function getTabTitle()
- {
- return __('Order Shipments');
- }
- /**
- * {@inheritdoc}
- */
- public function canShowTab()
- {
- if ($this->getOrder()->getIsVirtual()) {
- return false;
- }
- return true;
- }
- /**
- * {@inheritdoc}
- */
- public function isHidden()
- {
- return false;
- }
- }
|