![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-shipping/Block/Adminhtml/Order/Tracking/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ namespace Magento\Shipping\Block\Adminhtml\Order\Tracking; use Magento\Framework\App\ObjectManager; use Magento\Shipping\Helper\Data as ShippingHelper; /** * Shipment tracking control form * * @api * @since 100.0.2 */ class View extends \Magento\Shipping\Block\Adminhtml\Order\Tracking { /** * @var \Magento\Shipping\Model\CarrierFactory */ protected $_carrierFactory; /** * @param \Magento\Backend\Block\Template\Context $context * @param \Magento\Shipping\Model\Config $shippingConfig * @param \Magento\Framework\Registry $registry * @param \Magento\Shipping\Model\CarrierFactory $carrierFactory * @param array $data * @param ShippingHelper|null $shippingHelper */ public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Shipping\Model\Config $shippingConfig, \Magento\Framework\Registry $registry, \Magento\Shipping\Model\CarrierFactory $carrierFactory, array $data = [], ?ShippingHelper $shippingHelper = null ) { $data['shippingHelper'] = $shippingHelper ?? ObjectManager::getInstance()->get(ShippingHelper::class); parent::__construct($context, $shippingConfig, $registry, $data); $this->_carrierFactory = $carrierFactory; } /** * Prepares layout of block * * @return void */ protected function _prepareLayout() { $onclick = "saveTrackingInfo($('shipment_tracking_info').parentNode, '" . $this->getSubmitUrl() . "')"; $this->addChild( 'save_button', \Magento\Backend\Block\Widget\Button::class, ['label' => __('Add'), 'class' => 'save', 'onclick' => $onclick] ); } /** * Retrieve save url * * @return string */ public function getSubmitUrl() { return $this->getUrl('adminhtml/*/addTrack/', ['shipment_id' => $this->getShipment()->getId()]); } /** * Retrieve save button html * * @return string */ public function getSaveButtonHtml() { return $this->getChildHtml('save_button'); } /** * Retrieve remove url * * @param \Magento\Sales\Model\Order\Shipment\Track $track * @return string */ public function getRemoveUrl($track) { return $this->getUrl( 'adminhtml/*/removeTrack/', ['shipment_id' => $this->getShipment()->getId(), 'track_id' => $track->getId()] ); } /** * Get carrier title * * @param string $code * * @return \Magento\Framework\Phrase|string|bool */ public function getCarrierTitle($code) { $carrier = $this->_carrierFactory->create($code); return $carrier ? $carrier->getConfigData('title') : __('Custom Value'); } }