Form.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Shipping\Block\Adminhtml\Create;
  7. /**
  8. * Adminhtml shipment create form
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Form extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder
  14. {
  15. /**
  16. * Retrieve invoice order
  17. *
  18. * @return \Magento\Sales\Model\Order
  19. */
  20. public function getOrder()
  21. {
  22. return $this->getShipment()->getOrder();
  23. }
  24. /**
  25. * Retrieve source
  26. *
  27. * @return \Magento\Sales\Model\Order\Shipment
  28. */
  29. public function getSource()
  30. {
  31. return $this->getShipment();
  32. }
  33. /**
  34. * Retrieve shipment model instance
  35. *
  36. * @return \Magento\Sales\Model\Order\Shipment
  37. */
  38. public function getShipment()
  39. {
  40. return $this->_coreRegistry->registry('current_shipment');
  41. }
  42. /**
  43. * @return \Magento\Framework\View\Element\AbstractBlock
  44. */
  45. protected function _prepareLayout()
  46. {
  47. $this->addChild('items', \Magento\Shipping\Block\Adminhtml\Create\Items::class);
  48. return parent::_prepareLayout();
  49. }
  50. /**
  51. * @return string
  52. */
  53. public function getPaymentHtml()
  54. {
  55. return $this->getChildHtml('order_payment');
  56. }
  57. /**
  58. * @return string
  59. */
  60. public function getItemsHtml()
  61. {
  62. return $this->getChildHtml('order_items');
  63. }
  64. /**
  65. * @return string
  66. */
  67. public function getSaveUrl()
  68. {
  69. return $this->getUrl('*/*/save', ['order_id' => $this->getShipment()->getOrderId()]);
  70. }
  71. }