15 class View extends \Magento\Backend\Block\Widget\Form\Container
35 parent::__construct($context,
$data);
43 $this->_objectId =
'shipment_id';
44 $this->_mode =
'view';
48 $this->buttonList->remove(
'reset');
49 $this->buttonList->remove(
'delete');
54 if ($this->_authorization->isAllowed(
'Magento_Sales::emails')) {
55 $this->buttonList->update(
'save',
'label',
__(
'Send Tracking Information'));
56 $this->buttonList->update(
59 "deleteConfirm('" .
__(
60 'Are you sure you want to send a Shipment email to customer?' 66 $this->buttonList->add(
69 'label' =>
__(
'Print'),
71 'onclick' =>
'setLocation(\'' . $this->
getPrintUrl() .
'\')
' 82 public function getShipment() 84 return $this->_coreRegistry->registry('current_shipment
'); 90 public function getHeaderText() 92 if ($this->getShipment()->getEmailSent()) { 93 $emailSent = __('the shipment email was sent
'); 95 $emailSent = __('the shipment email is not sent
'); 98 'Shipment #%1 | %3 (%2)
', 99 $this->getShipment()->getIncrementId(), 102 $this->_localeDate->date(new \DateTime($this->getShipment()->getCreatedAt())), 103 \IntlDateFormatter::MEDIUM, 112 public function getBackUrl() 114 return $this->getUrl( 117 'order_id
' => $this->getShipment() ? $this->getShipment()->getOrderId() : null, 118 'active_tab
' => 'order_shipments
' 126 public function getEmailUrl() 128 return $this->getUrl('adminhtml/order_shipment/email
', ['shipment_id
' => $this->getShipment()->getId()]); 134 public function getPrintUrl() 136 return $this->getUrl('sales/shipment/print
', ['shipment_id
' => $this->getShipment()->getId()]); 143 public function updateBackButtonUrl($flag) 146 if ($this->getShipment()->getBackUrl()) { 147 return $this->buttonList->update( 150 'setLocation(\
'' . $this->
getShipment()->getBackUrl() .
'\')
' 153 return $this->buttonList->update( 156 'setLocation(\
'' . $this->
getUrl(
'sales/shipment/') .
'\')
'
getUrl($route='', $params=[])
__construct(\Magento\Backend\Block\Widget\Context $context, \Magento\Framework\Registry $registry, array $data=[])