76 lines
1.8 KiB
PHP
Executable File
76 lines
1.8 KiB
PHP
Executable File
<?php
|
|
|
|
namespace JR\NetSuite\Controller\Adminhtml\RmaQueue;
|
|
|
|
use Magento\Backend\App\Action\Context;
|
|
use Magento\Framework\View\Result\PageFactory;
|
|
use Magento\Backend\App\Action;
|
|
use Magento\Framework\App\Action\HttpGetActionInterface;
|
|
use Magento\Framework\View\Result\Page;
|
|
use JR\NetSuite\Model\ResourceModel\RmaQueueFactory;
|
|
|
|
/**
|
|
* Class ViewJson
|
|
*/
|
|
class View extends \Magento\Backend\App\Action
|
|
{
|
|
const MENU_ID = 'JR_NetSuite::rmaqueue';
|
|
|
|
/**
|
|
* @var PageFactory
|
|
*/
|
|
protected $resultPageFactory = false;
|
|
|
|
/**
|
|
* @var RmaQueueFactory
|
|
*/
|
|
protected $rmaQueueFactory;
|
|
|
|
/**
|
|
* Index constructor.
|
|
*
|
|
* @param \Magento\Backend\App\Action\Context $context
|
|
* @param PageFactory $resultPageFactory
|
|
*/
|
|
public function __construct(
|
|
Context $context,
|
|
RmaQueueFactory $rmaQueueFactory
|
|
) {
|
|
parent::__construct($context);
|
|
$this->rmaQueueFactory = $rmaQueueFactory;
|
|
}
|
|
|
|
/**
|
|
* Load the page defined in json form
|
|
*
|
|
* @return Page
|
|
*/
|
|
public function execute()
|
|
{
|
|
|
|
$entity_id = $this->getRequest()->getParam('entity_id');
|
|
|
|
if ($entity_id > 0) {
|
|
$prductQueue = $this->rmaQueueFactory->create()->load($entity_id);
|
|
if ($prductQueue) {
|
|
$resJson = $prductQueue->getData('data');
|
|
header('Content-Type: application/json');
|
|
http_response_code(200);
|
|
exit($resJson);
|
|
}
|
|
|
|
}
|
|
$this->messageManager->addErrorMessage(__('No record found!'));
|
|
$this->_redirect('jrnetsuite/rmaqueue/index');
|
|
}
|
|
|
|
/**
|
|
* Allow modules
|
|
*
|
|
* @return int
|
|
*/
|
|
protected function _isAllowed()
|
|
{
|
|
return $this->_authorization->isAllowed('JR_NetSuite::rma_queue');
|
|
}
|
|
} |